diff options
authorThanos Doukoudakis <>2019-01-19 15:19:08 (GMT)
committerThanos Doukoudakis <>2019-02-28 13:32:43 (GMT)
commit68c789ed93624620348b32ec92490c9bfc537a25 (patch)
tree99191bbb8ea3ee9e077f04b63d7bc250955ddf3c /Swift/Packaging/Debian/
parentf11ef30f7fe576723f71c2c6a9061ec7ef9472bd (diff)
Create Debian packages using Docker
This patch will setup Docker containers to build the source and Debian packages. The script will use the private key under gpg-keys folder to sign the Debian packages. If the folder is not there or doesn’t exist then the build will fail. Keys are expected to be in .asc format, unencrypted and not password protected. Added .dockerignore file to avoid copying the cache files to the container. The output is stored in out/ folder and the folder structure is ready for script. SWIFT_PACKAGE_PLATFORMS defines the platforms that it will be build for. Default values are: ubuntu:bionic ubuntu:cosmic debian:stretch debian:sid. DOCKERRUNEXTRAFLAGS variable can set additional flags for Docker builders. Currently is set to --privileged to avoid an issue during build with Qt5.11.1 Updated the Debian repo scripts to new distributions and Docker changes. Test-Information: Run the script and created source & binaries for all the distributions. Verified that changelog, compact, control, copyright, rules and source/format exist under the Debian folder when building the Debian package. Created tags and generated dev builds, rc builds, and release builds to test the output of the different release channels. Created a container, tested the Swift and Swiften packages, and the installations: Tested the following debs with piuparts in a docker container of the system they are build for. No errors raised and a few warnings related with chroot (which fails within a docker container) *libswiften-dev-dbgsym*.deb, *libswiften-dev_*.deb *libswiften5-dbgsym_*.deb *libswiften5_*.deb *swift-im-dbgsym_*.deb *swift-im_*.deb Installed the above packages and verified the install with swift-im –version, headers exist in /usr/include/Swiften/ and under /usr/lib/. Verified the gpg signatures on the .changes and .buildinfo files. Tested the output with the and the import was successful. Verified the .changes and .buildinfo files with lintion which reported the following errors and warnings (there are differences between different channels release, beta, development): E: swift-im changes: bad-distribution-in-changes-file development E: swift-im changes: multiple-distributions-in-changes-file beta development W: libswiften5: new-package-should-close-itp-bug W: libswiften-dev: new-package-should-close-itp-bug W: swift-im: new-package-should-close-itp-bug Tested that the man page exists after installing in a docker container (ubuntu xenial, debian stetch, debian sid). Change-Id: Ic28d2731bbca34716645e76e7e7e7e8183dea4f8
Diffstat (limited to 'Swift/Packaging/Debian/')
1 files changed, 70 insertions, 0 deletions
diff --git a/Swift/Packaging/Debian/ b/Swift/Packaging/Debian/
new file mode 100755
index 0000000..7fd1a3e
--- /dev/null
+++ b/Swift/Packaging/Debian/
@@ -0,0 +1,70 @@
+set -e
+cd $(dirname $(readlink -f $0 || realpath $0))
+export PYTHONPATH=../../../BuildTools/SCons
+VERSION=${VERSION:=`../../../BuildTools/ swift`}
+DEBIAN_VERSION=`../../../BuildTools/ $VERSION`
+SWIFTEN_SOVERSION=`../../../BuildTools/ swift --major`
+# DEVATTN there is an issue with some versions of Qt(5.11.1) and docker see Workaround is to add privileged flag
+git clone ../../../.git $SWIFT_SOURCE_DIR
+rm -rf $SWIFT_SOURCE_DIR/.git
+find $SWIFT_SOURCE_DIR -name .gitignore | xargs rm -f
+find $SWIFT_SOURCE_DIR/3rdParty -type f | grep -v uuid | grep -v SConscript | grep -v miniupnp | grep -v natpmp || xargs rm -f
+find $SWIFT_SOURCE_DIR/3rdParty -depth -empty -type d -exec rmdir {} \;
+rm -rf $SWIFT_SOURCE_DIR/3rdParty/SCons
+rm -rf $SWIFT_SOURCE_DIR/Swift/Packaging/Debian
+rm -rf $SWIFT_SOURCE_DIR/BuildTools/DocBook/Fonts
+rm -rf $SWIFT_SOURCE_DIR/BuildTools/Git/Hooks/commit-msg
+cp -r debian $SWIFT_SOURCE_DIR/debian
+../../../BuildTools/ $SWIFT_SOURCE_DIR/debian/changelog $DEBIAN_VERSION
+rm $SWIFT_SOURCE_DIR/debian/
+mv $SWIFT_SOURCE_DIR/debian/libswiften.install $SWIFT_SOURCE_DIR/debian/libswiften$SWIFTEN_SOVERSION.install
+cat ../../../COPYING.thirdparty | tail -n +3 >> $SWIFT_SOURCE_DIR/debian/copyright
+rm -rf swift-src
+mv $SWIFT_SOURCE_DIR swift-src
+docker build -t swift/swiftsourcebuilder -f Dockerfile.source .
+mkdir -p out/source
+docker run --rm -v`pwd`/gpg-keys:/gpg-keys -v`pwd`/out/source:/out swift/swiftsourcebuilder
+ platformsarray=( ubuntu:bionic ubuntu:cosmic debian:stretch debian:sid )
+ platformsarray=( $SWIFT_PACKAGE_PLATFORMS )
+for distro in "${platformsarray[@]}";
+ if [ -f $TMP_DOCKERFILE ];
+ then
+ fi
+ cat | sed -e "s/__DISTRO__/$distro/" -e "s/__DEBIAN_VERSION__/$DEBIAN_VERSION/" > $TMP_DOCKERFILE
+ docker build -t swift/packager -f $TMP_DOCKERFILE out/source
+ OUT_DIR="out/${distro//\://}"
+ echo $OUT_DIR
+ mkdir -p $OUT_DIR
+ docker run --rm $DOCKERRUNEXTRAFLAGS -v`pwd`/gpg-keys:/gpg-keys -v`pwd`/$OUT_DIR:/out swift/packager