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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Jan 4 17:31:53 2011 UTC (8 years, 11 months ago) by chainsaw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
As pointed out by Ivan L. Isaev in bug #344533, MySQL was not fully enabled. Together with Michael Lesniewski I have redone all conditional statements through menuselect instead of through use_with. Pre-creating directories in the installation image allows parallel install with MAKEOPTS above -j1, closes bug #350339 by rad0xicated@gmail.com. Kill USE=logrotate which snuck back in. Kill USE=keepsrc as I do not believe it is used. Petition me through a bug report if you disagree and present a clear use case. Nuke older 1.8 branch ebuilds, they are useless now because of a gtalk protocol change.

(Portage version: 2.1.9.28/cvs/Linux x86_64)

1 # Copyright 1999-2010 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.8.1.1.ebuild,v 1.1 2010/12/30 17:18:02 chainsaw Exp $
4
5 EAPI=3
6 inherit autotools base eutils linux-info multilib
7
8 MY_P="${PN}-${PV/_/-}"
9
10 DESCRIPTION="Asterisk: A Modular Open Source PBX System"
11 HOMEPAGE="http://www.asterisk.org/"
12 SRC_URI="http://downloads.asterisk.org/pub/telephony/asterisk/${MY_P}.tar.gz
13 mirror://gentoo/gentoo-asterisk-patchset-0.2.tar.bz2"
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17
18 IUSE="ais alsa bluetooth calendar +caps curl dahdi debug doc freetds gtalk h323 http iconv jabber jingle ldap logrotate lua keepsrc misdn mysql newt +samples odbc osplookup oss portaudio postgres radius snmp span speex ssl sqlite sqlite3 srtp static syslog usb vorbis"
19
20 EPATCH_SUFFIX="patch"
21 PATCHES=( "${WORKDIR}/asterisk-patchset" )
22
23 RDEPEND="sys-libs/ncurses
24 dev-libs/popt
25 sys-libs/zlib
26 dev-libs/libxml2
27 ais? ( sys-cluster/openais )
28 alsa? ( media-libs/alsa-lib )
29 bluetooth? ( net-wireless/bluez )
30 calendar? ( net-libs/neon
31 dev-libs/libical
32 dev-libs/iksemel )
33 caps? ( sys-libs/libcap )
34 curl? ( net-misc/curl )
35 dahdi? ( >=net-libs/libpri-1.4.12_beta2
36 net-misc/dahdi-tools )
37 freetds? ( dev-db/freetds )
38 gtalk? ( dev-libs/iksemel )
39 h323? ( net-libs/openh323 )
40 http? ( dev-libs/gmime:0 )
41 iconv? ( virtual/libiconv )
42 jabber? ( dev-libs/iksemel )
43 jingle? ( dev-libs/iksemel )
44 ldap? ( net-nds/openldap )
45 lua? ( dev-lang/lua )
46 misdn? ( net-dialup/misdnuser )
47 mysql? ( dev-db/mysql )
48 newt? ( dev-libs/newt )
49 odbc? ( dev-db/unixODBC )
50 osplookup? ( net-libs/osptoolkit
51 dev-libs/openssl )
52 portaudio? ( media-libs/portaudio )
53 postgres? ( dev-db/postgresql-base )
54 radius? ( net-dialup/radiusclient-ng )
55 snmp? ( net-analyzer/net-snmp )
56 span? ( media-libs/spandsp )
57 speex? ( media-libs/speex )
58 sqlite? ( dev-db/sqlite:0 )
59 sqlite3? ( dev-db/sqlite:3 )
60 srtp? ( net-libs/libsrtp )
61 ssl? ( dev-libs/openssl )
62 syslog? ( app-admin/syslog-ng )
63 usb? ( dev-libs/libusb
64 media-libs/alsa-lib )
65 vorbis? ( media-libs/libvorbis )"
66
67 DEPEND="${RDEPEND}
68 !<net-misc/asterisk-addons-1.6
69 !net-misc/asterisk-chan_unistim
70 !net-misc/zaptel"
71
72 PDEPEND="net-misc/asterisk-core-sounds
73 net-misc/asterisk-extra-sounds
74 net-misc/asterisk-moh-opsound"
75
76 S="${WORKDIR}/${MY_P}"
77
78 pkg_setup() {
79 CONFIG_CHECK="~!NF_CONNTRACK_SIP"
80 local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users
81 have reported that this module dropped critical SIP packets in their deployments. You
82 may want to disable it if you see such problems."
83 check_extra_config
84 }
85
86 src_prepare() {
87 base_src_prepare
88 AT_M4DIR=autoconf eautoreconf
89 }
90
91 src_configure() {
92 econf \
93 --libdir="/usr/$(get_libdir)" \
94 --localstatedir="/var" \
95 --with-gsm=internal \
96 --with-popt \
97 --with-z \
98 $(use_with ais openais) \
99 $(use_with alsa asound) \
100 $(use_with bluetooth) \
101 $(use_with calendar neon) \
102 $(use_with calendar neon29) \
103 $(use_with calendar ical) \
104 $(use_with calendar iksemel) \
105 $(use_with caps cap) \
106 $(use_with curl libcurl) \
107 $(use_with dahdi pri) \
108 $(use_with dahdi tonezone) \
109 $(use_with dahdi) \
110 $(use_with freetds tds) \
111 $(use_with h323) \
112 $(use_with http gmime) \
113 $(use_with iconv) \
114 $(use_with jabber iksemel) \
115 $(use_with jingle iksemel) \
116 $(use_with lua) \
117 $(use_with misdn isdnnet) \
118 $(use_with misdn suppserv) \
119 $(use_with misdn) \
120 $(use_with mysql mysqlclient) \
121 $(use_with newt) \
122 $(use_with osplookup osptk) \
123 $(use_with oss) \
124 $(use_with portaudio) \
125 $(use_with postgres) \
126 $(use_with radius) \
127 $(use_with snmp netsnmp) \
128 $(use_with span spandsp) \
129 $(use_with speex) \
130 $(use_with speex speexdsp) \
131 $(use_with sqlite) \
132 $(use_with sqlite3) \
133 $(use_with srtp) \
134 $(use_with ssl crypto) \
135 $(use_with ssl) \
136 $(use_with usb) \
137 $(use_with vorbis ogg) \
138 $(use_with vorbis) || die "econf failed"
139
140 #
141 # blank out sounds/sounds.xml file to prevent
142 # asterisk from installing sounds files (we pull them in via
143 # asterisk-{core,extra}-sounds and asterisk-moh-opsound.
144 #
145 >"${S}"/sounds/sounds.xml
146 }
147
148 src_compile() {
149 ASTLDFLAGS="${LDFLAGS}" emake || die "emake failed"
150 }
151
152 src_install() {
153 # setup directory structure
154 #
155 mkdir -p "${D}"usr/$(get_libdir)/pkgconfig
156
157 emake DESTDIR="${D}" install || die "emake install failed"
158
159 if use samples; then
160 emake DESTDIR="${D}" samples || die "emake samples failed"
161 for conffile in "${D}"etc/asterisk/*.*
162 do
163 chown asterisk:asterisk $conffile
164 chmod 0660 $conffile
165 done
166 einfo "Sample files have been installed"
167 else
168 einfo "Skipping installation of sample files..."
169 rm -f "${D}"var/lib/asterisk/mohmp3/*
170 rm -f "${D}"var/lib/asterisk/sounds/demo-*
171 rm -f "${D}"var/lib/asterisk/agi-bin/*
172 rm -f "${D}"etc/asterisk/*
173 fi
174 rm -rf "${D}"var/spool/asterisk/voicemail/default
175
176 # keep directories
177 diropts -m 0770 -o asterisk -g asterisk
178 keepdir /etc/asterisk
179 keepdir /var/lib/asterisk
180 keepdir /var/run/asterisk
181 keepdir /var/spool/asterisk
182 keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
183 diropts -m 0750 -o asterisk -g asterisk
184 keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
185
186 newinitd "${FILESDIR}"/1.6.2/asterisk.initd2 asterisk
187 newconfd "${FILESDIR}"/1.6.0/asterisk.confd asterisk
188
189 # some people like to keep the sources around for custom patching
190 # copy the whole source tree to /usr/src/asterisk-${PVF} and run make clean there
191 if use keepsrc
192 then
193 dodir /usr/src
194
195 ebegin "Copying sources into /usr/src"
196 cp -dPR "${S}" "${D}"/usr/src/${PF} || die "Unable to copy sources"
197 eend $?
198
199 ebegin "Cleaning source tree"
200 emake -C "${D}"/usr/src/${PF} clean &>/dev/null || die "Unable to clean sources"
201 eend $?
202
203 einfo "Clean sources are available in "${ROOT}"usr/src/${PF}"
204 fi
205
206 # install the upgrade documentation
207 #
208 dodoc README UPGRADE* BUGS CREDITS
209
210 # install extra documentation
211 #
212 if use doc
213 then
214 dodoc doc/*.txt
215 dodoc doc/*.pdf
216 dodoc doc/PEERING
217 dodoc doc/CODING-GUIDELINES
218 dodoc doc/tex/*.pdf
219 fi
220
221 # install SIP scripts; bug #300832
222 #
223 dodoc "${FILESDIR}/1.6.2/sip_calc_auth"
224 dodoc "${FILESDIR}/1.6.2/find_call_sip_trace.sh"
225 dodoc "${FILESDIR}/1.6.2/find_call_ids.sh"
226 dodoc "${FILESDIR}/1.6.2/call_data.txt"
227
228 # install logrotate snippet; bug #329281
229 #
230 if use logrotate
231 then
232 insinto /etc/logrotate.d
233 newins "${FILESDIR}/1.6.2/asterisk.logrotate3" asterisk
234 fi
235 }
236
237 pkg_preinst() {
238 enewgroup asterisk
239 enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
240 }
241
242 pkg_postinst() {
243 #
244 # Announcements, warnings, reminders...
245 #
246 einfo "Asterisk has been installed"
247 echo
248 elog "If you want to know more about asterisk, visit these sites:"
249 elog "http://www.asteriskdocs.org/"
250 elog "http://www.voip-info.org/wiki-Asterisk"
251 echo
252 elog "http://www.automated.it/guidetoasterisk.htm"
253 echo
254 elog "Gentoo VoIP IRC Channel:"
255 elog "#gentoo-voip @ irc.freenode.net"
256 echo
257 echo
258 elog "1.6 -> 1.8 changes that you may care about:"
259 elog "http://svn.asterisk.org/svn/${PN}/tags/${PV}/UPGRADE.txt"
260 elog "or: bzless ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.bz2"
261 }
262
263 pkg_config() {
264 einfo "Do you want to reset file permissions and ownerships (y/N)?"
265
266 read tmp
267 tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')"
268
269 if [[ "$tmp" = "y" ]] ||\
270 [[ "$tmp" = "yes" ]]
271 then
272 einfo "Resetting permissions to defaults..."
273
274 for x in spool run lib log; do
275 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
276 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
277 done
278
279 chown -R root:asterisk "${ROOT}"etc/asterisk
280 chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk
281
282 einfo "done"
283 else
284 einfo "skipping"
285 fi
286 }

  ViewVC Help
Powered by ViewVC 1.1.20