Sophie

Sophie

distrib > Mageia > 2 > i586 > by-pkgid > 450a60be256bc8995858a8f781961b4b > files > 6

nspr-4.9.0-5.mga2.src.rpm

%define major_nspr 4
%define epoch_nspr 2
%define libname %mklibname nspr %{major_nspr}
%define develname %mklibname nspr -d
%define release %mkrel 5

Summary:	Netscape Portable Runtime
Name:		nspr
Epoch:		%{epoch_nspr}
Version:	4.9.0
Release:	%{release}
License:	MPLv1.1 or GPLv2+ or LGPLv2+
Group:		System/Libraries
URL:		http://www.mozilla.org/projects/nspr/
Source0:	ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v%{version}/src/%{name}-4.9.tar.gz
Source1:	nspr.pc.in
Source2:	nspr-config-vars.in
Patch1:		nspr-config-pc.patch
Patch2:		nspr-config-version.patch
BuildRequires:	autoconf2.1

%description
Virtual package, not built.

%package -n %{libname}
Summary:	Netscape Portable Runtime
Group:		System/Libraries
Obsoletes:	mozilla-nspr
Provides:	nspr = %{epoch_nspr}:%{version}-%{release}
Provides:	mozilla-nspr = %{epoch_nspr}:%{version}-%{release}

%description -n %{libname}
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 -n %{develname}
Summary:	Development libraries for the Netscape Portable Runtime
Group:		Development/C++
Requires:	%{libname} = %{epoch_nspr}:%{version}-%{release}
Obsoletes:	mozilla-nspr-devel
Obsoletes:	nspr-devel
Obsoletes:	%{libname}-devel
Provides:	nspr-devel = %{epoch_nspr}:%{version}-%{release}
Provides:	libnspr-devel = %{epoch_nspr}:%{version}-%{release}
Conflicts:	%{libname} < 2:4.7.3-3

%description -n %{develname}
Header files for doing development with the Netscape Portable Runtime.

%prep
%setup -q -n %{name}-4.9

# Original nspr-config is not suitable for our distribution,
# because on different platforms it contains different dynamic content.
# Therefore we produce an adjusted copy of nspr-config that will be 
# identical on all platforms.
# However, we need to use original nspr-config to produce some variables
# that go into nspr.pc for pkg-config.

cp ./mozilla/nsprpub/config/nspr-config.in ./mozilla/nsprpub/config/nspr-config-pc.in
%patch1 -p1
%patch2 -p1

sed -i 's/^MOD_PATCH_VERSION=.*$/MOD_PATCH_VERSION=${MOD_PATCH_VERSION}/' ./mozilla/nsprpub/configure{,.in}
export MOD_PATCH_VERSION=`echo %{version} | sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`

cp %{SOURCE2} ./mozilla/nsprpub/config/

pushd mozilla/nsprpub
autoconf-2.13
popd

%build
%setup_compile_flags

# (tpg) don't use macro here
./mozilla/nsprpub/configure \
	--build=%{_target_platform} \
	--host=%{_host} \
	--target=%{_target_platform} \
	--prefix=%{_prefix} \
	--libdir=%{_libdir} \
	--includedir=%{_includedir}/nspr4 \
%ifarch x86_64 ppc64 ia64 s390x sparc64
	--enable-64bit \
%endif
	--enable-optimize="-O2" \
	--disable-debug \
	--enable-ipv6 \
	--with-pthreads \
	--with-mozilla

%make

%install
%makeinstall_std 

NSPR_LIBS=`./config/nspr-config --libs`
NSPR_CFLAGS=`./config/nspr-config --cflags`
%{__mkdir_p} %{buildroot}/%{_libdir}/pkgconfig

cat ./config/nspr-config-vars > \
                     %{buildroot}/%{_libdir}/pkgconfig/nspr.pc

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,%%NSPR_VERSION%%,%{version},g" \
                     -e "s,%%FULL_NSPR_LIBS%%,$NSPR_LIBS,g" \
                     -e "s,%%FULL_NSPR_CFLAGS%%,$NSPR_CFLAGS,g" >> \
                     %{buildroot}/%{_libdir}/pkgconfig/nspr.pc

%{__mkdir_p} %{buildroot}%{_bindir}
%{__mkdir_p} %{buildroot}/%{_lib}
install -m755 -D ./config/nspr-config-pc %{buildroot}/%{_bindir}/nspr-config

# Get rid of the things we don't want installed (per upstream)
%{__rm} -rf \
   %{buildroot}%{_bindir}/compile-et.pl \
   %{buildroot}%{_bindir}/prerr.properties \
   %{buildroot}%{_libdir}/libnspr4.a \
   %{buildroot}%{_libdir}/libplc4.a \
   %{buildroot}%{_libdir}/libplds4.a \
   %{buildroot}%{_datadir}/aclocal/nspr.m4 \
   %{buildroot}%{_includedir}/nspr4/md

# nb: those symlinks helps having devel(xxx) provides (through find-provides)
for file in libnspr4.so libplc4.so libplds4.so
do
  mv -f %{buildroot}%{_libdir}/$file %{buildroot}/%{_lib}/$file
  ln -sf ../../%{_lib}/$file %{buildroot}%{_libdir}/$file
done

%clean
%{__rm} -rf %{buildroot}

%files -n %{libname}
%defattr(-,root,root)
/%{_lib}/libnspr4.so
/%{_lib}/libplc4.so
/%{_lib}/libplds4.so

%files -n %{develname}
%defattr(-,root,root)
%{_libdir}/libnspr4.so
%{_libdir}/libplc4.so
%{_libdir}/libplds4.so
%{_includedir}/nspr4
%{_libdir}/pkgconfig/nspr.pc
%{_bindir}/nspr-config




%changelog

* Sun Apr 22 2012 luigiwalser <luigiwalser> 2:4.9.0-5.mga2
+ Revision: 232563
- match package version with upstream pkg-config version (4.9.0)

* Tue Apr 17 2012 luigiwalser <luigiwalser> 2:4.9-4.mga2
+ Revision: 231221
- fix nspr-config version

* Sun Feb 26 2012 luigiwalser <luigiwalser> 2:4.9-3.mga2
+ Revision: 215061
- fix pkg-config version

* Tue Feb 21 2012 fwang <fwang> 2:4.9-2.mga2
+ Revision: 211509
- new version 4.9
- rebuild for higher release tag than stable 1
- new version 4.8.9

* Thu Jun 16 2011 tv <tv> 2:4.8.8-1.mga2
+ Revision: 108403
- drop patch 2 (merged)
- new release
- new release

* Tue Apr 26 2011 rtp <rtp> 2:4.8.7-1.mga1
+ Revision: 91657
- fix build (nspr autoconf files are working with autoconf 2.1 not 2.5)
- add patch from Debian to get proper cflags while waiting upstream fix

  + tv <tv>
    - fix autoconf call
    - fix perm
    - we are actually shipping final version

* Sat Jan 15 2011 blino <blino> 2:4.8.7-0.beta2.1.mga1
+ Revision: 19052
- remove old mkrel checks
- remove old ldconfig scriptlets and conditionals
- imported package nspr