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 Patch1000: mingw32-nspr-4.7.2-build.patch
27 BuildRequires: mingw32-filesystem >= 33
28 BuildRequires: mingw32-gcc
29 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}
50 # Configure for Windows cross-compiling.
51 %{_mingw32_configure} \
52 --prefix=%{_mingw32_prefix} \
53 --libdir=%{_mingw32_libdir} \
54 --includedir=%{_mingw32_includedir}/nspr4 \
55 --enable-optimize="$RPM_OPT_FLAGS" \
57 --enable-win32-target=WINNT \
60 # Something in the configure script is added -m64 option,
62 # Also remove stack-protector checks.
64 mv autoconf.mk autoconf.mk.orig
65 sed -e 's/-m64//' -e 's/-fstack-protector//' \
66 < autoconf.mk.orig > autoconf.mk
69 # NSPR comes with its own "special" install program called nsinstall.
70 # This must be built as a native program.
71 make -C config CC=gcc CFLAGS="-DXP_UNIX=1"
73 # Now build the rest using the "special" nsinstall.
75 NSINSTALL=`pwd`/config/nsinstall \
76 RANLIB=i686-pc-mingw32-ranlib \
83 rm -rf $RPM_BUILD_ROOT
87 # 'make install' doesn't appear to work, so do it by hand.
88 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
89 mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
90 mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}
91 install dist/bin/*.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
92 install dist/lib/*.dll.a $RPM_BUILD_ROOT%{_mingw32_libdir}
93 cp -r dist/include/nspr $RPM_BUILD_ROOT%{_mingw32_includedir}/
99 rm -rf $RPM_BUILD_ROOT
103 %defattr(-,root,root)
104 %{_mingw32_bindir}/libnspr4.dll
105 %{_mingw32_bindir}/libplc4.dll
106 %{_mingw32_bindir}/libplds4.dll
107 %{_mingw32_libdir}/libnspr4.dll.a
108 %{_mingw32_libdir}/libplc4.dll.a
109 %{_mingw32_includedir}/nspr
113 * Mon Nov 10 2008 Richard W.M. Jones <rjones@redhat.com> - 4.7.2-1
114 - Initial RPM release.