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