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