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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Mon Jul 14 20:13:36 2014 UTC (5 years, 6 months ago) by chainsaw
Branch: MAIN
New development on the 12 branch adds persistent connection support on the built-in HTTP server. Fixes trickling down to stable branches include making ast_careful_fwrite careful enough to avoid infinite loops and avoiding unnecessary MOH restarts. Downstream patchset unchanged.

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

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

  ViewVC Help
Powered by ViewVC 1.1.20