wok annotate asterisk/receipt @ rev 13877

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