APKBUILD 2.75 KB
Newer Older
1 2 3
# Contributor: Timo Teras <timo.teras@iki.fi>
# Maintainer: Timo Teras <timo.teras@iki.fi>
pkgname=asterisk
4
pkgver=1.6.0.19
5
pkgrel=1
6 7 8
pkgdesc="Asterisk: A Module Open Source PBX System"
url="http://www.asterisk.org/"
license="GPL"
9
depends=
10
makedepends="autoconf automake libtool ncurses-dev popt-dev newt-dev zlib-dev
11
	postgresql-dev unixodbc-dev dahdi-tools-dev libpri-dev tar
12
	freetds-dev openssl-dev lua-dev alsa-lib-dev"
13
install="$pkgname.pre-install $pkgname.pre-upgrade $pkgname.post-install"
14 15 16 17 18 19
subpackages="$pkgname-dev $pkgname-doc $pkgname-pgsql $pkgname-odbc
	$pkgname-tds"
source="http://downloads.digium.com/pub/asterisk/releases/$pkgname-$pkgver.tar.gz
	100-uclibc-daemon.patch
	101-caps-uclibc.patch
	102-gsm-pic.patch	
20 21
	103-rundir.patch
	201-incomplete.patch
22
	301-libpri-autoconf.patch
23
	asterisk.initd
24 25
	asterisk.confd
	asterisk.logrotate"
26 27 28 29 30 31 32 33

build() {
	cd "$srcdir/$pkgname-$pkgver"
	for i in ../[1-9]*.patch; do
		msg "Apply $i"
		patch -p1 < $i || return 1
	done

34
	sed -i -e 's:lua5.1/::' pbx/pbx_lua.c
35 36 37 38 39 40 41 42 43 44 45 46 47
	sed -i -e 's/PBX_ICONV=1/PBX_ICONV=0/g' configure.ac

	./bootstrap.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-odbc --with-postgres --with-tds \
		--with-dahdi --with-pri --with-tonezone \
48
		--with-asound \
49
		--without-x11 \
50 51 52 53 54 55 56 57
		|| return 1

	# and figure out which modules to build
	rm menuselect.makeopts
	make menuselect.makeopts
	make -j1 || return 1
	make -j1 DESTDIR="$pkgdir" install

58
	install -d "$pkgdir"/var/run/asterisk
59 60
	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
61 62
	install -m644 -D "$srcdir"/$pkgname.logrotate \
		"$pkgdir"/etc/logrotate.d/$pkgname
63 64 65 66 67 68 69 70 71 72 73 74 75
}

_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
}

pgsql() {
76
	depends=
77 78 79 80 81
	install=
	_find_and_move '*_pgsql*'
}

odbc() {
82
	depends=
83 84 85 86 87
	install=
	_find_and_move '*odbc*'
}

tds() {
88
	depends=
89 90 91 92
	install=
	_find_and_move '*_tds*'
}

93
md5sums="0cc80b05d2af374fb5e397513959a206  asterisk-1.6.0.19.tar.gz
94
b00c9d98ce2ad445501248a197c6e436  100-uclibc-daemon.patch
95
6e1129e30c4fd2c25c86c81685a485a9  101-caps-uclibc.patch
96
97b39fd9777a2521d4f9f095482b7ac2  102-gsm-pic.patch
97
5008f51c737ec91f5047519bc9f25b85  103-rundir.patch
98
57825b74526187075ff7cb6816c55467  201-incomplete.patch
99
5771a5ab34b187dbfe8e23950b04213b  301-libpri-autoconf.patch
100
0ce3219e05f55af884a7dc6b99c2b276  asterisk.initd
101 102
ed31d7ba37bcf8b0346dcf8593c395f0  asterisk.confd
3e65172275684373e1a25c8a11224411  asterisk.logrotate"