updated on Fri Jan 20 04:00:45 UTC 2012
[aur-mirror.git] / asterisk16 / PKGBUILD
blob7c4c66c1257df7331928f1b7eac715d87b0b8791
1 # Contributor: Jonathan Liu <net147@gmail.com>
2 pkgname=asterisk16
3 _realpkgname=asterisk
4 pkgver=1.6.2.20
5 pkgrel=2
6 pkgdesc="A complete PBX solution"
7 arch=('i686' 'x86_64')
8 url="http://www.asterisk.org/"
9 license=('GPL2')
10 depends=('alsa-lib' 'libcap' 'libnewt' 'libvorbis' 'libxml2' 'openssl' 'popt' 'unixodbc')
11 makedepends=('imap' 'libresample' 'libusb'
12              'curl' 'dahdi' 'dahdi-tools' 'freetds'
13              'jack' 'gmime' 'iksemel' 'libldap'
14              'libpri' 'lua' 'net-snmp' 'postgresql-libs' 'radiusclient-ng'
15              'sdl' 'speex' 'sqlite3')
16 optdepends=('curl: CURL support'
17             'dahdi: DAHDI support'
18             'dahdi-tools: DAHDI support'
19             'freetds: Sybase and MS SQL Server database support'
20             'jack: JACK Audio Connection Kit support'
21             'gmime: HTTP POST upload support'
22             'iksemel: GTalk, Jingle and Jabber support'
23             'libldap: LDAP support'
24             'libpri: DAHDI Primary Rate ISDN support'
25             'lua: LUA scripting support'
26             'net-snmp: SNMP support'
27             'postgresql-libs: PostgreSQL database support'
28             'radiusclient-ng: RADIUS support'
29             'sdl: OSS support'
30             'speex: Speex codec support'
31             'sqlite3: SQLite database support')
32 provides=("asterisk=${pkgver}")
33 conflicts=('asterisk')
34 backup=('etc/asterisk/asterisk.conf')
35 source=("http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-$pkgver.tar.gz"
36         "http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-en-gsm-1.4.22.tar.gz"
37         "http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-en-gsm-1.4.22.tar.gz.sha1"
38         "http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-moh-opsound-wav-2.03.tar.gz"
39         "http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-moh-opsound-wav-2.03.tar.gz.sha1"
40         "Makefile.patch"
41         "logrotate.patch"
42         "asterisk")
43 install="${pkgname}.install"
44 md5sums=('70d14a8748cffe0c28125328d88f8374'
45          '2a99a45c0675135255bc65796b12f7c6'
46          'af248890a947e30d0838dced58276656'
47          '8277e2c693fd056773b1c15e4d52077d'
48          '011fa4dc9fe35dc3d34ed557bb04263f'
49          '4800ea15d8fce3788f1a2a9fcc2abf18'
50          'af4d636d86b2cb0a26dd063f8589e1cc'
51          '59146273738605f1e011d8e7bed3561a')
53 build() {
54   cd "${srcdir}/${_realpkgname}-${pkgver}"
56   ln -sf "$srcdir/asterisk-core-sounds-en-gsm-1.4.22.tar.gz" "sounds/"
57   ln -sf "$srcdir/asterisk-core-sounds-en-gsm-1.4.22.tar.gz.sha1" "sounds/"
58   ln -sf "$srcdir/asterisk-moh-opsound-wav-2.03.tar.gz" "sounds/"
59   ln -sf "$srcdir/asterisk-moh-opsound-wav-2.03.tar.gz.sha1" "sounds/"
61   patch -Np1 -i "${srcdir}/Makefile.patch" || return 1
62   patch -Np1 -i "${srcdir}/logrotate.patch" || return 1
63   ./configure --prefix=/usr --sysconfdir=/etc --without-h323 --without-pwlib
65   # Uncomment one of the following lines to configure Asterisk
66   #make menuconfig || return 1
67   #make cmenuconfig || return 1
68   #make gmenuconfig || return 1
69   #make nmenuconfig || return 1
71   make || return 1
72   # make h323 
73   make DESTDIR="${pkgdir}" samples || return 1
76 package() {
77   cd "${srcdir}/${_realpkgname}-${pkgver}"
79   make DESTDIR="${pkgdir}" install || return 1
80   make DESTDIR="${pkgdir}" install-logrotate || return 1
81   
82   cd contrib/utils
83   gcc ${CXXFLAGS} rawplayer.c -o "${pkgdir}/usr/sbin/rawplayer"
84   cd ../..
86   (cd "${pkgdir}/etc/asterisk" &&
87   ls -I asterisk.conf | xargs -I '{}' mv '{}' '{}.default')
88   sed -i -e "s#/var/run#/var/run/asterisk#" "${pkgdir}/etc/asterisk/asterisk.conf"
89   
90   install -d "${pkgdir}/var/run/asterisk"
91   install -D -m755 "${srcdir}/asterisk" "${pkgdir}/etc/rc.d/asterisk"
94 # vim:set ts=2 sw=2 et: