├── compat ├── source ├── format └── options ├── .gitignore ├── libbcg729-0.install ├── libbcg729-dev.install ├── .dockerignore ├── patches ├── series ├── version.patch ├── enable-subdir-objects.patch ├── codebookqLSF-1.0.4+1.patch ├── patterns-md5-1.0.4+3.patch ├── bestIntPitchDelay-1.0.4+2.patch └── fix-tests.patch ├── watch ├── Dockerfile.buildmany ├── libbcg729-0.symbols ├── rules ├── README.rst ├── control ├── changelog ├── Dockerfile.build ├── copyright └── Dockerfile /compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /Dockerfile.out 2 | /.cache/ 3 | -------------------------------------------------------------------------------- /libbcg729-0.install: -------------------------------------------------------------------------------- 1 | usr/lib/*/lib*.so.* 2 | -------------------------------------------------------------------------------- /source/options: -------------------------------------------------------------------------------- 1 | extend-diff-ignore = "^test/testCampaign(All)?$|^test/bcg729-patterns\.zip$" 2 | -------------------------------------------------------------------------------- /libbcg729-dev.install: -------------------------------------------------------------------------------- 1 | usr/include/* 2 | usr/lib/*/lib*.a 3 | usr/lib/*/lib*.so 4 | usr/lib/*/pkgconfig/* 5 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | /Dockerfile.build 2 | /Dockerfile.buildmany 3 | /Dockerfile.out 4 | /Dockerfile 5 | 6 | /.dockerignore 7 | /.git 8 | /.gitignore 9 | /.*swp 10 | -------------------------------------------------------------------------------- /patches/series: -------------------------------------------------------------------------------- 1 | codebookqLSF-1.0.4+1.patch 2 | bestIntPitchDelay-1.0.4+2.patch 3 | patterns-md5-1.0.4+3.patch 4 | 5 | enable-subdir-objects.patch 6 | version.patch 7 | fix-tests.patch 8 | -------------------------------------------------------------------------------- /watch: -------------------------------------------------------------------------------- 1 | version=3 2 | 3 | opts=\ 4 | filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/bcg729-$1\.tar\.gz/,\ 5 | https://github.com/BelledonneCommunications/bcg729/tags .*/v?(\d\S*)\.tar\.gz 6 | -------------------------------------------------------------------------------- /Dockerfile.buildmany: -------------------------------------------------------------------------------- 1 | #!/bin/sh -ex 2 | #./Dockerfile.build ubuntu/xenial # ubu16.04 3 | #./Dockerfile.build ubuntu/bionic # ubu18.04 4 | #./Dockerfile.build debian/jessie # deb8 5 | ./Dockerfile.build debian/stretch # deb9 6 | ./Dockerfile.build debian/buster # deb10 7 | -------------------------------------------------------------------------------- /libbcg729-0.symbols: -------------------------------------------------------------------------------- 1 | libbcg729.so.0 #PACKAGE# #MINVER# 2 | bcg729Decoder@Base 1.0.0 3 | bcg729Encoder@Base 1.0.0 4 | bcg729GetRFC3389Payload@Base 1.0.3 5 | closeBcg729DecoderChannel@Base 1.0.0 6 | closeBcg729EncoderChannel@Base 1.0.0 7 | initBcg729DecoderChannel@Base 1.0.0 8 | initBcg729EncoderChannel@Base 1.0.0 9 | -------------------------------------------------------------------------------- /rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | 4 | # Uncomment this to turn on verbose mode. 5 | # export DH_VERBOSE=1 6 | 7 | # Uncomment this to change the hardening options 8 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all 9 | 10 | DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) 11 | 12 | %: 13 | dh $@ --buildsystem=cmake --without autoreconf 14 | 15 | override_dh_auto_configure: 16 | dh_auto_configure -- -DENABLE_STATIC=YES -DENABLE_TESTS=NO 17 | -------------------------------------------------------------------------------- /patches/version.patch: -------------------------------------------------------------------------------- 1 | Description: Update version in configure.ac from 1.0.3 to 1.0.4 2 | Because we now run autogen.sh, we get newly built files with the 3 | configure.ac based versions. 4 | Author: Walter Doekes 5 | Forwarded: no 6 | Last-Update: 2018-04-10 7 | 8 | --- a/configure.ac 9 | +++ b/configure.ac 10 | @@ -3,7 +3,7 @@ 11 | 12 | 13 | 14 | -AC_INIT([bcg729],[1.0.3]) 15 | +AC_INIT([bcg729],[1.0.4]) 16 | AC_CANONICAL_SYSTEM 17 | AC_PREREQ(2.63) 18 | AC_CONFIG_SRCDIR([src/encoder.c]) 19 | -------------------------------------------------------------------------------- /patches/enable-subdir-objects.patch: -------------------------------------------------------------------------------- 1 | Description: Enable subdir-objects in Automake 2 | Author: Felix Lechner 3 | Forwarded: no 4 | Last-Update: 2015-05-16 5 | --- 6 | This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ 7 | --- a/configure.ac 8 | +++ b/configure.ac 9 | @@ -8,7 +8,7 @@ AC_CANONICAL_SYSTEM 10 | AC_PREREQ(2.63) 11 | AC_CONFIG_SRCDIR([src/encoder.c]) 12 | AC_CONFIG_MACRO_DIR([m4]) 13 | -AM_INIT_AUTOMAKE([tar-ustar --warnings=no-portability]) 14 | +AM_INIT_AUTOMAKE([tar-ustar subdir-objects --warnings=no-portability]) 15 | LT_INIT 16 | AC_PROG_CC 17 | AC_CONFIG_HEADERS(config.h) 18 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | OSSO build of the Bcg729 shared library (G729 speech codec) 2 | =========================================================== 3 | 4 | *NOTE: This package is obsolete now that there is libbcg729-0 in vanilla 5 | Debian/Ubuntu.* 6 | 7 | 8 | Docker build 9 | ------------ 10 | 11 | Just do:: 12 | 13 | ./Dockerfile.build 14 | 15 | And it will create the build files in ``Dockerfile.out/``. 16 | 17 | For example:: 18 | 19 | $ dpkg-deb -c stretch/bcg729_1.0.4-0osso3+deb9/libbcg729-0_1.0.4-0osso3+deb9_amd64.deb 20 | 55,864 /usr/lib/x86_64-linux-gnu/libbcg729.so.0.0.0 21 | 691 /usr/share/doc/libbcg729-0/changelog.Debian.gz 22 | 3,459 /usr/share/doc/libbcg729-0/copyright 23 | 0 /usr/lib/x86_64-linux-gnu/libbcg729.so.0 -> libbcg729.so.0.0.0 24 | -------------------------------------------------------------------------------- /patches/codebookqLSF-1.0.4+1.patch: -------------------------------------------------------------------------------- 1 | From a71e68587dda27eec55dda62a75cb7fd486cec2a Mon Sep 17 00:00:00 2001 2 | From: JaccoCompier 3 | Date: Thu, 11 May 2017 21:49:10 +0200 4 | Subject: [PATCH] Update decodeLSP.c 5 | 6 | codebookqLSF check started on index 1 instead of index 0 7 | --- 8 | src/decodeLSP.c | 4 ++-- 9 | 1 file changed, 2 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/src/decodeLSP.c b/src/decodeLSP.c 12 | index d2e6576..1d4b217 100644 13 | --- a/src/decodeLSP.c 14 | +++ b/src/decodeLSP.c 15 | @@ -95,8 +95,8 @@ void computeqLSF(word16_t *codebookqLSF, word16_t previousLCodeWord[MA_MAX_K][NB 16 | insertionSort(codebookqLSF, NB_LSP_COEFF); 17 | 18 | /* check for low limit on qLSF[0] */ 19 | - if (codebookqLSF[1] 3 | Date: Fri, 16 Feb 2018 17:21:06 +0700 4 | Subject: [PATCH] Patterns updated to match previous commits if tests fail 5 | please delete the test/pattern directory this will trigger the download of 6 | updated patterns 7 | 8 | --- 9 | test/testCampaignAll.cmake | 2 +- 10 | 1 file changed, 1 insertion(+), 1 deletion(-) 11 | 12 | diff --git a/test/testCampaignAll.cmake b/test/testCampaignAll.cmake 13 | index 1ae203a..a76dfc8 100755 14 | --- a/test/testCampaignAll.cmake 15 | +++ b/test/testCampaignAll.cmake 16 | @@ -10,7 +10,7 @@ if [ ! -d "patterns" ]; then 17 | wget http://www.belledonne-communications.com/downloads/bcg729-patterns.zip 18 | if [ -e bcg729-patterns.zip ]; then 19 | # check file 20 | - if [[ `openssl md5 bcg729-patterns.zip | grep -c a8a998f6838b052d05ba06d02b8612a1` -ne 0 ]]; then 21 | + if [[ `openssl md5 bcg729-patterns.zip | grep -c ee5702e17cff8484d1396e6f23f84305` -ne 0 ]]; then 22 | # file ok, unzip it 23 | unzip bcg729-patterns.zip 24 | if [[ $? -ne 0 ]]; then 25 | -------------------------------------------------------------------------------- /control: -------------------------------------------------------------------------------- 1 | Source: bcg729 2 | Priority: optional 3 | Maintainer: Debian VoIP Team 4 | Uploaders: Mark Purcell , Kilian Krause , Tzafrir Cohen 5 | Build-Depends: 6 | cmake, 7 | debhelper (>= 9), 8 | autotools-dev, 9 | dh-autoreconf, 10 | pkg-config, 11 | unzip, 12 | wget 13 | Standards-Version: 3.9.6 14 | Section: libs 15 | Homepage: http://www.linphone.org/technical-corner/bcg729/overview 16 | Vcs-Browser: https://github.com/BelledonneCommunications/bcg729 17 | Vcs-Git: git://git.linphone.org/bcg729.git 18 | 19 | Package: libbcg729-0 20 | Architecture: any 21 | Multi-Arch: same 22 | Pre-Depends: ${misc:Pre-Depends} 23 | Depends: 24 | ${shlibs:Depends}, 25 | ${misc:Depends} 26 | Description: ITU G.729 Annex A compatible audio codec 27 | Bcg729 is an open source implementation of the ITU G729 Annex A 28 | speech codec. Written in C 99, the library is fully portable. It 29 | runs on many platforms, including ARM and x86. 30 | . 31 | Bcg729 supports concurrent channels encoding/decoding for multi 32 | call application such as conferencing. 33 | . 34 | The project was developed as part of mediastreamer2, Linphone's 35 | media processing engine. 36 | 37 | Package: libbcg729-dev 38 | Section: libdevel 39 | Architecture: any 40 | Multi-Arch: same 41 | Depends: 42 | libbcg729-0 (= ${binary:Version}), 43 | ${misc:Depends} 44 | Description: Development files for the ITU G.729 compatible audio codec 45 | Bcg729 is an open source implementation of the ITU G729 Annex A 46 | speech codec. Written in C 99, the library is fully portable. It 47 | runs on many platforms, including ARM and x86. 48 | . 49 | This package contains the development files. 50 | -------------------------------------------------------------------------------- /patches/bestIntPitchDelay-1.0.4+2.patch: -------------------------------------------------------------------------------- 1 | From 527d67349372c0ed8c6a11e5a5b7528111a520e9 Mon Sep 17 00:00:00 2001 2 | From: JaccoCompier 3 | Date: Thu, 11 May 2017 21:59:29 +0200 4 | Subject: [PATCH] Update postFilter.c 5 | 6 | While calculation the best pitch delay (bestIntPitchDelay) the lower bounds of range was not calculated correctly near the maximun range. 7 | --- 8 | src/postFilter.c | 8 +++----- 9 | 1 file changed, 3 insertions(+), 5 deletions(-) 10 | 11 | diff --git a/src/postFilter.c b/src/postFilter.c 12 | index 4450bac..44c93ef 100644 13 | --- a/src/postFilter.c 14 | +++ b/src/postFilter.c 15 | @@ -62,7 +62,6 @@ void postFilter(bcg729DecoderChannelContextStruct *decoderChannelContext, word16 16 | word16_t *residualSignal; 17 | word16_t *scaledResidualSignal; 18 | word32_t correlationMax = (word32_t)MININT32; 19 | - int16_t intPitchDelayMax; 20 | int16_t bestIntPitchDelay = 0; 21 | word16_t *delayedResidualSignal; 22 | word32_t residualSignalEnergy = 0; /* in Q-4 */ 23 | @@ -113,12 +112,11 @@ void postFilter(bcg729DecoderChannelContextStruct *decoderChannelContext, word16 24 | 25 | /*** Compute the maximum correlation on scaledResidualSignal delayed by intPitchDelay +/- 3 to get the best delay. Spec 4.2.1 eq80 ***/ 26 | /* using a scaled(Q-2) signals gives correlation in Q-4. */ 27 | - intPitchDelayMax = intPitchDelay+3; /* intPitchDelayMax shall be < MAXIMUM_INT_PITCH_DELAY(143) */ 28 | - if (intPitchDelayMax>MAXIMUM_INT_PITCH_DELAY) { 29 | - intPitchDelayMax = MAXIMUM_INT_PITCH_DELAY; 30 | + if (intPitchDelay>MAXIMUM_INT_PITCH_DELAY-3) { /* intPitchDelay shall be < MAXIMUM_INT_PITCH_DELAY-3 (140) */ 31 | + intPitchDelay = MAXIMUM_INT_PITCH_DELAY-3; 32 | } 33 | 34 | - for (i=intPitchDelay-3; i<=intPitchDelayMax; i++) { 35 | + for (i=intPitchDelay-3; i<=intPitchDelay+3; i++) { 36 | word32_t correlation = 0; 37 | delayedResidualSignal = &(scaledResidualSignal[-i]); /* delayedResidualSignal points to scaledResidualSignal[-i] */ 38 | 39 | -------------------------------------------------------------------------------- /changelog: -------------------------------------------------------------------------------- 1 | bcg729 (1.1.1-0osso1+REL) stable; urgency=medium 2 | 3 | * Fix control file after Dockerfile cosmetic change and build breakage. 4 | No actual difference against 1.1.1-0osso0. 5 | 6 | -- Walter Doekes Thu, 01 Sep 2022 18:45:00 +0200 7 | 8 | bcg729 (1.1.1-0osso0+REL) stable; urgency=medium 9 | 10 | * Bump to 1.1.1. 11 | * Obsolete this package, as vanilla debian has this. 12 | 13 | -- Walter Doekes Fri, 24 Jun 2022 16:10:30 +0200 14 | 15 | bcg729 (1.0.4-0osso3+deb9) stretch; urgency=medium 16 | 17 | * Renamed from +d9 to +deb9 again. 18 | * Updated dockerfiles for more convenient building, added a 19 | Dockerfile.buildmany to build for multiple OS environments sequentially. 20 | 21 | -- Walter Doekes Thu, 12 Dec 2019 17:12:48 +0100 22 | 23 | bcg729 (1.0.4-0osso2+d9) stretch; urgency=medium 24 | 25 | * Rename from +deb9 to +d9. 26 | * Add ./Docker.build to build instructions. 27 | * Add missing wget/unzip to control file (required by tests). 28 | 29 | -- Walter Doekes Mon, 17 Sep 2018 17:37:29 +0200 30 | 31 | bcg729 (1.0.4-0osso1+deb9) stretch; urgency=medium 32 | 33 | * Bump bcg729 lib to 1.0.4; fix version in configure.ac. 34 | * Build for stretch. 35 | * Drop upstream-fixed install-codec-library-normally.patch. 36 | * Hacks so we can test again. Also add necessary fixes from upstream 37 | against 1.4. 38 | 39 | -- Walter Doekes Tue, 10 Apr 2018 11:29:42 +0200 40 | 41 | bcg729 (1.0.3-0osso1~deb8) jessie; urgency=medium 42 | 43 | * Release for Asterisk G.729 codec: asterisk-g72x-g729. 44 | See: https://github.com/ossobv/asterisk-g72x-deb 45 | * Remove all mediastreamer stuff that we don't need. 46 | 47 | -- Walter Doekes Fri, 09 Jun 2017 16:10:20 +0200 48 | 49 | bcg729 (1.0.0-1) unstable; urgency=medium 50 | 51 | * Initial release (Closes: #785480) 52 | 53 | -- Felix Lechner Sat, 16 May 2015 14:03:19 -0700 54 | -------------------------------------------------------------------------------- /Dockerfile.build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd "$(dirname "$0")" # jump to curdir 3 | set -eu 4 | 5 | # Pass these on the command line. 6 | oscodename=${1:-debian/bullseye} # debian/stretch 7 | upname=bcg729 8 | upversion=${2:-1.1.1} # bcg729 version 9 | debepoch= 10 | debversion=${3:-0osso1} # deb build version, e.g. 0osso2 11 | 12 | echo "Usage: $0 [$oscodename [$upversion [$debversion]]]" 13 | echo ".. continuing" 14 | 15 | osdistro=${oscodename%/*} # debian (or ubuntu) 16 | oscodename=${oscodename#*/} # stretch (or bionic) 17 | case $osdistro/$oscodename in 18 | debian/bullseye)osdistshort=deb; oscodenum=11;; 19 | debian/buster) osdistshort=deb; oscodenum=10;; 20 | debian/stretch) osdistshort=deb; oscodenum=9;; 21 | debian/jessie) osdistshort=deb; oscodenum=8;; 22 | debian/wheezy) osdistshort=deb; oscodenum=7;; 23 | ubuntu/jammy) osdistshort=ubu; oscodenum=22.04;; 24 | ubuntu/focal) osdistshort=ubu; oscodenum=20.04;; 25 | ubuntu/bionic) osdistshort=ubu; oscodenum=18.04;; 26 | ubuntu/xenial) osdistshort=ubu; oscodenum=16.04;; 27 | ubuntu/trusty) osdistshort=ubu; oscodenum=14.04;; 28 | *) echo "ERROR: undefined OS: $osdistro/$oscodename" >&2 && exit 1 29 | esac 30 | _shortver=$osdistshort$oscodenum 31 | 32 | # Docker disallows certain tokens in versions. 33 | dockversion=$(echo build-${upname}-${upversion}-${debversion}-${oscodename} | 34 | sed -e 's/[^0-9A-Za-z_.-]/_/g') 35 | 36 | # Will build files. 37 | docker build \ 38 | --pull \ 39 | --ulimit nofile=512 \ 40 | --build-arg osdistro=$osdistro \ 41 | --build-arg osdistshort=$osdistshort \ 42 | --build-arg oscodename=$oscodename \ 43 | --build-arg upname=$upname \ 44 | --build-arg upversion=$upversion \ 45 | --build-arg debepoch=$debepoch \ 46 | --build-arg debversion=$debversion \ 47 | -t $dockversion \ 48 | -f Dockerfile \ 49 | . || ret=$? 50 | if test ${ret:-0} -ne 0; then 51 | echo "fail" >&2 52 | exit $ret 53 | fi 54 | 55 | # Copy files to ./Dockerfile.out 56 | test -d Dockerfile.out/$oscodename || mkdir -p Dockerfile.out/$oscodename 57 | docker run $dockversion sh -c 'cd /dist; tar -zc *' | 58 | tar -zxvC Dockerfile.out/$oscodename/ | 59 | sed -e 's#$# -> Dockerfile.out/'$oscodename'/#' 60 | -------------------------------------------------------------------------------- /patches/fix-tests.patch: -------------------------------------------------------------------------------- 1 | Description: Fix so tests work with non-cmake dpkg-buildpackage 2 | The tests failed to run because the CMAKE paths weren't expanded and 3 | other paths did not work as expected. Fix the paths. Also cache the 4 | bcg720-patterns.zip download. 5 | Author: Walter Doekes 6 | Forwarded: no 7 | Last-Update: 2018-04-10 8 | 9 | --- a/test/testCampaignAll.cmake 10 | +++ b/test/testCampaignAll.cmake 11 | @@ -4,10 +4,13 @@ 12 | 13 | # Do we have a patterns directory 14 | if [ ! -d "patterns" ]; then 15 | - rm -f ./bcg729-patterns.zip 16 | # no pattern directory: download it from 17 | # http://www.belledonne-communications.com/downloads/bcg729-patterns.zip 18 | - wget http://www.belledonne-communications.com/downloads/bcg729-patterns.zip 19 | + # reuse cached copy if available 20 | + if [ ! -f ./bcg729-patterns.zip ] || ! openssl md5 bcg729-patterns.zip | grep -q ee5702e17cff8484d1396e6f23f84305; then 21 | + rm -f ./bcg729-patterns.zip 22 | + wget https://linphone.org/bc-downloads/bcg729-patterns.zip 23 | + fi 24 | if [ -e bcg729-patterns.zip ]; then 25 | # check file 26 | if [[ `openssl md5 bcg729-patterns.zip | grep -c ee5702e17cff8484d1396e6f23f84305` -ne 0 ]]; then 27 | @@ -16,7 +19,8 @@ if [ ! -d "patterns" ]; then 28 | if [[ $? -ne 0 ]]; then 29 | echo "Error: unable to unzip correctly bcg729-patterns.zip, try to do it manually" 30 | else 31 | - rm bcg729-patterns.zip 32 | + # rm bcg729-patterns.zip 33 | + true # keep copy for reuse 34 | fi 35 | else 36 | echo "Error: bad checksum on bcg729-patterns.zip downloaded from http://www.belledonne-communications.com/downloads/.\nTry again" 37 | --- a/test/testCampaign.cmake 38 | +++ b/test/testCampaign.cmake 39 | @@ -26,7 +26,7 @@ use Term::ANSIColor; 40 | # Tune the defaultMaxDiff associative array definition to modify 41 | # the behavior of this script for any functional bloc under test 42 | 43 | -my $binDirectory = "./"; 44 | +my $binDirectory = "./bin/"; 45 | my $patternDirectory = "./patterns"; 46 | # softDiff: compare two CSV files with a margin of acceptance between the values found 47 | # arguments : file1, file2, maximumDiff tolerated(value), maximum percentage abs((val1-val2)/val1)*100 tolerated 48 | --- a/test/Makefile.am 49 | +++ b/test/Makefile.am 50 | @@ -1,5 +1,15 @@ 51 | SUBDIRS = bin 52 | 53 | +$(srcdir)/testCampaign: 54 | + cp -f testCampaign.cmake $(srcdir)/testCampaign 55 | + sed -e 's/@CMAKE_CURRENT_BINARY_DIR@/$(srcdir)/g' testCampaign.cmake >$(srcdir)/testCampaign 56 | + chmod 755 $(srcdir)/testCampaign 57 | + 58 | +$(srcdir)/testCampaignAll: 59 | + cp -f testCampaignAll.cmake $(srcdir)/testCampaignAll 60 | + sed -e 's/@CMAKE_CURRENT_BINARY_DIR@/$(srcdir)/g' testCampaignAll.cmake >$(srcdir)/testCampaignAll 61 | + chmod 755 $(srcdir)/testCampaignAll 62 | + 63 | testCampaignAll-exec: $(srcdir)/testCampaignAll $(srcdir)/testCampaign 64 | cp -f $(srcdir)/testCampaignAll testCampaignAll-exec 65 | cp -f $(srcdir)/testCampaign testCampaign-exec 66 | -------------------------------------------------------------------------------- /copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: bcg729 3 | Upstream-Contact: Simon Morlat 4 | Source: https://github.com/BelledonneCommunications/bcg729/tags 5 | 6 | Files: * 7 | Copyright: 2011 Belledonne Communications, Grenoble, France 8 | License: GPL-2+ 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License 11 | as published by the Free Software Foundation; either version 2 12 | of the License, or (at your option) any later version. 13 | . 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | . 19 | You should have received a copy of the GNU General Public License 20 | along with this program; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin St, Fifth Floor, 22 | Boston, MA 02110-1301, USA. 23 | . 24 | On Debian systems, the complete text of the GNU General 25 | Public License version 2 can be found in 26 | "/usr/share/common-licenses/GPL-2". 27 | 28 | Files: include/MSVC/stdint.h 29 | Copyright: 2006-2008 Alexander Chemeris 30 | License: BSD-2-clause 31 | Redistribution and use in source and binary forms, with or without 32 | modification, are permitted provided that the following conditions are met: 33 | . 34 | 1. Redistributions of source code must retain the above copyright notice, 35 | this list of conditions and the following disclaimer. 36 | . 37 | 2. Redistributions in binary form must reproduce the above copyright 38 | notice, this list of conditions and the following disclaimer in the 39 | documentation and/or other materials provided with the distribution. 40 | . 41 | 3. The name of the author may be used to endorse or promote products 42 | derived from this software without specific prior written permission. 43 | . 44 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 45 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 46 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 47 | EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 48 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 49 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 50 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 51 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 52 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 53 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 54 | 55 | Files: debian/* 56 | Copyright: 2015 Felix Lechner 57 | License: GPL-2+ 58 | This package is free software; you can redistribute it and/or modify 59 | it under the terms of the GNU General Public License as published by 60 | the Free Software Foundation; either version 2 of the License, or 61 | (at your option) any later version. 62 | . 63 | This package is distributed in the hope that it will be useful, 64 | but WITHOUT ANY WARRANTY; without even the implied warranty of 65 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 66 | GNU General Public License for more details. 67 | . 68 | You should have received a copy of the GNU General Public License 69 | along with this program. If not, see 70 | . 71 | On Debian systems, the complete text of the GNU General 72 | Public License version 2 can be found in 73 | "/usr/share/common-licenses/GPL-2". 74 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG osdistro=debian 2 | ARG oscodename=stretch 3 | 4 | FROM $osdistro:$oscodename 5 | LABEL maintainer="Walter Doekes " 6 | LABEL dockerfile-vcs=https://github.com/ossobv/bcg729-deb 7 | 8 | ARG DEBIAN_FRONTEND=noninteractive 9 | 10 | # This time no "keeping the build small". We only use this container for 11 | # building/testing and not for running, so we can keep files like apt 12 | # cache. We do this before copying anything and before getting lots of 13 | # ARGs from the user. That keeps this bit cached. 14 | RUN echo 'APT::Install-Recommends "0";' >/etc/apt/apt.conf.d/01norecommends 15 | # We'll be ignoring "debconf: delaying package configuration, since apt-utils 16 | # is not installed" 17 | RUN apt-get update -q && \ 18 | apt-get dist-upgrade -y && \ 19 | apt-get install -y \ 20 | ca-certificates curl \ 21 | build-essential devscripts dh-autoreconf dpkg-dev equivs quilt && \ 22 | printf "%s\n" \ 23 | QUILT_PATCHES=debian/patches QUILT_NO_DIFF_INDEX=1 \ 24 | QUILT_NO_DIFF_TIMESTAMPS=1 'QUILT_DIFF_OPTS="--show-c-function"' \ 25 | 'QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"' \ 26 | >~/.quiltrc 27 | 28 | # Apt-get prerequisites according to control file. 29 | COPY control /build/debian/control 30 | RUN mk-build-deps --install --remove --tool "apt-get -y" /build/debian/control 31 | 32 | # debian, deb, stretch, bcg729, 1.0.4, '', 0osso1 33 | ARG osdistro osdistshort oscodename upname upversion debepoch= debversion 34 | 35 | COPY changelog /build/debian/changelog 36 | RUN . /etc/os-release && \ 37 | sed -i -e "1s/+[^+)]*)/+${osdistshort}${VERSION_ID})/;1s/) stable;/) ${oscodename};/" \ 38 | /build/debian/changelog && \ 39 | fullversion="${upversion}-${debversion}+${osdistshort}${VERSION_ID}" && \ 40 | expected="${upname} (${debepoch}${fullversion}) ${oscodename}; urgency=medium" && \ 41 | head -n1 /build/debian/changelog && \ 42 | if test "$(head -n1 /build/debian/changelog)" != "${expected}"; \ 43 | then echo "${expected} <-- mismatch" >&2; false; fi 44 | 45 | # Trick to allow caching of UPNAME*.tar.gz files. Download them 46 | # once using the curl command below into .cache/* if you want. The COPY 47 | # is made conditional by the "[z]" "wildcard". (We need one existing 48 | # file (README.rst) so the COPY doesn't fail.) 49 | COPY ./README.rst .cache/${upname}_${upversion}.orig.tar.g[z] /build/ 50 | # https://github.com/BelledonneCommunications/bcg729/tags 51 | RUN if ! test -s /build/${upname}_${upversion}.orig.tar.gz; then \ 52 | url="https://github.com/BelledonneCommunications/bcg729/archive/refs/tags/${upversion}.tar.gz" && \ 53 | echo "Fetching: ${url}" >&2 && \ 54 | curl -fLsS "${url}" -o /build/${upname}_${upversion}.orig.tar.gz; fi 55 | # 0234814618a4314cb56ae0b9084d1ae1 = 1.0.4 56 | # 3e8277a684b8060c60bf9fb5ef99920b = 1.1.1 57 | RUN test $(md5sum /build/bcg729_${upversion}.orig.tar.gz | awk '{print $1}') = 3e8277a684b8060c60bf9fb5ef99920b 58 | RUN cd /build && tar zxf "${upname}_${upversion}.orig.tar.gz" && \ 59 | mv debian "${upname}-${upversion}/" 60 | COPY compat control copyright libbcg729-0.install libbcg729-0.symbols \ 61 | libbcg729-dev.install patches rules source watch \ 62 | /build/${upname}-${upversion}/debian/ 63 | WORKDIR /build/${upname}-${upversion} 64 | 65 | # Build! 66 | RUN DEB_BUILD_OPTIONS=parallel=6 dpkg-buildpackage -us -uc -sa 67 | 68 | # TODO: for bonus points, we could run quick tests here; 69 | # for starters dpkg -i tests? 70 | 71 | # Write output files (store build args in ENV first). 72 | ENV oscodename=$oscodename osdistshort=$osdistshort \ 73 | upname=$upname upversion=$upversion debversion=$debversion 74 | RUN . /etc/os-release && fullversion=${upversion}-${debversion}+${osdistshort}${VERSION_ID} && \ 75 | mkdir -p /dist/${upname}_${fullversion} && \ 76 | mv /build/${upname}_${upversion}.orig.tar.gz /dist/${upname}_${fullversion}/ && \ 77 | mv /build/*${fullversion}* /dist/${upname}_${fullversion}/ && \ 78 | cd / && find dist/${upname}_${fullversion} -type f >&2 79 | --------------------------------------------------------------------------------