Summary: Netscape Portable Runtime Name: nspr Version: 4.13.1 Release: 1 License: MPLv2.0 URL: http://www.mozilla.org/projects/nspr/ Group: System Environment/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-root # Sources available at https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/ Source0: %{name}-%{version}.tar.gz Source1: %{name}.pc.in Patch0: %{name}-%{version}-aix.patch BuildRequires: make %define _libdir64 %{_prefix}/lib64 %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. The library is available as 32-bit and 64-bit. %package devel Summary: Development libraries for the Netscape Portable Runtime Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: pkg-config %description devel Header files for doing development with the Netscape Portable Runtime. If you are compiling a 32-bit program, no special compiler options are needed. If you are compiling a 64-bit program, you have to compile and link your application with "cc_r -q64" or "gcc -maix64". %prep %setup -q %patch0 %build export CC="cc_r" # setup environment for 32-bit and 64-bit builds export AR="/usr/bin/ar -X32_64" # first build the 64-bit version export OBJECT_MODE=64 export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib" ./nspr/configure \ --prefix=%{_prefix} \ --libdir=%{_libdir64} \ --includedir=%{_includedir}/nspr4 \ --enable-64bit \ --disable-debug gmake %{?_smp_mflags} cp config/nspr-config config/nspr-config_64 # build 64-bit shared objects for AIX ( cd dist/lib for file in lib*.a ; do f=`basename ${file} .a` /usr/bin/rm -f ${f}.so CreateExportList -X64 ${f}.exp ${file} done ${CC} -qmkshrobj libnspr4.a -o libnspr4.so -bE:libnspr4.exp -bmaxdata:0x80000000 -lpthreads -lodm -lcfg ${CC} -qmkshrobj libplc4.a -o libplc4.so -bE:libplc4.exp -blibpath:/opt/freeware/lib:/usr/vac/lib:/usr/lib:/lib -bmaxdata:0x80000000 -L. -lnspr4 -lpthreads ${CC} -qmkshrobj libplds4.a -o libplds4.so -bE:libplds4.exp -blibpath:/opt/freeware/lib:/usr/vac/lib:/usr/lib:/lib -bmaxdata:0x80000000 -L. -lnspr4 -lpthreads cp lib*so ../.. /usr/bin/rm -f *.exp ) gmake distclean # now build the 32-bit version export OBJECT_MODE=32 export LDFLAGS="-L/opt/freeware/lib" ./nspr/configure \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --includedir=%{_includedir}/nspr4 \ --disable-debug gmake %{?_smp_mflags} %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} gmake install DESTDIR=${RPM_BUILD_ROOT} cp config/nspr-config_64 ${RPM_BUILD_ROOT}%{_bindir} # setup environment for 32-bit and 64-bit builds export AR="ar -X32_64" # create 32-bit AIX shared library ( export CC="cc_r -q32" cd ${RPM_BUILD_ROOT}%{_libdir} for file in *.a ; do f=`basename ${file} .a` rm -f ${f}.so CreateExportList -X32 ${f}.exp ${file} done ${CC} -qmkshrobj libnspr4.a -o libnspr4.so -bE:libnspr4.exp -bmaxdata:0x80000000 -lpthreads -lodm -lcfg ${CC} -qmkshrobj libplc4.a -o libplc4.so -bE:libplc4.exp -blibpath:/opt/freeware/lib:/usr/vac/lib:/usr/lib:/lib -bmaxdata:0x80000000 -L. -lnspr4 -lpthreads ${CC} -qmkshrobj libplds4.a -o libplds4.so -bE:libplds4.exp -blibpath:/opt/freeware/lib:/usr/vac/lib:/usr/lib:/lib -bmaxdata:0x80000000 -L. -lnspr4 -lpthreads for file in *.a ; do f=`basename ${file} .a` rm -f ${file} ${AR} -rv ${file} ${f}.so rm -f ${f}.exp ${f}.so done ) # add the 64-bit shared objects to the shared libraries already containing # the 32-bit shared objects for f in nspr4 plc4 plds4 ; do ${AR} -q ${RPM_BUILD_ROOT}%{_libdir}/lib${f}.a lib${f}.so done # generate 32-bit pkg-config file NSPR_LIBS=`./config/nspr-config --libs` NSPR_CFLAGS=`./config/nspr-config --cflags` NSPR_VERSION=`./config/nspr-config --version` %{__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,%%NSPR_VERSION%%,$NSPR_VERSION,g" \ -e "s,%%FULL_NSPR_LIBS%%,$NSPR_LIBS,g" \ -e "s,%%FULL_NSPR_CFLAGS%%,$NSPR_CFLAGS,g" >> \ ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig/nspr.pc # generate 64-bit pkg-config file NSPR_LIBS=`./config/nspr-config_64 --libs` NSPR_CFLAGS=`./config/nspr-config_64 --cflags` NSPR_VERSION=`./config/nspr-config_64 --version` %{__mkdir_p} ${RPM_BUILD_ROOT}%{_libdir64}/pkgconfig cat %{SOURCE1} | sed -e "s,%%libdir%%,%{_libdir64},g" \ -e "s,%%prefix%%,%{_prefix},g" \ -e "s,%%exec_prefix%%,%{_prefix},g" \ -e "s,%%includedir%%,%{_includedir}/nspr4,g" \ -e "s,%%NSPR_VERSION%%,$NSPR_VERSION,g" \ -e "s,%%FULL_NSPR_LIBS%%,$NSPR_LIBS,g" \ -e "s,%%FULL_NSPR_CFLAGS%%,$NSPR_CFLAGS,g" >> \ ${RPM_BUILD_ROOT}%{_libdir64}/pkgconfig/nspr.pc ( cd ${RPM_BUILD_ROOT}%{_libdir64} for f in ../lib/*.a ; do /usr/bin/ar -X64 -x ${f} done cd ${RPM_BUILD_ROOT}%{_libdir} for f in *.a ; do /usr/bin/ar -X32 -x ${f} done ) ( cd ${RPM_BUILD_ROOT} for dir in bin include lib lib64 do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done ) %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* %files devel %defattr(-,root,system) %{_bindir}/nspr-config* %{_includedir}/* %{_libdir}/pkgconfig/%{name}.pc %{_libdir64}/pkgconfig/%{name}.pc %{_datadir}/aclocal/* /usr/bin/nspr-config* /usr/include/* %changelog * Fri Dec 02 2016 Michael Perzl - 4.13.1-1 - updated to version 4.13.1 * Sun Aug 22 2011 Michael Perzl - 4.8.9-1 - updated to version 4.8.9 * Fri Jun 03 2011 Michael Perzl - 4.8.8-1 - updated to version 4.8.8 * Sat Feb 05 2011 Michael Perzl - 4.8.7-2 - fixed pkg-config file for 64-bit - added RTL-style shared libraries * Sat Jan 15 2011 Michael Perzl - 4.8.7-1 - updated to version 4.8.7 * Fri Oct 01 2010 Michael Perzl - 4.8.6-1 - updated to version 4.8.6 * Mon Mar 22 2010 Michael Perzl - 4.8.4-1 - updated to version 4.8.4 * Tue Jan 19 2010 Michael Perzl - 4.8.2-1 - updated to version 4.8.2 * Fri Sep 18 2009 Michael Perzl - 4.8-1 - first version for AIX5L v5.1 and higher