wok annotate asterisk/receipt @ rev 13028

asterisk: fix compile_rules
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Jun 11 21:38:18 2012 +0200 (2012-06-11)
parents d71ba04aa9f5
children ca0bcdf8ead0
rev   line source
pascal@1187 1 # SliTaz package receipt.
pascal@1187 2
pascal@1187 3 PACKAGE="asterisk"
pascal@5452 4 VERSION="1.6.2.7"
pascal@1423 5 CATEGORY="misc"
pascal@1187 6 SHORT_DESC="Open Source PBX and telephony toolkit."
pascal@1187 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@4111 8 TARBALL="$PACKAGE-$VERSION.tar.gz"
pascal@4111 9 WEB_SITE="http://www.asterisk.org/"
pascal@12756 10 WGET_URL="http://downloads.asterisk.org/pub/telephony/asterisk/releases/$TARBALL"
gokhlayeh@9395 11 DEPENDS="openssl ncurses zlib libogg libvorbis curl newt libusb-compat alsa-lib \
pascal@1187 12 speex iksemel spandsp tiff radiusclient-ng nbs freetds libpostgresqlclient \
pascal@4998 13 libmysqlclient libunixODBC popt dahdi libpri lua libcap attr net-snmp \
pascal@4998 14 portaudio sqlite libkrb5 libcomerr3 libsdl-image"
pascal@12756 15 BUILD_DEPENDS="gtk+-dev libxml2-dev postgresql-dev libsdl-dev ncurses-dev \
pascal@10447 16 gmime gmime-dev unixODBC-dev unixODBC openldap-dev openldap \
pascal@12949 17 dahdi-linux dahdi-tools dahdi-dev"
pascal@1187 18 CONFIG_FILES="/etc/asterisk"
pascal@13027 19 TAGS="telephony"
pascal@1187 20
pascal@4111 21 # Rules to configure and make the package.
pascal@4111 22 #
pascal@4111 23 # Graphical configuration: 'make menuconfig' or 'make gmenuconfig'
pascal@4111 24 #
pascal@4111 25 compile_rules()
pascal@1187 26 {
pascal@4111 27 cd $src
pascal@5442 28 busybox sed -i 's/tar xof/tar xf/' sounds/Makefile
pascal@5442 29 busybox sed -i '/LOG_ERROR, "The file/ {nd}' main/config.c
pascal@5442 30 busybox sed -i 's/LOG_ERROR, "The file/LOG_WARNING, "The file/' \
pascal@5442 31 main/config.c
pascal@5442 32 busybox sed -i 's|lua5.1/||' pbx/pbx_lua.c
pascal@10941 33 grep -rsl '^#define AST_PBX_MAX_STACK' * | xargs busybox sed -i \
pascal@10941 34 's/define AST_PBX_MAX_STACK.*/define AST_PBX_MAX_STACK 1024/'
pascal@10942 35 [ -s $SOURCES_REPOSITORY/rfc3951.txt ] ||
pascal@10942 36 wget -P $SOURCES_REPOSITORY http://www.ietf.org/rfc/rfc3951.txt
pascal@12756 37 cp $SOURCES_REPOSITORY/rfc3951.txt codecs/ilbc ||
pascal@12858 38 cp $stuff/rfc3951.txt codecs/ilbc
pascal@10943 39 [ -f codecs/ilbc/iLBC_define.h ] || ( cd codecs/ilbc &&
pascal@10943 40 awk -f $stuff/extract-cfile.awk rfc3951.txt > /dev/null )
pascal@5442 41 busybox sed -i '/codec_ilbc/{ns/no/yes/}' menuselect-tree
pascal@4111 42 ./configure \
pascal@4111 43 --prefix=/usr \
pascal@4111 44 --sysconfdir=/etc \
pascal@4111 45 --without-pwlib \
pascal@4593 46 --with-dahdi=$WOK/dahdi/$(ls $WOK/dahdi/taz) \
pascal@12949 47 --with-tonezone \
pascal@4111 48 $CONFIGURE_ARGS &&
pascal@13028 49 make &&
pascal@13028 50 make DESTDIR=$DESTDIR install &&
pascal@13028 51 make DESTDIR=$DESTDIR samples &&
pascal@4111 52 cd contrib/utils &&
pascal@13028 53 gcc rawplayer.c -o $DESTDIR/usr/bin/rawplayer
pascal@1187 54 }
pascal@1187 55
pascal@1187 56 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@1187 57 genpkg_rules()
pascal@1187 58 {
pascal@4111 59 mkdir -p $fs/usr
pascal@4111 60 cp -a $_pkg/etc $fs
pascal@4111 61 cp -a $_pkg/var $fs
pascal@4111 62 cp -a $_pkg/usr/bin $fs/usr
pascal@4111 63 cp -a $_pkg/usr/lib $fs/usr
pascal@4111 64 cp -a $_pkg/usr/sbin $fs/usr
pascal@10942 65 cp -a $stuff/*/ $fs
pascal@1806 66 }
pascal@1806 67
pascal@1806 68 # Rules to configure package
pascal@1806 69 setup_rules()
pascal@1806 70 {
pascal@1806 71 case "$2" in
pascal@1806 72 mysql_host)
pascal@1806 73 sed -i "s|^hostname=.*|hostname=$3|" $1/etc/asterisk/cdr_mysql.conf
pascal@1920 74 sed -i "s|^dbhost=.*|dbhost=$3|" $1/etc/asterisk/res_mysql.conf
pascal@1806 75 ;;
pascal@1806 76 mysql_user)
pascal@1806 77 sed -i "s|^user=.*|user=$3|" $1/etc/asterisk/cdr_mysql.conf
pascal@1920 78 sed -i "s|^dbuser=.*|dbuser=$3|" $1/etc/asterisk/res_mysql.conf
pascal@1806 79 ;;
pascal@1806 80 mysql_password)
pascal@1806 81 sed -i "s|^password=.*|password=$3|" $1/etc/asterisk/cdr_mysql.conf
pascal@1920 82 sed -i "s|^dbpass=.*|dbpass=$3|" $1/etc/asterisk/res_mysql.conf
pascal@1806 83 ;;
pascal@1806 84 mysql_database)
pascal@1920 85 sed -i "s|^dbname=.*|dbname=$3|" $1/etc/asterisk/res_mysql.conf \
pascal@1806 86 $1/etc/asterisk/cdr_mysql.conf
pascal@1806 87 ;;
pascal@1920 88 pgsql_host)
pascal@1920 89 sed -i "s|^hostname=.*|hostname=$3|" $1/etc/asterisk/cdr_pgsql.conf
pascal@1920 90 sed -i "s|^dbhost=.*|dbhost=$3|" $1/etc/asterisk/res_pgsql.conf
pascal@1920 91 ;;
pascal@1920 92 pgsql_user)
pascal@1920 93 sed -i "s|^user=.*|user=$3|" $1/etc/asterisk/cdr_pgsql.conf
pascal@1920 94 sed -i "s|^dbuser=.*|dbuser=$3|" $1/etc/asterisk/res_pgsql.conf
pascal@1920 95 ;;
pascal@1920 96 pgsql_password)
pascal@1920 97 sed -i "s|^password=.*|password=$3|" $1/etc/asterisk/cdr_pgsql.conf
pascal@1920 98 sed -i "s|^dbpass=.*|dbpass=$3|" $1/etc/asterisk/res_pgsql.conf
pascal@1920 99 ;;
pascal@1920 100 pgsql_database)
pascal@1920 101 sed -i "s|^dbname=.*|dbname=$3|" $1/etc/asterisk/res_pgsql.conf \
pascal@1920 102 $1/etc/asterisk/cdr_pgsql.conf
pascal@1920 103 ;;
pascal@1806 104 *) cat <<EOT
pascal@1806 105 mysql_host hostname or ip of mysql server
pascal@1806 106 mysql_user username to connect to mysql server
pascal@1806 107 mysql_password password to connect to mysql server
pascal@1806 108 mysql_database database used by asterisk
pascal@1920 109 pgsql_host hostname or ip of postgresql server
pascal@1920 110 pgsql_user username to connect to postgresql server
pascal@1920 111 pgsql_password password to connect to postgresql server
pascal@1920 112 pgsql_database database used by asterisk
pascal@1806 113 EOT
pascal@1806 114 ;;
pascal@1806 115 esac
pascal@1187 116 }