wok-6.x view asterisk/receipt @ rev 24998
Up rp-pppoe (3.15)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon May 16 10:11:22 2022 +0000 (2022-05-16) |
parents | 7cfc423aaa00 |
children |
line source
1 # SliTaz package receipt.
3 PACKAGE="asterisk"
4 VERSION="11.1.1"
5 CATEGORY="misc"
6 SHORT_DESC="Open Source PBX and telephony toolkit."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 EXTRA_SOURCE_FILES="rfc3951.txt"
11 WEB_SITE="https://www.asterisk.org/"
12 WGET_URL="http://downloads.asterisk.org/pub/telephony/asterisk/releases/$TARBALL"
13 CONFIG_FILES="/etc/asterisk"
14 TAGS="telephony"
16 DEPENDS="openssl ncurses zlib libogg libvorbis curl newt libusb-compat alsa-lib \
17 speex iksemel spandsp tiff radiusclient-ng nbs freetds libpostgresqlclient \
18 libmysqlclient libunixODBC popt dahdi libpri lua libcap attr net-snmp \
19 portaudio sqlite libkrb5 libcomerr3 libsdl libsdl-image libssl libxml2 bluez \
20 libldap libical neon util-linux-uuid opus codec2"
21 BUILD_DEPENDS="gtk+-dev libxml2-dev postgresql-dev libsdl-dev ncurses-dev \
22 gmime gmime-dev unixODBC-dev unixODBC openldap-dev openldap \
23 dahdi-linux dahdi-tools dahdi-dev \
24 newt-dev mysql-dev nbs-dev popt-dev neon-dev neon postgresql sqlite-dev \
25 openssl-dev lua-dev lua libpri-dev bluez-dev bluez portaudio-dev alsa-lib-dev \
26 libsdl-image-dev net-snmp iksemel libical-dev curl-dev libcap-dev iksemel-dev \
27 jack-audio-connection-kit-dev radiusclient-ng-dev radiusclient-ng \
28 libvorbis-dev speex-dev opus-dev codec2-dev autoconf automake libtool"
30 # What is the latest version available today?
31 current_version()
32 {
33 wget -O - $WEB_SITE 2>/dev/null | \
34 sed '/Available/!d;s|.*Asterisk ||;s|,* .*||;q'
35 }
37 # Rules to configure and make the package.
38 #
39 # Graphical configuration: 'make menuconfig' or 'make gmenuconfig'
40 #
41 compile_rules()
42 {
43 # according to https://issues.asterisk.org/jira/browse/ASTERISK-20576
44 # the message "Makefile:82: pjproject/build.mak: No such file or directory" is normal :-/
45 sed -i 's/>no</>yes</' addons/[acor]*.c
46 find * -name config.guess -o -name configure | xargs \
47 sed -i "s/(uname -m)/(echo $ARCH)/"
48 find * -name Makefile | xargs \
49 sed -i "s/(shell uname -m)/(shell echo $ARCH)/"
50 busybox sed -i 's/tar xof/tar xf/' sounds/Makefile
51 busybox sed -i '/LOG_ERROR, "The file/ {nd}' main/config.c
52 busybox sed -i 's/LOG_ERROR, "The file/LOG_WARNING, "The file/' \
53 main/config.c
54 busybox sed -i 's|lua5.1/||' pbx/pbx_lua.c
55 grep -rsl '^#define AST_PBX_MAX_STACK' * | xargs busybox sed -i \
56 's/define AST_PBX_MAX_STACK.*/define AST_PBX_MAX_STACK 1024/'
57 while read url ; do
58 [ -s $SOURCES_REPOSITORY/$(basename "$url") ] ||
59 wget --no-check-certificate -P $SOURCES_REPOSITORY "$url"
60 done <<EOT
61 http://www.ietf.org/rfc/rfc3951.txt
62 https://github.com/meetecho/asterisk-opus/raw/master/asterisk_opus%2Bvp8.diff
63 http://svn.code.sf.net/p/freetel/code/codec2/branches/0.5/asterisk-11/asterisk-11.8.1-codec2.patch
64 http://svn.code.sf.net/p/freetel/code/codec2/branches/0.5/asterisk-11/asterisk-11.8.1-opus-codec2.patch
65 EOT
66 cp $SOURCES_REPOSITORY/rfc3951.txt codecs/ilbc ||
67 cp $stuff/rfc3951.txt codecs/ilbc
68 [ -f codecs/ilbc/iLBC_define.h ] || ( cd codecs/ilbc &&
69 awk -f $stuff/extract-cfile.awk rfc3951.txt > /dev/null )
70 patch -p1 < $SOURCES_REPOSITORY/asterisk_opus%2Bvp8.diff
71 patch -p1 < $SOURCES_REPOSITORY/asterisk-11.8.1-opus-codec2.patch
72 mkdir -p $DESTDIR/usr/bin
73 ./bootstrap.sh
74 ./configure \
75 --prefix=/usr \
76 --sysconfdir=/etc \
77 --without-pwlib \
78 --with-dahdi=$WOK/dahdi/$(ls $WOK/dahdi/taz) \
79 --with-tonezone \
80 $CONFIGURE_ARGS &&
81 make -j 1 2>&1 | grep -v pjproject &&
82 make -j 1 DESTDIR=$DESTDIR install &&
83 make -j 1 DESTDIR=$DESTDIR samples &&
84 cd contrib/utils &&
85 gcc rawplayer.c -o $DESTDIR/usr/bin/rawplayer
86 }
88 # Rules to gen a SliTaz package suitable for Tazpkg.
89 genpkg_rules()
90 {
91 mkdir -p $fs/usr
92 cp -a $install/etc $fs
93 cp -a $install/var $fs
94 cp -a $install/usr/lib $fs/usr
95 cp -a $install/usr/sbin $fs/usr
96 cp -a $stuff/*/ $fs
97 rm -f $fs/usr/lib/libasteriskssl.so
98 ln -s libasteriskssl.so.1 $fs/usr/lib/libasteriskssl.so
99 }
101 # Rules to configure package
102 setup_rules()
103 {
104 case "$2" in
105 mysql_host)
106 sed -i "s|^hostname=.*|hostname=$3|" "$1/etc/asterisk/cdr_mysql.conf"
107 sed -i "s|^dbhost=.*|dbhost=$3|" "$1/etc/asterisk/res_mysql.conf"
108 ;;
109 mysql_user)
110 sed -i "s|^user=.*|user=$3|" "$1/etc/asterisk/cdr_mysql.conf"
111 sed -i "s|^dbuser=.*|dbuser=$3|" "$1/etc/asterisk/res_mysql.conf"
112 ;;
113 mysql_password)
114 sed -i "s|^password=.*|password=$3|" "$1/etc/asterisk/cdr_mysql.conf"
115 sed -i "s|^dbpass=.*|dbpass=$3|" "$1/etc/asterisk/res_mysql.conf"
116 ;;
117 mysql_database)
118 sed -i "s|^dbname=.*|dbname=$3|" "$1/etc/asterisk/res_mysql.conf" \
119 "$1/etc/asterisk/cdr_mysql.conf"
120 ;;
121 pgsql_host)
122 sed -i "s|^hostname=.*|hostname=$3|" "$1/etc/asterisk/cdr_pgsql.conf"
123 sed -i "s|^dbhost=.*|dbhost=$3|" "$1/etc/asterisk/res_pgsql.conf"
124 ;;
125 pgsql_user)
126 sed -i "s|^user=.*|user=$3|" "$1/etc/asterisk/cdr_pgsql.conf"
127 sed -i "s|^dbuser=.*|dbuser=$3|" "$1/etc/asterisk/res_pgsql.conf"
128 ;;
129 pgsql_password)
130 sed -i "s|^password=.*|password=$3|" "$1/etc/asterisk/cdr_pgsql.conf"
131 sed -i "s|^dbpass=.*|dbpass=$3|" "$1/etc/asterisk/res_pgsql.conf"
132 ;;
133 pgsql_database)
134 sed -i "s|^dbname=.*|dbname=$3|" "$1/etc/asterisk/res_pgsql.conf" \
135 "$1/etc/asterisk/cdr_pgsql.conf"
136 ;;
137 *) cat <<EOT
138 mysql_host hostname or ip of mysql server
139 mysql_user username to connect to mysql server
140 mysql_password password to connect to mysql server
141 mysql_database database used by asterisk
142 pgsql_host hostname or ip of postgresql server
143 pgsql_user username to connect to postgresql server
144 pgsql_password password to connect to postgresql server
145 pgsql_database database used by asterisk
146 EOT
147 ;;
148 esac
149 }