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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Feb 11 20:53:57 2015 UTC (4 years, 9 months ago) by chainsaw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Upgrades on the 12 & 13 branches for security bug #539806 (CVE-2015-1558). Removed vulnerable ebuilds.

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

  ViewVC Help
Powered by ViewVC 1.1.20