Added nspr.
[fedora-mingw.git] / nspr / mingw32-nspr.spec
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}
6
7 Name:           mingw32-nspr
8 Version:        4.7.2
9 Release:        1%{?dist}
10 Summary:        MinGW Windows port of the Netscape Portable Runtime (NSPR)
11
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)
17
18 BuildArch:      noarch
19
20 #Source1:        nspr.pc.in
21 #Source2:        nspr-config-vars.in
22
23 #Patch1:         nspr-config-pc.patch
24
25 Patch1000:      mingw32-nspr-4.7.2-build.patch
26
27 BuildRequires:  mingw32-filesystem >= 33
28 BuildRequires:  mingw32-gcc
29 BuildRequires:  mingw32-binutils
30
31
32 %description
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.
37
38
39 %prep
40 %setup -q -n nspr-%{version}
41
42 pushd mozilla/nsprpub
43 %patch1000 -p0
44 popd
45
46
47 %build
48 pushd mozilla/nsprpub
49
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" \
56   --disable-debug \
57   --enable-win32-target=WINNT \
58   --enable-64bit=no
59
60 # Something in the configure script is added -m64 option,
61 # so remove it.
62 # Also remove stack-protector checks.
63 pushd config
64 mv autoconf.mk autoconf.mk.orig
65 sed -e 's/-m64//' -e 's/-fstack-protector//' \
66   < autoconf.mk.orig > autoconf.mk
67 popd
68
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"
72
73 # Now build the rest using the "special" nsinstall.
74 make \
75   NSINSTALL=`pwd`/config/nsinstall \
76   RANLIB=i686-pc-mingw32-ranlib \
77   %{?_smp_mflags}
78
79 popd
80
81
82 %install
83 rm -rf $RPM_BUILD_ROOT
84
85 pushd mozilla/nsprpub
86
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}/
94
95 popd
96
97
98 %clean
99 rm -rf $RPM_BUILD_ROOT
100
101
102 %files
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
110
111
112 %changelog
113 * Mon Nov 10 2008 Richard W.M. Jones <rjones@redhat.com> - 4.7.2-1
114 - Initial RPM release.