summaryrefslogtreecommitdiffstats
path: root/build_nss.sh
blob: aad12bb04dedea9785d850a80ffd208070f6f84f (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
#!/bin/bash
# Build the nss package set and some nss clients inside mock
# 
# 1. prepare for building: initialize the mock environment and
# install # packages we will need later when building nss
# 2. create a mock shell to build nss packages
# 3. build the nss related packages inside mock installing
#    the newly built ones as we go along
#
# This script is meant to be invoked by build_nss.py

dist=rawhide
DIST=${DIST:-$dist}
if [ $DIST = "rawhide" ]; then
    DIST="19"
fi
arch=x86_64
ARCH=${ARCH:-$arch}

# prepare for build
# initialize the mock environment and install
# packages we will need later when building nss
mock -r fedora-${dist}-${arch} --init

nss_pkgs="nspr nss-util nss-softokn nss"
NSS_PKGS=${NSS_PKGS:-$nss_pkgs}

client_pkgs="crypto-utils curl evolution-data-server mod_nss mod_revocator openswan xulrunner"
CLIENT_PKGS=${CLIENT_PKGS:-$client_pkgs}

workdir=`pwd`
for pkg in $NSS_PKGS; do
    cd ${pkg}
    fedpkg srpm
    mock -r fedora-${dist}-${arch} --installdeps ${pkg}-*.src.rpm
    mock -r fedora-${dist}-${arch} --copyin ${pkg}-*.src.rpm /tmp
    cd ${workdir}
done

for pkg in $CLIENT_PKGS; do
    cd ${pkg}
    fedpkg srpm
    mock -r fedora-${dist}-${arch} --installdeps ${pkg}-*.src.rpm
    mock -r fedora-${dist}-${arch} --copyin ${pkg}-*.src.rpm /tmp
    cd ${workdir}
done


# copy the build script into mock
mock -r fedora-${dist}-${arch} --copyin ./build_nss_inside_mock.sh /usr/bin

# create a mock shell and execute a build script thre
mock -r fedora-rawhide-x86_64 --shell NSS_PKGS=\"${NSS_PKGS}\" CLIENT_PKGS=\"${CLIENT_PKGS}\" build_nss_inside_mock.sh 

#----------------------------------------------------------------------
# Inside mock we will execute build_nss_inside_mock.sh
#-------------------------------------------------------------------------