Summary: Netscape Portable Runtime
Name: nspr
Version: 4.6
Release: 2
License: MPL/GPL/LGPL
URL: http://www.mozilla.org/projects/nspr/
Group: System Environment/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Source0: %{name}-%{version}.tar.gz
Source1: nspr.pc.in
Provides: mozilla-nspr
Obsoletes: mozilla-nspr
%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 devel
Summary: Development libraries for the Netscape Portable Runtime
Group: Development/Libraries
Requires: nspr = %{version}-%{release}
Provides: mozilla-nspr-devel
Obsoletes: mozilla-nspr-devel
%description devel
Header files for doing development with the Netscape Portable Runtime.
%prep
%setup -q
# patches
%build
./mozilla/nsprpub/configure \
--prefix=%{_prefix} \
--libdir=%{_libdir} \
--includedir=%{_includedir}/nspr4 \
%ifarch x86_64 ppc64 ia64 s390x
--enable-64bit \
%endif
--enable-optimize="$RPM_OPT_FLAGS" \
--disable-debug
make
%install
# Crack-tastic!
DESTDIR=$RPM_BUILD_ROOT \
make real_install
NSPR_LIBS=`./config/nspr-config --libs`
NSPR_CFLAGS=`./config/nspr-config --cflags`
%{__mkdir_p} $RPM_BUILD_ROOT/%{_libdir}/pkgconfig
cat %{SOURCE1} | sed -e "s,%%libdir%%,%{_libdir},g" \
-e "s,%%prefix%%,%{_prefix},g" \
-e "s,%%exec_prefix%%,%{_prefix},g" \
-e "s,%%includedir%%,%{_includedir}/nspr4,g" \
-e "s,%%MOZILLA_VERSION%%,%{version},g" \
-e "s,%%FULL_NSPR_LIBS%%,$NSPR_LIBS,g" \
-e "s,%%NSPR_CFLAGS%%,$NSPR_CFLAGS,g" > \
$RPM_BUILD_ROOT/%{_libdir}/pkgconfig/nspr.pc
%{__mkdir_p} $RPM_BUILD_ROOT/%{_bindir}
%{__cp} ./config/nspr-config $RPM_BUILD_ROOT/%{_bindir}
# Get rid of the things we don't want installed (per upstream)
%{__rm} -rf \
$RPM_BUILD_ROOT/%{_bindir}/compile-et.pl \
$RPM_BUILD_ROOT/%{_bindir}/prerr.properties \
$RPM_BUILD_ROOT/%{_datadir}/aclocal/nspr.m4 \
$RPM_BUILD_ROOT/%{_includedir}/nspr4/md
%clean
rm -rf $RPM_BUILD_ROOT
%post
/sbin/ldconfig >/dev/null 2>/dev/null
%postun
/sbin/ldconfig >/dev/null 2>/dev/null
%files
%defattr(-,root,root)
%{_libdir}/libnspr4.so
%{_libdir}/libplc4.so
%{_libdir}/libplds4.so
%files devel
%defattr(-, root, root)
%{_includedir}/nspr4
%{_libdir}/pkgconfig/nspr.pc
%{_bindir}/nspr-config
# Static libs are temporarily shipped since nss currently needs
# them to build (and all things depending on nss, e.g. firefox)
# They will not be included in a future revision.
%{_libdir}/libnspr4.a
%{_libdir}/libplc4.a
%{_libdir}/libplds4.a
%changelog
* Tue Jul 12 2005 Christopher Aillon <caillon@redhat.com> 4.6-2
- Temporarily include the static libraries allowing nss and
its dependencies to build.
* Tue Jul 12 2005 Christopher Aillon <caillon@redhat.com> 4.6-1
- Update to NSPR 4.6
* Wed Apr 20 2005 Christopher Aillon <caillon@redhat.com> 4.4.1-2
- NSPR doesn't have make install, but it has make real_install. Use it.
* Thu Apr 14 2005 Christopher Aillon <caillon@redhat.com> 4.4.1-1
- Let's make an RPM.