Commit f89d706d authored by aviau's avatar aviau

Add Debian and Ubuntu packaging

This moves the official Debian packaging into ring-project. Jenkins
should now be able to run packaging jobs and publish packages. It
should also make it easy to add a `verify` check on Jenkins to test
packaging patches.

This will make it much easier to work on packaging issues because the
build environment is now reproductible on any machine.

The patch adds Makefile targets to create packages such as:
 - package-all
 - package-<DISTRO>

Builds are all done inside Docker containers and it is possible to
build many at a time with the `package-all` target.

To debug a build, use `package-<DISTRO>-interactive` to obtain a shell
inside a container, ready to launch a build.

Tuleap: #781
Change-Id: Id87a74a6c412ffc5bf82b9562639ce5a9424b06a
parent 81e420a4
client-android
client-gnome
client-macosx
client-windows
daemon
lrc
ring_*
.git
*/.git
......@@ -4,3 +4,6 @@
.DS_Store
env
docs/build
packages
ring_*.tar.gz
Makefile.packaging.distro_targets
......@@ -12,6 +12,8 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
.DEFAULT_GOAL := package-all
##############################
## Version number variables ##
......@@ -31,10 +33,15 @@ COMMIT_ID:=$(shell git rev-parse --short HEAD)
RELEASE_VERSION:=$(LAST_COMMIT_DATE_SHORT).$(NUMBER_OF_COMMITS).$(COMMIT_ID)
RELEASE_TARBALL_FILENAME:=ring_$(RELEASE_VERSION).tar.gz
# Debian versions
DEBIAN_VERSION:=$(RELEASE_VERSION)~dfsg1-1
DEBIAN_DSC_FILENAME:=ring_$(DEBIAN_VERSION).dsc
#####################
## Other variables ##
#####################
TMPDIR := $(shell mktemp -d)
CURRENT_UID:=$(shell id -u)
#############################
## Release tarball targets ##
......@@ -59,6 +66,25 @@ $(RELEASE_TARBALL_FILENAME):
rm -rf $(CURDIR)/daemon/contrib/tarballs/*
#######################
## Packaging targets ##
#######################
.PHONY: package-all
package-all: package-debian8 \
package-debian8_i386 \
package-debian9 \
package-debian9_i386 \
package-ubuntu15.10 \
package-ubuntu15.10_i386 \
package-ubuntu16.04 \
package-ubuntu16.04_i386
# Append the output of make-packaging-target to this Makefile
# see Makefile.packaging.distro_targets
$(shell scripts/make-packaging-target.py --generate-all > Makefile.packaging.distro_targets)
include Makefile.packaging.distro_targets
###################
## Other targets ##
###################
......@@ -76,3 +102,6 @@ clean:
rm -rf env
rm -rf docs/build
rm -f ring_*.tar.gz
rm -rf packages
rm -f Makefile.packaging.distro_targets
rm -f .docker-image-*
client-gnome @ 884c37c0
Subproject commit 45bee9ccc17ec7de1e570ef3133f4dfdfba8c309
Subproject commit 884c37c0d1ceb17d0146f174d014f56092373593
daemon @ 150035a8
Subproject commit fbdc7b2476d330897ff2014e9fc17fd128eb4c19
Subproject commit 150035a81912cc8109331c684d8ad5be6b343e8f
FROM debian:8
RUN apt-get update && \
apt-get install -y vim devscripts equivs
# Speed up mk-build-deps
RUN apt-get update && \
apt-get install -y autoconf automake cmake libtool libdbus-1-dev \
libdbus-c++-dev libupnp-dev \
libebook1.2-dev libclutter-gtk-1.0-dev \
libclutter-1.0-dev libglib2.0-dev libgtk-3-dev \
libnotify-dev qtbase5-dev qttools5-dev \
qttools5-dev-tools yasm unbound-anchor git-core \
autotools-dev gnome-icon-theme-symbolic gettext \
libpulse-dev libsamplerate0-dev libasound2-dev \
libexpat1-dev libpcre3-dev libyaml-cpp-dev \
libboost-dev libsndfile1-dev libsrtp-dev \
libxext-dev libxfixes-dev autopoint libspeex-dev \
libspeexdsp-dev chrpath uuid-dev libavcodec-dev \
libavutil-dev libavformat-dev libswscale-dev \
libavdevice-dev libopus-dev libudev-dev libticonv-dev \
libgsm1-dev libjsoncpp-dev libqrencode-dev
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
FROM savoirfairelinux/ring-debian32:8
RUN apt-get update && \
apt-get install -y vim devscripts equivs
# Speed up mk-build-deps
RUN apt-get update && \
apt-get install -y autoconf automake cmake libtool libdbus-1-dev \
libdbus-c++-dev libupnp-dev \
libebook1.2-dev libclutter-gtk-1.0-dev \
libclutter-1.0-dev libglib2.0-dev libgtk-3-dev \
libnotify-dev qtbase5-dev qttools5-dev \
qttools5-dev-tools yasm unbound-anchor git-core \
autotools-dev gnome-icon-theme-symbolic gettext \
libpulse-dev libsamplerate0-dev libasound2-dev \
libexpat1-dev libpcre3-dev libyaml-cpp-dev \
libboost-dev libsndfile1-dev libsrtp-dev \
libxext-dev libxfixes-dev autopoint libspeex-dev \
libspeexdsp-dev chrpath uuid-dev libavcodec-dev \
libavutil-dev libavformat-dev libswscale-dev \
libavdevice-dev libopus-dev libudev-dev libticonv-dev \
libgsm1-dev libjsoncpp-dev libqrencode-dev
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
FROM debian:stretch
RUN apt-get update && \
apt-get install -y vim devscripts
# Speed up mk-build-deps
RUN apt-get update && \
apt-get install -y autoconf automake cmake libtool libdbus-1-dev \
libdbus-c++-dev libupnp-dev libgnutls28-dev \
libebook1.2-dev libclutter-gtk-1.0-dev \
libclutter-1.0-dev libglib2.0-dev libgtk-3-dev \
libnotify-dev qtbase5-dev qttools5-dev \
qttools5-dev-tools yasm unbound-anchor git-core \
autotools-dev gnome-icon-theme-symbolic gettext \
libpulse-dev libsamplerate0-dev libasound2-dev \
libexpat1-dev libpcre3-dev libyaml-cpp-dev \
libboost-dev libsndfile1-dev libsrtp-dev \
libxext-dev libxfixes-dev autopoint libspeex-dev \
libspeexdsp-dev chrpath uuid-dev libavcodec-dev \
libavutil-dev libavformat-dev libswscale-dev \
libavdevice-dev libopus-dev libudev-dev libticonv-dev \
libgsm1-dev libjsoncpp-dev libqrencode-dev
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
FROM savoirfairelinux/ring-debian32:9
RUN apt-get update && \
apt-get install -y vim devscripts
# Speed up mk-build-deps
RUN apt-get update && \
apt-get install -y autoconf automake cmake libtool libdbus-1-dev \
libdbus-c++-dev libupnp-dev libgnutls28-dev \
libebook1.2-dev libclutter-gtk-1.0-dev \
libclutter-1.0-dev libglib2.0-dev libgtk-3-dev \
libnotify-dev qtbase5-dev qttools5-dev \
qttools5-dev-tools yasm unbound-anchor git-core \
autotools-dev gnome-icon-theme-symbolic gettext \
libpulse-dev libsamplerate0-dev libasound2-dev \
libexpat1-dev libpcre3-dev libyaml-cpp-dev \
libboost-dev libsndfile1-dev libsrtp-dev \
libxext-dev libxfixes-dev autopoint libspeex-dev \
libspeexdsp-dev chrpath uuid-dev libavcodec-dev \
libavutil-dev libavformat-dev libswscale-dev \
libavdevice-dev libopus-dev libudev-dev libticonv-dev \
libgsm1-dev libjsoncpp-dev libqrencode-dev
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
FROM ubuntu:14.04
RUN apt-get update && \
apt-get install -y vim devscripts equivs
# Speed up mk-build-deps
RUN apt-get update && \
apt-get install -y autoconf automake cmake libtool libdbus-1-dev \
libdbus-c++-dev libupnp-dev \
libebook1.2-dev libclutter-gtk-1.0-dev \
libclutter-1.0-dev libglib2.0-dev libgtk-3-dev \
libnotify-dev qtbase5-dev qttools5-dev \
qttools5-dev-tools yasm unbound-anchor git-core \
autotools-dev gnome-icon-theme-symbolic gettext \
libpulse-dev libsamplerate0-dev libasound2-dev \
libexpat1-dev libpcre3-dev libyaml-cpp-dev \
libboost-dev libsndfile1-dev libsrtp-dev \
libxext-dev libxfixes-dev autopoint libspeex-dev \
libspeexdsp-dev chrpath uuid-dev libavcodec-dev \
libavutil-dev libavformat-dev libswscale-dev \
libavdevice-dev libopus-dev libudev-dev libticonv-dev \
libgsm1-dev libjsoncpp-dev libqrencode-dev
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
FROM savoirfairelinux/ring-ubuntu32:14.04
RUN apt-get update && \
apt-get install -y vim devscripts equivs
# Speed up mk-build-deps
RUN apt-get update && \
apt-get install -y autoconf automake cmake libtool libdbus-1-dev \
libdbus-c++-dev libupnp-dev \
libebook1.2-dev libclutter-gtk-1.0-dev \
libclutter-1.0-dev libglib2.0-dev libgtk-3-dev \
libnotify-dev qtbase5-dev qttools5-dev \
qttools5-dev-tools yasm unbound-anchor git-core \
autotools-dev gnome-icon-theme-symbolic gettext \
libpulse-dev libsamplerate0-dev libasound2-dev \
libexpat1-dev libpcre3-dev libyaml-cpp-dev \
libboost-dev libsndfile1-dev libsrtp-dev \
libxext-dev libxfixes-dev autopoint libspeex-dev \
libspeexdsp-dev chrpath uuid-dev libavcodec-dev \
libavutil-dev libavformat-dev libswscale-dev \
libavdevice-dev libopus-dev libudev-dev libticonv-dev \
libgsm1-dev libjsoncpp-dev libqrencode-dev
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
FROM ubuntu:15.10
RUN apt-get update && \
apt-get install -y vim devscripts equivs
# Speed up mk-build-deps
RUN apt-get update && \
apt-get install -y autoconf automake cmake libtool libdbus-1-dev \
libdbus-c++-dev libupnp-dev \
libebook1.2-dev libclutter-gtk-1.0-dev \
libclutter-1.0-dev libglib2.0-dev libgtk-3-dev \
libnotify-dev qtbase5-dev qttools5-dev \
qttools5-dev-tools yasm unbound-anchor git-core \
autotools-dev gnome-icon-theme-symbolic gettext \
libpulse-dev libsamplerate0-dev libasound2-dev \
libexpat1-dev libpcre3-dev libyaml-cpp-dev \
libboost-dev libsndfile1-dev libsrtp-dev \
libxext-dev libxfixes-dev autopoint libspeex-dev \
libspeexdsp-dev chrpath uuid-dev libavcodec-dev \
libavutil-dev libavformat-dev libswscale-dev \
libavdevice-dev libopus-dev libudev-dev libticonv-dev \
libgsm1-dev libjsoncpp-dev libqrencode-dev
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
FROM savoirfairelinux/ring-ubuntu32:15.10
RUN apt-get update && \
apt-get install -y vim devscripts equivs
# Speed up mk-build-deps
RUN apt-get update && \
apt-get install -y autoconf automake cmake libtool libdbus-1-dev \
libdbus-c++-dev libupnp-dev \
libebook1.2-dev libclutter-gtk-1.0-dev \
libclutter-1.0-dev libglib2.0-dev libgtk-3-dev \
libnotify-dev qtbase5-dev qttools5-dev \
qttools5-dev-tools yasm unbound-anchor git-core \
autotools-dev gnome-icon-theme-symbolic gettext \
libpulse-dev libsamplerate0-dev libasound2-dev \
libexpat1-dev libpcre3-dev libyaml-cpp-dev \
libboost-dev libsndfile1-dev libsrtp-dev \
libxext-dev libxfixes-dev autopoint libspeex-dev \
libspeexdsp-dev chrpath uuid-dev libavcodec-dev \
libavutil-dev libavformat-dev libswscale-dev \
libavdevice-dev libopus-dev libudev-dev libticonv-dev \
libgsm1-dev libjsoncpp-dev libqrencode-dev
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y vim devscripts equivs
# Speed up mk-build-deps
RUN apt-get update && \
apt-get install -y autoconf automake cmake libtool libdbus-1-dev \
libdbus-c++-dev libupnp-dev libgnutls28-dev \
libebook1.2-dev libclutter-gtk-1.0-dev \
libclutter-1.0-dev libglib2.0-dev libgtk-3-dev \
libnotify-dev qtbase5-dev qttools5-dev \
qttools5-dev-tools yasm unbound-anchor git-core \
autotools-dev gnome-icon-theme-symbolic gettext \
libpulse-dev libsamplerate0-dev libasound2-dev \
libexpat1-dev libpcre3-dev libyaml-cpp-dev \
libboost-dev libsndfile1-dev libsrtp-dev \
libxext-dev libxfixes-dev autopoint libspeex-dev \
libspeexdsp-dev chrpath uuid-dev libavcodec-dev \
libavutil-dev libavformat-dev libswscale-dev \
libavdevice-dev libopus-dev libudev-dev libticonv-dev \
libgsm1-dev libjsoncpp-dev libqrencode-dev
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
FROM savoirfairelinux/ring-ubuntu32:16.04
RUN apt-get update && \
apt-get install -y vim devscripts equivs
# Speed up mk-build-deps
RUN apt-get update && \
apt-get install -y autoconf automake cmake libtool libdbus-1-dev \
libdbus-c++-dev libupnp-dev libgnutls28-dev \
libebook1.2-dev libclutter-gtk-1.0-dev \
libclutter-1.0-dev libglib2.0-dev libgtk-3-dev \
libnotify-dev qtbase5-dev qttools5-dev \
qttools5-dev-tools yasm unbound-anchor git-core \
autotools-dev gnome-icon-theme-symbolic gettext \
libpulse-dev libsamplerate0-dev libasound2-dev \
libexpat1-dev libpcre3-dev libyaml-cpp-dev \
libboost-dev libsndfile1-dev libsrtp-dev \
libxext-dev libxfixes-dev autopoint libspeex-dev \
libspeexdsp-dev chrpath uuid-dev libavcodec-dev \
libavutil-dev libavformat-dev libswscale-dev \
libavdevice-dev libopus-dev libudev-dev libticonv-dev \
libgsm1-dev libjsoncpp-dev libqrencode-dev
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
lrc @ 3fc24faf
Subproject commit 54bb9b6c55ab9c5b23a5c76641b49761ca67b5be
Subproject commit 3fc24faf38351b018ebe018a9785d59b76645fd9
Packaging
#########
The rules folder contains the latest and greatest packaging rules.
The distros folder contains overrides for some files that must be changed
depending on the distribution. Those are kept at a minimum.
Differences log
###############
This files lists the overrides done in the various subfolders. It is useful
when updating packaging because we don't maintain patches and we should know
what was overriden and why.
# Notes
## Importing a new version
1- Prepare the new changelog entry mentioning the new version.
(the version on the changelog will be used to determine what to download).
Releases are available here: https://dl.ring.cx/ring-release/tarballs/
2- Run debian/rules get-orig-source
3- Import the tarball with gbp import-orig <tarball>
## tarballs-unpacked
We need those tarballs in tarballs-unpacked.
The rest should be excluded.
- msgpack-c-cpp-1.2.0.tar.gz
- opendht-281b62dfd529a226e94d0da19e01acf07871a797.tar.gz
- pjproject-2.4.5.tar.bz2
Source: ring
Section: comm
Priority: extra
Maintainer: Alexandre Viau <aviau@debian.org>
Build-Depends: debhelper (>= 9),
autoconf,
automake,
cmake,
libtool,
# gnome client
libebook1.2-dev,
libclutter-gtk-1.0-dev,
libclutter-1.0-dev,
libglib2.0-dev,
libgtk-3-dev,
libnotify-dev,
qtbase5-dev,
qttools5-dev,
qttools5-dev-tools,
unbound-anchor,
git-core,
gnome-icon-theme-symbolic,
gettext,
libqrencode-dev,
libappindicator-dev,
# ring-daemon
libdbus-1-dev,
libdbus-c++-dev,
libupnp-dev,
libgnutls28-dev,
yasm,
autotools-dev,
libpulse-dev,
libasound2-dev,
libexpat1-dev,
libpcre3-dev,
libyaml-cpp-dev,
libboost-dev,
libsndfile1-dev,
libsrtp-dev,
libxext-dev,
libxfixes-dev,
autopoint,
libspeex-dev,
libspeexdsp-dev,
chrpath,
uuid-dev,
libavcodec-dev,
libavutil-dev,
libavformat-dev,
libswscale-dev,
libavdevice-dev,
libopus-dev,
libudev-dev,
libticonv-dev,
libgsm1-dev,
libjsoncpp-dev,
libnatpmp-dev
Standards-Version: 3.9.8
Homepage: https://ring.cx
Vcs-Git: https://anonscm.debian.org/git/pkg-voip/ring.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-voip/ring.git
Package: ring
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
ring-daemon (=${binary:Version})
Description: Secure and distributed voice, video and chat platform - desktop client
Ring (ring.cx) is a secure and distributed voice, video and chat communication
platform that requires no centralized server and leaves the power of privacy
in the hands of the user.
.
This package contains the desktop client: gnome-ring.
Package: ring-daemon
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends}
Description: Secure and distributed voice, video and chat platform - daemon
Ring (ring.cx) is a secure and distributed voice, video and chat communication
platform that requires no centralized server and leaves the power of privacy
in the hands of the user.
.
This package contains the Ring daemon: dring.
This diff is collapsed.
[DEFAULT]
pristine-tar = True
Description: Assume gsm is installed to avoid internet access
Origin: vendor
Author: Alexandre Viau <aviau@debian.org>
Reviewed-by: Alexandre Viau <aviau@debian.org>
Last-Update: 2016-04-22
--- a/daemon/contrib/src/gsm/rules.mak
+++ b/daemon/contrib/src/gsm/rules.mak
@@ -4,6 +4,8 @@
PKGS += gsm
+PKGS_FOUND += gsm
+
$(TARBALLS)/libgsm_$(GSM_VERSION).tar.gz:
$(call download,$(GSM_URL))
# We are shipping a .so, but this isn't a library package
package-name-doesnt-match-sonames
no-symbols-control-file
client-gnome/doc/gnome-ring.1
#!/usr/bin/make -f
# -*- makefile -*-
# Hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
# Number of CPUS
NO_CPUS=$(shell nproc)
ifeq ($(NO_CPUS),0)
NO_CPUS=1
endif
%:
dh $@
override_dh_auto_configure:
###############################################
## Re-create tarballs from tarballs-unpacked ##
###############################################
mkdir -p daemon/contrib/tarballs
# Create tarballs
for i in $(CURDIR)/daemon/contrib/tarballs-unpacked/*; do \
projectname=`basename $$i` && \
cd $$i && tar -caf ../../tarballs/$$projectname * && \
echo "Repacked $$projectname"; \
done
# Prevent bootstrap script from verifying checksums
mkdir -p daemon/contrib/native
touch daemon/contrib/native/.sum-msgpack
touch daemon/contrib/native/.sum-opendht
touch daemon/contrib/native/.sum-pjproject
###########################
## Ring Daemon configure ##
###########################
mkdir -p daemon/contrib/native
cd daemon/contrib/native && \
../bootstrap \
--disable-ogg \
--disable-flac \
--disable-vorbis \
--disable-vorbisenc \
--disable-speex \
--disable-sndfile \
--disable-speexdsp && \
make list && \
make -j1
cd daemon && \
./autogen.sh && \
./configure \
--prefix=/usr \
--without-iax
#############################
## libringclient configure ##
#############################
cd lrc && \
mkdir build && \
cd build && \
cmake \
-DRING_BUILD_DIR=$(CURDIR)/daemon/src \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_VIDEO=true \
..
############################
## gnome client configure ##
############################
cd client-gnome && \
mkdir build && \
cd build && \
cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLibRingClient_PROJECT_DIR=/$(CURDIR)/lrc \
..
dh_auto_configure
override_dh_auto_build:
#######################
## Ring Daemon build ##
#######################
cd daemon && make -j$(NO_CPUS)
pod2man daemon/man/dring.pod > daemon/dring.1
#########################
## libringclient build ##
#########################
cd lrc/build && make -j$(NO_CPUS)
########################
## gnome client build ##
########################
cd client-gnome/build && make LDFLAGS="-lpthread" -j$(NO_CPUS)
override_dh_auto_clean:
################################
## Generated contrib tarballs ##
################################
rm -rfv daemon/contrib/tarballs
#######################
## Ring Daemon clean ##
#######################
if [ -d daemon/contrib/native ]; then cd daemon/contrib/native && make distclean; fi
rm -rfv daemon/contrib/native
rm -rfv daemon/dring.1
#########################
## libringclient clean ##
#########################
if [ -d lrc/build ]; then cd lrc/build && make distclean; fi
rm -rfv lrc/build
########################
## gnome client clean ##
########################
if [ -d client-gnome/build ]; then cd client-gnome/build && make distclean; fi
rm -rfv client-gnome/build
override_dh_auto_install:
#########################
## Ring Daemon install ##
#########################
cd daemon && make DESTDIR=$(CURDIR)/debian/ring-daemon install
rm -rfv $(CURDIR)/debian/ring-daemon/usr/include
rm -rfv $(CURDIR)/debian/ring-daemon/usr/lib
###########################
## libringclient install ##
###########################
cd lrc/build && make DESTDIR=$(CURDIR)/debian/ring install
rm -rfv $(CURDIR)/debian/ring/usr/include
# This is a symlink, should be in -dev package
rm -v $(CURDIR)/debian/ring/usr/lib/libringclient.so
# cmake files
rm -rfv $(CURDIR)/debian/ring/usr/lib/cmake
##########################
## gnome client install ##
##########################
cd client-gnome/build && make DESTDIR=$(CURDIR)/debian/ring install
# Remove ring binary: it is not needed for now
rm $(CURDIR)/debian/ring/usr/bin/ring.cx
tmpdir:= $(shell mktemp -d)
workdir:= $(shell pwd)
PKD := $(abspath $(dir $(MAKEFILE_LIST)))
version_to_download := $(shell dpkg-parsechangelog -ldebian/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\~dfsg.+)(?:\-\d+.*)};')
# Repacks the tarball with contrib tarballs unpacked.
get-orig-source:
# Download ring tarball
if [ -n "$$GET_ORIG_SOURCE_OVERRIDE_USCAN_TARBALL" ]; then \
mv $$GET_ORIG_SOURCE_OVERRIDE_USCAN_TARBALL ${tmpdir}; \
else \
uscan --rename --destdir=${tmpdir} --download-version ${version_to_download} ;\
fi
# Unpack ring tarball
tar -C ${tmpdir} -xf ${tmpdir}/*.tar.gz
# Remove original tarball
rm ${tmpdir}/*.tar.gz
# Unpack all of the orig tarballs into tarballs-unpacked
mkdir ${tmpdir}/ring-project/daemon/contrib/tarballs-unpacked
for i in `find ${tmpdir}/ring-project/daemon/contrib/tarballs/ -name "*.tar.*"`; do \
projectname=`basename $$i` && \
mkdir ${tmpdir}/ring-project/daemon/contrib/tarballs-unpacked/$$projectname && \
tar -C ${tmpdir}/ring-project/daemon/contrib/tarballs-unpacked/$$projectname -xf $$i && \
echo "Unpacked $$projectname"; \
done
###################
## Exclude files ##
###################
# This does not exclude everything that we need to exclude.
# debian/copyright's File-Excluded section also excludes files.
## pjproject
rm -rf ${tmpdir}/ring-project/daemon/contrib/tarballs-unpacked/pjproject-*/pjproject-*/third_party/g7221 # non-distributable (requires a license from Polycom)
rm -rf ${tmpdir}/ring-project/daemon/contrib/tarballs-unpacked/pjproject-*/pjproject-*/third_party/ilbc # non distributable (the version included with pjproject)
rm -rf ${tmpdir}/ring-project/daemon/contrib/tarballs-unpacked/pjproject-*/pjproject-*/third_party/milenage # non distributable
rm -rf ${tmpdir}/ring-project/daemon/contrib/tarballs-unpacked/pjproject-*/pjproject-*/third_party/BaseClasses # non distributable (?)
rm -rf ${tmpdir}/ring-project/daemon/contrib/tarballs-unpacked/pjproject-*/pjproject-*/third_party/portaudio # not needed
rm -rf ${tmpdir}/ring-project/daemon/contrib/tarballs-unpacked/pjproject-*/pjproject-*/third_party/speex # not needed
rm -rf ${tmpdir}/ring-project/daemon/contrib/tarballs-unpacked/pjproject-*/pjproject-*/third_party/mp3 # not needed
rm -rf ${tmpdir}/ring-project/daemon/contrib/tarballs-unpacked/pjproject-*/pjproject-*/third_party/gsm # not needed
rm -rf ${tmpdir}/ring-project/daemon/contrib/tarballs-unpacked/pjproject-*/pjproject-*/third_party/bdsound # not needed
#rm -rf ${tmpdir}/ring-project/daemon/contrib/tarballs-unpacked/pjproject-*/pjproject-*/third_party/srtp # not needed
rm -f ${tmpdir}/ring-project/daemon/contrib/tarballs-unpacked/pjproject-*/pjproject-*/pjmedia/src/pjmedia-audiodev/s60_g729_bitstream.h # non distributable
rm -rf ${tmpdir}/ring-project/daemon/contrib/tarballs-unpacked/pjproject-*/pjproject-*/build/vs # not needed, VisualStudio files.
# Remove all contrib tarballs
rm -rf ${tmpdir}/ring-project/daemon/contrib/tarballs
# Create the new tarball
cd ${tmpdir} && tar -czf ${workdir}/ring_${version_to_download}~dfsg1.orig.tar.gz ring-project
# Clear the temp dir
rm -rf ${tmpdir}
version=3
opts=dversionmangle=s/\~dfsg\d*$// \
https://dl.ring.cx/ring-release/tarballs/ ring_(\d\S*)\.tar\.gz
#!/usr/bin/env bash
#
# Copyright (C) 2016 Savoir-faire Linux Inc.
#
# Author: Alexandre Viau <alexandre.viau@savoirfairelinux.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or