summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Packaging/Debian')
-rw-r--r--Swift/Packaging/Debian/.dockerignore1
-rw-r--r--Swift/Packaging/Debian/.gitignore4
-rw-r--r--Swift/Packaging/Debian/Dockerfile.package.in30
-rw-r--r--Swift/Packaging/Debian/Dockerfile.source17
-rwxr-xr-xSwift/Packaging/Debian/Testing/swift-distr-tests.sh103
-rw-r--r--Swift/Packaging/Debian/Testing/test-distr.sh88
-rw-r--r--Swift/Packaging/Debian/changelog.debian-unstable18
-rw-r--r--Swift/Packaging/Debian/debian/control.in2
-rw-r--r--Swift/Packaging/Debian/debian/copyright2
-rwxr-xr-xSwift/Packaging/Debian/debian/rules4
-rwxr-xr-xSwift/Packaging/Debian/package.sh12
-rwxr-xr-xSwift/Packaging/Debian/package_all_platforms.sh10
-rwxr-xr-xSwift/Packaging/Debian/package_docker.sh70
-rw-r--r--Swift/Packaging/Debian/update_debian_repo.sh17
14 files changed, 357 insertions, 21 deletions
diff --git a/Swift/Packaging/Debian/.dockerignore b/Swift/Packaging/Debian/.dockerignore
new file mode 100644
index 0000000..5d238e7
--- /dev/null
+++ b/Swift/Packaging/Debian/.dockerignore
@@ -0,0 +1 @@
+**/out
diff --git a/Swift/Packaging/Debian/.gitignore b/Swift/Packaging/Debian/.gitignore
index 5401ae0..9c8f275 100644
--- a/Swift/Packaging/Debian/.gitignore
+++ b/Swift/Packaging/Debian/.gitignore
@@ -1,3 +1,7 @@
/swift-*
/swift_*
/libswiften*
+/out/
+/swift-src/
+swift-im*.orig.tar.gz
+*.tmp.package
diff --git a/Swift/Packaging/Debian/Dockerfile.package.in b/Swift/Packaging/Debian/Dockerfile.package.in
new file mode 100644
index 0000000..b53d477
--- /dev/null
+++ b/Swift/Packaging/Debian/Dockerfile.package.in
@@ -0,0 +1,30 @@
+FROM __DISTRO__
+MAINTAINER packages@swift.im
+
+ENV DEBIAN_VERSION=__DEBIAN_VERSION__
+
+# Make sure nothing needs an interactive prompt
+ARG DEBIAN_FRONTEND=noninteractive
+
+RUN \
+ apt-get -qq update && \
+ apt-get install -y lintian devscripts scons build-essential dh-make pkg-config libssl-dev qt5-default libqt5x11extras5-dev libqt5webkit5-dev qtmultimedia5-dev qttools5-dev-tools qt5-image-formats-plugins libqt5svg5-dev libminiupnpc-dev libnatpmp-dev libhunspell-dev libxml2-dev libxss-dev libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev libboost-signals-dev libboost-system-dev libboost-thread-dev libboost-date-time-dev libidn11-dev docbook-xsl docbook-xml xsltproc libxml2-utils libsqlite3-dev zlib1g-dev help2man && \
+ apt-get clean
+
+RUN mkdir /swift-packages
+COPY * /swift-packages/
+
+CMD \
+ gpg --allow-secret-key-import --import /gpg-keys/*.asc && \
+ cd /swift-packages && \
+ tar xf swift-im_${DEBIAN_VERSION}*.orig.tar.gz && \
+ tar xf swift-im_${DEBIAN_VERSION}*.debian.tar.xz -C /swift-packages/swift-im-${DEBIAN_VERSION}/ && \
+ cd swift-im-${DEBIAN_VERSION} && \
+ debuild -i -I -b --lintian-opts --profile debian --pedantic && \
+ cd /swift-packages/ && \
+ rm -rf /swift-packages/swift-im-${DEBIAN_VERSION}/ && \
+ rm -f /swift-packages/swift-im_${DEBIAN_VERSION}*.orig.tar.gz && \
+ rm -f /swift-packages/swift-im_${DEBIAN_VERSION}*.debian.tar.xz && \
+ rm -f /swift-packages/swift-im_${DEBIAN_VERSION}*.dsc && \
+ rm -f /swift-packages/swift-im_${DEBIAN_VERSION}*_source.* && \
+ mv * /out/
diff --git a/Swift/Packaging/Debian/Dockerfile.source b/Swift/Packaging/Debian/Dockerfile.source
new file mode 100644
index 0000000..3c23b2c
--- /dev/null
+++ b/Swift/Packaging/Debian/Dockerfile.source
@@ -0,0 +1,17 @@
+FROM debian:stretch
+VOLUME ["/gpg-keys"]
+MAINTAINER packages@swift.im
+
+RUN \
+ apt-get -qq update && \
+ apt-get install -y lintian devscripts scons build-essential pkg-config libssl-dev qt5-default libqt5x11extras5-dev libqt5webkit5-dev qtmultimedia5-dev qttools5-dev-tools qt5-image-formats-plugins libqt5svg5-dev libminiupnpc-dev libnatpmp-dev libhunspell-dev libxml2-dev libxss-dev libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev libboost-signals-dev libboost-system-dev libboost-thread-dev libboost-date-time-dev libidn11-dev docbook-xsl docbook-xml xsltproc libxml2-utils libsqlite3-dev zlib1g-dev help2man && \
+ apt-get clean
+
+COPY swift-src /swift-src
+
+CMD \
+ gpg --allow-secret-key-import --import /gpg-keys/*.asc && \
+ cd /swift-src && \
+ mv swift-im_*.orig.tar.gz ../ && \
+ debuild -i -I -S --lintian-opts --pedantic && \
+ mv /swift-im* /out/
diff --git a/Swift/Packaging/Debian/Testing/swift-distr-tests.sh b/Swift/Packaging/Debian/Testing/swift-distr-tests.sh
new file mode 100755
index 0000000..e817974
--- /dev/null
+++ b/Swift/Packaging/Debian/Testing/swift-distr-tests.sh
@@ -0,0 +1,103 @@
+#!/usr/bin/env bash
+
+# Returns 0 if all releases are valid. Needs to be run with sudo
+# release_level is the level of the release to test.
+# 2 will test development stream only
+# 1 will test development and beta
+# 0 will test all three development, beta and release
+
+function finish {
+ if [ "$?" -eq 0 ] && [ "$CLEAN_INSTALL" = True ]; then
+ echo "No errors found, removing base systems."
+ rm -rf "Debian-Tests/"
+ fi
+}
+trap finish EXIT
+
+if [ "$#" -lt 2 ] || [ "$#" -gt 3 ]; then
+ echo "Usage $0 <release_tag> <release_level> [-c]"
+ echo "The -c flag will recreate all base systems."
+ exit 1
+fi
+RELEASE_LEVEL="$2"
+re='^[0-9]+$'
+if ! [[ "$RELEASE_LEVEL" =~ $re ]]; then
+ echo "error: release level is not a number" >&2; exit 1
+fi
+if [ "$RELEASE_LEVEL" -gt 2 ] || [ "$RELEASE_LEVEL" -lt 0 ]; then
+ echo "error: release level should be between 0 and 2" >&2; exit 1
+fi
+if [ "$3" == "-c" ]; then
+ echo "The script will create all base systems from scratch."
+ CLEAN_INSTALL=True
+else
+ CLEAN_INSTALL=False
+fi
+
+declare -A arr
+#Ubuntu xenial
+arr[0,0]="ubuntu"
+arr[0,1]="http://archive.ubuntu.com/ubuntu"
+arr[0,2]="xenial"
+
+#Ubuntu artful
+arr[1,0]="ubuntu"
+arr[1,1]="http://archive.ubuntu.com/ubuntu"
+arr[1,2]="artful"
+
+#Debian jessie
+arr[2,0]="debian"
+arr[2,1]="http://deb.debian.org/debian/"
+arr[2,2]="jessie"
+
+#Debian stretch
+arr[3,0]="debian"
+arr[3,1]="http://deb.debian.org/debian/"
+arr[3,2]="stretch"
+
+#Debian sid
+arr[4,0]="debian"
+arr[4,1]="http://deb.debian.org/debian/"
+arr[4,2]="sid"
+
+
+DIST="$1"
+RETURN_VALUE=0
+
+for counter in {0..4}
+do
+# for ARCH in "amd64" "i386"
+ for ARCH in "amd64"
+ do
+ echo "========================================"
+ echo "Testing ${arr[${counter},0]} ${arr[${counter},2]} $ARCH"
+ echo "========================================"
+ DIST_FOLDER="Debian-Tests/${arr[${counter},0]}_${arr[${counter},2]}_$ARCH"
+ if [ "$CLEAN_INSTALL" = True ] ; then
+ rm -rf "$DIST_FOLDER"
+ echo "Removing $DIST_FOLDER"
+ fi
+ if [ ! -d "$DIST_FOLDER" ]; then
+ echo "$DIST_FOLDER was not present. Creating Base system from scratch."
+ {
+ mkdir -p "$DIST_FOLDER"
+ debootstrap --arch=$ARCH ${arr[${counter},2]} $DIST_FOLDER ${arr[${counter},1]}
+ } &>/dev/null
+ echo "Setup complete."
+ fi
+ cp test-distr.sh "$DIST_FOLDER"
+
+ RELEASES_COUNT=0
+ for RELEASE in "development" "beta" "release"
+ do
+ if [[ "$RELEASES_COUNT" -le "$RELEASE_LEVEL" ]]; then
+ chroot $DIST_FOLDER bash test-distr.sh https://swift.im/packages/${arr[${counter},0]}/${arr[${counter},2]} ${arr[${counter},2]} $DIST $RELEASE
+ RETURN_VALUE=$((RETURN_VALUE + $?))
+ else
+ echo "Skipping stream: $RELEASE"
+ fi
+ RELEASES_COUNT=$((RELEASES_COUNT + 1))
+ done
+ done
+done
+exit $RETURN_VALUE
diff --git a/Swift/Packaging/Debian/Testing/test-distr.sh b/Swift/Packaging/Debian/Testing/test-distr.sh
new file mode 100644
index 0000000..82d31ee
--- /dev/null
+++ b/Swift/Packaging/Debian/Testing/test-distr.sh
@@ -0,0 +1,88 @@
+#!/usr/bin/env bash
+
+# Return values
+# 0 if the package, source and installation were successful
+# 1 if the source packages are missing
+# 2 if the binary is not present in the repository
+# 3 if the binary and source packages are not present in the repository
+# 4 if the binary failed to install
+# 5 if the binary failed to install and the source package is not available.
+
+function finish {
+ rm /etc/apt/sources.list.d/swift-distr.list
+ if [[ "$1" != "*ubuntu*" ]]; then
+ rm /etc/apt/sources.list.d/ubuntu-universe.list
+ fi
+ {
+ rm -rf swift-im* packages.key*
+ apt-get remove -y swift-im
+ apt-get autoremove -y
+ } &>/dev/null
+}
+trap finish EXIT
+
+if [ "$#" -ne 4 ]; then
+ echo "Usage $0 <remote_repository> <dist_code_name> <swift_version> <release> "
+ exit 1
+fi
+RELEASE="$4"
+echo "Repository $1 build $RELEASE contents:"
+echo "------------------------"
+
+#Adding the swift repository
+echo deb $1 $RELEASE main >/etc/apt/sources.list.d/swift-distr.list
+echo deb-src $1 $RELEASE main >>/etc/apt/sources.list.d/swift-distr.list
+
+#Adding the ubuntu universe repository if it is not present.
+if [[ "$1" != "*ubuntu*" ]]; then
+ if ! grep -q '^deb http://archive.ubuntu.com/ubuntu '"$2"' universe' /etc/apt/sources.list /etc/apt/sources.list.d/*.list; then
+ echo deb http://archive.ubuntu.com/ubuntu $2 universe >/etc/apt/sources.list.d/ubuntu-universe.list
+ fi
+fi
+
+{
+ apt-get remove -y swift-im
+ apt-get autoremove -y
+ apt-get update
+ apt-get upgrade -y
+ apt-get install -y apt-transport-https wget
+ apt-get install -y dpkg-dev
+ wget http://swift.im/keys/packages.key
+ apt-key add packages.key
+ apt-get update
+} &>/dev/null
+
+RETURN_VALUE=0
+echo "Sources:"
+{
+ rm -rf swift-im*
+ apt-get source swift-im=$3
+} &>/dev/null
+if [ "$?" -eq 0 ]; then
+ echo "Sources files downloaded."
+else
+ echo "Sources files not present"
+ RETURN_VALUE=$((RETURN_VALUE + ((1 << 0))))
+fi
+
+echo "Binary:"
+{
+ apt-cache show swift-im=$3*
+} &>/dev/null
+if [ "$?" -ne 0 ]; then
+ echo "Swift package was not found in the repository."
+ RETURN_VALUE=$((RETURN_VALUE + ((1 << 1))))
+ exit $RETURN_VALUE
+fi
+echo "Installing binaries"
+{
+ apt-get install -y swift-im=$3*
+} &>/dev/null
+if [ "$?" -eq 0 ]; then
+ echo "Installation was successful."
+else
+ echo "Installation failed"
+ RETURN_VALUE=$((RETURN_VALUE + ((1 << 2))))
+fi
+echo "------------------------"
+exit $RETURN_VALUE
diff --git a/Swift/Packaging/Debian/changelog.debian-unstable b/Swift/Packaging/Debian/changelog.debian-unstable
index ca9ffec..f2bf2c5 100644
--- a/Swift/Packaging/Debian/changelog.debian-unstable
+++ b/Swift/Packaging/Debian/changelog.debian-unstable
@@ -1,3 +1,21 @@
+swift-im (4.0.3-1) UNRELEASED; urgency=medium
+
+ * New chat theme including a new font
+ * Support for message carbons (XEP-0280)
+ * Enabled trellis mode as a default feature, allowing several tiled chats windows to be shown at once
+ * Redesigned keyword highlighting
+ * Improve date formatting
+ * Fix Last Message Correction in multi client scenarios
+ * Fix UI layout issue for translations that require right-to-left (RTL) layout
+ * Fix UX issues in trellis mode
+ * Improvements to font size handling in the chat theme
+ * Add AppImage for Linux 64-bit as a supported platform
+ * Improved spell checker support on Linux
+ * Allow setting vCard on servers that do not return an empty vCard on fresh accounts
+ * And assorted smaller features and usability enhancements. Closes: 840151, 889062
+
+ -- Kevin Smith <kevin@kismith.co.uk> Thu, 03 Jan 2019 13:59:07 +0100
+
swift-im (3.0.4-1) unstable; urgency=low
* New upstream release
diff --git a/Swift/Packaging/Debian/debian/control.in b/Swift/Packaging/Debian/debian/control.in
index 26544e5..e779f21 100644
--- a/Swift/Packaging/Debian/debian/control.in
+++ b/Swift/Packaging/Debian/debian/control.in
@@ -3,7 +3,7 @@ Section: net
Priority: optional
Maintainer: Swift Package Maintainer <packages@swift.im>
Uploaders: Remko Tronçon <dev@el-tramo.be>, Kevin Smith <kevin@kismith.co.uk>
-Build-Depends: debhelper (>= 9), scons (>= 1.2.0), libssl-dev (>= 0.9.8g), qtbase5-dev (>= 5.0.0), qtchooser, qtbase5-dev-tools (>= 5.0.0), libqt5x11extras5-dev (>= 5.0.0), libqt5webkit5-dev (>= 5.0.0), qtmultimedia5-dev (>=5.0.0), qttools5-dev-tools (>=5.0.0), qt5-image-formats-plugins (>=5.0.0), libqt5svg5-dev (>=5.0.0), libxml2-dev (>= 2.7.6), libxss-dev (>= 1.2.0), libboost-dev (>= 1.34.1), libboost-filesystem-dev (>= 1.34.1), libboost-program-options-dev (>= 1.34.1), libboost-regex-dev (>= 1.34.1), libboost-signals-dev (>= 1.34.1), libboost-system-dev (>= 1.34.1), libboost-thread-dev (>= 1.34.1), libboost-date-time-dev (>= 1.34.1), libidn11-dev (>= 1.10), docbook-xsl (>= 1.75.0), docbook-xml (>= 4.5), xsltproc, libxml2-utils, libnatpmp-dev, libminiupnpc-dev, libsqlite3-dev, libhunspell-dev, zlib1g-dev
+Build-Depends: debhelper (>= 9), scons (>= 1.2.0), libssl-dev (>= 0.9.8g), qtbase5-dev (>= 5.0.0), qtchooser, qtbase5-dev-tools (>= 5.0.0), libqt5x11extras5-dev (>= 5.0.0), libqt5webkit5-dev (>= 5.0.0), qtmultimedia5-dev (>=5.0.0), qttools5-dev-tools (>=5.0.0), qt5-image-formats-plugins (>=5.0.0), libqt5svg5-dev (>=5.0.0), libxml2-dev (>= 2.7.6), libxss-dev (>= 1.2.0), libboost-dev (>= 1.34.1), libboost-filesystem-dev (>= 1.34.1), libboost-program-options-dev (>= 1.34.1), libboost-regex-dev (>= 1.34.1), libboost-signals-dev (>= 1.34.1), libboost-system-dev (>= 1.34.1), libboost-thread-dev (>= 1.34.1), libboost-date-time-dev (>= 1.34.1), libidn11-dev (>= 1.10), docbook-xsl (>= 1.75.0), docbook-xml (>= 4.5), xsltproc, libxml2-utils, libnatpmp-dev, libminiupnpc-dev, libsqlite3-dev, libhunspell-dev, zlib1g-dev, help2man
Standards-Version: 3.9.8
Vcs-Git: git://swift.im/swift
Vcs-Browser: http://swift.im/git/swift
diff --git a/Swift/Packaging/Debian/debian/copyright b/Swift/Packaging/Debian/debian/copyright
index a0c2c79..9219930 100644
--- a/Swift/Packaging/Debian/debian/copyright
+++ b/Swift/Packaging/Debian/debian/copyright
@@ -3,7 +3,7 @@ with help from Olly Betts <olly@survex.com>.
The upstream sources were obtained from http://swift.im.
-Copyright (C) 2010-2016 Isode Limited.
+Copyright (C) 2010-2019 Isode Limited.
Licensed under the GNU General Public License.
See /usr/share/common-licenses/GPL-3 for the full license.
diff --git a/Swift/Packaging/Debian/debian/rules b/Swift/Packaging/Debian/debian/rules
index 87c551b..ed432bb 100755
--- a/Swift/Packaging/Debian/debian/rules
+++ b/Swift/Packaging/Debian/debian/rules
@@ -4,7 +4,7 @@
export PYTHONDONTWRITEBYTECODE=1
export QT_SELECT=qt5
-SCONS_FLAGS=V=1 qt5=1 optimize=1 debug=1 allow_warnings=1 swiften_dll=1 docbook_xsl=/usr/share/xml/docbook/stylesheet/docbook-xsl docbook_xml=/usr/share/xml/docbook/schema/dtd/4.5 linkflags="$(shell dpkg-buildflags --get LDFLAGS)" ccflags="$(shell dpkg-buildflags --get CPPFLAGS) $(shell dpkg-buildflags --get CFLAGS)"
+SCONS_FLAGS=V=1 qt5=1 optimize=1 debug=1 allow_warnings=1 swiften_dll=1 help2man=1 docbook_xsl=/usr/share/xml/docbook/stylesheet/docbook-xsl docbook_xml=/usr/share/xml/docbook/schema/dtd/4.5 linkflags="$(shell dpkg-buildflags --get LDFLAGS)" ccflags="$(shell dpkg-buildflags --get CPPFLAGS) $(shell dpkg-buildflags --get CFLAGS)"
SCONS_INSTALL_BASE=$(CURDIR)/debian/tmp
SCONS_INSTALL_FLAGS=SWIFT_INSTALLDIR=$(SCONS_INSTALL_BASE)/usr SWIFTEN_INSTALLDIR=$(SCONS_INSTALL_BASE)/usr
SWIFT_INSTALLDIR=$(SCONS_INSTALL_BASE)/usr SWIFTEN_INSTALLDIR=$(SCONS_INSTALL_BASE)/usr
@@ -21,7 +21,7 @@ override_dh_clean:
override_dh_configure:
override_dh_auto_build:
- scons $(SCONS_FLAGS) $(SCONS_EXTRA_FLAGS) Swift Swiften
+ scons $(SCONS_FLAGS) $(SCONS_EXTRA_FLAGS) Swift Swiften debian/swift-im.1 debian/swiften-config.1
override_dh_auto_install:
scons $(SCONS_FLAGS) $(SCONS_EXTRA_FLAGS) $(SCONS_INSTALL_FLAGS) $(SCONS_INSTALL_BASE)
diff --git a/Swift/Packaging/Debian/package.sh b/Swift/Packaging/Debian/package.sh
index d19f5dc..62dfff0 100755
--- a/Swift/Packaging/Debian/package.sh
+++ b/Swift/Packaging/Debian/package.sh
@@ -95,18 +95,6 @@ cat $DIRNAME/debian/control.in | sed -e "s/%SWIFTEN_SOVERSION%/$SWIFTEN_SOVERSIO
rm $DIRNAME/debian/control.in
mv $DIRNAME/debian/libswiften.install $DIRNAME/debian/libswiften$SWIFTEN_SOVERSION.install
cat ../../../COPYING.thirdparty | tail -n +3 >> $DIRNAME/debian/copyright
-# Generate updated man-page if possible
-if type "help2man" > /dev/null 2>&1; then
- if [ -f ../../QtUI/swift-im ]; then
- help2man -m "Swift Manual" -S "Swift" -n "swift-im" -N ../../QtUI/swift-im > $DIRNAME/debian/swift-im.1
- fi
- if [ -f ../../../Swiften/Config/swiften-config ]; then
- help2man -m "Swift Manual" -S "swiften-config" -n "swiften-config" -N ../../../Swiften/Config/swiften-config > $DIRNAME/debian/swiften-config.1
- fi
-else
- >2& echo "Unable to generate man pages. Please ensure that help2man is installed"
- exit 1;
-fi
# Build
cd $DIRNAME
diff --git a/Swift/Packaging/Debian/package_all_platforms.sh b/Swift/Packaging/Debian/package_all_platforms.sh
index 097fe38..afd0621 100755
--- a/Swift/Packaging/Debian/package_all_platforms.sh
+++ b/Swift/Packaging/Debian/package_all_platforms.sh
@@ -24,9 +24,15 @@ export SWIFT_FORCE_LUCID="yep"
unset SWIFT_FORCE_LUCID
./package.sh
-for distro in xenial yakkety jessie sid; do
+if [ -z ${SWIFT_PACKAGE_PLATFORMS+x} ];
+then
+ platformsarray=( xenial artful jessie stretch sid )
+else
+ platformsarray=( $SWIFT_PACKAGE_PLATFORMS )
+fi
+
+for distro in "${platformsarray[@]}"; do
for arch in amd64; do
pbuilder-dist $distro $arch build *.dsc
done
done
-
diff --git a/Swift/Packaging/Debian/package_docker.sh b/Swift/Packaging/Debian/package_docker.sh
new file mode 100755
index 0000000..7fd1a3e
--- /dev/null
+++ b/Swift/Packaging/Debian/package_docker.sh
@@ -0,0 +1,70 @@
+#!/bin/bash
+
+set -e
+
+cd $(dirname $(readlink -f $0 || realpath $0))
+export PYTHONPATH=../../../BuildTools/SCons
+VERSION=${VERSION:=`../../../BuildTools/GetBuildVersion.py swift`}
+DEBIAN_VERSION=`../../../BuildTools/DebianizeVersion.py $VERSION`
+SWIFTEN_SOVERSION=`../../../BuildTools/GetBuildVersion.py swift --major`
+SWIFT_SOURCE_DIR=swift-im-$DEBIAN_VERSION
+TARBALLBARE="swift-im_$DEBIAN_VERSION.orig.tar.gz"
+TARBALL="${SHARED_DIR}${TARBALLBARE}"
+# DEVATTN there is an issue with some versions of Qt(5.11.1) and docker see https://bugreports.qt.io/browse/QTBUG-64490. Workaround is to add privileged flag
+if [ -z ${DOCKERRUNEXTRAFLAGS+x} ];
+then
+ DOCKERRUNEXTRAFLAGS="--privileged"
+fi
+
+rm -rf $SWIFT_SOURCE_DIR
+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
+echo $VERSION > $SWIFT_SOURCE_DIR/VERSION.swift
+
+tar czf $TARBALLBARE $SWIFT_SOURCE_DIR
+cp $TARBALLBARE $SWIFT_SOURCE_DIR
+
+cp -r debian $SWIFT_SOURCE_DIR/debian
+../../../BuildTools/UpdateDebianChangelog.py $SWIFT_SOURCE_DIR/debian/changelog $DEBIAN_VERSION
+
+cat $SWIFT_SOURCE_DIR/debian/control.in | sed -e "s/%SWIFTEN_SOVERSION%/$SWIFTEN_SOVERSION/g" | sed -e "s/%WEBKIT_DEPENDENCY%/$WEBKIT_DEPENDENCY/g" > $SWIFT_SOURCE_DIR/debian/control
+rm $SWIFT_SOURCE_DIR/debian/control.in
+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
+
+TMP_DOCKERFILE=Dockerfile.tmp.package
+
+if [ -z ${SWIFT_PACKAGE_PLATFORMS+x} ];
+then
+ platformsarray=( ubuntu:bionic ubuntu:cosmic debian:stretch debian:sid )
+else
+ platformsarray=( $SWIFT_PACKAGE_PLATFORMS )
+fi
+
+for distro in "${platformsarray[@]}";
+do
+ if [ -f $TMP_DOCKERFILE ];
+ then
+ rm $TMP_DOCKERFILE
+ fi
+ cat Dockerfile.package.in | 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
+done
diff --git a/Swift/Packaging/Debian/update_debian_repo.sh b/Swift/Packaging/Debian/update_debian_repo.sh
index d62a376..fc736ed 100644
--- a/Swift/Packaging/Debian/update_debian_repo.sh
+++ b/Swift/Packaging/Debian/update_debian_repo.sh
@@ -73,14 +73,25 @@ command -v reprepro >/dev/null 2>&1 || { echo >&2 "This script requires aptly bu
mkdir -p $APT_REPO_ROOT
+if [ -z ${SWIFT_PACKAGE_PLATFORMS+x} ]; then
+ platformsarray=( bionic cosmic stretch sid )
+else
+ platformsarray=( $SWIFT_PACKAGE_PLATFORMS )
+fi
+
# distros
for full_distribution_path in $INCOMING_FOLDER/{debian,ubuntu}/*; do
distro_version=`basename $full_distribution_path`
distro_name=$(basename `dirname $full_distribution_path`)
distro_reprepro_root=${APT_REPO_ROOT}/${distro_name}/${distro_version}
- # ensure reprepro diretctory for this distribution version is present
- if [ ! -d "$distro_preprepro_root" ]; then
+ if ! [[ ${platformsarray[@]} == *"$distro_version"* ]]; then
+ echo "$distro_version was not found in SWIFT_PACKAGE_PLATFORMS. Skipping..."
+ continue
+ fi
+
+ # ensure reprepro directory for this distribution version is present
+ if [ ! -d "$distro_reprepro_root" ]; then
echo "Create distribution repository for $distro_name/$distro_version"
mkdir -p $distro_reprepro_root
mkdir -p ${distro_reprepro_root}/conf
@@ -89,7 +100,7 @@ for full_distribution_path in $INCOMING_FOLDER/{debian,ubuntu}/*; do
write_reprepo_conf_incoming_to_file "${distro_reprepro_root}/conf/incoming" "$full_distribution_path"
fi
- # This is workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808558
+ # This is workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808558
# and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=843402
if [ "$distro_name/$distro_version" = "debian/sid" ]; then
sed -i '/dbgsym/ d' $full_distribution_path/*.changes