%{?mingw_package_header} Name: mingw-nspr Version: 4.10.10 Release: 1%{?dist} Summary: MinGW build of Netscape Portable Runtime License: MPLv2.0 URL: http://www.mozilla.org/projects/nspr/ Source0: https://ftp.mozilla.org/pub/nspr/releases/v%{version}/src/nspr-%{version}.tar.gz # From the OpenSuSE distributions Patch1: nspr-threads.patch Patch2: nspr-pkgconfig.patch # MinGW-specific build patch. Patch1000: nspr-build.patch BuildArch: noarch BuildRequires: mingw32-filesystem >= 95 BuildRequires: mingw64-filesystem >= 95 BuildRequires: mingw32-gcc BuildRequires: mingw64-gcc BuildRequires: mingw32-binutils BuildRequires: mingw64-binutils BuildRequires: mingw32-pkg-config BuildRequires: mingw64-pkg-config BuildRequires: mingw32-dlfcn BuildRequires: mingw64-dlfcn %description NSPR provides platform independence for non-GUI operating system facilities. These facilities include threads, thread synchronization, normal file and network I/O, interval timing and calendar time, basic memory management (malloc and free) and shared library linking. %package -n mingw32-nspr Summary: %{summary} %description -n mingw32-nspr NSPR provides platform independence for non-GUI operating system facilities. These facilities include threads, thread synchronization, normal file and network I/O, interval timing and calendar time, basic memory management (malloc and free) and shared library linking. %package -n mingw32-nspr-static Summary: %{summary} Requires: mingw32-nspr = %{version} %description -n mingw32-nspr-static NSPR provides platform independence for non-GUI operating system facilities. These facilities include threads, thread synchronization, normal file and network I/O, interval timing and calendar time, basic memory management (malloc and free) and shared library linking. %package -n mingw64-nspr Summary: %{summary} %description -n mingw64-nspr NSPR provides platform independence for non-GUI operating system facilities. These facilities include threads, thread synchronization, normal file and network I/O, interval timing and calendar time, basic memory management (malloc and free) and shared library linking. %package -n mingw64-nspr-static Summary: %{summary} Requires: mingw64-nspr = %{version} %description -n mingw64-nspr-static NSPR provides platform independence for non-GUI operating system facilities. These facilities include threads, thread synchronization, normal file and network I/O, interval timing and calendar time, basic memory management (malloc and free) and shared library linking. %{?mingw_debug_package} %prep %setup -q -n nspr-%{version} pushd nspr %patch1 -b .threads %patch2 -b .pkgconfig %patch1000 -b .build chmod -x pr/include/prvrsion.h popd %build pushd nspr MINGW32_CONFIGURE_ARGS='--includedir=%{mingw32_includedir}/nspr4 --enable-64bit=no' MINGW64_CONFIGURE_ARGS='--includedir=%{mingw64_includedir}/nspr4 --enable-64bit=yes' %{mingw_configure} \ --enable-shared \ --enable-static \ --enable-debug \ --disable-strip \ --enable-win32-target=WINNT \ --enable-user-threads # Now, back to your scheduled programming pushd build_win32 # NSPR comes with its own "special" install program called nsinstall. # This must be built as a native program. make -C config CC=gcc CFLAGS="-DXP_UNIX=1" %{?_smp_mflags} # Now build the rest using the "special" nsinstall. make \ NSINSTALL=$(pwd)/config/nsinstall \ RANLIB=%{mingw32_ranlib} \ RC=%{mingw32_windres} \ %{?_smp_mflags} popd pushd build_win64 # NSPR comes with its own "special" install program called nsinstall. # This must be built as a native program. make -C config CC=gcc CFLAGS="-DXP_UNIX=1" %{?_smp_mflags} # Now build the rest using the "special" nsinstall. make \ NSINSTALL=$(pwd)/config/nsinstall \ RANLIB=%{mingw64_ranlib} \ RC=%{mingw64_windres} \ %{?_smp_mflags} popd %install pushd nspr # 'make install' doesn't appear to work, so do it by hand. mkdir -p %{buildroot}%{mingw32_bindir} mkdir -p %{buildroot}%{mingw64_bindir} mkdir -p %{buildroot}%{mingw32_libdir}/pkgconfig mkdir -p %{buildroot}%{mingw64_libdir}/pkgconfig mkdir -p %{buildroot}%{mingw32_includedir}/nspr4 mkdir -p %{buildroot}%{mingw64_includedir}/nspr4 pushd build_win32 install dist/bin/*.dll %{buildroot}%{mingw32_bindir} install config/nspr-config %{buildroot}%{mingw32_bindir} install config/nspr.pc %{buildroot}/%{mingw32_libdir}/pkgconfig install dist/lib/*.a %{buildroot}%{mingw32_libdir} cp -rL dist/include/nspr/* %{buildroot}%{mingw32_includedir}/nspr4/ popd pushd build_win64 install dist/bin/*.dll %{buildroot}%{mingw64_bindir} install config/nspr-config %{buildroot}%{mingw64_bindir} install config/nspr.pc %{buildroot}/%{mingw64_libdir}/pkgconfig install dist/lib/*.a %{buildroot}%{mingw64_libdir} cp -rL dist/include/nspr/* %{buildroot}%{mingw64_includedir}/nspr4/ popd %files -n mingw32-nspr %license nspr/LICENSE %{mingw32_bindir}/libnspr4.dll %{mingw32_bindir}/libplc4.dll %{mingw32_bindir}/libplds4.dll %{mingw32_bindir}/nspr-config %{mingw32_libdir}/libnspr4.dll.a %{mingw32_libdir}/libplc4.dll.a %{mingw32_libdir}/libplds4.dll.a %{mingw32_libdir}/pkgconfig/nspr.pc %{mingw32_includedir}/nspr4 %files -n mingw32-nspr-static %{mingw32_libdir}/libnspr4_s.a %{mingw32_libdir}/libplc4_s.a %{mingw32_libdir}/libplds4_s.a %files -n mingw64-nspr %license nspr/LICENSE %{mingw64_bindir}/libnspr4.dll %{mingw64_bindir}/libplc4.dll %{mingw64_bindir}/libplds4.dll %{mingw64_bindir}/nspr-config %{mingw64_libdir}/libnspr4.dll.a %{mingw64_libdir}/libplc4.dll.a %{mingw64_libdir}/libplds4.dll.a %{mingw64_libdir}/pkgconfig/nspr.pc %{mingw64_includedir}/nspr4 %files -n mingw64-nspr-static %{mingw64_libdir}/libnspr4_s.a %{mingw64_libdir}/libplc4_s.a %{mingw64_libdir}/libplds4_s.a %changelog * Wed Nov 25 2015 Fabiano FidĂȘncio - 4.10.10-1 - Initial build based on Greg Hellings' and OpenSuSE ones