Lines 2-20
Link Here
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.0.3.ebuild,v 1.2 2004/12/27 18:52:50 gustavoz Exp $ |
3 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.0.3.ebuild,v 1.2 2004/12/27 18:52:50 gustavoz Exp $ |
4 |
|
4 |
|
5 |
IUSE="alsa doc gtk mmx mysql pri zaptel uclibc resperl" |
5 |
IUSE="alsa doc gtk mmx pri zaptel uclibc resperl mysql postgres vmdbmysql vmdbpostgres" |
6 |
|
6 |
|
7 |
inherit eutils |
7 |
inherit eutils |
8 |
|
8 |
|
|
|
9 |
ADDONS_VERSION="1.0.4" |
10 |
SOUNDS_VERSION="1.0.1" |
11 |
ASTCFG_VERSION="0.0.2" |
12 |
|
9 |
DESCRIPTION="Asterisk: A Modular Open Source PBX System" |
13 |
DESCRIPTION="Asterisk: A Modular Open Source PBX System" |
10 |
HOMEPAGE="http://www.asterisk.org/" |
14 |
HOMEPAGE="http://www.asterisk.org/" |
11 |
SRC_URI="ftp://ftp.asterisk.org/pub/telephony/asterisk/${P}.tar.gz |
15 |
SRC_URI="ftp://ftp.asterisk.org/pub/telephony/asterisk/${P}.tar.gz |
12 |
ftp://ftp.asterisk.org/pub/telephony/asterisk/${PN}-addons-1.0.1.tar.gz |
16 |
ftp://ftp.asterisk.org/pub/telephony/asterisk/${PN}-addons-${ADDONS_VERSION}.tar.gz |
13 |
ftp://ftp.asterisk.org/pub/telephony/asterisk/${PN}-sounds-1.0.1.tar.gz" |
17 |
ftp://ftp.asterisk.org/pub/telephony/asterisk/${PN}-sounds-${SOUNDS_VERSION}.tar.gz" |
14 |
|
18 |
|
15 |
S=${WORKDIR}/${P} |
19 |
S="${WORKDIR}/${P}" |
16 |
S_ADDONS=${WORKDIR}/${PN}-addons-1.0.1 |
20 |
S_ADDONS="${WORKDIR}/${PN}-addons-${ADDONS_VERSION}" |
17 |
S_SOUNDS=${WORKDIR}/${PN}-sounds-1.0.1 |
21 |
S_SOUNDS="${WORKDIR}/${PN}-sounds-${SOUNDS_VERSION}" |
18 |
|
22 |
|
19 |
SLOT="0" |
23 |
SLOT="0" |
20 |
LICENSE="GPL-2" |
24 |
LICENSE="GPL-2" |
Lines 27-68
Link Here
|
27 |
pri? ( >=net-libs/libpri-1.0.3 ) |
31 |
pri? ( >=net-libs/libpri-1.0.3 ) |
28 |
alsa? ( media-libs/alsa-lib ) |
32 |
alsa? ( media-libs/alsa-lib ) |
29 |
mysql? ( dev-db/mysql ) |
33 |
mysql? ( dev-db/mysql ) |
30 |
uclibc? ( dev-libs/uclibc ) |
34 |
uclibc? ( sys-libs/uclibc ) |
31 |
zaptel? ( >=net-misc/zaptel-1.0.3 ) |
35 |
zaptel? ( >=net-misc/zaptel-1.0.3 ) |
32 |
resperl? ( dev-lang/perl |
36 |
resperl? ( dev-lang/perl |
33 |
>=net-misc/zaptel-1.0.3 )" |
37 |
>=net-misc/zaptel-1.0.3 ) |
|
|
38 |
postgres? ( dev-db/postgresql ) |
39 |
vmdbmysql? ( dev-db/mysql ) |
40 |
vmdbpostgres? ( dev-db/postgresql )" |
41 |
|
34 |
|
42 |
|
35 |
|
43 |
|
36 |
changes_message() { |
44 |
changes_message() { |
37 |
ewarn "Important changes since 1.0.0:" |
45 |
einfo "Changes since 1.0.3:" |
38 |
ewarn "" |
46 |
einfo "" |
39 |
ewarn "- Voicemail Webapp has been removed!" |
47 |
einfo "* Added support for MySQL / Postgresql Voicemail database backends" |
40 |
ewarn " (files are in /usr/share/doc/${PF}/cgi/ if you really need them)" |
48 |
einfo " (vmdbmysql / vmdbpostgres useflags, see" |
41 |
ewarn "" |
49 |
einfo " http://www.voip-info.org/wiki-Asterisk+voicemail+database for more information)" |
42 |
ewarn "- Zaptel and PRI support are now disabled by default (see emerge -pv asterisk)" |
50 |
einfo "" |
43 |
ewarn "" |
51 |
einfo "* Added Postgres support" |
44 |
ewarn "- Support for embedded perl in the extensions file has been added" |
52 |
einfo " (postgres useflag)" |
45 |
ewarn " (res_perl from asterisk-addons; \"resperl\" use-flag)" |
|
|
46 |
ewarn "" |
47 |
ewarn "- Should build with uclibc now (untested / experimental)" |
48 |
ewarn "" |
49 |
} |
53 |
} |
50 |
|
54 |
|
51 |
pkg_setup() { |
55 |
pkg_setup() { |
52 |
changes_message |
|
|
53 |
ebeep |
54 |
epause 10 |
55 |
|
56 |
einfo "Running some pre-flight checks..." |
56 |
einfo "Running some pre-flight checks..." |
57 |
if use resperl; then |
57 |
if use resperl; then |
58 |
# res_perl pre-flight check... |
58 |
# res_perl pre-flight check... |
59 |
if ! $(perl -V | grep -q "usemultiplicity=define"); then |
59 |
if ! $(perl -V | grep -q "usemultiplicity=define"); then |
60 |
eerror "Embedded perl add-on needs Perl with built-in threads support" |
60 |
eerror "Embedded perl add-on needs Perl with built-in threads support" |
61 |
eerror "(rebuild perl with ithreads use-flag enabled)" |
61 |
eerror "(rebuild perl and libperl with ithreads use-flag enabled)" |
62 |
die "Perl w/o threads support..." |
62 |
die "Perl w/o threads support..." |
63 |
fi |
63 |
fi |
64 |
einfo "Perl with ithreads support found" |
64 |
einfo "Perl with ithreads support found" |
65 |
fi |
65 |
fi |
|
|
66 |
|
67 |
# mysql and postgres voicemail support are mutually exclusive.. |
68 |
if use vmdbmysql && use vmdbpostgres; then |
69 |
eerror "MySQL and PostgreSQL Voicemail support are mutually exclusive... choose one!" |
70 |
die "Conflicting use-flags" |
71 |
fi |
66 |
} |
72 |
} |
67 |
|
73 |
|
68 |
src_unpack() { |
74 |
src_unpack() { |
Lines 70-76
Link Here
|
70 |
cd ${S} |
76 |
cd ${S} |
71 |
|
77 |
|
72 |
# set cflags & mmx optimization |
78 |
# set cflags & mmx optimization |
73 |
sed -i -e "s:^\(OPTIMIZE=\).*:\1 ${CFLAGS}:" Makefile |
79 |
sed -i -e "s:^\(OPTIMIZE\).*:\1=${CFLAGS}:" Makefile |
74 |
|
80 |
|
75 |
if use mmx; then |
81 |
if use mmx; then |
76 |
einfo "enabling mmx optimization" |
82 |
einfo "enabling mmx optimization" |
Lines 96-108
Link Here
|
96 |
sed -i -e "s:^ASTSRC.*:ASTSRC = ${S}:" \ |
102 |
sed -i -e "s:^ASTSRC.*:ASTSRC = ${S}:" \ |
97 |
-e "s:\$(ASTLIBDIR)/modules/\(res_musiconhold.so\):${S}/res/\1:" \ |
103 |
-e "s:\$(ASTLIBDIR)/modules/\(res_musiconhold.so\):${S}/res/\1:" \ |
98 |
${S_ADDONS}/res_perl/Makefile |
104 |
${S_ADDONS}/res_perl/Makefile |
99 |
|
|
|
100 |
## needs more testing... |
101 |
# # move perl stuff into /usr/lib/asterisk and symlink it |
102 |
# # with /etc/asterisk/perl (solves config protection trouble) |
103 |
# sed -i -e "s:\$(ASTETCDIR)/perl:\$(ASTLIBDIR)/perl:g" \ |
104 |
# -e "s:\(mkdir \$(ASTLIBDIR)/perl \):\1; ln -s \$(subst \$(INSTALL_PREFIX),,\$(ASTLIBDIR))/perl \$(ASTETCDIR)/perl :" \ |
105 |
# ${S_ADDONS}/res_perl/Makefile |
106 |
fi |
105 |
fi |
107 |
|
106 |
|
108 |
# |
107 |
# |
Lines 117-122
Link Here
|
117 |
# other patches |
116 |
# other patches |
118 |
# |
117 |
# |
119 |
|
118 |
|
|
|
119 |
# experimental asterisk-config patch, eases building of external modules |
120 |
epatch ${FILESDIR}/1.0.0/${PN}-1.0.2-astconfig-${ASTCFG_VERSION}.diff |
121 |
|
120 |
# |
122 |
# |
121 |
# asterisk add-ons |
123 |
# asterisk add-ons |
122 |
# |
124 |
# |
Lines 125-130
Link Here
|
125 |
sed -i -e "s:-I../asterisk:-I${S} -I${S}/include:" Makefile |
127 |
sed -i -e "s:-I../asterisk:-I${S} -I${S}/include:" Makefile |
126 |
sed -i -e "s:^\(CFLAGS=\)\(.*\):\1-I${S}/include \2:" \ |
128 |
sed -i -e "s:^\(CFLAGS=\)\(.*\):\1-I${S}/include \2:" \ |
127 |
format_mp3/Makefile |
129 |
format_mp3/Makefile |
|
|
130 |
|
131 |
# |
132 |
# database voicemail support |
133 |
# |
134 |
if use postgres; then |
135 |
sed -i -e "s:^#\(APPS+=app_sql_postgres.so\):\1:" \ |
136 |
-e "s:/usr/local/pgsql/include:/usr/include/postgresql/pgsql:" \ |
137 |
-e "s:/usr/local/pgsql/lib:/usr/lib/postgresql:" \ |
138 |
apps/Makefile |
139 |
fi |
140 |
|
141 |
if use vmdbpostgres; then |
142 |
einfo "Enabling PostgreSQL voicemail support" |
143 |
sed -i -e "s:^\(USE_POSTGRES_VM_INTERFACE\).*:\1=1:" \ |
144 |
-e "s:/usr/local/pgsql/include:/usr/include/postgresql/pgsql:" \ |
145 |
-e "s:/usr/local/pgsql/lib:/usr/lib/postgresql:" \ |
146 |
apps/Makefile |
147 |
|
148 |
# patch app_voicemail.c |
149 |
sed -i -e "s:^#include <postgresql/libpq-fe\.h>:#include \"libpq-fe\.h\":" \ |
150 |
apps/app_voicemail.c |
151 |
|
152 |
elif use vmdbmysql; then |
153 |
einfo "Enabling MySQL voicemail support" |
154 |
sed -i -e "s:^\(USE_MYSQL_VM_INTERFACE\).*:\1=1:" \ |
155 |
-e "s:^\(CFLAGS+=-DUSEMYSQLVM\):\1 -I${S_ADDONS}:" \ |
156 |
apps/Makefile |
157 |
fi |
128 |
} |
158 |
} |
129 |
|
159 |
|
130 |
src_compile() { |
160 |
src_compile() { |
Lines 159-166
Link Here
|
159 |
emake -j1 DESTDIR=${D} progdocs |
189 |
emake -j1 DESTDIR=${D} progdocs |
160 |
|
190 |
|
161 |
# install necessary files |
191 |
# install necessary files |
162 |
dodir /etc/env.d |
192 |
## scheduled for removal |
163 |
echo "LD_LIBRARY_PATH=\"/usr/lib/asterisk\"" > ${D}/etc/env.d/25asterisk |
193 |
# dodir /etc/env.d |
|
|
194 |
# echo "LD_LIBRARY_PATH=\"/usr/lib/asterisk\"" > ${D}/etc/env.d/25asterisk |
164 |
|
195 |
|
165 |
exeinto /etc/init.d |
196 |
exeinto /etc/init.d |
166 |
newexe ${FILESDIR}/1.0.0/asterisk.rc6 asterisk |
197 |
newexe ${FILESDIR}/1.0.0/asterisk.rc6 asterisk |
Lines 211-221
Link Here
|
211 |
einfo "" |
242 |
einfo "" |
212 |
einfo "to add new Mailboxes use: /usr/sbin/addmailbox" |
243 |
einfo "to add new Mailboxes use: /usr/sbin/addmailbox" |
213 |
einfo "" |
244 |
einfo "" |
214 |
einfo "If you want to know more about asterisk, visit these sites:" |
245 |
einfo "Useful site(s):" |
215 |
einfo "http://www.automated.it/guidetoasterisk.htm" |
|
|
216 |
einfo "http://asterisk.xvoip.com/" |
217 |
einfo "http://www.voip-info.org/wiki-Asterisk" |
246 |
einfo "http://www.voip-info.org/wiki-Asterisk" |
218 |
einfo "http://ns1.jnetdns.de/jn/relaunch/asterisk/" |
|
|
219 |
echo |
247 |
echo |
220 |
|
248 |
|
221 |
changes_message |
249 |
changes_message |