rpms/nss-util/devel nss-split-util.sh, NONE, 1.1 nss-util-config.in, NONE, 1.1 nss-util.pc.in, NONE, 1.1 nss-util.spec, NONE, 1.1

Elio Maldonado emaldonado at fedoraproject.org
Wed Aug 19 22:36:19 UTC 2009


Author: emaldonado

Update of /cvs/extras/rpms/nss-util/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv21138

Added Files:
	nss-split-util.sh nss-util-config.in nss-util.pc.in 
	nss-util.spec 
Log Message:
Initial commit for nss-util package - rhbz# 515032


--- NEW FILE nss-split-util.sh ---
#!/bin/sh
#
# Splits NSS into nss-util 
# Takes as command line input the version of nss
# and assumes that a file nss-${nss_version}-stripped.tar.bz2
# exits in the current directory

set -e

if test -z $1
then
  echo "usage: $0 nss-version"
  exit
fi

export name=nss
export version=$1

echo "Extracting ${name}-${version}-stripped.tar.bz2"

tar -xjf ${name}-${version}-stripped.tar.bz2

# the directory will be named ${name}-${version}

nss_source_dir=${name}-${version}
util_dir=${name}-util-${version}
softokn_dir=${name}-softokn-${version}

# make_nss_util
#-------------------------------------------------
# create the nss-util subset consisting of
#   mozilla/dbm                   --- full directory
#   mozilla/security              --- top empty
#   mozilla/security/coreconf     --- full directory
#   mozilla/security/nss          --- top files only
#   mozilla/security/nss/lib      --- top files only
#   mozilla/security/nss/lib/util --- full directory
#--------------------------------------------------

UTIL_WORK=${util_dir}-work
rm -rf ${UTIL_WORK}
mkdir ${UTIL_WORK}

# copy everything
cp -a ${nss_source_dir} ${UTIL_WORK}/${util_dir}

# remove subdirectories that we don't want
rm -rf ${UTIL_WORK}/${util_dir}/mozilla/security/nss/cmd
rm -rf ${UTIL_WORK}/${util_dir}/mozilla/security/nss/tests
rm -rf ${UTIL_WORK}/${util_dir}/mozilla/security/nss/lib

# start with an empty lib directory to be filled
mkdir ${UTIL_WORK}/${util_dir}/mozilla/security/nss/lib
# copy some files at the top and the util subdirectory recursively
cp ${nss_source_dir}/mozilla/security/nss/lib/Makefile ${UTIL_WORK}/${util_dir}/mozilla/security/nss/lib
cp ${nss_source_dir}/mozilla/security/nss/lib/manifest.mn ${UTIL_WORK}/${util_dir}/mozilla/security/nss/lib
cp -a ${nss_source_dir}/mozilla/security/nss/lib/util ${UTIL_WORK}/${util_dir}/mozilla/security/nss/lib/util
pushd ${UTIL_WORK}
# the compressed tar ball for nss-util
tar -cjf ../${name}-util-${version}.tar.bz2 ${util_dir}
popd

# cleanup after ourselves
rm -fr ${nss_source_dir}
rm -fr ${UTIL_WORK}





--- NEW FILE nss-util-config.in ---
#!/bin/sh

prefix=@prefix@

major_version=@MOD_MAJOR_VERSION@
minor_version=@MOD_MINOR_VERSION@
patch_version=@MOD_PATCH_VERSION@

usage()
{
	cat <<EOF
Usage: nss-util-config [OPTIONS] [LIBRARIES]
Options:
	[--prefix[=DIR]]
	[--exec-prefix[=DIR]]
	[--includedir[=DIR]]
	[--libdir[=DIR]]
	[--version]
	[--libs]
	[--cflags]
Dynamic Libraries:
	nssutil
EOF
	exit $1
}

if test $# -eq 0; then
	usage 1 1>&2
fi

lib_ssl=no
lib_smime=no
lib_nss=no
lib_nssutil=yes

while test $# -gt 0; do
  case "$1" in
  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) optarg= ;;
  esac

  case $1 in
    --prefix=*)
      prefix=$optarg
      ;;
    --prefix)
      echo_prefix=yes
      ;;
    --exec-prefix=*)
      exec_prefix=$optarg
      ;;
    --exec-prefix)
      echo_exec_prefix=yes
      ;;
    --includedir=*)
      includedir=$optarg
      ;;
    --includedir)
      echo_includedir=yes
      ;;
    --libdir=*)
      libdir=$optarg
      ;;
    --libdir)
      echo_libdir=yes
      ;;
    --version)
      echo ${major_version}.${minor_version}.${patch_version}
      ;;
    --cflags)
      echo_cflags=yes
      ;;
    --libs)
      echo_libs=yes
      ;;
    ssl)
      lib_ssl=no
      ;;
    smime)
      lib_smime=no
      ;;
    nss)
      lib_nss=no
      ;;
    nssutil)
      lib_nssutil=yes
      ;;
    *)
      usage 1 1>&2
      ;;
  esac
  shift
