Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to upstream+asterisk22 #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/.dockerignore
/.git
/.gitignore
/.*swp
116 changes: 53 additions & 63 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,48 @@ ARG oscodename=stretch

FROM $osdistro:$oscodename
LABEL maintainer="Walter Doekes <[email protected]>"
LABEL dockerfile-vcs=https://github.com/ossobv/asterisk-g72x-deb

ARG DEBIAN_FRONTEND=noninteractive

# This time no "keeping the build small". We only use this container for
# building/testing and not for running, so we can keep files like apt
# cache. We do this before copying anything and before getting lots of
# ARGs from the user. That keeps this bit cached.
RUN echo 'APT::Install-Recommends "0";' >/etc/apt/apt.conf.d/01norecommends
# We'll be ignoring "debconf: delaying package configuration, since apt-utils
# is not installed"
RUN apt-get update -q && \
apt-get dist-upgrade -y && \
apt-get install -y \
ca-certificates curl \
build-essential devscripts dh-autoreconf dpkg-dev equivs quilt && \
printf "%s\n" \
QUILT_PATCHES=debian/patches QUILT_NO_DIFF_INDEX=1 \
QUILT_NO_DIFF_TIMESTAMPS=1 'QUILT_DIFF_OPTS="--show-c-function"' \
'QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"' \
>~/.quiltrc

# Apt-get prerequisites according to control file.
COPY control /build/debian/control
RUN mk-build-deps --install --remove --tool "apt-get -y" /build/debian/control

# debian, deb, stretch, asterisk-g72x, 1.3+20+3058c45eb60d, '', 0osso1
ARG osdistro
ARG osdistshort
ARG oscodename
ARG upname
ARG upversion
ARG debepoch=
ARG debversion
ARG osdistro osdistshort oscodename upname upversion debepoch= debversion

# Copy debian dir, check version
RUN mkdir -p /build/debian
COPY ./changelog /build/debian/changelog
RUN . /etc/os-release && fullversion="${upversion}-${debversion}+${osdistshort}${VERSION_ID}" && \
COPY changelog /build/debian/changelog
RUN . /etc/os-release && \
sed -i -e "1s/+[^+)]*)/+${osdistshort}${VERSION_ID})/;1s/) stable;/) ${oscodename};/" \
/build/debian/changelog && \
fullversion="${upversion}-${debversion}+${osdistshort}${VERSION_ID}" && \
expected="${upname} (${debepoch}${fullversion}) ${oscodename}; urgency=medium" && \
head -n1 /build/debian/changelog && \
if test "$(head -n1 /build/debian/changelog)" != "${expected}"; \
then echo "${expected} <-- mismatch" >&2; false; fi

# This time no "keeping the build small". We only use this container for
# building/testing and not for running, so we can keep files like apt
# cache.
RUN echo 'APT::Install-Recommends "0";' >/etc/apt/apt.conf.d/01norecommends
#RUN sed -i -e 's:deb.debian.org:apt.osso.nl:;s:security.debian.org:apt.osso.nl/debian-security:' /etc/apt/sources.list
#RUN sed -i -e 's:security.ubuntu.com:apt.osso.nl:;s:archive.ubuntu.com:apt.osso.nl:' /etc/apt/sources.list
RUN apt-get update -q
RUN apt-get install -y apt-utils
RUN apt-get dist-upgrade -y
RUN apt-get install -y \
bzip2 ca-certificates curl mercurial \
dirmngr gnupg \
build-essential dh-autoreconf devscripts dpkg-dev equivs quilt

