1 |
%define major_nspr 4 |
2 |
%define epoch_nspr 2 |
3 |
%define libname %mklibname nspr %{major_nspr} |
4 |
%define develname %mklibname nspr -d |
5 |
%define release %mkrel 1 |
6 |
|
7 |
Summary: Netscape Portable Runtime |
8 |
Name: nspr |
9 |
Epoch: %{epoch_nspr} |
10 |
Version: 4.9.5 |
11 |
Release: %{release} |
12 |
License: MPLv1.1 or GPLv2+ or LGPLv2+ |
13 |
Group: System/Libraries |
14 |
URL: http://www.mozilla.org/projects/nspr/ |
15 |
Source0: ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v%{version}/src/%{name}-%{version}.tar.gz |
16 |
Source1: nspr.pc.in |
17 |
Source2: nspr-config-vars.in |
18 |
Patch1: nspr-config-pc.patch |
19 |
BuildRequires: autoconf2.1 |
20 |
|
21 |
%description |
22 |
Virtual package, not built. |
23 |
|
24 |
%package -n %{libname} |
25 |
Summary: Netscape Portable Runtime |
26 |
Group: System/Libraries |
27 |
Obsoletes: mozilla-nspr |
28 |
Provides: nspr = %{epoch_nspr}:%{version}-%{release} |
29 |
Provides: mozilla-nspr = %{epoch_nspr}:%{version}-%{release} |
30 |
|
31 |
%description -n %{libname} |
32 |
NSPR provides platform independence for non-GUI operating system |
33 |
facilities. These facilities include threads, thread synchronization, |
34 |
normal file and network I/O, interval timing and calendar time, basic |
35 |
memory management (malloc and free) and shared library linking. |
36 |
|
37 |
%package -n %{develname} |
38 |
Summary: Development libraries for the Netscape Portable Runtime |
39 |
Group: Development/C++ |
40 |
Requires: %{libname} = %{epoch_nspr}:%{version}-%{release} |
41 |
Obsoletes: mozilla-nspr-devel |
42 |
Obsoletes: nspr-devel |
43 |
Obsoletes: %{libname}-devel |
44 |
Provides: nspr-devel = %{epoch_nspr}:%{version}-%{release} |
45 |
Provides: libnspr-devel = %{epoch_nspr}:%{version}-%{release} |
46 |
Conflicts: %{libname} < 2:4.7.3-3 |
47 |
|
48 |
%description -n %{develname} |
49 |
Header files for doing development with the Netscape Portable Runtime. |
50 |
|
51 |
%prep |
52 |
%setup -q -n %{name}-%{version} |
53 |
|
54 |
# Original nspr-config is not suitable for our distribution, |
55 |
# because on different platforms it contains different dynamic content. |
56 |
# Therefore we produce an adjusted copy of nspr-config that will be |
57 |
# identical on all platforms. |
58 |
# However, we need to use original nspr-config to produce some variables |
59 |
# that go into nspr.pc for pkg-config. |
60 |
|
61 |
cp ./mozilla/nsprpub/config/nspr-config.in ./mozilla/nsprpub/config/nspr-config-pc.in |
62 |
%patch1 -p1 |
63 |
|
64 |
cp %{SOURCE2} ./mozilla/nsprpub/config/ |
65 |
|
66 |
pushd mozilla/nsprpub |
67 |
autoconf-2.13 |
68 |
popd |
69 |
|
70 |
%build |
71 |
%setup_compile_flags |
72 |
|
73 |
# (tpg) don't use macro here |
74 |
./mozilla/nsprpub/configure \ |
75 |
--build=%{_target_platform} \ |
76 |
--host=%{_host} \ |
77 |
--target=%{_target_platform} \ |
78 |
--prefix=%{_prefix} \ |
79 |
--libdir=%{_libdir} \ |
80 |
--includedir=%{_includedir}/nspr4 \ |
81 |
%ifarch x86_64 ppc64 ia64 s390x sparc64 |
82 |
--enable-64bit \ |
83 |
%endif |
84 |
--enable-optimize="-O2" \ |
85 |
--disable-debug \ |
86 |
--enable-ipv6 \ |
87 |
--with-pthreads \ |
88 |
--with-mozilla |
89 |
|
90 |
%make |
91 |
|
92 |
%install |
93 |
%makeinstall_std |
94 |
|
95 |
NSPR_LIBS=`./config/nspr-config --libs` |
96 |
NSPR_CFLAGS=`./config/nspr-config --cflags` |
97 |
%{__mkdir_p} %{buildroot}/%{_libdir}/pkgconfig |
98 |
|
99 |
cat ./config/nspr-config-vars > \ |
100 |
%{buildroot}/%{_libdir}/pkgconfig/nspr.pc |
101 |
|
102 |
cat %{SOURCE1} | sed -e "s,%%libdir%%,%{_libdir},g" \ |
103 |
-e "s,%%prefix%%,%{_prefix},g" \ |
104 |
-e "s,%%exec_prefix%%,%{_prefix},g" \ |
105 |
-e "s,%%includedir%%,%{_includedir}/nspr4,g" \ |
106 |
-e "s,%%NSPR_VERSION%%,%{version},g" \ |
107 |
-e "s,%%FULL_NSPR_LIBS%%,$NSPR_LIBS,g" \ |
108 |
-e "s,%%FULL_NSPR_CFLAGS%%,$NSPR_CFLAGS,g" >> \ |
109 |
%{buildroot}/%{_libdir}/pkgconfig/nspr.pc |
110 |
|
111 |
%{__mkdir_p} %{buildroot}%{_bindir} |
112 |
%{__mkdir_p} %{buildroot}/%{_lib} |
113 |
install -m755 -D ./config/nspr-config-pc %{buildroot}/%{_bindir}/nspr-config |
114 |
|
115 |
# Get rid of the things we don't want installed (per upstream) |
116 |
%{__rm} -rf \ |
117 |
%{buildroot}%{_bindir}/compile-et.pl \ |
118 |
%{buildroot}%{_bindir}/prerr.properties \ |
119 |
%{buildroot}%{_libdir}/libnspr4.a \ |
120 |
%{buildroot}%{_libdir}/libplc4.a \ |
121 |
%{buildroot}%{_libdir}/libplds4.a \ |
122 |
%{buildroot}%{_datadir}/aclocal/nspr.m4 \ |
123 |
%{buildroot}%{_includedir}/nspr4/md |
124 |
|
125 |
# nb: those symlinks helps having devel(xxx) provides (through find-provides) |
126 |
for file in libnspr4.so libplc4.so libplds4.so |
127 |
do |
128 |
mv -f %{buildroot}%{_libdir}/$file %{buildroot}/%{_lib}/$file |
129 |
ln -sf ../../%{_lib}/$file %{buildroot}%{_libdir}/$file |
130 |
done |
131 |
|
132 |
%clean |
133 |
%{__rm} -rf %{buildroot} |
134 |
|
135 |
%files -n %{libname} |
136 |
%defattr(-,root,root) |
137 |
/%{_lib}/libnspr4.so |
138 |
/%{_lib}/libplc4.so |
139 |
/%{_lib}/libplds4.so |
140 |
|
141 |
%files -n %{develname} |
142 |
%defattr(-,root,root) |
143 |
%{_libdir}/libnspr4.so |
144 |
%{_libdir}/libplc4.so |
145 |
%{_libdir}/libplds4.so |
146 |
%{_includedir}/nspr4 |
147 |
%{_libdir}/pkgconfig/nspr.pc |
148 |
%{_bindir}/nspr-config |
149 |
|
150 |
|