done

# Set variables that may be dependent upon other variables
if test -z "$exec_prefix"; then
    exec_prefix=`pkg-config --variable=exec_prefix nssutil`
fi
if test -z "$includedir"; then
    includedir=`pkg-config --variable=includedir nssutil`
fi
if test -z "$libdir"; then
    libdir=`pkg-config --variable=libdir nssutil`
fi

if test "$echo_prefix" = "yes"; then
    echo $prefix
fi

if test "$echo_exec_prefix" = "yes"; then
    echo $exec_prefix
fi

if test "$echo_includedir" = "yes"; then
    echo $includedir
fi

if test "$echo_libdir" = "yes"; then
    echo $libdir
fi

if test "$echo_cflags" = "yes"; then
    echo -I$includedir
fi

if test "$echo_libs" = "yes"; then
      libdirs="-Wl,-rpath-link,$libdir -L$libdir"
      if test -n "$lib_ssl"; then
	libdirs="$libdirs -lssl${major_version}"
      fi
      if test -n "$lib_smime"; then
	libdirs="$libdirs -lsmime${major_version}"
      fi
      if test -n "$lib_nss"; then
	libdirs="$libdirs -lnss${major_version}"
      fi
      if test -n "$lib_nssutil"; then
	libdirs="$libdirs -lnssutil${major_version}"
      fi
      echo $libdirs
fi      



--- NEW FILE nss-util.pc.in ---
prefix=%prefix%
exec_prefix=%exec_prefix%
libdir=%libdir%
includedir=%includedir%

Name: NSS-UTIL
Description: Network Security Services Utility Library
Version: %NSSUTIL_VERSION%
Requires: nspr >= %NSPR_VERSION%
Libs: -lnssutil3
Cflags: -I${includedir}


--- NEW FILE nss-util.spec ---
%global nspr_version 4.8

Summary:          Network Security Services Utilities Library
Name:             nss-util
Version:          3.12.3.99.3
Release:          8%{?dist}
License:          MPLv1.1 or GPLv2+ or LGPLv2+
URL:              http://www.mozilla.org/projects/security/pki/nss/
Group:            System Environment/Libraries
Requires:         nspr >= %{nspr_version}
Requires:         sqlite
BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:    nspr-devel >= %{nspr_version}
BuildRequires:    zlib-devel
BuildRequires:    pkgconfig
BuildRequires:    gawk
BuildRequires:    psmisc
BuildRequires:    perl

Source0:          %{name}-%{version}.tar.bz2
# The nss-util tar ball is a subset of nss-%{version}-stripped.tar.bz2, 
# Therefore we use the nss-split-util.sh script to keeping only what we need.
# Download the nss tarball via CVS from the nss propect and follow these
# steps to make the r tarball for nss-util out of the for nss:
# cvs co nss
# cvs nss-util (as soon as it is in cvs - for now extract the srpm)
# cd nss-util/devel
# cp ../../nss/devel/${version}-stripped.tar.bz2  .
# (use 3.12.3.99.3 for version above until 3.12.4 comes out)
# sh ./nss-split-util.sh ${version}
# A %{name}-%{version}.tar.bz2 should appear
Source1:          nss-split-util.sh
Source2:          nss-util.pc.in
Source3:          nss-util-config.in


%description
Utilities for Network Security Services and the Softoken module

# 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:         nss-util = %{version}-%{release}
Requires:         nspr-devel >= %{nspr_version}
Requires:         pkgconfig

%description devel
Header and utility library files for doing development with Network Security Services.


%prep
%setup -q

%build

# Enable compiler optimizations and disable debugging code
BUILD_OPT=1
export BUILD_OPT

# Generate symbolic info for debuggers
XCFLAGS=$RPM_OPT_FLAGS
export XCFLAGS


PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1

export PKG_CONFIG_ALLOW_SYSTEM_LIBS
export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS

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


%ifarch x86_64 ppc64 ia64 s390x sparc64
USE_64=1
export USE_64
%endif

# make util
%{__make} -C ./mozilla/security/coreconf
%{__make} -C ./mozilla/security/nss

# Set up our package file
%{__mkdir_p} ./mozilla/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" > \
                          ./mozilla/dist/pkgconfig/nss-util.pc