# Set up upstream source, move debian dir and jump into dir.
#
# Trick to allow caching of asterisk*.tar.bz2/gz files. Download them
# Trick to allow caching of UPNAME*.tar.gz files. Download them
# once using the curl command below into .cache/* if you want. The COPY
# is made conditional by the "[2]" "wildcard". (We need one existing
# is made conditional by the "[bg]" "wildcard". (We need one existing
# file (README.rst) so the COPY doesn't fail.)
COPY ./README.rst .cache/${upname}_${upversion}.orig.tar.[bg]* /build/
# RUN if ! test -s /build/${upname}_${upversion}.orig.tar.gz; then \
Expand All @@ -67,55 +69,43 @@ RUN (test -f /build/${upname}_${upversion}.orig.tar.bz2 || \
test $(md5sum /build/${upname}_${upversion}.orig.tar.bz2 | awk '{print $1}') = e99e153e88fe45cde0a7b04e22f1a414
RUN cd /build && tar jxf "${upname}_${upversion}.orig.tar.bz2" && \
mv debian "${upname}-${upversion}/"
WORKDIR "/build/${upname}-${upversion}"
COPY asterisk-g72x-g729-ast11.install asterisk-g72x-g729-ast13.install \
asterisk-g72x-g729-ast16.install asterisk-g72x-g729-ast18.install \
asterisk-g72x-g729-ast22.install \
compat rules source /build/${upname}-${upversion}/debian/
WORKDIR /build/${upname}-${upversion}

# We require (lib)bcg729 from elsewhere
RUN echo "deb http://ppa.osso.nl/${osdistro} ${oscodename} osso" >/etc/apt/sources.list.d/osso-ppa.list && \
# apt-key adv --keyserver pgp.mit.edu --recv-keys 0xBEAD51B6B36530F5 && \
curl https://ppa.osso.nl/[email protected] | apt-key add - && \
apt-get update
# We could fetch asterisk-dev from elsewhere as well, but instead we'll
# use include-tars.
# We'll use include-tars so we can build for multiple asterisk versions.
# RUN printf "%s\n" "Package: asterisk asterisk-*" "Pin: version 1:11.*" "Pin-Priority: 600" \
# >/etc/apt/preferences.d/asterisk.pref
# TODO: 22 no available at the URL below
RUN set -x && \
cd .. && for version in 11 13 16 18; do \
cd .. && for version in 18 16 13 11; do \
curl --fail -O https://junk.devs.nu/a/asterisk/asterisk-$version-include.tar.bz2 && \
tar jxf asterisk-$version-include.tar.bz2; done && \
test $(md5sum asterisk-11-include.tar.bz2 | awk '{print $1}') = 2d0e18839d469f0929bc45738faa1b77 && \
test $(md5sum asterisk-13-include.tar.bz2 | awk '{print $1}') = cad97c28885add2c0b3fe7b7c713f2aa && \
test $(md5sum asterisk-18-include.tar.bz2 | awk '{print $1}') = bddb6ba2a27e80470cccacc67a725ffb && \
test $(md5sum asterisk-16-include.tar.bz2 | awk '{print $1}') = f2135dd7204514f6899374618aa7873f && \
test $(md5sum asterisk-18-include.tar.bz2 | awk '{print $1}') = f2135dd7204514f6899374618aa7873f && \
test $(md5sum asterisk-13-include.tar.bz2 | awk '{print $1}') = cad97c28885add2c0b3fe7b7c713f2aa && \
test $(md5sum asterisk-11-include.tar.bz2 | awk '{print $1}') = 2d0e18839d469f0929bc45738faa1b77 && \
set +x

# Apt-get prerequisites according to control file.
COPY ./control debian/control
RUN mk-build-deps --install --remove --tool "apt-get -y" debian/control

# Set up build env
RUN printf "%s\n" \
QUILT_PATCHES=debian/patches \
QUILT_NO_DIFF_INDEX=1 \
QUILT_NO_DIFF_TIMESTAMPS=1 \
'QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"' \
'QUILT_DIFF_OPTS="--show-c-function"' \
>~/.quiltrc
COPY . debian/
# Yuck -- we'd like to .dockerignore /.cache, but then loading files
# from the cache doesn't work.
RUN rm -rf debian/.cache

# Build!
RUN DEB_BUILD_OPTIONS=parallel=1 dpkg-buildpackage -us -uc -sa

# TODO: for bonus points, we could run quick tests here;
# for starters dpkg -i tests?

# Write output files (store build args in ENV first).
# Get build args so we can make a version string.
ENV oscodename=$oscodename osdistshort=$osdistshort \
upname=$upname upversion=$upversion debversion=$debversion

# Do a quick test that all subpackages got their own codec_g729.so file.
RUN . /etc/os-release && fullversion=${upversion}-${debversion}+${osdistshort}${VERSION_ID} && \
packages=$(sed -e '/^Package:/!d;s/^[^:]*: //' debian/control) && \
for pkg in $packages; do deb=../${pkg}_${fullversion}_amd64.deb; \
echo "Checking .so in $deb" >&2; dpkg-deb -c "$deb" | \
grep -F './usr/lib/asterisk/modules/codec_g729.so'; done

# Write output files.
RUN . /etc/os-release && fullversion=${upversion}-${debversion}+${osdistshort}${VERSION_ID} && \
mkdir -p /dist/${upname}_${fullversion} && \
mv /build/*${fullversion}* /dist/${upname}_${fullversion}/ && \
mv /build/${upname}_${upversion}.orig.tar.bz2 /dist/${upname}_${fullversion}/ && \
mv /build/*${fullversion}* /dist/${upname}_${fullversion}/ && \
cd / && find dist/${upname}_${fullversion} -type f >&2
37 changes: 16 additions & 21 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,45 +1,41 @@
#!/bin/bash
#!/bin/sh
cd "$(dirname "$0")" # jump to curdir
set -eu

# Pass these on the command line.
oscodename=${1:-debian/stretch} # debian/stretch

oscodename=${1:-debian/bullseye} # debian/stretch
buildversion=$(sed -e '1!d;s/.*(//;s/).*//' changelog)
upname=asterisk-g72x
upversion=$(echo "$buildversion" | sed -e 's/-.*//;s/^[0-9]*://')
debepoch=$(echo "$buildversion" | sed -e '/^[0-9]*:/!d;s/:.*/:/')
debversion=$(echo "$buildversion" | sed -e 's/[^-]*-//;s/+[^+]*$//')
dockversion=$(echo "build-$upname-$buildversion" |
sed -e 's/^[0-9]*://;s/[^A-Za-z0-9.-]/_/g')

echo "Usage: $0 [$oscodename]"
echo ".. continuing"

osdistro=${oscodename%/*} # debian (or ubuntu)
oscodename=${oscodename#*/} # stretch (or bionic)
osdistshort=${osdistro:0:3} # deb (or ubu)
case $osdistro/$oscodename in
debian/buster) oscodenum=10;;
debian/stretch) oscodenum=9;;
debian/jessie) oscodenum=8;;
debian/wheezy) oscodenum=7;;
ubuntu/bionic) oscodenum=18.04;;
ubuntu/xenial) oscodenum=16.04;;
ubuntu/trusty) oscodenum=14.04;;
debian/bullseye)osdistshort=deb; oscodenum=11;;
debian/buster) osdistshort=deb; oscodenum=10;;
debian/stretch) osdistshort=deb; oscodenum=9;;
debian/jessie) osdistshort=deb; oscodenum=8;;
debian/wheezy) osdistshort=deb; oscodenum=7;;
ubuntu/jammy) osdistshort=ubu; oscodenum=22.04;;
ubuntu/focal) osdistshort=ubu; oscodenum=20.04;;
ubuntu/bionic) osdistshort=ubu; oscodenum=18.04;;
ubuntu/xenial) osdistshort=ubu; oscodenum=16.04;;
ubuntu/trusty) osdistshort=ubu; oscodenum=14.04;;
*) echo "ERROR: undefined OS: $osdistro/$oscodename" >&2 && exit 1
esac
_shortver=$osdistshort$oscodenum

