diff --git a/.gitignore b/.gitignore index 4c43ee9..4d866d0 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/nss-util-3.15.2.tar.bz2 +/nss-util-3.15.2.tar.gz diff --git a/mozilla-crypto-strip.sh b/mozilla-crypto-strip.sh deleted file mode 100755 index 56b00a8..0000000 --- a/mozilla-crypto-strip.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh -set -e - -if test -z $1 -then - echo "usage: $0 " - exit -fi - -ORIGDIR=`pwd` -WORKDIR=nss_ecc_strip_working_dir -EXTENSION=`echo $1 | sed -r 's#^(.*)(.tar.bz2|.tbz2|.tar.gz|.tgz)$#\2#'` -BASE=`echo $1 | sed -r 's#^(.*)(.tar.bz2|.tbz2|.tar.gz|.tgz)$#\1#'` -COMPRESS="" - -if test "x$EXTENSION" = "x.tar.bz2" || test "x$EXTENSION" = "x.tbz2" -then - COMPRESS="j" -fi - -if test "x$EXTENSION" = "x.tar.gz" || test "x$EXTENSION" = "x.tgz" -then - COMPRESS="z" -fi - -if test "x$COMPRESS" = "x" -then - echo "unable to process, input file $1 has unsupported extension" - exit -fi - -echo "== extension is $EXTENSION - ok" -echo "== new extension will be $JEXTENSION" -echo "== cleaning old workdir $WORKDIR" - -rm -rf $WORKDIR -mkdir $WORKDIR - -echo "== extracting input archive $1" -tar -x -$COMPRESS -C $WORKDIR -f $1 - -echo "changing into $WORKDIR" -pushd $WORKDIR - -DIRCOUNT=`ls -1 | wc -l` -if test $DIRCOUNT -ne 1 -then - echo "unable to process, $1 contains more than one toplevel directory" - exit -fi - -TOPDIR=`ls -1` -if test "x$TOPDIR" != "xnss" -then - # try to deal with a single additional subdirectory above "nss" - echo "== skipping toplevel directory $TOPDIR" - cd $TOPDIR -fi - -DIRCOUNT=`ls -1 | wc -l` -if test $DIRCOUNT -ne 1 -then - echo "unable to process, $1 contains more than one second level directory" - exit -fi - -SINGLEDIR=`ls -1` -if test "x$SINGLEDIR" != "xnss" -then - echo "unable to process, first or second level directory is not nss" - exit -fi - -echo "== input archive accepted, now processing" - -REALFREEBLDIR=nss/lib/freebl -FREEBLDIR=./$REALFREEBLDIR - -rm -rf ./nss/cmd/ecperf - -mv ${FREEBLDIR}/ecl/ecl-exp.h ${FREEBLDIR}/save -rm -rf ${FREEBLDIR}/ecl/tests -rm -rf ${FREEBLDIR}/ecl/CVS -for i in ${FREEBLDIR}/ecl/* ; do -echo clobbering $i - > $i -done -mv ${FREEBLDIR}/save ${FREEBLDIR}/ecl/ecl-exp.h - -for j in ${FREEBLDIR}/ec.*; do - echo unifdef $j - cat $j | \ - awk 'BEGIN {ech=1; prt=0;} \ - /^#[ \t]*ifdef.*NSS_ENABLE_ECC/ {ech--; next;} \ - /^#[ \t]*if/ {if(ech < 1) ech--;} \ - {if(ech>0) {;print $0};} \ - /^#[ \t]*endif/ {if(ech < 1) ech++;} \ - {if (prt && (ech<=0)) {;print $0}; } \ - {if (ech>0) {prt=0;} } \ - /^#[ \t]*else/ {if (ech == 0) prt=1;}' > $j.hobbled && \ - mv $j.hobbled $j -done - -echo "== returning to original directory" -popd - -JCOMPRESS=j -JEXTENSION=.tar.bz2 -NEWARCHIVE=$BASE-stripped$JEXTENSION -echo "== finally producing new archive $NEWARCHIVE" -tar -c -$JCOMPRESS -C $WORKDIR -f $NEWARCHIVE $TOPDIR - -echo "== all done, listing of old and new archive:" -ls -l $1 -ls -l $NEWARCHIVE - -LISTING_DIR="" -if test "x$TOPDIR" != "xmozilla" -then - LISTING_DIR="$TOPDIR/$REALFREEBLDIR/ecl" -else - LISTING_DIR="$REALFREEBLDIR/ecl" -fi - -echo "== FYI, producing listing of stripped dir in new archive" -tar -t -v -$JCOMPRESS -C $WORKDIR -f $NEWARCHIVE $LISTING_DIR - - diff --git a/nss-split-util.sh b/nss-split-util.sh index 08d875e..b56debe 100644 --- a/nss-split-util.sh +++ b/nss-split-util.sh @@ -16,9 +16,9 @@ fi export name=nss export version=$1 -echo "Extracting ${name}-${version}-stripped.tar.bz2" +echo "Extracting ${name}-${version}.tar.gz" -tar -xjf ${name}-${version}-stripped.tar.bz2 +tar -xzf ${name}-${version}.tar.gz # the directory will be named ${name}-${version} @@ -62,7 +62,7 @@ cp ${nss_source_dir}/nss/lib/manifest.mn ${UTIL_WORK}/${util_dir}/nss/lib cp -a ${nss_source_dir}/nss/lib/util ${UTIL_WORK}/${util_dir}/nss/lib/util pushd ${UTIL_WORK} # the compressed tar ball for nss-util -tar -cjf ../${name}-util-${version}.tar.bz2 ${util_dir} +tar -czf ../${name}-util-${version}.tar.gz ${util_dir} popd # cleanup after ourselves diff --git a/nss-util.spec b/nss-util.spec index 570f1df..7ca2fa2 100644 --- a/nss-util.spec +++ b/nss-util.spec @@ -3,7 +3,7 @@ Summary: Network Security Services Utilities Library Name: nss-util Version: 3.15.2 -Release: 1%{?dist} +Release: 2%{?dist} License: MPLv2.0 URL: http://www.mozilla.org/projects/security/pki/nss/ Group: System Environment/Libraries @@ -16,28 +16,20 @@ 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. -# We use the nss-split-util.sh script for keeping only what we need. -# We first produce the full source archive from from the upstream, -# nss-{version}-stripped.tar.gz, by running mozilla-crypto-strip.sh -# to remove any non-free sources, none in this case but we want a bz2 archive, -# and then split off nss-util from it via nss-split-util.sh {name}-{version} +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 +# nss-util is produced via via nss-split-util.sh {version} # Detailed Steps: # fedpkg clone nss-util # cd nss-util -# Download the nss-{version}-stripped.tar.gz tarball from upstream -# Strip-off unwanted sources with -# ./mozilla-crypto-srip.sh nss-{version}-stripped.tar.gz -# which produces nss-{version}-stripped.tar.bz2 # Make the source tarball for nss-util out of the nss one: # sh ./nss-split-util.sh ${version} -# A file named ${name}-${version}.tar.bz2 should appear +# A file named ${name}-${version}.tar.gz should appear # ready to upload to the lookaside cache. -Source1: mozilla-crypto-strip.sh -Source2: nss-split-util.sh -Source3: nss-util.pc.in -Source4: nss-util-config.in +Source1: nss-split-util.sh +Source2: nss-util.pc.in +Source3: nss-util-config.in Patch1: build-nss-util-only.patch Patch2: hasht-dont-include-prtypes.patch @@ -108,7 +100,7 @@ export USE_64 # Set up our package file %{__mkdir_p} ./dist/pkgconfig -%{__cat} %{SOURCE3} | sed -e "s,%%libdir%%,%{_libdir},g" \ +%{__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" \ @@ -120,11 +112,11 @@ NSSUTIL_VMAJOR=`cat nss/lib/util/nssutil.h | grep "#define.*NSSUTIL_VMAJOR" | aw 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_VMAJOR +export NSSUTIL_VMINOR export NSSUTIL_VPATCH -%{__cat} %{SOURCE4} | sed -e "s,@libdir@,%{_libdir},g" \ +%{__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" \ @@ -228,6 +220,9 @@ done %{_includedir}/nss3/templates/templates.c %changelog +* Sun Oct 27 2013 Elio Maldonado - 3.15.2-2 +- Split off nss-util from full nss sources as released upstream + * Thu Sep 26 2013 Elio Maldonado - 3.15.2-1 - Update to NSS_3_15_2_RTM diff --git a/sources b/sources index 2fcc002..0cc2fc6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -10c64069b11e1b4ee874f92751a1c028 nss-util-3.15.2.tar.bz2 +38aec93d5de6447dab998dba43e855e0 nss-util-3.15.2.tar.gz