wok-stable view asterisk/receipt @ rev 2435
mc: update depends
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Mar 12 16:28:39 2009 +0000 (2009-03-12) |
parents | 45e6c1f3da4f |
children | 7a436db659a4 |
line source
1 # SliTaz package receipt.
3 PACKAGE="asterisk"
4 VERSION="bristuff"
5 CATEGORY="misc"
6 SHORT_DESC="Open Source PBX and telephony toolkit."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 WEB_SITE="http://www.digium.com/"
9 WANTED="bristuff"
10 DEPENDS="openssl ncurses zlib libogg libvorbis curl newt libusb alsa-lib \
11 speex iksemel spandsp tiff radiusclient-ng nbs freetds libpostgresqlclient \
12 libmysqlclient"
13 CONFIG_FILES="/etc/asterisk"
15 # Extract VERSION from WANTED package source
16 get_version()
17 {
18 eval $(grep ^AST_VER= $WOK/$WANTED/$WANTED-*/download.sh)
19 VERSION=$WANTED-$AST_VER
20 }
22 # Rules to gen a SliTaz package suitable for Tazpkg.
23 genpkg_rules()
24 {
25 get_version
26 [ -d taz/$PACKAGE-$WANTED/fs ] && \
27 mv taz/$PACKAGE-$WANTED taz/$PACKAGE-$VERSION
28 _pkg=$(cd $(dirname $src)/$WANTED-*/_pkg ; pwd)
29 while read file; do
30 dir=$(dirname $file)
31 [ -d $fs$dir ] || mkdir -p $fs$dir
32 eval cp -a "$_pkg$file" $fs$dir
33 done < $_pkg/../$PACKAGE.files-list
34 for i in $fs/etc/asterisk/*.sample; do
35 mv $i ${i%.sample}
36 done
37 cp -a stuff/* $fs
38 }
40 # Rules to configure package
41 setup_rules()
42 {
43 case "$2" in
44 mysql_host)
45 sed -i "s|^hostname=.*|hostname=$3|" $1/etc/asterisk/cdr_mysql.conf
46 sed -i "s|^dbhost=.*|dbhost=$3|" $1/etc/asterisk/res_mysql.conf
47 ;;
48 mysql_user)
49 sed -i "s|^user=.*|user=$3|" $1/etc/asterisk/cdr_mysql.conf
50 sed -i "s|^dbuser=.*|dbuser=$3|" $1/etc/asterisk/res_mysql.conf
51 ;;
52 mysql_password)
53 sed -i "s|^password=.*|password=$3|" $1/etc/asterisk/cdr_mysql.conf
54 sed -i "s|^dbpass=.*|dbpass=$3|" $1/etc/asterisk/res_mysql.conf
55 ;;
56 mysql_database)
57 sed -i "s|^dbname=.*|dbname=$3|" $1/etc/asterisk/res_mysql.conf \
58 $1/etc/asterisk/cdr_mysql.conf
59 ;;
60 pgsql_host)
61 sed -i "s|^hostname=.*|hostname=$3|" $1/etc/asterisk/cdr_pgsql.conf
62 sed -i "s|^dbhost=.*|dbhost=$3|" $1/etc/asterisk/res_pgsql.conf
63 ;;
64 pgsql_user)
65 sed -i "s|^user=.*|user=$3|" $1/etc/asterisk/cdr_pgsql.conf
66 sed -i "s|^dbuser=.*|dbuser=$3|" $1/etc/asterisk/res_pgsql.conf
67 ;;
68 pgsql_password)
69 sed -i "s|^password=.*|password=$3|" $1/etc/asterisk/cdr_pgsql.conf
70 sed -i "s|^dbpass=.*|dbpass=$3|" $1/etc/asterisk/res_pgsql.conf
71 ;;
72 pgsql_database)
73 sed -i "s|^dbname=.*|dbname=$3|" $1/etc/asterisk/res_pgsql.conf \
74 $1/etc/asterisk/cdr_pgsql.conf
75 ;;
76 *) cat <<EOT
77 mysql_host hostname or ip of mysql server
78 mysql_user username to connect to mysql server
79 mysql_password password to connect to mysql server
80 mysql_database database used by asterisk
81 pgsql_host hostname or ip of postgresql server
82 pgsql_user username to connect to postgresql server
83 pgsql_password password to connect to postgresql server
84 pgsql_database database used by asterisk
85 EOT
86 ;;
87 esac
88 }