1 %define __strip %{_mingw32_strip}
2 %define __objdump %{_mingw32_objdump}
3 %define _use_internal_dependency_generator 0
4 %define __find_requires %{_mingw32_findrequires}
5 %define __find_provides %{_mingw32_findprovides}
10 Summary: MinGW Windows port of the Netscape Portable Runtime (NSPR)
12 License: MPLv1.1 or GPLv2+ or LGPLv2+
13 Group: Development/Libraries
14 URL: http://www.mozilla.org/projects/nspr/
15 Source0: ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v%{version}/src/nspr-%{version}.tar.gz
16 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
21 Source2: nspr-config-vars.in
23 Patch1: nspr-config-pc.patch
25 BuildRequires: mingw32-filesystem >= 33
26 BuildRequires: mingw32-gcc
27 BuildRequires: mingw32-binutils
33 NSPR provides platform independence for non-GUI operating system
34 facilities. These facilities include threads, thread synchronization,
35 normal file and network I/O, interval timing and calendar time, basic
36 memory management (malloc and free) and shared library linking.
40 %setup -q -n nspr-%{version}
42 cp ./mozilla/nsprpub/config/nspr-config.in \
43 ./mozilla/nsprpub/config/nspr-config-pc.in
46 cp %{SOURCE2} ./mozilla/nsprpub/config/
52 # Configure for Windows cross-compiling.
53 %{_mingw32_configure} \
54 --includedir=%{_mingw32_includedir}/nspr4 \
55 --enable-optimize="%{_mingw32_cflags}" \
57 --enable-win32-target=WINNT \
60 # NSPR comes with its own "special" install program called nsinstall.
61 # This must be built as a native program.
62 make -C config CC=gcc CFLAGS="-DXP_UNIX=1"
64 # Now build the rest using the "special" nsinstall.
66 NSINSTALL=$(pwd)/config/nsinstall \
67 RANLIB=i686-pc-mingw32-ranlib \
68 RC=i686-pc-mingw32-windres \
75 rm -rf $RPM_BUILD_ROOT
79 # 'make install' doesn't appear to work, so do it by hand.
80 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
81 mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
82 mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}
83 install dist/bin/*.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
84 install dist/lib/*.a $RPM_BUILD_ROOT%{_mingw32_libdir}
85 cp -rL dist/include/nspr $RPM_BUILD_ROOT%{_mingw32_includedir}/
87 # Write an nspr pkgconfig file.
89 NSPR_LIBS=`./config/nspr-config --libs`
90 NSPR_CFLAGS=`./config/nspr-config --cflags`
91 NSPR_VERSION=`./config/nspr-config --version`
92 %{__mkdir_p} $RPM_BUILD_ROOT/%{_mingw32_libdir}/pkgconfig
94 cat ./config/nspr-config-vars > \
95 $RPM_BUILD_ROOT/%{_mingw32_libdir}/pkgconfig/nspr.pc
97 cat %{SOURCE1} | sed -e "s,%%libdir%%,%{_mingw32_libdir},g" \
98 -e "s,%%prefix%%,%{_mingw32_prefix},g" \
99 -e "s,%%exec_prefix%%,%{_mingw32_prefix},g" \
100 -e "s,%%includedir%%,%{_mingw32_includedir}/nspr4,g" \
101 -e "s,%%NSPR_VERSION%%,$NSPR_VERSION,g" \
102 -e "s,%%FULL_NSPR_LIBS%%,$NSPR_LIBS,g" \
103 -e "s,%%FULL_NSPR_CFLAGS%%,$NSPR_CFLAGS,g" >> \
104 $RPM_BUILD_ROOT/%{_mingw32_libdir}/pkgconfig/nspr.pc
110 rm -rf $RPM_BUILD_ROOT
114 %defattr(-,root,root)
115 %{_mingw32_bindir}/libnspr4.dll
116 %{_mingw32_bindir}/libplc4.dll
117 %{_mingw32_bindir}/libplds4.dll
118 %{_mingw32_libdir}/libnspr4.a
119 %{_mingw32_libdir}/libplc4.a
120 %{_mingw32_libdir}/libnspr4_s.a
121 %{_mingw32_libdir}/libplc4_s.a
122 %{_mingw32_libdir}/libplds4.a
123 %{_mingw32_libdir}/libplds4_s.a
124 %{_mingw32_libdir}/pkgconfig/nspr.pc
125 %{_mingw32_includedir}/nspr
129 * Fri Feb 20 2009 Richard W.M. Jones <rjones@redhat.com> - 4.7.2-7
130 - Rebuild for mingw32-gcc 4.4
132 * Wed Feb 18 2009 Richard W.M. Jones <rjones@redhat.com> - 4.7.2-6
133 - Fix build inside mock.
135 * Tue Feb 17 2009 Richard W.M. Jones <rjones@redhat.com> - 4.7.2-4
136 - 'cp -L' to install header files, not symlinks to header files.
138 * Tue Jan 13 2009 Richard W.M. Jones <rjones@redhat.com> - 4.7.2-3
139 - Requires pkgconfig.
141 * Mon Nov 10 2008 Richard W.M. Jones <rjones@redhat.com> - 4.7.2-2
142 - Initial RPM release.