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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Thu May 3 09:52:13 2012 UTC (7 years, 7 months ago) by chainsaw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Bugfix release; double FD closure patch by Jaco Kroon finally applied upstream. Also prevents chanspy from binding to zombie channels and removes an unnecessary ISDN hold restrictions on non-bridged calls. Removed vulnerable 1.8 branch ebuild now that a secure version is stable.

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

  ViewVC Help
Powered by ViewVC 1.1.20