forked from varnishcache/pkg-varnish-cache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package-rpm
executable file
·52 lines (40 loc) · 1.33 KB
/
package-rpm
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
#!/bin/bash -x
#
# This script builds Varnish Cache in chroot from a tarball.
#
# Author: Lasse Karstensen <[email protected]>, March 2015.
set -o errexit
ELVER=${ELVER:-el7}
CHROOT="epel-${ELVER:2:1}-x86_64"
. common.sh
rm -rf build
mkdir -p build
cd build
SOURCE=$(ls -1 ../sources/varnish-*.tar.gz 2>/dev/null || ls -1 ../sources/varnish-*.tgz 2>/dev/null)
tar xf "$SOURCE"
cp -r ../redhat/* .
ln "$SOURCE" `basename "$SOURCE"`
if [ -n "$WEEKLY_VERSION" ]; then
sed -i -e "s/^Version:.*/Version: $WEEKLY_VERSION/" ./*.spec
sed -i -e "s/.*define v_rc.*/\%define v_rc 0/" ./*.spec
else
findversion "$SOURCE"
sed -i -e "s/^Version:.*/Version: $V.$MINOR/" ./*.spec
sed -i -e "s/.*define v_rc.*/\%define v_rc $RELEASE/" ./*.spec
fi
# while debugging, disable make check since it takes 15-20 minutes to run.
sed -i -e 's/^make check/# make check/' *.spec
MOPT="--uniqueext=worker${EXECUTOR_NUMBER} --resultdir=varnish-${V}/${ELVER}"
mock -r "$CHROOT" $MOPT --init
mock -v -r "$CHROOT" $MOPT --buildsrpm \
-D "_smp_mflags -j10" \
-D "dist .${ELVER}" \
-D "releasetag ${RPMRELEASE}" \
--source .\
--spec ./*.spec
mock -r "$CHROOT" $MOPT --clean
mock -v -r "$CHROOT" $MOPT \
-D "_smp_mflags -j10" \
-D "dist .${ELVER}" \
-D "releasetag ${RPMRELEASE}" \
--rebuild varnish-${V}/${ELVER}/varnish*.src.rpm