summaryrefslogtreecommitdiffstats
path: root/legacy-scripts/top-script.sh
blob: a8320a0350cc7a91f5b038d1b7ecc6cf1dd93764 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# -- #!/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.9; export nspr_r=2
export nss_v=3.13.1; export nss_r=3
export nss_util_v=3.13.1; export nss_util_r=1
export nss_softokn_v=3.12.10; export nss_softokn_r=7
export nss_softokn_v=
export nss_softokn_r=
export nss_softokn_v=; export nss_softokn_r=
export target=16; export dist=16
export arch=x86_64; export archalso=x86_64

# prepare for build
./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.9; export nspr_r=2
export nss_v=3.13.1; export nss_r=3
export nss_util_r=3.13.1; export nss_util_r=1
export nss_softokn_r=""; export nss_softokn_r=""
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