NSSUTIL_VMAJOR=`cat mozilla/security/nss/lib/util/nssutil.h | grep "#define.*NSSUTIL_VMAJOR" | awk '{print $3}'`
NSSUTIL_VMINOR=`cat mozilla/security/nss/lib/util/nssutil.h | grep "#define.*NSSUTIL_VMINOR" | awk '{print $3}'`
NSSUTIL_VPATCH=`cat mozilla/security/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, at libdir@,%{_libdir},g" \
                          -e "s, at prefix@,%{_prefix},g" \
                          -e "s, at exec_prefix@,%{_prefix},g" \
                          -e "s, at includedir@,%{_includedir}/nss3,g" \
                          -e "s, at MOD_MAJOR_VERSION@,$NSSUTIL_VMAJOR,g" \
                          -e "s, at MOD_MINOR_VERSION@,$NSSUTIL_VMINOR,g" \
                          -e "s, at MOD_PATCH_VERSION@,$NSSUTIL_VPATCH,g" \
                          > ./mozilla/dist/pkgconfig/nss-util-config

chmod 755 ./mozilla/dist/pkgconfig/nss-util-config


%install

%{__rm} -rf $RPM_BUILD_ROOT

# There is no make install target so we'll do it ourselves.

%{__mkdir_p} $RPM_BUILD_ROOT/%{_includedir}/nss3
%{__mkdir_p} $RPM_BUILD_ROOT/%{_lib}
%{__mkdir_p} $RPM_BUILD_ROOT/%{_libdir}/nss3
%{__mkdir_p} $RPM_BUILD_ROOT/%{_libdir}/pkgconfig
%{__mkdir_p} $RPM_BUILD_ROOT/%{_bindir}

# Copy the binary libraries we want
for file in libnssutil3.so
do
  %{__install} -p -m 755 mozilla/dist/*.OBJ/lib/$file $RPM_BUILD_ROOT/%{_lib}
  ln -sf ../../%{_lib}/$file $RPM_BUILD_ROOT/%{_libdir}/$file
done

# Copy the include files we want
# The util headers, the rest come from softokn and nss
for file in mozilla/dist/public/nss/*.h
do
  %{__install} -p -m 644 $file $RPM_BUILD_ROOT/%{_includedir}/nss3
done

# Copy the package configuration files
%{__install} -p ./mozilla/dist/pkgconfig/nss-util.pc $RPM_BUILD_ROOT/%{_libdir}/pkgconfig/nss-util.pc
%{__install} -p ./mozilla/dist/pkgconfig/nss-util-config $RPM_BUILD_ROOT/%{_bindir}/nss-util-config

%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)
/%{_lib}/libnssutil3.so
%{_includedir}/nss3

%files devel
%defattr(-,root,root)
%{_libdir}/libnssutil3.so
%{_libdir}/pkgconfig/nss-util.pc
%{_bindir}/nss-util-config

# co-owned with nss
%dir %{_includedir}/nss3
# these are marked as public export in
# mozilla/security/nss/lib/util/manifest.mk
%{_includedir}/nss3/base64.h
%{_includedir}/nss3/ciferfam.h
%{_includedir}/nss3/nssb64.h
%{_includedir}/nss3/nssb64t.h
%{_includedir}/nss3/nsslocks.h
%{_includedir}/nss3/nssilock.h
%{_includedir}/nss3/nssilckt.h
%{_includedir}/nss3/nssrwlk.h
%{_includedir}/nss3/nssrwlkt.h
%{_includedir}/nss3/nssutil.h
%{_includedir}/nss3/pkcs11.h
%{_includedir}/nss3/pkcs11f.h
%{_includedir}/nss3/pkcs11n.h
%{_includedir}/nss3/pkcs11p.h
%{_includedir}/nss3/pkcs11t.h
%{_includedir}/nss3/pkcs11u.h
%{_includedir}/nss3/portreg.h
%{_includedir}/nss3/secasn1.h
%{_includedir}/nss3/secasn1t.h
%{_includedir}/nss3/seccomon.h
%{_includedir}/nss3/secder.h
%{_includedir}/nss3/secdert.h
%{_includedir}/nss3/secdig.h
%{_includedir}/nss3/secdigt.h
%{_includedir}/nss3/secerr.h
%{_includedir}/nss3/secitem.h
%{_includedir}/nss3/secoid.h
%{_includedir}/nss3/secoidt.h
%{_includedir}/nss3/secport.h
%{_includedir}/nss3/utilrename.h

%changelog
* Thu Aug 13 2009 Elio Maldonado <emaldona at redhat.com> 3.12.3.99.3-8
- Initial build




More information about the scm-commits mailing list