wok-next view asterisk/receipt @ rev 21020
Cleaning is almost finished... I should proceed to upgrades.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Nov 02 14:15:08 2018 +0200 (2018-11-02) |
parents | f48456621a9d |
children | 75632eca5b07 |
line source
1 # SliTaz package receipt v2.
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 WEB_SITE="http://www.asterisk.org/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="http://downloads.asterisk.org/pub/telephony/asterisk/releases/$TARBALL"
14 EXTRA_SOURCE_FILES="rfc3951.txt"
16 BUILD_DEPENDS="gtk2-dev libxml2-dev postgresql-dev libsdl-dev ncurses-dev \
17 gmime gmime-dev unixODBC-dev unixODBC openldap-dev openldap \
18 dahdi-linux dahdi-tools dahdi-dev \
19 newt-dev mysql-dev nbs-dev popt-dev neon-dev neon postgresql sqlite3-dev \
20 openssl-dev lua-dev lua libpri-dev bluez-dev bluez portaudio-dev alsa-lib-dev \
21 libsdl-image-dev net-snmp iksemel libical-dev curl-dev libcap-dev iksemel-dev \
22 jack-dev radiusclient-ng-dev radiusclient-ng \
23 libvorbis-dev speex-dev"
24 SPLIT="$PACKAGE-dev"
26 # Graphical configuration: 'make menuconfig' or 'make gmenuconfig'
27 #
28 compile_rules() {
29 # according to https://issues.asterisk.org/jira/browse/ASTERISK-20576
30 # the message "Makefile:82: pjproject/build.mak: No such file or directory" is normal :-/
31 sed -i 's/>no</>yes</' addons/[acor]*.c
32 find * -name config.guess -o -name configure | xargs \
33 sed -i "s/(uname -m)/(echo $ARCH)/"
34 find * -name Makefile | xargs \
35 sed -i "s/(shell uname -m)/(shell echo $ARCH)/"
36 busybox sed -i 's/tar xof/tar xf/' sounds/Makefile
37 busybox sed -i '/LOG_ERROR, "The file/ {nd}' main/config.c
38 busybox sed -i 's/LOG_ERROR, "The file/LOG_WARNING, "The file/' \
39 main/config.c
40 busybox sed -i 's|lua5.1/||' pbx/pbx_lua.c
41 grep -rsl '^#define AST_PBX_MAX_STACK' * | xargs busybox sed -i \
42 's/define AST_PBX_MAX_STACK.*/define AST_PBX_MAX_STACK 1024/'
43 [ -s $SRC/rfc3951.txt ] ||
44 wget -P $SRC http://www.ietf.org/rfc/rfc3951.txt
45 cp $SRC/rfc3951.txt codecs/ilbc ||
46 cp $stuff/rfc3951.txt codecs/ilbc
47 [ -f codecs/ilbc/iLBC_define.h ] || ( cd codecs/ilbc &&
48 awk -f $stuff/extract-cfile.awk rfc3951.txt > /dev/null )
49 mkdir -p $install/usr/bin
50 # export CXXFLAGS="$CXXFLAGS -fPIC"
51 ./configure \
52 --without-pwlib \
53 --with-dahdi=$WOK/dahdi/$(ls $WOK/dahdi/taz) \
54 --with-tonezone \
55 $CONFIGURE_ARGS &&
56 make -j1 2>&1 | grep -v pjproject &&
57 make -j1 DESTDIR=$install install &&
58 make -j1 DESTDIR=$install samples &&
59 cd contrib/utils &&
60 gcc rawplayer.c -o $install/usr/bin/rawplayer
61 }
63 genpkg_rules() {
64 case $PACKAGE in
65 asterisk)
66 CONFIG_FILES="/etc/asterisk"
67 DEPENDS="openssl ncurses zlib libogg libvorbis curl newt \
68 libusb-compat alsa-lib speex iksemel spandsp tiff \
69 radiusclient-ng nbs freetds libpostgresqlclient \
70 libmysqlclient libunixODBC popt dahdi libpri lua \
71 libcap attr net-snmp portaudio sqlite3 libkrb5 \
72 libcomerr3 libsdl libsdl-image libxml2 bluez \
73 libldap libical neon util-linux-uuid"
74 mkdir -p $fs/usr
75 cp -a $install/etc $fs
76 cp -a $install/var $fs
77 cp -a $install/usr/lib $fs/usr
78 cp -a $install/usr/sbin $fs/usr
79 cp -a $stuff/*/ $fs
80 TAGS="telephony"
81 ;;
82 asterisk-dev)
83 copy @dev
84 ;;
85 esac
86 }
88 setup_rules() {
89 case "$2" in
90 mysql_host)
91 sed "s|^hostname=.*|hostname=$3|" -i "$1/etc/asterisk/cdr_mysql.conf"
92 sed "s|^dbhost=.*|dbhost=$3|" -i "$1/etc/asterisk/res_mysql.conf"
93 ;;
94 mysql_user)
95 sed "s|^user=.*|user=$3|" -i "$1/etc/asterisk/cdr_mysql.conf"
96 sed "s|^dbuser=.*|dbuser=$3|" -i "$1/etc/asterisk/res_mysql.conf"
97 ;;
98 mysql_password)
99 sed "s|^password=.*|password=$3|" -i "$1/etc/asterisk/cdr_mysql.conf"
100 sed "s|^dbpass=.*|dbpass=$3|" -i "$1/etc/asterisk/res_mysql.conf"
101 ;;
102 mysql_database)
103 sed "s|^dbname=.*|dbname=$3|" "$1/etc/asterisk/res_mysql.conf" \
104 -i "$1/etc/asterisk/cdr_mysql.conf"
105 ;;
106 pgsql_host)
107 sed "s|^hostname=.*|hostname=$3|" -i "$1/etc/asterisk/cdr_pgsql.conf"
108 sed "s|^dbhost=.*|dbhost=$3|" -i "$1/etc/asterisk/res_pgsql.conf"
109 ;;
110 pgsql_user)
111 sed "s|^user=.*|user=$3|" -i "$1/etc/asterisk/cdr_pgsql.conf"
112 sed "s|^dbuser=.*|dbuser=$3|" -i "$1/etc/asterisk/res_pgsql.conf"
113 ;;
114 pgsql_password)
115 sed "s|^password=.*|password=$3|" -i "$1/etc/asterisk/cdr_pgsql.conf"
116 sed "s|^dbpass=.*|dbpass=$3|" -i "$1/etc/asterisk/res_pgsql.conf"
117 ;;
118 pgsql_database)
119 sed "s|^dbname=.*|dbname=$3|" "$1/etc/asterisk/res_pgsql.conf" \
120 -i "$1/etc/asterisk/cdr_pgsql.conf"
121 ;;
122 *) cat <<EOT
123 mysql_host hostname or ip of mysql server
124 mysql_user username to connect to mysql server
125 mysql_password password to connect to mysql server
126 mysql_database database used by asterisk
127 pgsql_host hostname or ip of postgresql server
128 pgsql_user username to connect to postgresql server
129 pgsql_password password to connect to postgresql server
130 pgsql_database database used by asterisk
131 EOT
132 ;;
133 esac
134 }