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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Tue Apr 10 09:51:40 2012 UTC (7 years, 8 months ago) by chainsaw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Remove vulnerable ebuild for security bug #408431 by Tim Sammut.

(Portage version: 2.1.10.56/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-1.8.8.2.ebuild,v 1.4 2012/03/02 17:48:28 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/${MY_P}.tar.gz
13 mirror://gentoo/gentoo-asterisk-patchset-1.7.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 http iconv jabber jingle ldap lua mysql newt +samples odbc osplookup oss portaudio postgres radius snmp span speex sqlite sqlite3 srtp static syslog usb vorbis"
19
20 EPATCH_SUFFIX="patch"
21 PATCHES=( "${WORKDIR}/asterisk-patchset" )
22
23 RDEPEND="dev-libs/popt
24 dev-libs/libxml2
25 dev-libs/openssl
26 ais? ( sys-cluster/openais )
27 alsa? ( media-libs/alsa-lib )
28 bluetooth? ( net-wireless/bluez )
29 calendar? ( net-libs/neon
30 dev-libs/libical
31 dev-libs/iksemel )
32 caps? ( sys-libs/libcap )
33 curl? ( net-misc/curl )
34 dahdi? ( >=net-libs/libpri-1.4.12_beta2
35 net-misc/dahdi-tools )
36 freetds? ( dev-db/freetds )
37 gtalk? ( dev-libs/iksemel )
38 http? ( dev-libs/gmime:2.4 )
39 iconv? ( virtual/libiconv )
40 jabber? ( dev-libs/iksemel )
41 jingle? ( dev-libs/iksemel )
42 ldap? ( net-nds/openldap )
43 lua? ( dev-lang/lua )
44 mysql? ( virtual/mysql )
45 newt? ( dev-libs/newt )
46 odbc? ( dev-db/unixODBC )
47 osplookup? ( net-libs/osptoolkit )
48 portaudio? ( media-libs/portaudio )
49 postgres? ( dev-db/postgresql-base )
50 radius? ( net-dialup/radiusclient-ng )
51 snmp? ( net-analyzer/net-snmp )
52 span? ( media-libs/spandsp )
53 speex? ( media-libs/speex )
54 sqlite? ( dev-db/sqlite:0 )
55 sqlite3? ( dev-db/sqlite:3 )
56 srtp? ( net-libs/libsrtp )
57 usb? ( dev-libs/libusb
58 media-libs/alsa-lib )
59 vorbis? ( media-libs/libvorbis )"
60
61 DEPEND="${RDEPEND}
62 !net-libs/openh323"
63
64 RDEPEND="${RDEPEND}
65 syslog? ( virtual/logger )"
66
67 PDEPEND="net-misc/asterisk-core-sounds
68 net-misc/asterisk-extra-sounds
69 net-misc/asterisk-moh-opsound"
70
71 S="${WORKDIR}/${MY_P}"
72
73 pkg_setup() {
74 CONFIG_CHECK="~!NF_CONNTRACK_SIP"
75 local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users
76 have reported that this module dropped critical SIP packets in their deployments. You
77 may want to disable it if you see such problems."
78 check_extra_config
79
80 enewgroup asterisk
81 enewgroup dialout 20
82 enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
83 }
84
85 src_prepare() {
86 base_src_prepare
87 AT_M4DIR=autoconf eautoreconf
88 }
89
90 src_configure() {
91 econf \
92 --libdir="/usr/$(get_libdir)" \
93 --localstatedir="/var" \
94 --with-crypto \
95 --with-gsm=internal \
96 --with-popt \
97 --with-ssl \
98 --with-z \
99 $(use_with caps cap) \
100 $(use_with http gmime) \
101 $(use_with newt) \
102 $(use_with portaudio)
103
104 # Blank out sounds/sounds.xml file to prevent
105 # asterisk from installing sounds files (we pull them in via
106 # asterisk-{core,extra}-sounds and asterisk-moh-opsound.
107 >"${S}"/sounds/sounds.xml
108
109 # Compile menuselect binary for optional components
110 emake menuselect.makeopts
111
112 # Broken functionality is forcibly disabled (bug #360143)
113 menuselect/menuselect --disable chan_misdn menuselect.makeopts
114 menuselect/menuselect --disable chan_ooh323 menuselect.makeopts
115
116 # Utility set is forcibly enabled (bug #358001)
117 menuselect/menuselect --enable smsq menuselect.makeopts
118 menuselect/menuselect --enable streamplayer menuselect.makeopts
119 menuselect/menuselect --enable aelparse menuselect.makeopts
120 menuselect/menuselect --enable astman menuselect.makeopts
121
122 # this is connected, otherwise it would not find
123 # ast_pktccops_gate_alloc symbol
124 menuselect/menuselect --enable chan_mgcp menuselect.makeopts
125 menuselect/menuselect --enable res_pktccops menuselect.makeopts
126
127 # SSL is forcibly enabled, IAX2 & DUNDI are expected to be available
128 menuselect/menuselect --enable pbx_dundi menuselect.makeopts
129 menuselect/menuselect --enable func_aes menuselect.makeopts
130 menuselect/menuselect --enable chan_iax2 menuselect.makeopts
131
132 # The others are based on USE-flag settings
133 use_select() {
134 local state=$(use "$1" && echo enable || echo disable)
135 shift # remove use from parameters
136
137 while [[ -n $1 ]]; do
138 menuselect/menuselect --${state} "$1" menuselect.makeopts
139 shift
140 done
141 }
142
143 use_select ais res_ais
144 use_select alsa chan_alsa
145 use_select bluetooth chan_mobile
146 use_select calendar res_calendar res_calendar_{caldav,ews,exchange,icalendar}
147 use_select curl func_curl res_config_curl res_curl
148 use_select dahdi app_dahdibarge app_dahdiras chan_dahdi codec_dahdi res_timing_dahdi
149 use_select freetds {cdr,cel}_tds
150 use_select gtalk chan_gtalk
151 use_select http res_http_post
152 use_select iconv func_iconv
153 use_select jabber res_jabber
154 use_select jingle chan_jingle
155 use_select ldap res_config_ldap
156 use_select lua pbx_lua
157 use_select mysql app_mysql cdr_mysql res_config_mysql
158 use_select odbc cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc
159 use_select osplookup app_osplookup
160 use_select oss chan_oss
161 use_select postgres {cdr,cel}_pgsql res_config_pgsql
162 use_select radius {cdr,cel}_radius
163 use_select snmp res_snmp
164 use_select span res_fax_spandsp
165 use_select speex {codec,func}_speex
166 use_select sqlite cdr_sqlite
167 use_select sqlite3 {cdr,cel}_sqlite3_custom
168 use_select srtp res_srtp
169 use_select syslog cdr_syslog
170 use_select usb chan_usbradio
171 use_select vorbis format_ogg_vorbis
172 }
173
174 src_compile() {
175 ASTLDFLAGS="${LDFLAGS}" emake
176 }
177
178 src_install() {
179 mkdir -p "${D}"usr/$(get_libdir)/pkgconfig || die
180 emake DESTDIR="${D}" installdirs
181 emake DESTDIR="${D}" install
182
183 if use radius; then
184 insinto /etc/radiusclient-ng/
185 doins contrib/dictionary.digium
186 fi
187 if use samples; then
188 emake DESTDIR="${D}" samples
189 for conffile in "${D}"etc/asterisk/*.*
190 do
191 chown asterisk:asterisk $conffile
192 chmod 0660 $conffile
193 done
194 einfo "Sample files have been installed"
195 else
196 einfo "Skipping installation of sample files..."
197 rm -f "${D}"var/lib/asterisk/mohmp3/* || die
198 rm -f "${D}"var/lib/asterisk/sounds/demo-* || die
199 rm -f "${D}"var/lib/asterisk/agi-bin/* || die
200 rm -f "${D}"etc/asterisk/* || die
201 fi
202 rm -rf "${D}"var/spool/asterisk/voicemail/default || die
203
204 # keep directories
205 diropts -m 0770 -o asterisk -g asterisk
206 keepdir /etc/asterisk
207 keepdir /var/lib/asterisk
208 keepdir /var/run/asterisk
209 keepdir /var/spool/asterisk
210 keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
211 diropts -m 0750 -o asterisk -g asterisk
212 keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
213
214 newinitd "${FILESDIR}"/1.8.0/asterisk.initd2 asterisk
215 newconfd "${FILESDIR}"/1.8.0/asterisk.confd asterisk
216
217 # install the upgrade documentation
218 #
219 dodoc README UPGRADE* BUGS CREDITS
220
221 # install extra documentation
222 #
223 if use doc
224 then
225 dodoc doc/*.txt
226 dodoc doc/*.pdf
227 fi
228
229 # install SIP scripts; bug #300832
230 #
231 dodoc "${FILESDIR}/1.6.2/sip_calc_auth"
232 dodoc "${FILESDIR}/1.6.2/find_call_sip_trace.sh"
233 dodoc "${FILESDIR}/1.6.2/find_call_ids.sh"
234 dodoc "${FILESDIR}/1.6.2/call_data.txt"
235
236 # install logrotate snippet; bug #329281
237 #
238 insinto /etc/logrotate.d
239 newins "${FILESDIR}/1.6.2/asterisk.logrotate3" asterisk
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