# Update changelog
sed -i -e "1s/+\\(deb\\|ubu\\)[0-9.]*) [a-z]\\+;/+$_shortver) $oscodename;/" \
changelog

# Docker disallows certain tokens in versions.
dockversion=$(echo build-${upname}-${upversion}-${debversion}-${oscodename} |
sed -e 's/[^0-9A-Za-z_.-]/_/g')

# Will build files.
if ! docker build \
docker build \
--pull \
--ulimit nofile=512 \
--build-arg osdistro=$osdistro \
Expand All @@ -51,9 +47,8 @@ if ! docker build \
--build-arg debversion=$debversion \
-t $dockversion \
-f Dockerfile \
.
then
ret=$?
. || ret=$?
if test ${ret:-0} -ne 0; then
echo "fail" >&2
exit $ret
fi
Expand Down
1 change: 1 addition & 0 deletions asterisk-g72x-g729-ast22.install
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tmp/modules-22/* usr/lib/asterisk/modules
18 changes: 18 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
asterisk-g72x (1.4.3-0osso3+REL) stable; urgency=medium

* Include asterisk 22

-- Dennis Kraus <[email protected]> Fri, 23 Dec 2024 10:59:27 +0200

asterisk-g72x (1.4.3-0osso3+REL) stable; urgency=medium

* Fix build for bullseye.

-- Walter Doekes <[email protected]> Fri, 24 Jun 2022 16:42:53 +0200

asterisk-g72x (1.4.3-0osso2+deb9) stretch; urgency=medium

* New build, this time with asterisk-18 packages as well.

-- Walter Doekes <[email protected]> Tue, 16 Feb 2021 11:01:50 +0100

asterisk-g72x (1.4.3-0osso1+deb10) buster; urgency=medium

* Update to upstream 1.4.3 (which has a source package now).
Expand Down
43 changes: 35 additions & 8 deletions control
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,29 @@ Homepage: http://asterisk.hosting.lv/
Vcs-Browser: https://bitbucket.org/arkadi/asterisk-g72x/src
Vcs-Hg: https://bitbucket.org/arkadi/asterisk-g72x

Package: asterisk-g72x-g729-ast22
Architecture: any
Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends}
Depends:
${shlibs:Depends},
${misc:Depends}
Conflicts:
asterisk-g72x-g729-ast18,
asterisk-g72x-g729-ast16,
asterisk-g72x-g729-ast13,
asterisk-g72x-g729-ast11
Recommends: asterisk (>= 1:22), asterisk (<< 1:17), asterisk-modules
Description: G.729 codec support for the Asterisk PBX
G.729 is a royalty-free narrow-band vocoder-based audio data
compression algorithm using a frame length of 10 milliseconds.
.
This package includes the G.729 codec driver (codec_g729.so) for
Asterisk PBX.
.
For more information about the Asterisk PBX, have a look at the Asterisk
package.

Package: asterisk-g72x-g729-ast18
Architecture: any
Multi-Arch: same
Expand All @@ -22,9 +45,10 @@ Depends:
${shlibs:Depends},
${misc:Depends}
Conflicts:
asterisk-g72x-g729-ast11,
asterisk-g72x-g729-ast22,
asterisk-g72x-g729-ast16,
asterisk-g72x-g729-ast13,
asterisk-g72x-g729-ast16
asterisk-g72x-g729-ast11
Recommends: asterisk (>= 1:18), asterisk (<< 1:17), asterisk-modules
Description: G.729 codec support for the Asterisk PBX
G.729 is a royalty-free narrow-band vocoder-based audio data
Expand All @@ -44,9 +68,10 @@ Depends:
${shlibs:Depends},
${misc:Depends}
Conflicts:
asterisk-g72x-g729-ast11,
asterisk-g72x-g729-ast22,
asterisk-g72x-g729-ast18,
asterisk-g72x-g729-ast13,
asterisk-g72x-g729-ast18
asterisk-g72x-g729-ast11
Recommends: asterisk (>= 1:16), asterisk (<< 1:17), asterisk-modules
Description: G.729 codec support for the Asterisk PBX
G.729 is a royalty-free narrow-band vocoder-based audio data
Expand All @@ -66,9 +91,10 @@ Depends:
${shlibs:Depends},
${misc:Depends}
Conflicts:
asterisk-g72x-g729-ast11,
asterisk-g72x-g729-ast22,
asterisk-g72x-g729-ast18,
asterisk-g72x-g729-ast16,
asterisk-g72x-g729-ast18
asterisk-g72x-g729-ast11
Recommends: asterisk (>= 1:13), asterisk (<< 1:14), asterisk-modules
Description: G.729 codec support for the Asterisk PBX
G.729 is a royalty-free narrow-band vocoder-based audio data
Expand All @@ -88,9 +114,10 @@ Depends:
${shlibs:Depends},
${misc:Depends}
Conflicts:
asterisk-g72x-g729-ast13,
asterisk-g72x-g729-ast22,
asterisk-g72x-g729-ast18,
asterisk-g72x-g729-ast16,
asterisk-g72x-g729-ast18
asterisk-g72x-g729-ast13
Recommends: asterisk (>= 1:11), asterisk (<< 1:12), asterisk-modules
Description: G.729 codec support for the Asterisk PBX
G.729 is a royalty-free narrow-band vocoder-based audio data
Expand Down
8 changes: 8 additions & 0 deletions rules
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ override_dh_auto_configure:
true

override_dh_auto_build:
# Build for 22.
rm -f config.log
dh_auto_clean
dh_auto_configure -- --with-asterisk180 --with-bcg729 \
--with-asterisk-includes=../asterisk-18/include \
--libdir=$(AST_LIBDIR)
dh_auto_build "$@"
mkdir /tmp/modules-22 && mv .libs/codec_g729.so /tmp/modules-22/
# Build for 18.
rm -f config.log
dh_auto_clean
Expand Down