/[gentoo-x86]/net-misc/asterisk/asterisk-1.0.5.ebuild
Gentoo

Contents of /net-misc/asterisk/asterisk-1.0.5.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Fri Jun 24 16:49:19 2005 UTC (14 years, 5 months ago) by stkn
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Removing old ebuilds without security update
(Portage version: 2.0.51.22-r1)

1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.0.5.ebuild,v 1.3 2005/05/30 03:17:48 solar Exp $
4
5 IUSE="alsa doc gtk mmx mysql pri zaptel resperl debug"
6
7 inherit eutils
8
9 DESCRIPTION="Asterisk: A Modular Open Source PBX System"
10 HOMEPAGE="http://www.asterisk.org/"
11 SRC_URI="ftp://ftp.asterisk.org/pub/telephony/asterisk/${P}.tar.gz
12 ftp://ftp.asterisk.org/pub/telephony/asterisk/${PN}-addons-1.0.4.tar.gz
13 ftp://ftp.asterisk.org/pub/telephony/asterisk/${PN}-sounds-1.0.1.tar.gz"
14
15 S=${WORKDIR}/${P}
16 S_ADDONS=${WORKDIR}/${PN}-addons-1.0.4
17 S_SOUNDS=${WORKDIR}/${PN}-sounds-1.0.1
18
19 SLOT="0"
20 LICENSE="GPL-2"
21 KEYWORDS="~x86 ~sparc"
22
23 DEPEND="dev-libs/newt
24 media-sound/mpg123
25 media-sound/sox
26 doc? ( app-doc/doxygen )
27 gtk? ( =x11-libs/gtk+-1.2* )
28 pri? ( >=net-libs/libpri-1.0.3 )
29 alsa? ( media-libs/alsa-lib )
30 mysql? ( dev-db/mysql )
31 zaptel? ( >=net-misc/zaptel-1.0.3 )
32 resperl? ( dev-lang/perl
33 >=net-misc/zaptel-1.0.3 )"
34
35
36 changes_message() {
37 ewarn "Important changes since 1.0.0:"
38 ewarn ""
39 ewarn "- Voicemail Webapp has been removed!"
40 ewarn " (files are in /usr/share/doc/${PF}/cgi/ if you really need them)"
41 ewarn ""
42 ewarn "- Zaptel and PRI support are now disabled by default (see emerge -pv asterisk)"
43 ewarn ""
44 ewarn "- Support for embedded perl in the extensions file has been added"
45 ewarn " (res_perl from asterisk-addons; \"resperl\" use-flag)"
46 ewarn ""
47 ewarn "- Should build with uclibc now (untested / experimental)"
48 ewarn ""
49 }
50
51 pkg_setup() {
52 changes_message
53 ebeep
54 epause 10
55
56 einfo "Running some pre-flight checks..."
57 if use resperl; then
58 # res_perl pre-flight check...
59 if ! $(perl -V | grep -q "usemultiplicity=define"); then
60 eerror "Embedded perl add-on needs Perl with built-in threads support"
61 eerror "(rebuild perl with ithreads use-flag enabled)"
62 die "Perl w/o threads support..."
63 fi
64 einfo "Perl with ithreads support found"
65 fi
66 }
67
68 src_unpack() {
69 unpack ${A}
70 cd ${S}
71
72 # set cflags & mmx optimization
73 sed -i -e "s:^\(OPTIMIZE+=\).*:\1 ${CFLAGS}:" Makefile
74 # asterisk wants to set -march itself
75 sed -i -e "s:^\(CFLAGS+=\$(shell if \$(CC)\):#\1:" Makefile
76 # gsm codec still uses -fomit-frame-pointer, and other codecs have their
77 # own flags. We only change the arch.
78 sed -i -e "s:^OPTIMIZE+=.*:OPTIMIZE+=${CFLAGS}:" codecs/gsm/Makefile
79
80 if use mmx; then
81 einfo "enabling mmx optimization"
82 sed -i -e "s:^#\(K6OPT.*\):\1:" Makefile
83 fi
84
85 if ! use debug; then
86 einfo "disabling debugging"
87 sed -i -e "s:^\(DEBUG=\):#\1:" Makefile
88 fi
89
90 # change image path in voicemail cgi
91 sed -i -e "s:^\(\$astpath = \).*:\1 \"/asterisk\";:" contrib/scripts/vmail.cgi
92
93 #
94 # embedded perl
95 #
96 if use resperl; then
97 einfo "Patching asterisk for embedded perl support..."
98 epatch ${S_ADDONS}/res_perl/astmake.diff
99
100 # create necessary .c file
101 perl -MExtUtils::Embed -e xsinit || die "Could not create perlxsi.c"
102
103 sed -i -e "s:/usr/local/bin/perl:/usr/bin/perl:" \
104 ${S_ADDONS}/res_perl/Makefile \
105 Makefile
106 sed -i -e "s:^ASTSRC.*:ASTSRC = ${S}:" \
107 -e "s:\$(ASTLIBDIR)/modules/\(res_musiconhold.so\):${S}/res/\1:" \
108 ${S_ADDONS}/res_perl/Makefile
109
110 ## needs more testing...
111 # # move perl stuff into /usr/lib/asterisk and symlink it
112 # # with /etc/asterisk/perl (solves config protection trouble)
113 # sed -i -e "s:\$(ASTETCDIR)/perl:\$(ASTLIBDIR)/perl:g" \
114 # -e "s:\(mkdir \$(ASTLIBDIR)/perl \):\1; ln -s \$(subst \$(INSTALL_PREFIX),,\$(ASTLIBDIR))/perl \$(ASTETCDIR)/perl :" \
115 # ${S_ADDONS}/res_perl/Makefile
116 fi
117
118 #
119 # uclibc patch
120 #
121 if use elibc_uclibc; then
122 einfo "Patching asterisk for uclibc..."
123 epatch ${FILESDIR}/1.0.0/asterisk-uclibc-dns.diff
124 fi
125
126 #
127 # other patches
128 #
129
130 #
131 # asterisk add-ons
132 #
133 cd ${S_ADDONS}
134 sed -i -e "s:^OPTIMIZE+=.*:OPTIMIZE+=${CFLAGS}:" format_mp3/Makefile
135 sed -i -e "s:^\(CFLAGS=\)\(.*\):\1-I${S}/include \2:" format_mp3/Makefile
136 sed -i -e "s:-I../asterisk:-I${S} -I${S}/include:" Makefile
137 }
138
139 src_compile() {
140 # build asterisk first...
141 einfo "Building Asterisk..."
142 cd ${S}
143 emake -j1 || die "Make failed"
144
145 #
146 # add-ons
147 #
148 einfo "Building additional stuff..."
149 cd ${S_ADDONS}
150 emake -j1 || die "Make failed"
151
152 if use resperl; then
153 cd ${S_ADDONS}/res_perl
154 emake -j1 || die "Building embedded perl failed"
155 fi
156 }
157
158 src_install() {
159 emake -j1 DESTDIR=${D} install || die "Make install failed"
160 emake -j1 DESTDIR=${D} samples || die "Make install samples failed"
161
162 # install addmailbox and astgenkey
163 dosbin contrib/scripts/addmailbox
164 dosbin contrib/scripts/astgenkey
165
166 # documentation
167 use doc && \
168 emake -j1 DESTDIR=${D} progdocs
169
170 # install necessary files
171 dodir /etc/env.d
172 echo "LD_LIBRARY_PATH=\"/usr/lib/asterisk\"" > ${D}/etc/env.d/25asterisk
173
174 exeinto /etc/init.d
175 newexe ${FILESDIR}/1.0.0/asterisk.rc6 asterisk
176
177 insinto /etc/conf.d
178 newins ${FILESDIR}/1.0.0/asterisk.confd asterisk
179
180 # don't delete these, even if they are empty
181 keepdir /var/spool/asterisk/voicemail/default/1234/INBOX
182 keepdir /var/log/asterisk/cdr-csv
183
184 # install standard docs...
185 dodoc BUGS CREDITS LICENSE ChangeLog HARDWARE README README.fpm SECURITY
186
187 docinto scripts
188 dodoc contrib/scripts/*
189 docinto firmware/iax
190 dodoc contrib/firmware/iax/*
191
192 insinto /usr/share/doc/${PF}/cgi
193 doins contrib/scripts/vmail.cgi
194 for i in "images/*.gif"; do
195 doins $i
196 done
197
198 #
199 # sounds + add-ons
200 #
201
202 # install additional sounds...
203 einfo "Installing additional sounds..."
204 cd ${S_SOUNDS}
205 emake -j1 DESTDIR=${D} install || die "Make install failed"
206
207 # install additional modules...
208 einfo "Installing additional modules..."
209 cd ${S_ADDONS}
210 emake -j1 INSTALL_PREFIX=${D} install || die "Make install failed"
211
212 if use resperl; then
213 cd ${S_ADDONS}/res_perl
214 emake -j1 INSTALL_PREFIX=${D} install || die "Installation of perl AST_API failed"
215 fi
216 }
217
218 pkg_postinst() {
219 einfo "Asterisk has been installed"
220 einfo ""
221 einfo "to add new Mailboxes use: /usr/sbin/addmailbox"
222 einfo ""
223 einfo "If you want to know more about asterisk, visit these sites:"
224 einfo "http://www.automated.it/guidetoasterisk.htm"
225 einfo "http://asterisk.xvoip.com/"
226 einfo "http://www.voip-info.org/wiki-Asterisk"
227 einfo "http://ns1.jnetdns.de/jn/relaunch/asterisk/"
228 echo
229
230 changes_message
231 }

  ViewVC Help
Powered by ViewVC 1.1.20