Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > 74246963c4b619ef054f14893817b543 > files > 5

nspr-4.9.1-1.mga1.src.rpm

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

Summary:	Netscape Portable Runtime
Name:		nspr
Epoch:		%{epoch_nspr}
Version:	4.9.1
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}-%{version}.tar.gz
Source1:	nspr.pc.in
Source2:	nspr-config-vars.in
Patch1:		nspr-config-pc.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}-%{version}

# 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

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

* Tue Jun 05 2012 luigiwalser <luigiwalser> 2:4.9.1-1.mga1
+ Revision: 256012
- 4.9.1
- update patch 1 (from mdv)
- 4.9.0

  + dmorgan <dmorgan>
    - Update to version 4.8.9 ( needed by FF6)

* 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