summaryrefslogtreecommitdiffstats
path: root/testing/asterisk/APKBUILD
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-09-05 11:50:40 +0300
committerTimo Teräs <timo.teras@iki.fi>2012-09-05 11:53:13 +0300
commite41af81a83fd767c98c8c5bdba7def5da868163b (patch)
tree7751b089cbb2e4473c2c5193b06799f2f99b364c /testing/asterisk/APKBUILD
parentf5ea352121c614e1abdd86e67ba9c8c3827eb653 (diff)
downloadaports-e41af81a83fd767c98c8c5bdba7def5da868163b.tar.bz2
aports-e41af81a83fd767c98c8c5bdba7def5da868163b.tar.xz
testing/asterisk: fork main/asterisk and upgrade to 11.0.0-beta1
* remove patches upstreamed ASTERISK-18977 and 900-tryinclude.patch * add ASTERISK-20362 required to fix parallel compile issues * rebase the ConfBridge 'deaf participant' patch ASTERISK-19109
Diffstat (limited to 'testing/asterisk/APKBUILD')
-rw-r--r--testing/asterisk/APKBUILD191
1 files changed, 191 insertions, 0 deletions
diff --git a/testing/asterisk/APKBUILD b/testing/asterisk/APKBUILD
new file mode 100644
index 000000000..82768e994
--- /dev/null
+++ b/testing/asterisk/APKBUILD
@@ -0,0 +1,191 @@
+# Contributor: Timo Teras <timo.teras@iki.fi>
+# Maintainer: Timo Teras <timo.teras@iki.fi>
+pkgname=asterisk
+pkgver=11.0.0_beta1
+pkgrel=0
+pkgdesc="Asterisk: A Module Open Source PBX System"
+pkgusers="asterisk"
+pkggroups="asterisk"
+url="http://www.asterisk.org/"
+arch="all"
+license="GPL"
+depends=
+makedepends="autoconf automake libtool ncurses-dev popt-dev newt-dev zlib-dev
+ postgresql-dev unixodbc-dev dahdi-tools-dev libpri-dev tar
+ freetds-dev openssl-dev lua-dev alsa-lib-dev spandsp-dev tiff-dev
+ libresample sqlite-dev wget speex-dev libogg-dev bluez-dev"
+install="$pkgname.pre-install $pkgname.pre-upgrade"
+subpackages="$pkgname-dev $pkgname-doc $pkgname-pgsql $pkgname-odbc
+ $pkgname-tds $pkgname-fax $pkgname-sample-config:sample
+ $pkgname-sounds-moh:sound_moh $pkgname-sounds-en:sound_en
+ $pkgname-mobile"
+source="http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-${pkgver/_/-}.tar.gz
+ 100-uclibc-daemon.patch
+ 101-caps-uclibc.patch
+ ASTERISK-18995.patch
+ ASTERISK-19109.patch
+ ASTERISK-20362.patch
+ asterisk.initd
+ asterisk.confd
+ asterisk.logrotate"
+
+_builddir="$srcdir/$pkgname-${pkgver/_/-}"
+
+prepare() {
+ cd "$_builddir"
+ for i in ../[1-9A]*.patch; do
+ msg "Apply $i"
+ patch -p1 < $i || return 1
+ done
+
+ sed -i -e 's:lua5.1/::' pbx/pbx_lua.c
+ sed -i -e 's/PBX_ICONV=1/PBX_ICONV=0/g' configure.ac
+ sed -i -e 's/int foo = res_ninit(NULL);/res_ninit_is_not_really_here();/g' configure.ac
+
+ ./bootstrap.sh
+}
+
+build() {
+ cd "$_builddir"
+ SHA1SUM="$PWD"/build_tools/sha1sum-sh ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --libdir=/usr/lib \
+ --localstatedir=/var \
+ --disable-xmldoc --with-gsm=internal \
+ --without-iconv --with-popt --with-z --with-newt \
+ --with-unixodbc --with-postgres --with-tds \
+ --with-dahdi --with-pri --with-tonezone \
+ --with-resample \
+ --with-sqlite3 \
+ --with-speex \
+ --with-asound \
+ --without-x11 \
+ --with-spandsp \
+ --with-bluetooth \
+ || return 1
+
+ # and figure out which modules to build
+ rm menuselect.makeopts
+ make menuselect.makeopts
+ # enable chan_mobile
+ sed -i -e '/^MENUSELECT_ADDONS=/s/chan_mobile//' menuselect.makeopts
+ make ASTCFLAGS="$CFLAGS" ASTLDFLAGS="$LDFLAGS" || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make -j1 DESTDIR="$pkgdir" install
+
+ install -d "$pkgdir"/var/run/asterisk
+ install -d "$pkgdir"/var/lib/asterisk
+
+ install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+ install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
+ install -m644 -D "$srcdir"/$pkgname.logrotate \
+ "$pkgdir"/etc/logrotate.d/$pkgname
+
+ chown -R asterisk:asterisk "$pkgdir"/var/*/asterisk
+ chown -R asterisk:asterisk "$pkgdir"/etc/asterisk
+ chmod -R u=rwX,g=rX,o= "$pkgdir"/etc/asterisk
+}
+
+_move_dir() {
+ for DIR in "$@"; do
+ local dest=`dirname "$subpkgdir/$DIR"`
+ echo mkdir -p $dest
+ mkdir -p "$dest"
+ echo mv "$pkgdir"/$DIR $dest
+ mv "$pkgdir"/"$DIR" "$dest"
+ done
+}
+
+_find_and_move() {
+ local pattern="$1"
+ cd "$pkgdir" || return 1
+ find -name "$pattern" -type f | while read f; do
+ local dest="$subpkgdir/${f%/*}"
+ mkdir -p "$dest"
+ mv "$f" "$dest"
+ done
+}
+
+doc() {
+ default_doc
+}
+
+dev() {
+ default_dev
+ depends="asterisk"
+}
+
+pgsql() {
+ depends=
+ install=
+ _find_and_move '*_pgsql*'
+}
+
+odbc() {
+ depends=
+ install=
+ _find_and_move '*odbc*'
+}
+
+tds() {
+ depends=
+ install=
+ _find_and_move '*_tds*'
+}
+
+fax() {
+ depends=
+ install=
+ _find_and_move '*_fax*'
+}
+
+mobile() {
+ depends=
+ install=
+ _find_and_move '*_mobile*'
+}
+
+sample() {
+ arch="noarch"
+ pkgdesc="Sample configuration files for asterisk"
+ cd "$_builddir"
+ mkdir -p "$subpkgdir"/var/lib/asterisk/phoneprov
+ make -j1 samples DESTDIR="$subpkgdir"
+
+ chown -R asterisk:asterisk "$subpkgdir"/var/*/asterisk
+ chown -R asterisk:asterisk "$subpkgdir"/etc/asterisk
+ chmod -R u=rwX,g=rX,o= "$subpkgdir"/etc/asterisk
+}
+
+sound_moh() {
+ arch="noarch"
+ pkgdesc="Default on-hold music files for asterisk"
+ depends=
+ install=
+ _move_dir var/lib/asterisk/moh
+ chown -R asterisk:asterisk "$subpkgdir"/var/*/asterisk
+}
+
+sound_en() {
+ arch="noarch"
+ pkgdesc="English sound files for asterisk"
+ depends=
+ install=
+ _move_dir var/lib/asterisk/sounds/en
+ chown -R asterisk:asterisk "$subpkgdir"/var/*/asterisk
+}
+
+md5sums="a99bdeae82f80b25b093eba957581dd9 asterisk-11.0.0-beta1.tar.gz
+b00c9d98ce2ad445501248a197c6e436 100-uclibc-daemon.patch
+6e1129e30c4fd2c25c86c81685a485a9 101-caps-uclibc.patch
+bc6713f5434e07b79d3afdd155461d72 ASTERISK-18995.patch
+146befabe95798a67c58d8ac00d397a6 ASTERISK-19109.patch
+491aa86a1b3b6d1b9c8dd72314e9859f ASTERISK-20362.patch
+74cd25a5638a94ef51e9f4ede2fd28f2 asterisk.initd
+ed31d7ba37bcf8b0346dcf8593c395f0 asterisk.confd
+3e65172275684373e1a25c8a11224411 asterisk.logrotate"