Updating to 4.10.6. Required by latest nss 3.16.3.
[platform/upstream/nspr.git] / packaging / nspr.spec
1 Name:           nspr
2 Version:        4.10.6
3 Release:        0
4 License:        MPL-2.0
5 Summary:        Netscape Portable Runtime
6 Url:            http://www.mozilla.org/projects/nspr/
7 Group:          Base/Libraries
8 Source:         ftp://ftp.mozilla.org/pub/nspr/releases/v%{version}/src/nspr-%{version}.tar.bz2
9 Source1:        baselibs.conf
10 Source2:        nspr.changes
11 Source1001:     nspr.manifest
12 BuildRequires:  gcc-c++
13 BuildRequires:  pkg-config
14 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
15
16 %description
17 NSPR provides platform independence for non-GUI operating system
18 facilities. These facilities include threads, thread synchronization,
19 normal file and network I/O, interval timing and calendar time, basic
20 memory management (malloc and free), and shared library linking.
21
22 %package devel
23 Summary:        Netscape Portable Runtime development files
24 Group:          Base/Development
25 Requires:       nspr = %{version}
26
27 %description devel
28 NSPR provides platform independence for non-GUI operating system
29 facilities. These facilities include threads, thread synchronization,
30 normal file and network I/O, interval timing and calendar time, basic
31 memory management (malloc and free), and shared library linking.
32
33 %prep
34 %setup -n nspr-%{version} -q
35 cp %{SOURCE1001} .
36
37 %build
38 # set buildtime to "last-modification-time"
39 modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{_sourcedir}/%{name}.changes")"
40 BUILD_STRING="$(date -u -d "${modified}" "+%%F %%T")"
41 BUILD_TIME="$(date -u -d "${modified}" "+%%s000000")"
42 #cd nspr
43 export CFLAGS="%{optflags}"
44 %configure --enable-optimize="$CFLAGS" \
45 %ifarch x86_64
46             --enable-64bit \
47 %endif
48             --includedir=%{_includedir}/nspr4 \
49             --disable-debug
50 make SH_DATE="$BUILD_STRING" SH_NOW="$BUILD_TIME" %{?_smp_mflags}
51 %check
52 # Run test suite
53 perl ./pr/tests/runtests.pl 2>&1 | tee output.log
54 TEST_FAILURES=`grep -c FAILED ./output.log` || :
55 if [ $TEST_FAILURES -ne 0 ]; then
56   echo "error: test suite returned failure(s)"
57   exit 1
58 fi
59 echo "test suite completed"
60
61
62 %install
63 mkdir -p %{buildroot}%{_bindir}
64 mkdir -p %{buildroot}%{_libdir}/nspr
65 mkdir -p %{buildroot}%{_libdir}/pkgconfig
66 mkdir -p %{buildroot}%{_includedir}/nspr4
67 #cp nspr/config/nspr-config %{buildroot}%{_bindir}/
68 #cp nspr/config/nspr.pc %{buildroot}%{_libdir}/pkgconfig
69 #cp -L nspr/dist/lib/*.so %{buildroot}%{_libdir}
70 #cp -L nspr/dist/lib/*.a  %{buildroot}%{_libdir}/nspr/
71 #cp -rL nspr/dist/include/nspr/* %{buildroot}%{_includedir}/nspr4/
72 cp config/nspr-config %{buildroot}%{_bindir}/
73 cp config/nspr.pc %{buildroot}%{_libdir}/pkgconfig
74 cp -L dist/lib/*.so %{buildroot}%{_libdir}
75 cp -L dist/lib/*.a  %{buildroot}%{_libdir}/nspr/
76 cp -rL dist/include/nspr/* %{buildroot}%{_includedir}/nspr4/
77 # #31667
78 chmod -x %{buildroot}%{_includedir}/nspr4/prvrsion.h
79
80 %post -p /sbin/ldconfig
81
82 %postun -p /sbin/ldconfig
83
84 %files
85 %manifest %{name}.manifest
86 %defattr(-, root, root)
87 %{_libdir}/*.so
88
89 %files devel
90 %manifest %{name}.manifest
91 %defattr(-, root, root)
92 %{_bindir}/nspr-config
93 %{_libdir}/pkgconfig/nspr.pc
94 %{_includedir}/nspr4/
95 %exclude %{_includedir}/nspr4/md/*
96 %{_libdir}/nspr/
97
98 %changelog