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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Fri Sep 19 10:14:31 2014 UTC (5 years, 2 months ago) by chainsaw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Upstream fix to fully respect SpanDSP API and avoid a potential null pointer dereference. On the 12 branch, additional input validation for the PubSub framework in PJSIP. Remove older non-stable ebuilds.

(Portage version: 2.2.13/cvs/Linux x86_64, signed Manifest commit with key 0xB5058F9A)

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

  ViewVC Help
Powered by ViewVC 1.1.20