summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElio Maldonado <emaldona@redhat.com>2011-02-27 10:34:38 -0800
committerElio Maldonado <emaldona@redhat.com>2011-02-27 10:34:38 -0800
commit22e04b5b7417763e583bb19e7f1287ee8038597a (patch)
treed50c52485e988d94c8b89e2c6a692e2f6ebeac0b
downloadnssmockbuilds4fedora-22e04b5b7417763e583bb19e7f1287ee8038597a.tar.gz
nssmockbuilds4fedora-22e04b5b7417763e583bb19e7f1287ee8038597a.tar.xz
nssmockbuilds4fedora-22e04b5b7417763e583bb19e7f1287ee8038597a.zip
Initial commit
-rwxr-xr-xcheckout-all-packages.sh41
-rwxr-xr-xclean-all-packages.sh33
-rwxr-xr-xinstall-clients-deps.sh31
-rwxr-xr-xmock-build-inside.sh80
-rwxr-xr-xmock-build-install-nss.sh47
-rwxr-xr-xmock-build-prepare.sh133
-rwxr-xr-xprepare-nss-clients.sh44
-rw-r--r--top-script-f14.sh84
-rw-r--r--top-script-f16.sh84
9 files changed, 577 insertions, 0 deletions
diff --git a/checkout-all-packages.sh b/checkout-all-packages.sh
new file mode 100755
index 0000000..73a70bf
--- /dev/null
+++ b/checkout-all-packages.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+# checks out nspr, nss-util, nss-softokn, and nss
+# checks out also some clients of nss, xulrunner, etc.
+# Usage: checkout-all-packages [-b branch], defaults to master
+#
+# TODO: Pass the package names as arguments
+
+checkout_pkgs() {
+ for p in $1; do
+ fedpkg clone $p
+ pushd $p
+ if [ -n "$2" ]; then
+ fedpkg switch-branch $2
+ fi
+ popd
+ done
+}
+
+#----------------------------------------------------------
+nssPkgs="nspr nss-util nss-softokn nss"
+clientPkgs="crypto-utils curl xulrunner"
+
+
+while getopts b: opt
+do
+ case $opt in
+ b) export branch="$OPTARG";;
+ ?) printf "Usage: %s: [-b branch]\n defauls to master" $0
+ exit 2;;
+ esac
+done
+
+echo "branch = ${branch}"
+
+source ./clean-all-packages.sh
+
+checkout_pkgs "${nssPkgs}" "${branch}"
+checkout_pkgs "${clientPkgs}" "${branch}"
+
+
diff --git a/clean-all-packages.sh b/clean-all-packages.sh
new file mode 100755
index 0000000..5a0be7b
--- /dev/null
+++ b/clean-all-packages.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# check out nspr, nss-util, nss-softokn, and nss
+# check out also some clients of nss
+
+remove_pkgs() {
+ for p in $1; do
+ rm -fr $p
+ done
+}
+
+#----------------------------------------------------------
+
+nssPkgs="nspr nss-util nss-softokn nss"
+clientPkgs="crypto-utils curl xulrunner"
+
+# Defaults
+TARGET=Rawhide
+
+while getopts i: opt
+do
+ case $opt in
+ i) TARGET="$OPTARG";;
+ ?) printf "Usage: %s: [-i dist]\n" $0
+ exit 2;;
+ esac
+done
+
+export dist=${TARGET}
+
+remove_pkgs "${nssPkgs}"
+remove_pkgs "${clientPkgs}"
+
diff --git a/install-clients-deps.sh b/install-clients-deps.sh
new file mode 100755
index 0000000..77195ff
--- /dev/null
+++ b/install-clients-deps.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# Defaults
+TARGET=14
+ARCH=x86_64
+
+while getopts i:j: opt
+do
+ case $opt in
+ i) TARGET="$OPTARG";;
+ j) ARCH="$OPTARG";;
+ ?) printf "Usage: %s: [-i dist] [-j arch]\n" $0
+ exit 2;;
+ esac
+done
+
+export dist=${TARGET}
+export arch=${ARCH}
+
+cc="curl xulrunner";
+
+for c in $cc; do
+ pushd ${c}
+ fedpkg clean
+ fedpkg srpm
+ mock -r fedora-${dist}-${arch} --copyin ${c}-*.src.rpm /tmp
+ mock -r fedora-${dist}-${arch} --installdeps ${c}-*.src.rpm
+ popd
+done
+
+
diff --git a/mock-build-inside.sh b/mock-build-inside.sh
new file mode 100755
index 0000000..6e8de2e
--- /dev/null
+++ b/mock-build-inside.sh
@@ -0,0 +1,80 @@
+#!/bin/bash
+
+#
+# Rebase to nss to 3.12.9 and nspr 4.8.7 and use mock to build nss for Rawhide
+# Using beta candidates
+#
+# --nspr=nspr-version
+# --nss=nss-version
+# --fedora=target
+# --arch=arch or current
+
+export_tags() {
+export nspr_v=${NSPR_V}
+export nspr_r=${NSPR_R}
+export nss_v=${NSS_V}
+export nss_r=${NSS_R}
+export nss_util_v=${NSS_UTIL_V}
+export nss_util_r=${NSS_UTIL_R}
+export nss_softokn_v=${NSS_SOFTOKN_V}
+export nss_softokn_r=${NSS_SOFTOKN_R}
+export target=${TARGET}
+export dist=${DIST}
+export arch=${ARCH}
+export archalso=${ARCHALSO}
+}
+
+#----------------------------------------------------------
+# Defaults
+NSPR_V=4.8.7
+NSPR_R=1
+NSS_V=3.12.9
+NSS_R=8
+NSS_UTIL_V=3.12.9
+NSS_UTIL_R=1
+NSS_SOFTOKN_V=3.12.9
+NSS_SOFTOKN_R=5
+TARGET=14
+DIST=14
+ARCH=x86_64
+ARCHALSO=x86_64
+
+while getopts :a:b:c:d:e:f:g:h:i:j: opt
+do
+ case $opt in
+ a) NSPR_V="$OPTARG";;
+ b) NSPR_R="$OPTARG";;
+ c) NSS_V="$OPTARG";;
+ d) NSS_R="$OPTARG";;
+ e) NSS_UTIL_R="$OPTARG";;
+ f) NSS_UTIL_V="$OPTARG";;
+ g) NSS_SOFTOKN_R="$OPTARG";;
+ h) NSS_SOFTOKN_V="$OPTARG";;
+ i) TARGET="$OPTARG";;
+ j) ARCH="$OPTARG";;
+ ?) printf "Usage: %s: [-a nspr_version] [-b nspr_version] [-c nss_version] [-d nss_version] [-e dist] [-f arch]\n" $0
+ exit 2;;
+ esac
+done
+if [ ${ARCH} eq "i386" ]; then
+ ARCHALSO="i686"
+fi
+
+# set environment variables
+export_tags
+
+# for ease of installing later
+cd /builddir/build/RPMS/
+
+# build nspr, nss-util, and nss-softokn as root
+rpmbuild --rebuild /tmp/nspr-${nspr_v}-${nspr_r}.fc${target}.src.rpm
+rpm -ihv /builddir/build/RPMS/nspr-*
+rpmbuild --rebuild /tmp/nss-util-${nss_util_v}-${nss_util_r}.fc${target}.src.rpm
+rpm -ihv /builddir/build/RPMS/nss-util-*
+rpmbuild --rebuild /tmp/nss-softokn-${nss_softokn_v}-${nss_softokn_r}.fc${target}.src.rpm
+rpm -ihv /builddir/build/RPMS/nss-softokn-*
+# build nss as mockbuild
+su mockbuild -c 'rpmbuild --rebuild /tmp/nss-${nss_v}-${nss_r}.fc${target}.src.rpm /builddir/build/RPMS'
+rpm -ihv /builddir/build/RPMS/nss-*.rpm
+
+
diff --git a/mock-build-install-nss.sh b/mock-build-install-nss.sh
new file mode 100755
index 0000000..49d7bbb
--- /dev/null
+++ b/mock-build-install-nss.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+#
+# Installs nss in mock
+#
+export_tags() {
+export nss_version=${NSS_V}
+export nss_release=${NSS_R}
+export target=${TARGET}
+export dist=${DIST}
+export arch=${ARCH}
+export archalso=${ARCHALSO}
+}
+
+# Defaults
+NSS_V=3.12.9
+NSS_R=8
+TARGET=14
+DIST=rawhide
+ARCH=x86_64
+ARCHALSO=x86_64
+
+while getopts :c:d:i:j: opt
+do
+ case $opt in
+ c) NSS_V="$OPTARG";;
+ d) NSS_R="$OPTARG";;
+ i) TARGET="$OPTARG";;
+ j) ARCH="$OPTARG";;
+ ?) printf "Usage: %s [-c nss_version] [-d nss_release] [-i dist] [-j arch]\n" $0
+ exit 2;;
+ esac
+done
+if [ "${ARCH}" = "i386" ]; then
+ ARCHALSO="i686"
+fi
+
+export_tags
+
+# install nss
+rpm -Uhv \
+nss-${nss_version}-${nss_release}.fc${target}.${archalso}.rpm \
+nss-sysinit-${nss_version}-${nss_release}.fc${target}.${archalso}.rpm \
+nss-tools-${nss_version}-${nss_release}.fc${target}.${archalso}.rpm \
+nss-debuginfo-${nss_version}-${nss_release}.fc${target}.${archalso}.rpm \
+nss-devel-${nss_version}-${nss_release}.fc${target}.${archalso}.rpm \
+nss-pkcs11-devel-${nss_version}-${nss_release}.fc${target}.${archalso}.rpm
+
diff --git a/mock-build-prepare.sh b/mock-build-prepare.sh
new file mode 100755
index 0000000..f38bc62
--- /dev/null
+++ b/mock-build-prepare.sh
@@ -0,0 +1,133 @@
+#!/bin/bash
+
+#
+# Rebase to nss to 3.12.9 and nspr 4.8.7 and use mock to build nss for Rawhide
+# Using beta candidates
+#
+# --nspr=nspr-version
+# --nss=nss-version
+# --fedora=target
+# --arch=arch or current
+
+export_tags() {
+export nspr_v=${NSPR_V}
+export nspr_r=${NSPR_R}
+export nss_v=${NSS_V}
+export nss_r=${NSS_R}
+export nss_util_v=${NSS_UTIL_V}
+export nss_util_r=${NSS_UTIL_R}
+export nss_softokn_v=${NSS_SOFTOKN_V}
+export nss_softokn_r=${NSS_SOFTOKN_R}
+export target=${TARGET}
+export dist=${DIST}
+export arch=${ARCH}
+export archalso=${ARCHALSO}
+}
+
+#----------------------------------------------------------
+
+# Defaults
+
+NSPR_V=4.8.7
+NSPR_R=1
+
+NSS_V=3.12.9
+NSS_R=8
+
+NSS_UTIL_V=3.12.9
+NSS_UTIL_R=1
+
+NSS_SOFTOKN_V=3.12.9
+NSS_SOFTOKN_R=5
+
+TARGET=14
+DIST=14
+
+ARCH=x86_64
+ARCHALSO=x86_64
+
+while getopts :a:b:c:d:e:f:g:h:i:j: opt
+do
+ case $opt in
+ a) NSPR_V="$OPTARG";;
+ b) NSPR_R="$OPTARG";;
+ c) NSS_V="$OPTARG";;
+ d) NSS_R="$OPTARG";;
+ e) NSS_UTIL_V="$OPTARG";;
+ f) NSS_UTIL_R="$OPTARG";;
+ g) NSS_SOFTOKN_V="$OPTARG";;
+ h) NSS_SOFTOKN_R="$OPTARG";;
+ i) TARGET="$OPTARG";;
+ j) ARCH="$OPTARG";;
+ ?) printf "Usage: %s [-a nspr_v] [-b nspr_r] [-c nss_version] [-d nss_r] [-e nss_util_v] [-f nss_util_r] [-g nss_softokn_v] [-h nss_softokn_r] [-i dist] [-j arch]\n" $0
+ exit 2;;
+ esac
+done
+
+if [ "${TARGET}" = "f16" ]; then
+ DIST="rawhide"
+fi
+if [ "${ARCH}" = "i386" ]; then
+ ARCHALSO="i686"
+fi
+
+export nspr_v=${NSPR_V}
+export nspr_r=${NSPR_R}
+export nss_v=${NSS_V}
+export nss_r=${NSS_R}
+export nss_util_v=${NSS_UTIL_V}
+export nss_util_r=${NSS_UTIL_R}
+export nss_softokn_v=${NSS_SOFTOKN_V}
+export nss_softokn_r=${NSS_SOFTOKN_R}
+export target=${TARGET}
+export dist=${DIST}
+export arch=${ARCH}
+export archalso=${ARCHALSO}
+
+echo "nspr_v=${nspr_v}"
+echo "nspr_r=${nspr_r}"
+echo "nss_v=${nss_v}"
+echo "nss_r=${nss_r}"
+echo "nss_util_v=${nss_util_v}"
+echo "nss_util_r=${nss_util_r}"
+echo "nss_softokn_v=${nss_softokn_v}"
+echo "nss_softokn_r=${nss_softokn_r}"
+echo "target=${target}"
+echo "dist=${dist}"
+echo "arch=${arch}"
+echo "archalso=${archalso}"
+
+# initialize the mock environment and install
+# packages we will need later when building nss
+mock -r fedora-${dist}-${arch} --init
+mock -r fedora-${dist}-${arch} --install sqlite-devel zlib-devel pkgconfig gawk psmisc perl vim
+mock -r fedora-${dist}-${arch} --install nspr-devel nss-util-devel nss-softokn-devel nss-devel
+
+# Create the srpm's for our packages and copy the srpms into mock
+cd ./nspr
+fedpkg clean; fedpkg srpm
+mock -r fedora-${dist}-${arch} --copyin nspr-*.fc${target}.src.rpm ${tmpdir4srpms} /tmp
+
+cd ../nss-util
+fedpkg clean; fedpkg srpm
+mock -r fedora-${dist}-${arch} --copyin nss-util-*.fc${target}.src.rpm /tmp
+
+cd ../nss-softokn
+fedpkg clean; fedpkg srpm
+mock -r fedora-${dist}-${arch} --copyin nss-softokn-*.fc${target}.src.rpm /tmp
+
+cd ../nss
+fedpkg clean; fedpkg srpm
+mock -r fedora-${dist}-${arch} --copyin nss-*.fc${target}.src.rpm /tmp
+
+cd ..
+
+# copy the build script into mock
+mock -r fedora-${dist}-${arch} --copyin ./mock-build-inside.sh /usr/bin
+mock -r fedora-${dist}-${arch} --copyin ./mock-build-install-nss.sh /usr/bin
+mock -r fedora-${dist}-${arch} --copyin ./install-clients-deps.sh /usr/bin
+
+# create a mock shell
+#mock -r fedora-${dist}-${arch} --shell
+#exit
+# mock-build-inside.sh -a ${nspr_v} -b ${nspr_r} -c ${nss_version} -d ${nss_r} -e ${dist} -f ${arch}
diff --git a/prepare-nss-clients.sh b/prepare-nss-clients.sh
new file mode 100755
index 0000000..02f5762
--- /dev/null
+++ b/prepare-nss-clients.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+#
+
+# Defaults
+TARGET=14
+ARCH=x86_64
+
+#------------------------------------------------------------------------------
+# Testing: Having our new versions in the build root should not break
+# the build of other packages that depend on nss. Two very important
+# pacakges are curl and xulrunner. curl is a client of the PEM module
+# and xulrunner is how Mozilla applications call nss.
+#
+# Install dependencies for those devel packages that depend on nss and
+# verify that we don't break their builds.
+
+while getopts i:j: opt
+do
+ case $opt in
+ i) TARGET="$OPTARG";;
+ j) ARCH="$OPTARG";;
+ ?) printf "Usage: %s: [-a nspr_version] [-b nspr_version] [-c nss_version] [-d nss_version] [-e dist] [-f arch]\n" $0
+ exit 2;;
+ esac
+done
+
+export dist=${TARGET}
+export arch=${ARCH}
+
+cc="curl xulrunner"
+
+for c in $cc; do
+ pushd $c
+ fedpkg clean
+ fedpkg srpm
+ fedpkg local
+ push ${arch}
+ mock -r fedora-${dist}-${arch} --installdeps *.rpm
+ popd
+ mock -r fedora-${dist}-${arch} --copyin ${c}-*.src.rpm /tmp
+ popd
+done
+
+
diff --git a/top-script-f14.sh b/top-script-f14.sh
new file mode 100644
index 0000000..51d52bf
--- /dev/null
+++ b/top-script-f14.sh
@@ -0,0 +1,84 @@
+# -- #!/bin/bash
+
+# This is not a real script. You must execute the steps by hand.
+# We do use auxiliary scripts inside and outside mock.
+# 1. prepare for building
+# 2. create a mock shell to build nss packages
+# 3. build the nss related packages inside mock
+# and also install the newly bult ones for some testing
+# 4. exit mock to install in mock the dependencies for
+# building a few nss client packages, e.g.xumrunne
+# 5. create a mock shell to build nss clients (the old environment remains)
+# 6. build some nss client packages inside mock
+# At this stage we at least know we don't break others
+# 7. Optional: collect the packages for further testing in a suitable
+# virtual machine
+#
+# TODO: Automate some some, perhaps using python
+
+#
+# Build nspr, nss-util, nss-softokn, and nss using mock.
+#
+# These exports define what we want to build
+export nspr_v=4.8.7; export nspr_r=1
+export nss_v=3.12.9; export nss_r=8
+export nss_util_v=3.12.9; export nss_util_r=1
+export nss_softokn_v=3.12.9; export nss_softokn_r=5
+export target=14; export dist=14
+export arch=x86_64; export archalso=x86_64
+
+# prepare for build
+sh ./mock-build-prepare.sh -a ${nspr_v} -b ${nspr_r} -c ${nss_v} -d ${nss_r} -e ${nss_util_v} -f ${nss_util_r} -g ${nss_softokn_v} -h ${nss_softokn_r} -i ${target} -j ${arch}
+
+# create a mock shell
+mock -r fedora-${target}-x86_64 --shell
+
+#-------------------------------------------------------------------------
+# Now we are inside mock
+#-------------------------------------------------------------------------
+
+# Must export these again
+export nspr_v=4.8.7; export nspr_r=1
+export nss_v=3.12.9; export nss_r=8
+export nss_util_v=3.12.9; export nss_util_r=1
+export nss_softokn_v=3.12.9; export nss_softokn_r=5
+export target=14; export dist=14
+export arch=x86_64; export archalso=x86_64
+
+# build the packages
+mock-build-inside.sh -a ${nspr_v} -b ${nspr_r} -c ${nss_v} -d ${nss_r} -e ${nss_util_v} f ${nss_util_r} -g ${nss_softokn_v} -h ${nss_softokn_r} -i ${target} -j ${arch}
+
+#Ignore these warnings
+#Installing /builddir/build/RPMS
+#error: not an rpm package
+#error: /builddir/build/RPMS cannot be installed
+cd /builddir/build/RPMS/
+
+#go back to the ouside shell and package the rpm's
+exit
+
+#-----------------------------------------------------------------------------
+# We are outside mock now
+#-----------------------------------------------------------------------------
+
+#------------------------------------------------------------------------------
+# Testing 1: Having our new versions in the build root should not break
+# the build of other packages that depend on nss. Two very important
+# pacakges are curl and xulrunner. curl is a client of the PEM module
+# and xulrunner is how Mozilla applications call nss.
+#
+# Install dependencies for those devel packages that depend on nss and
+# verify that we don't break their builds.
+
+sh ./prepare-nss-clients.sh -i ${target} -j ${arch}
+
+# back to mock
+mock -r fedora-${target}-${arch} --shell
+
+# build xulrunner
+rpmbuild --rebuild /tmp/xulrunner-*.src.rpm
+
+# Testing 2: You may now collect the rpms and send them to a convenient
+# location fromwhere you can download them, install them for doing more
+# tests on a virtual machine. The rpm's can be found at
+# /var/lib/mock/fedora-${target}-${arch}/root/builddir/build/RPMS
diff --git a/top-script-f16.sh b/top-script-f16.sh
new file mode 100644
index 0000000..6150258
--- /dev/null
+++ b/top-script-f16.sh
@@ -0,0 +1,84 @@
+# -- #!/bin/bash
+
+# This is not a real script. You must execute the steps by hand.
+# We do use auxiliary scripts inside and outside mock.
+# 1. prepare for building
+# 2. create a mock shell to build nss packages
+# 3. build the nss related packages inside mock
+# and also install the newly bult ones for some testing
+# 4. exit mock to install in mock the dependencies for
+# building a few nss client packages, e.g.xumrunne
+# 5. create a mock shell to build nss clients (the old environment remains)
+# 6. build some nss client packages inside mock
+# At this stage we at least know we don't break others
+# 7. Optional: collect the packages for further testing in a suitable
+# virtual machine
+#
+# TODO: Automate some some, perhaps using python
+
+#
+# Build nspr, nss-util, nss-softokn, and nss using mock.
+#
+# These exports define what we want to build
+export nspr_v=4.8.7; export nspr_r=2
+export nss_v=3.12.9; export nss_r=13
+export nss_util_v=3.12.9; export nss_util_r=2
+export nss_softokn_v=3.12.9; export nss_softokn_r=7
+export target=16; export dist=16
+export arch=x86_64; export archalso=x86_64
+
+# prepare for build
+sh ./mock-build-prepare.sh -a ${nspr_v} -b ${nspr_r} -c ${nss_v} -d ${nss_r} -e ${nss_util_v} -f ${nss_util_r} -g ${nss_softokn_v} -h ${nss_softokn_r} -i ${target} -j ${arch}
+
+# create a mock shell
+mock -r fedora-rawhide-x86_64 --shell
+
+#-------------------------------------------------------------------------
+# Now we are inside mock
+#-------------------------------------------------------------------------
+
+# Must export these again
+export nspr_v=4.8.7; export nspr_r=2
+export nss_v=3.12.9; export nss_r=13
+export nss_util_r=3.12.9; export nss_util_r=2
+export nss_softokn_r=3.12.9; export nss_softokn_r=7
+export target=16; export dist=16
+export arch=x86_64; export archalso=x86_64
+
+# build the packages
+mock-build-inside.sh -a ${nspr_v} -b ${nspr_r} -c ${nss_v} -d ${nss_r} -e ${nss_util_v} f ${nss_util_r} -g ${nss_softokn_v} -h ${nss_softokn_r} -i ${target} -j ${arch}
+
+#Ignore these warnings
+#Installing /builddir/build/RPMS
+#error: not an rpm package
+#error: /builddir/build/RPMS cannot be installed
+cd /builddir/build/RPMS/
+
+#go back to the ouside shell and package the rpm's
+exit
+
+#-----------------------------------------------------------------------------
+# We are outside mock now
+#-----------------------------------------------------------------------------
+
+#------------------------------------------------------------------------------
+# Testing 1: Having our new versions in the build root should not break
+# the build of other packages that depend on nss. Two very important
+# pacakges are curl and xulrunner. curl is a client of the PEM module
+# and xulrunner is how Mozilla applications call nss.
+#
+# Install dependencies for those devel packages that depend on nss and
+# verify that we don't break their builds.
+
+sh ./prepare-nss-clients.sh -i ${target} -j ${arch}
+
+# back to mock
+mock -r fedora-${target}-${arch} --shell
+
+# build xulrunner
+rpmbuild --rebuild /tmp/xulrunner-*.src.rpm
+
+# Testing 2: You may now collect the rpms and send them to a convenient
+# location fromwhere you can download them, install them for doing more
+# tests on a virtual machine. The rpm's can be found at
+# /var/lib/mock/fedora-${target}-${arch}/root/builddir/build/RPMS