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

Contents of /net-misc/asterisk/asterisk-1.0.3-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Tue May 31 23:37:51 2005 UTC (14 years, 6 months ago) by stkn
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Removed old ebuilds
(Portage version: 2.0.51.19)

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.3-r1.ebuild,v 1.3 2005/05/30 03:17:48 solar Exp $
4
5 IUSE="alsa doc gtk mmx mysql pri zaptel resperl"
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.1.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.1
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
75 if use mmx; then
76 einfo "enabling mmx optimization"
77 sed -i -e "s:^#\(K6OPT.*\):\1:" Makefile
78 fi
79
80 # change image path in voicemail cgi
81 sed -i -e "s:^\(\$astpath = \).*:\1 \"/asterisk\";:" contrib/scripts/vmail.cgi
82
83 #
84 # embedded perl
85 #
86 if use resperl; then
87 einfo "Patching asterisk for embedded perl support..."
88 epatch ${S_ADDONS}/res_perl/astmake.diff
89
90 # create necessary .c file
91 perl -MExtUtils::Embed -e xsinit || die "Could not create perlxsi.c"
92
93 sed -i -e "s:/usr/local/bin/perl:/usr/bin/perl:" \
94 ${S_ADDONS}/res_perl/Makefile \
95 Makefile
96 sed -i -e "s:^ASTSRC.*:ASTSRC = ${S}:" \
97 -e "s:\$(ASTLIBDIR)/modules/\(res_musiconhold.so\):${S}/res/\1:" \
98 ${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
107
108 #
109 # uclibc patch
110 #
111 if use elibc_uclibc; then
112 einfo "Patching asterisk for uclibc..."
113 epatch ${FILESDIR}/1.0.0/asterisk-uclibc-dns.diff
114 fi
115
116 #
117 # other patches
118 #
119
120 #
121 # asterisk add-ons
122 #
123 cd ${S_ADDONS}
124
125 sed -i -e "s:-I../asterisk:-I${S} -I${S}/include:" Makefile
126 sed -i -e "s:^\(CFLAGS=\)\(.*\):\1-I${S}/include \2:" \
127 format_mp3/Makefile
128 }
129
130 src_compile() {
131 # build asterisk first...
132 einfo "Building Asterisk..."
133 cd ${S}
134 emake -j1 || die "Make failed"
135
136 #
137 # add-ons
138 #
139 einfo "Building additional stuff..."
140 cd ${S_ADDONS}
141 emake -j1 || die "Make failed"
142
143 if use resperl; then
144 cd ${S_ADDONS}/res_perl
145 emake -j1 || die "Building embedded perl failed"
146 fi
147 }
148
149 src_install() {
150 emake -j1 DESTDIR=${D} install || die "Make install failed"
151 emake -j1 DESTDIR=${D} samples || die "Make install samples failed"
152
153 # install addmailbox and astgenkey
154 dosbin contrib/scripts/addmailbox
155 dosbin contrib/scripts/astgenkey
156
157 # documentation
158 use doc && \
159 emake -j1 DESTDIR=${D} progdocs
160
161 # install necessary files
162 dodir /etc/env.d
163 echo "LD_LIBRARY_PATH=\"/usr/lib/asterisk\"" > ${D}/etc/env.d/25asterisk
164
165 exeinto /etc/init.d
166 newexe ${FILESDIR}/1.0.0/asterisk.rc6 asterisk
167
168 insinto /etc/conf.d
169 newins ${FILESDIR}/1.0.0/asterisk.confd asterisk
170
171 # don't delete these, even if they are empty
172 keepdir /var/spool/asterisk/voicemail/default/1234/INBOX
173 keepdir /var/log/asterisk/cdr-csv
174
175 # install standard docs...
176 dodoc BUGS CREDITS LICENSE ChangeLog HARDWARE README README.fpm SECURITY
177
178 docinto scripts
179 dodoc contrib/scripts/*
180 docinto firmware/iax
181 dodoc contrib/firmware/iax/*
182
183 insinto /usr/share/doc/${PF}/cgi
184 doins contrib/scripts/vmail.cgi
185 for i in "images/*.gif"; do
186 doins $i
187 done
188
189 #
190 # sounds + add-ons
191 #
192
193 # install additional sounds...
194 einfo "Installing additional sounds..."
195 cd ${S_SOUNDS}
196 emake -j1 DESTDIR=${D} install || die "Make install failed"
197
198 # install additional modules...
199 einfo "Installing additional modules..."
200 cd ${S_ADDONS}
201 emake -j1 INSTALL_PREFIX=${D} install || die "Make install failed"
202
203 if use resperl; then
204 cd ${S_ADDONS}/res_perl
205 emake -j1 INSTALL_PREFIX=${D} install || die "Installation of perl AST_API failed"
206 fi
207 }
208
209 pkg_postinst() {
210 einfo "Asterisk has been installed"
211 einfo ""
212 einfo "to add new Mailboxes use: /usr/sbin/addmailbox"
213 einfo ""
214 einfo "If you want to know more about asterisk, visit these sites:"
215 einfo "http://www.automated.it/guidetoasterisk.htm"
216 einfo "http://asterisk.xvoip.com/"
217 einfo "http://www.voip-info.org/wiki-Asterisk"
218 einfo "http://ns1.jnetdns.de/jn/relaunch/asterisk/"
219 echo
220
221 changes_message
222 }

  ViewVC Help
Powered by ViewVC 1.1.20