Blame SOURCES/nss-split-util.sh

f75352
#!/bin/sh
f75352
#
f75352
# Splits NSS into nss-util 
f75352
# Takes as command line input the version of nss
f75352
# and assumes that a file nss-${nss_version}-stripped.tar.bz2
f75352
# exits in the current directory
f75352
f75352
set -e
f75352
f75352
if test -z $1
f75352
then
f75352
  echo "usage: $0 nss-version"
f75352
  exit
f75352
fi
f75352
f75352
export name=nss
f75352
export version=$1
f75352
9adeb8
echo "Extracting ${name}-${version}.tar.gz"
f75352
9adeb8
tar -xzf ${name}-${version}.tar.gz
f75352
f75352
# the directory will be named ${name}-${version}
f75352
f75352
nss_source_dir=${name}-${version}
f75352
util_dir=${name}-util-${version}
f75352
softokn_dir=${name}-softokn-${version}
f75352
f75352
# make_nss_util
f75352
#-------------------------------------------------
f75352
# create the nss-util subset consisting of
f75352
#   nss/dbm      --- full directory
f75352
#   nss/coreconf --- full directory
f75352
#   nss          --- top files only
f75352
#   nss/lib      --- top files only
f75352
#   nss/lib/util --- full directory
f75352
#--------------------------------------------------
f75352
f75352
UTIL_WORK=${util_dir}-work
f75352
rm -rf ${UTIL_WORK}
f75352
mkdir ${UTIL_WORK}
f75352
f75352
# copy everything
f75352
cp -a ${nss_source_dir} ${UTIL_WORK}/${util_dir}
f75352
f75352
# remove subdirectories that we don't want
f75352
rm -rf ${UTIL_WORK}/${util_dir}/nss/cmd
f75352
rm -rf ${UTIL_WORK}/${util_dir}/nss/tests
f75352
rm -rf ${UTIL_WORK}/${util_dir}/nss/lib
f75352
f75352
# start with an empty cmd lib directories to be filled selectively
f75352
mkdir ${UTIL_WORK}/${util_dir}/nss/cmd
f75352
cp ${nss_source_dir}/nss/cmd/Makefile ${UTIL_WORK}/${util_dir}/nss/cmd
f75352
cp ${nss_source_dir}/nss/cmd/manifest.mn ${UTIL_WORK}/${util_dir}/nss/cmd
f75352
cp ${nss_source_dir}/nss/cmd/platlibs.mk ${UTIL_WORK}/${util_dir}/nss/cmd
f75352
cp ${nss_source_dir}/nss/cmd/platrules.mk ${UTIL_WORK}/${util_dir}/nss/cmd
f75352
f75352
mkdir ${UTIL_WORK}/${util_dir}/nss/lib
f75352
# copy some files at the top and the util subdirectory recursively
f75352
cp ${nss_source_dir}/nss/lib/Makefile ${UTIL_WORK}/${util_dir}/nss/lib
f75352
cp -a ${nss_source_dir}/nss/lib/util ${UTIL_WORK}/${util_dir}/nss/lib/util
f75352
pushd ${UTIL_WORK}
f75352
# the compressed tar ball for nss-util
9adeb8
tar -czf ../${name}-util-${version}.tar.gz ${util_dir}
f75352
popd
f75352
f75352
# cleanup after ourselves
f75352
rm -fr ${nss_source_dir}
f75352
rm -fr ${UTIL_WORK}
f75352
f75352
f75352