summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-04-07 20:12:44 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-04-07 20:12:44 (GMT)
commitcc7f0bdf106dfa82e1b0a841db8af6522fe7bbca (patch)
tree9b88efb0254c3fe28f703ceab783bba82682ae64 /Swift/Packaging
parente9a33e1cfc91af374f928931f47b19f53cb165d7 (diff)
downloadswift-cc7f0bdf106dfa82e1b0a841db8af6522fe7bbca.zip
swift-cc7f0bdf106dfa82e1b0a841db8af6522fe7bbca.tar.bz2
Allowing differently placed tarballs, to let us share hashes between .deb builds
Diffstat (limited to 'Swift/Packaging')
-rwxr-xr-xSwift/Packaging/Debian/package.sh61
1 files changed, 43 insertions, 18 deletions
diff --git a/Swift/Packaging/Debian/package.sh b/Swift/Packaging/Debian/package.sh
index 5bc9fbc..d693c0f 100755
--- a/Swift/Packaging/Debian/package.sh
+++ b/Swift/Packaging/Debian/package.sh
@@ -1,5 +1,8 @@
#!/bin/sh
+#If you want to share tar output (note: necessary if you want multiple archs with the same hashed tarballs)
+# set SHARED_DIR - YOU MUST MAKE SURE YOU HAVE A TRAILING / ON SHARED_DIR
+
set -e -x
export PYTHONPATH=../../../BuildTools/SCons
@@ -8,6 +11,12 @@ DEBIAN_VERSION=`../../../BuildTools/DebianizeVersion.py $VERSION`
DIRNAME=swift-im-$DEBIAN_VERSION
SWIFTEN_SOVERSION=`../../../BuildTools/GetBuildVersion.py swift --major`
+if [ -z "$SHARED_DIR" ]; then
+ echo "Using standalone output"
+else
+ echo "Using shared output in ${SHARED_DIR}"
+fi
+
if [ -z "$DEBIAN_VERSION" ]; then
echo "Unable to determine version"
exit -1
@@ -18,28 +27,44 @@ rm -f swift-im_*
rm -f libswiften*
rm -rf swift-im-*
-echo "Checking out a fresh copy ..."
-rm -rf $DIRNAME
-git clone ../../../.git $DIRNAME
+TARBALLBARE="swift-im_$DEBIAN_VERSION.orig.tar.gz"
+TARBALL="${SHARED_DIR}${TARBALLBARE}"
-# Remove development files & 3rdParty files
-rm -rf $DIRNAME/.git
-find $DIRNAME -name .gitignore | xargs rm -f
-find $DIRNAME/3rdParty -type f | grep -v uuid | grep -v SConscript | xargs rm -f
-find $DIRNAME/3rdParty -depth -empty -type d -exec rmdir {} \;
-rm -rf $DIRNAME/3rdParty/SCons
-rm -rf $DIRNAME/Swift/Packaging/Debian
+if [ -f $TARBALL ]; then
+ echo "Found existing tarball for the right version, using ${TARBALL}"
+ echo "Cleaning out any previous builds in ${DIRNAME} and re-extracting"
+ rm -rf $DIRNAME
+ cp $TARBALL tmp.tmp
+ mv tmp.tmp $TARBALLBARE
+ tar xzf $TARBALLBARE
+else
+ echo "No shared tarball found"
+ echo "Checking out a fresh copy ..."
+ rm -rf $DIRNAME
+ git clone ../../../.git $DIRNAME
+
+ # Remove development files & 3rdParty files
+ rm -rf $DIRNAME/.git
+ find $DIRNAME -name .gitignore | xargs rm -f
+ find $DIRNAME/3rdParty -type f | grep -v uuid | grep -v SConscript | xargs rm -f
+ find $DIRNAME/3rdParty -depth -empty -type d -exec rmdir {} \;
+ rm -rf $DIRNAME/3rdParty/SCons
+ rm -rf $DIRNAME/Swift/Packaging/Debian
-# Initialize the build version
-echo $VERSION > $DIRNAME/VERSION.swift
+ # Initialize the build version
+ echo $VERSION > $DIRNAME/VERSION.swift
-# Fork local Boost UUID copy
-# FIXME: This shouldn't be necessary, but SCons isn't picking up the generated headers for compilation
-mkdir -p $DIRNAME/3rdParty/Boost/uuid/boost
-cp -r $DIRNAME/3rdParty/Boost/src/boost/uuid $DIRNAME/3rdParty/Boost/uuid/boost
+ # Fork local Boost UUID copy
+ # FIXME: This shouldn't be necessary, but SCons isn't picking up the generated headers for compilation
+ mkdir -p $DIRNAME/3rdParty/Boost/uuid/boost
+ cp -r $DIRNAME/3rdParty/Boost/src/boost/uuid $DIRNAME/3rdParty/Boost/uuid/boost
+
+ # Create orig tarball
+ tar czf $TARBALLBARE $DIRNAME
+ cp $TARBALLBARE tmp.tmp
+ mv tmp.tmp $TARBALL
+fi
-# Create orig tarball
-tar czf swift-im_$DEBIAN_VERSION.orig.tar.gz $DIRNAME
# Detect dependencies
WEBKIT_DEPENDENCY=", libqtwebkit-dev (>= 2.0.0)"