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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Oct 9 08:38:23 2012 UTC (7 years, 3 months ago) by chainsaw
Branch: MAIN
Bugfix release on the 1.8 & 10 branches, addresses among other things a channel reference leak in ChanSpy, DTMF recognition issues in the absence of any interdigit delay, last queue member not being deleted, CEL PostgreSQL memory leak and a DUNDi message routing issue. Distro patchset unchanged.

(Portage version: 2.1.11.24/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-10.8.0.ebuild,v 1.1 2012/09/18 09:42:42 chainsaw Exp $
4
5 EAPI=4
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/releases/${MY_P}.tar.gz
13 mirror://gentoo/gentoo-asterisk-patchset-2.6.tar.bz2"
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17
18 IUSE_VOICEMAIL_STORAGE="
19 +voicemail_storage_file
20 voicemail_storage_odbc
21 voicemail_storage_imap
22 "
23 IUSE="${IUSE_VOICEMAIL_STORAGE} ais alsa bluetooth calendar +caps curl dahdi debug doc freetds gtalk http iconv jabber jingle ldap lua mysql newt +samples odbc osplookup oss portaudio postgres radius selinux snmp span speex srtp static syslog vorbis"
24 IUSE_EXPAND="VOICEMAIL_STORAGE"
25 REQUIRED_USE="gtalk? ( jabber )
26 ^^ ( ${IUSE_VOICEMAIL_STORAGE/+/} )
27 voicemail_storage_odbc? ( odbc )
28 "
29
30 EPATCH_SUFFIX="patch"
31 PATCHES=( "${WORKDIR}/asterisk-patchset" )
32
33 RDEPEND="dev-db/sqlite:3
34 dev-libs/popt
35 dev-libs/libxml2
36 dev-libs/openssl
37 sys-libs/ncurses
38 sys-libs/zlib
39 ais? ( sys-cluster/openais )
40 alsa? ( media-libs/alsa-lib )
41 bluetooth? ( net-wireless/bluez )
42 calendar? ( net-libs/neon
43 dev-libs/libical
44 dev-libs/iksemel )
45 caps? ( sys-libs/libcap )
46 curl? ( net-misc/curl )
47 dahdi? ( >=net-libs/libpri-1.4.12_beta2
48 net-misc/dahdi-tools )
49 freetds? ( dev-db/freetds )
50 gtalk? ( dev-libs/iksemel )
51 http? ( dev-libs/gmime:2.4 )
52 iconv? ( virtual/libiconv )
53 jabber? ( dev-libs/iksemel )
54 jingle? ( dev-libs/iksemel )
55 ldap? ( net-nds/openldap )
56 lua? ( dev-lang/lua )
57 mysql? ( virtual/mysql )
58 newt? ( dev-libs/newt )
59 odbc? ( dev-db/unixODBC )
60 osplookup? ( net-libs/osptoolkit )
61 portaudio? ( media-libs/portaudio )
62 postgres? ( dev-db/postgresql-base )
63 radius? ( net-dialup/radiusclient-ng )
64 selinux? ( sec-policy/selinux-asterisk )
65 snmp? ( net-analyzer/net-snmp )
66 span? ( media-libs/spandsp )
67 speex? ( media-libs/speex )
68 srtp? ( net-libs/libsrtp )
69 vorbis? ( media-libs/libvorbis )"
70
71 DEPEND="${RDEPEND}
72 !net-libs/openh323
73 voicemail_storage_imap? ( virtual/imap-c-client )
74 "
75
76 RDEPEND="${RDEPEND}
77 syslog? ( virtual/logger )"
78
79 PDEPEND="net-misc/asterisk-core-sounds
80 net-misc/asterisk-extra-sounds
81 net-misc/asterisk-moh-opsound"
82
83 S="${WORKDIR}/${MY_P}"
84
85 pkg_setup() {
86 CONFIG_CHECK="~!NF_CONNTRACK_SIP"
87 local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users
88 have reported that this module dropped critical SIP packets in their deployments. You
89 may want to disable it if you see such problems."
90 check_extra_config
91
92 enewgroup asterisk
93 enewgroup dialout 20
94 enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
95 }
96
97 src_prepare() {
98 base_src_prepare
99 AT_M4DIR=autoconf eautoreconf
100 }
101
102 src_configure() {
103 local vmst
104
105 econf \
106 --libdir="/usr/$(get_libdir)" \
107 --localstatedir="/var" \
108 --with-crypto \
109 --with-gsm=internal \
110 --with-popt \
111 --with-ssl \
112 --with-z \
113 $(use_with caps cap) \
114 $(use_with http gmime) \
115 $(use_with newt) \
116 $(use_with portaudio)
117
118 # Blank out sounds/sounds.xml file to prevent
119 # asterisk from installing sounds files (we pull them in via
120 # asterisk-{core,extra}-sounds and asterisk-moh-opsound.
121 >"${S}"/sounds/sounds.xml
122
123 # Compile menuselect binary for optional components
124 emake menuselect.makeopts
125
126 # Broken functionality is forcibly disabled (bug #360143)
127 menuselect/menuselect --disable chan_misdn menuselect.makeopts
128 menuselect/menuselect --disable chan_ooh323 menuselect.makeopts
129
130 # Utility set is forcibly enabled (bug #358001)
131 menuselect/menuselect --enable smsq menuselect.makeopts
132 menuselect/menuselect --enable streamplayer menuselect.makeopts
133 menuselect/menuselect --enable aelparse menuselect.makeopts
134 menuselect/menuselect --enable astman menuselect.makeopts
135
136 # this is connected, otherwise it would not find
137 # ast_pktccops_gate_alloc symbol
138 menuselect/menuselect --enable chan_mgcp menuselect.makeopts
139 menuselect/menuselect --enable res_pktccops menuselect.makeopts
140
141 # SSL is forcibly enabled, IAX2 & DUNDI are expected to be available
142 menuselect/menuselect --enable pbx_dundi menuselect.makeopts
143 menuselect/menuselect --enable func_aes menuselect.makeopts
144 menuselect/menuselect --enable chan_iax2 menuselect.makeopts
145
146 # SQlite3 is now the main database backend, enable related features
147 menuselect/menuselect --enable cdr_sqlite3_custom menuselect.makeopts
148 menuselect/menuselect --enable cel_sqlite3_custom menuselect.makeopts
149
150 # The others are based on USE-flag settings
151 use_select() {
152 local state=$(use "$1" && echo enable || echo disable)
153 shift # remove use from parameters
154
155 while [[ -n $1 ]]; do
156 menuselect/menuselect --${state} "$1" menuselect.makeopts
157 shift
158 done
159 }
160
161 use_select ais res_ais
162 use_select alsa chan_alsa
163 use_select bluetooth chan_mobile
164 use_select calendar res_calendar res_calendar_{caldav,ews,exchange,icalendar}
165 use_select curl func_curl res_config_curl res_curl
166 use_select dahdi app_dahdibarge app_dahdiras chan_dahdi codec_dahdi res_timing_dahdi
167 use_select freetds {cdr,cel}_tds
168 use_select gtalk chan_gtalk
169 use_select http res_http_post
170 use_select iconv func_iconv
171 use_select jabber res_jabber
172 use_select jingle chan_jingle
173 use_select ldap res_config_ldap
174 use_select lua pbx_lua
175 use_select mysql app_mysql cdr_mysql res_config_mysql
176 use_select odbc cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc
177 use_select osplookup app_osplookup
178 use_select oss chan_oss
179 use_select postgres {cdr,cel}_pgsql res_config_pgsql
180 use_select radius {cdr,cel}_radius
181 use_select snmp res_snmp
182 use_select span res_fax_spandsp
183 use_select speex {codec,func}_speex
184 use_select srtp res_srtp
185 use_select syslog cdr_syslog
186 use_select vorbis format_ogg_vorbis
187
188 # Voicemail storage ...
189 for vmst in ${IUSE_VOICEMAIL_STORAGE/+/}; do
190 if use ${vmst}; then
191 menuselect/menuselect --enable $(echo ${vmst##*_} | tr '[:lower:]' '[:upper:]')_STORAGE menuselect.makeopts
192 fi
193 done
194 }
195
196 src_compile() {
197 ASTLDFLAGS="${LDFLAGS}" emake
198 }
199
200 src_install() {
201 mkdir -p "${D}"usr/$(get_libdir)/pkgconfig || die
202 emake DESTDIR="${D}" installdirs
203 emake DESTDIR="${D}" install
204
205 if use radius; then
206 insinto /etc/radiusclient-ng/
207 doins contrib/dictionary.digium
208 fi
209 if use samples; then
210 emake DESTDIR="${D}" samples
211 for conffile in "${D}"etc/asterisk/*.*
212 do
213 chown asterisk:asterisk $conffile
214 chmod 0660 $conffile
215 done
216 einfo "Sample files have been installed"
217 else
218 einfo "Skipping installation of sample files..."
219 rm -f "${D}"var/lib/asterisk/mohmp3/* || die
220 rm -f "${D}"var/lib/asterisk/sounds/demo-* || die
221 rm -f "${D}"var/lib/asterisk/agi-bin/* || die
222 rm -f "${D}"etc/asterisk/* || die
223 fi
224 rm -rf "${D}"var/spool/asterisk/voicemail/default || die
225
226 # keep directories
227 diropts -m 0770 -o asterisk -g asterisk
228 keepdir /etc/asterisk
229 keepdir /var/lib/asterisk
230 keepdir /var/run/asterisk
231 keepdir /var/spool/asterisk
232 keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
233 diropts -m 0750 -o asterisk -g asterisk
234 keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
235
236 newinitd "${FILESDIR}"/1.8.0/asterisk.initd3 asterisk
237 newconfd "${FILESDIR}"/1.8.0/asterisk.confd asterisk
238
239 # install the upgrade documentation
240 #
241 dodoc README UPGRADE* BUGS CREDITS
242
243 # install extra documentation
244 #
245 if use doc
246 then
247 dodoc doc/*.txt
248 dodoc doc/*.pdf
249 fi
250
251 # install SIP scripts; bug #300832
252 #
253 dodoc "${FILESDIR}/1.6.2/sip_calc_auth"
254 dodoc "${FILESDIR}/1.8.0/find_call_sip_trace.sh"
255 dodoc "${FILESDIR}/1.8.0/find_call_ids.sh"
256 dodoc "${FILESDIR}/1.6.2/call_data.txt"
257
258 # install logrotate snippet; bug #329281
259 #
260 insinto /etc/logrotate.d
261 newins "${FILESDIR}/1.6.2/asterisk.logrotate3" asterisk
262 }
263
264 pkg_postinst() {
265 #
266 # Announcements, warnings, reminders...
267 #
268 einfo "Asterisk has been installed"
269 echo
270 elog "If you want to know more about asterisk, visit these sites:"
271 elog "http://www.asteriskdocs.org/"
272 elog "http://www.voip-info.org/wiki-Asterisk"
273 echo
274 elog "http://www.automated.it/guidetoasterisk.htm"
275 echo
276 elog "Gentoo VoIP IRC Channel:"
277 elog "#gentoo-voip @ irc.freenode.net"
278 echo
279 echo
280 elog "1.6 -> 1.8 changes that you may care about:"
281 elog "http://svn.asterisk.org/svn/${PN}/tags/${PV}/UPGRADE.txt"
282 elog "or: bzless ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.bz2"
283 }
284
285 pkg_config() {
286 einfo "Do you want to reset file permissions and ownerships (y/N)?"
287
288 read tmp
289 tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')"
290
291 if [[ "$tmp" = "y" ]] ||\
292 [[ "$tmp" = "yes" ]]
293 then
294 einfo "Resetting permissions to defaults..."
295
296 for x in spool run lib log; do
297 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
298 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
299 done
300
301 chown -R root:asterisk "${ROOT}"etc/asterisk
302 chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk
303
304 einfo "done"
305 else
306 einfo "skipping"
307 fi
308 }

  ViewVC Help
Powered by ViewVC 1.1.20