%global nspr_version 4.13.1 %define _libdir64 %{_prefix}/lib64 Summary: Network Security Services Utilities Library Name: nss-util Version: 3.27.2 Release: 1 License: MPLv1.1 or GPLv2+ or LGPLv2+ URL: http://www.mozilla.org/projects/security/pki/nss/ Group: System Environment/Libraries Requires: nspr >= %{nspr_version} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: nspr-devel >= %{nspr_version} BuildRequires: pkg-config BuildRequires: make Source0: %{name}-%{version}.tar.gz # The nss-util tar ball is a subset of nss-%{version}.tar.gz. # We use the nss-split-util.sh script for keeping only what we need. # Download the nss tarball from the nss propect and follow these # steps to make the tarball for nss-util out of the nss one: # # mkdir tmp # cd tmp # cp /nss-${version}.tar.gz . # cp /nss-split-util.sh . # PATH=/opt/freeware/bin:$PATH bash ./nss-split-util.sh ${version} # # A file %{name}-%{version}.tar.gz should appear Source1: nss-split-util.sh Source2: %{name}.pc.in Source3: %{name}-config.in Patch0: %{name}-%{version}-aix.patch Patch1: %{name}-%{version}-aix-shlibpath.patch %description Utilities for Network Security Services and the Softoken module The library is available as 32-bit and 64-bit. # We shouln't need to have a devel subpackage as util will be used in the # context of nss or nss-softoken. keeping to please rpmlint. # %package devel Summary: Development libraries for Network Security Services Utilities Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: nspr-devel >= %{nspr_version} Requires: pkg-config %description devel Header and library files for doing development with Network Security Services. 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 "xlc_r -q64" or gcc -maix64". %prep %setup -q %patch0 mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit && tar cf - . | (cd ../64bit ; tar xpf -) cd .. %patch1 %build # Enable compiler optimizations and disable debugging code export BUILD_OPT=1 # Generate symbolic info for debuggers XCFLAGS= export XCFLAGS export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 ##################################################################### # first build the 64-bit version cd 64bit export OBJECT_MODE=64 export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib" export USE_64=1 NSPR_INCLUDE_DIR=`/usr/bin/pkg-config_64 --cflags-only-I nspr | sed 's/-I//'` NSPR_LIB_DIR=`/usr/bin/pkg-config_64 --libs-only-L nspr | awk '{ print $1 }' | sed 's/-L//'` export NSPR_INCLUDE_DIR export NSPR_LIB_DIR export NSS_USE_SYSTEM_SQLITE=1 export NSS_BUILD_UTIL_ONLY=1 # external tests are not suitable for nss-util and # won't compile as they depend on ssl export NSS_DISABLE_GTESTS=1 # make util gmake -C ./nss/coreconf gmake -C ./nss # Set up our package file %{__mkdir_p} ./dist/pkgconfig %{__cat} %{SOURCE2} | sed -e "s,%%libdir%%,%{_libdir64},g" \ -e "s,%%prefix%%,%{_prefix},g" \ -e "s,%%exec_prefix%%,%{_prefix},g" \ -e "s,%%includedir%%,%{_includedir}/nss3,g" \ -e "s,%%NSPR_VERSION%%,%{nspr_version},g" \ -e "s,%%NSSUTIL_VERSION%%,%{version},g" \ > ./dist/pkgconfig/%{name}.pc NSSUTIL_VMAJOR=`cat nss/lib/util/nssutil.h | grep "#define.*NSSUTIL_VMAJOR" | awk '{print $3}'` NSSUTIL_VMINOR=`cat nss/lib/util/nssutil.h | grep "#define.*NSSUTIL_VMINOR" | awk '{print $3}'` NSSUTIL_VPATCH=`cat nss/lib/util/nssutil.h | grep "#define.*NSSUTIL_VPATCH" | awk '{print $3}'` export NSSUTIL_VMAJOR export NSSUTIL_VMINOR export NSSUTIL_VPATCH %{__cat} %{SOURCE3} | sed -e "s,@libdir@,%{_libdir},g" \ -e "s,@prefix@,%{_prefix},g" \ -e "s,@exec_prefix@,%{_prefix},g" \ -e "s,@includedir@,%{_includedir}/nss3,g" \ -e "s,@MOD_MAJOR_VERSION@,$NSSUTIL_VMAJOR,g" \ -e "s,@MOD_MINOR_VERSION@,$NSSUTIL_VMINOR,g" \ -e "s,@MOD_PATCH_VERSION@,$NSSUTIL_VPATCH,g" \ > ./dist/pkgconfig/%{name}-config chmod 755 ./dist/pkgconfig/nss-util-config ##################################################################### # now build the 32-bit version cd ../32bit export OBJECT_MODE=32 export LDFLAGS="-L/opt/freeware/lib" unset USE_64 NSPR_INCLUDE_DIR=`/usr/bin/pkg-config --cflags-only-I nspr | sed 's/-I//'` NSPR_LIB_DIR=`/usr/bin/pkg-config --libs-only-L nspr | sed 's/-L//'` export NSPR_INCLUDE_DIR export NSPR_LIB_DIR export NSS_USE_SYSTEM_SQLITE=1 export NSS_BUILD_UTIL_ONLY=1 # external tests are not suitable for nss-util and # won't compile as they depend on ssl export NSS_DISABLE_GTESTS=1 # make util gmake -C ./nss/coreconf gmake -C ./nss # Set up our package file %{__mkdir_p} ./dist/pkgconfig %{__cat} %{SOURCE2} | sed -e "s,%%libdir%%,%{_libdir},g" \ -e "s,%%prefix%%,%{_prefix},g" \ -e "s,%%exec_prefix%%,%{_prefix},g" \ -e "s,%%includedir%%,%{_includedir}/nss3,g" \ -e "s,%%NSPR_VERSION%%,%{nspr_version},g" \ -e "s,%%NSSUTIL_VERSION%%,%{version},g" \ > ./dist/pkgconfig/%{name}.pc NSSUTIL_VMAJOR=`cat nss/lib/util/nssutil.h | grep "#define.*NSSUTIL_VMAJOR" | awk '{print $3}'` NSSUTIL_VMINOR=`cat nss/lib/util/nssutil.h | grep "#define.*NSSUTIL_VMINOR" | awk '{print $3}'` NSSUTIL_VPATCH=`cat nss/lib/util/nssutil.h | grep "#define.*NSSUTIL_VPATCH" | awk '{print $3}'` export NSSUTIL_VMAJOR export NSSUTIL_VMINOR export NSSUTIL_VPATCH %{__cat} %{SOURCE3} | sed -e "s,@libdir@,%{_libdir},g" \ -e "s,@prefix@,%{_prefix},g" \ -e "s,@exec_prefix@,%{_prefix},g" \ -e "s,@includedir@,%{_includedir}/nss3,g" \ -e "s,@MOD_MAJOR_VERSION@,$NSSUTIL_VMAJOR,g" \ -e "s,@MOD_MINOR_VERSION@,$NSSUTIL_VMINOR,g" \ -e "s,@MOD_PATCH_VERSION@,$NSSUTIL_VPATCH,g" \ > ./dist/pkgconfig/%{name}-config chmod 755 ./dist/pkgconfig/nss-util-config %install export PATH=/opt/freeware/bin:$PATH [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} # There is no make install target so we'll do it ourselves. %{__mkdir_p} ${RPM_BUILD_ROOT}%{_bindir} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_includedir}/nss3 %{__mkdir_p} ${RPM_BUILD_ROOT}%{_includedir}/nss3/templates %{__mkdir_p} ${RPM_BUILD_ROOT}%{_libdir} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_libdir64} %{__mkdir_p} ${RPM_BUILD_ROOT}%{_libdir}/nss3 %{__mkdir_p} ${RPM_BUILD_ROOT}%{_libdir64}/nss3 %{__mkdir_p} ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig %{__mkdir_p} ${RPM_BUILD_ROOT}%{_libdir64}/pkgconfig # copy RTL-style shared library for f in libnssutil3.so ; do install -p -m 755 32bit/dist/*.OBJ/lib/${f} ${RPM_BUILD_ROOT}%{_libdir} install -p -m 755 64bit/dist/*.OBJ/lib/${f} ${RPM_BUILD_ROOT}%{_libdir64} done # build AIX-style shared library export AR="ar -X32_64" ${AR} -rv ${RPM_BUILD_ROOT}%{_libdir}/libnssutil3.a \ 32bit/dist/*.OBJ/lib/libnssutil3.so ${AR} -q ${RPM_BUILD_ROOT}%{_libdir}/libnssutil3.a \ 64bit/dist/*.OBJ/lib/libnssutil3.so # copy the include files we want # only the util headers, the rest come from softokn and nss for f in 32bit/dist/public/nss/*.h ; do install -p -m 644 ${f} ${RPM_BUILD_ROOT}%{_includedir}/nss3 done # copy the template files we want for f in 32bit/dist/private/nss/templates.c ; do install -p -m 644 ${f} ${RPM_BUILD_ROOT}%{_includedir}/nss3/templates done # copy the package configuration files install -p -m 644 32bit/dist/pkgconfig/nss-util.pc ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig/nss-util.pc install -p -m 644 64bit/dist/pkgconfig/nss-util.pc ${RPM_BUILD_ROOT}%{_libdir64}/pkgconfig/nss-util.pc install -p -m 755 32bit/dist/pkgconfig/nss-util-config ${RPM_BUILD_ROOT}%{_bindir}/nss-util-config install -p -m 755 64bit/dist/pkgconfig/nss-util-config ${RPM_BUILD_ROOT}%{_bindir}/nss-util-config_64 ( 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}/libnssutil3.a /usr/lib/libnssutil3.a %{_libdir}/libnssutil3.so /usr/lib/libnssutil3.so %{_libdir64}/libnssutil3.so /usr/lib64/libnssutil3.so %files devel %defattr(-,root,system) %{_bindir}/nss-util-config /usr/bin/nss-util-config %{_bindir}/nss-util-config_64 /usr/bin/nss-util-config_64 # package configuration files %{_libdir}/pkgconfig/nss-util.pc %{_libdir64}/pkgconfig/nss-util.pc # co-owned with nss %dir %{_includedir}/nss3 %{_includedir}/nss3/*.h /usr/include/nss3 %dir %{_includedir}/nss3/templates %{_includedir}/nss3/templates/templates.c %changelog * Fri Dec 02 2016 Michael Perzl - 3.27.2-1 - updated to version 3.27.2 * Tue Nov 08 2011 Michael Perzl - 3.13.1-1 - updated to version 3.13.1 * Fri Jul 01 2011 Michael Perzl - 3.12.10-1 - updated to version 3.12.10 * Sat Feb 05 2011 Michael Perzl - 3.12.9-1 - updated to version 3.12.9 * Thu Oct 21 2010 Michael Perzl - 3.12.8-1 - updated to version 3.12.8 * Fri Oct 01 2010 Michael Perzl - 3.12.4-1 - first version for AIX5L v5.1 and higher