Skip to content

Commit

Permalink
Homogenize.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lasse Karstensen committed Nov 20, 2015
1 parent dcba986 commit b8b5239
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 17 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
/sources
/build
/rpm-build
/deb-build
29 changes: 29 additions & 0 deletions common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

function findversion() {
tarfile=$1

# This looks like something that should work, but I can't get it right.
# tar -zxf sources/varnish-4.1.0.tar.gz --wildcards-match^Clash --wildcards '*figure';

# Workaround follows.
TMP=tmp.$$.$RANDOM
mkdir -p $TMP
tar zxf $tarfile -C $TMP
mv $TMP/*/configure .
rm -rf $TMP

V=$(grep PACKAGE_VERSION= configure | sed "s/.*=//;s/'//g")
if [ "$V" = "trunk" ]; then
V="5.0"
MINOR="0"
else
MINOR="${V##*.}"
V="${V%.*}"
fi
rm configure
}

#findversion sources/varnish-4.1.0.tar.gz
#echo $V
#echo $MINOR

14 changes: 4 additions & 10 deletions package-deb
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,22 @@
if [ -n "$JENKINS_HOME" ]; then
set -x
fi
BINDIST=${BINDIST:-jessie}

set -o errexit

BINDISTS=${BINDISTS:-jessie}
. common.sh

rm -rf build
mkdir -p build

SOURCE=$(ls -1 sources/varnish-*.tar.gz) # XXX

findversion $SOURCE
tar xf ${SOURCE} -C build

cd build/varnish-*

V=$(grep PACKAGE_VERSION= configure | sed "s/.*=//;s/'//g")
if [ "$V" = "trunk" ]; then
V="5.0"
MINOR="0"
else
MINOR="${V##*.}"
V="${V%.*}"
fi

cp -r ../../debian .
rm -f debian/.*.sw? # Delete any vim temporary files.
ln ../../$SOURCE ../varnish_$V.$MINOR.orig.tar.gz
Expand Down
14 changes: 9 additions & 5 deletions package-rpm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ ELVER=${ELVER:-el7}
CHROOT="epel-${ELVER:2:1}-x86_64"
MOPT="--uniqueext=worker${EXECUTOR_NUMBER}"

. common.sh

rm -rf build
mkdir -p build
cd build
Expand All @@ -17,9 +19,11 @@ SOURCE=$(ls -1 ../sources/varnish-*.tar.gz)
tar xf $SOURCE

cp -r ../redhat/* .
# GIT_DIR=../redhat/.git git archive HEAD | tar xf -

ln $SOURCE `basename $SOURCE`
ln $SOURCE `basename $SOURCE`

findversion $SOURCE
sed -i -e "s/^Version:.*/Version: $V.$MINOR/" *.spec

# while debugging, disable make check since it takes 15-20 minutes to run.
sed -i -e 's/^make check/# make check/' *.spec
Expand All @@ -30,11 +34,11 @@ mock -v -r $CHROOT $MOPT --buildsrpm \
-D "dist .${ELVER}" \
--spec *.spec \
--source . \
--resultdir ../rpm-build/varnish-4.1/${ELVER}
--resultdir ../build/varnish-4.1/${ELVER}

mock -r $CHROOT $MOPT --clean
mock -v -r $CHROOT $MOPT \
-D "_smp_mflags -j10" \
-D "dist .${ELVER}" \
--resultdir ../rpm-build/varnish-4.1/${ELVER} \
--rebuild ../rpm-build/varnish-4.1/${ELVER}/varnish*.src.rpm
--resultdir ../build/varnish-4.1/${ELVER} \
--rebuild ../build/varnish-4.1/${ELVER}/varnish*.src.rpm

0 comments on commit b8b5239

Please sign in to comment.