/[packages]/cauldron/nspr/current/SPECS/nspr.spec
ViewVC logotype

Contents of /cauldron/nspr/current/SPECS/nspr.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 273158 - (show annotations) (download)
Sat Jul 21 17:42:31 2012 UTC (11 years, 8 months ago) by colin
File size: 4748 byte(s)
Update for usrmove
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 2
6
7 Summary: Netscape Portable Runtime
8 Name: nspr
9 Epoch: %{epoch_nspr}
10 Version: 4.9.1
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 Patch2: nspr-config-version.patch
20 BuildRequires: autoconf2.1
21
22 %description
23 Virtual package, not built.
24
25 %package -n %{libname}
26 Summary: Netscape Portable Runtime
27 Group: System/Libraries
28 Requires(pre): filesystem >= 2.1.9-18
29 Obsoletes: mozilla-nspr
30 Provides: nspr = %{epoch_nspr}:%{version}-%{release}
31 Provides: mozilla-nspr = %{epoch_nspr}:%{version}-%{release}
32
33 %description -n %{libname}
34 NSPR provides platform independence for non-GUI operating system
35 facilities. These facilities include threads, thread synchronization,
36 normal file and network I/O, interval timing and calendar time, basic
37 memory management (malloc and free) and shared library linking.
38
39 %package -n %{develname}
40 Summary: Development libraries for the Netscape Portable Runtime
41 Group: Development/C++
42 Requires(pre): filesystem >= 2.1.9-18
43 Requires: %{libname} = %{epoch_nspr}:%{version}-%{release}
44 Obsoletes: mozilla-nspr-devel
45 Obsoletes: nspr-devel
46 Obsoletes: %{libname}-devel
47 Provides: nspr-devel = %{epoch_nspr}:%{version}-%{release}
48 Provides: libnspr-devel = %{epoch_nspr}:%{version}-%{release}
49 # (cg) The -devel package doesn't generate these automatically.
50 %ifarch x86_64
51 Provides: devel(libnspr4(64bit))
52 Provides: devel(libplc4(64bit))
53 Provides: devel(libplds4(64bit))
54 %else
55 Provides: devel(libnspr4)
56 Provides: devel(libplc4)
57 Provides: devel(libplds4)
58 %endif
59 Conflicts: %{libname} < 2:4.7.3-3
60
61 %description -n %{develname}
62 Header files for doing development with the Netscape Portable Runtime.
63
64 %prep
65 %setup -q -n %{name}-%{version}
66
67 # Original nspr-config is not suitable for our distribution,
68 # because on different platforms it contains different dynamic content.
69 # Therefore we produce an adjusted copy of nspr-config that will be
70 # identical on all platforms.
71 # However, we need to use original nspr-config to produce some variables
72 # that go into nspr.pc for pkg-config.
73
74 cp ./mozilla/nsprpub/config/nspr-config.in ./mozilla/nsprpub/config/nspr-config-pc.in
75 %patch1 -p1
76 %patch2 -p1
77
78 sed -i 's/^MOD_PATCH_VERSION=.*$/MOD_PATCH_VERSION=${MOD_PATCH_VERSION}/' ./mozilla/nsprpub/configure{,.in}
79 export MOD_PATCH_VERSION=`echo %{version} | sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
80
81 cp %{SOURCE2} ./mozilla/nsprpub/config/
82
83 pushd mozilla/nsprpub
84 autoconf-2.13
85 popd
86
87 %build
88 %setup_compile_flags
89
90 # (tpg) don't use macro here
91 ./mozilla/nsprpub/configure \
92 --build=%{_target_platform} \
93 --host=%{_host} \
94 --target=%{_target_platform} \
95 --prefix=%{_prefix} \
96 --libdir=%{_libdir} \
97 --includedir=%{_includedir}/nspr4 \
98 %ifarch x86_64 ppc64 ia64 s390x sparc64
99 --enable-64bit \
100 %endif
101 --enable-optimize="-O2" \
102 --disable-debug \
103 --enable-ipv6 \
104 --with-pthreads \
105 --with-mozilla
106
107 %make
108
109 %install
110 %makeinstall_std
111
112 NSPR_LIBS=`./config/nspr-config --libs`
113 NSPR_CFLAGS=`./config/nspr-config --cflags`
114 %{__mkdir_p} %{buildroot}/%{_libdir}/pkgconfig
115
116 cat ./config/nspr-config-vars > \
117 %{buildroot}/%{_libdir}/pkgconfig/nspr.pc
118
119 cat %{SOURCE1} | sed -e "s,%%libdir%%,%{_libdir},g" \
120 -e "s,%%prefix%%,%{_prefix},g" \
121 -e "s,%%exec_prefix%%,%{_prefix},g" \
122 -e "s,%%includedir%%,%{_includedir}/nspr4,g" \
123 -e "s,%%NSPR_VERSION%%,%{version},g" \
124 -e "s,%%FULL_NSPR_LIBS%%,$NSPR_LIBS,g" \
125 -e "s,%%FULL_NSPR_CFLAGS%%,$NSPR_CFLAGS,g" >> \
126 %{buildroot}/%{_libdir}/pkgconfig/nspr.pc
127
128 %{__mkdir_p} %{buildroot}%{_bindir}
129 %{__mkdir_p} %{buildroot}/%{_lib}
130 install -m755 -D ./config/nspr-config-pc %{buildroot}/%{_bindir}/nspr-config
131
132 # Get rid of the things we don't want installed (per upstream)
133 %{__rm} -rf \
134 %{buildroot}%{_bindir}/compile-et.pl \
135 %{buildroot}%{_bindir}/prerr.properties \
136 %{buildroot}%{_libdir}/libnspr4.a \
137 %{buildroot}%{_libdir}/libplc4.a \
138 %{buildroot}%{_libdir}/libplds4.a \
139 %{buildroot}%{_datadir}/aclocal/nspr.m4 \
140 %{buildroot}%{_includedir}/nspr4/md
141
142 %clean
143 %{__rm} -rf %{buildroot}
144
145 %files -n %{libname}
146 %defattr(-,root,root)
147 %{_libdir}/libnspr4.so
148 %{_libdir}/libplc4.so
149 %{_libdir}/libplds4.so
150
151 %files -n %{develname}
152 %defattr(-,root,root)
153 %{_includedir}/nspr4
154 %{_libdir}/pkgconfig/nspr.pc
155 %{_bindir}/nspr-config
156
157

  ViewVC Help
Powered by ViewVC 1.1.30