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

Contents of /net-misc/asterisk/asterisk-1.6.2.16.2-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Wed Mar 23 16:35:15 2011 UTC (8 years, 8 months ago) by chainsaw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Remove vulnerable ebuild for CVE-2011-1174 & CVE-2011-1175 now that a secure ebuild has been stabled.

(Portage version: 2.1.9.44/cvs/Linux x86_64)

1 # Copyright 1999-2011 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.6.2.16.2-r2.ebuild,v 1.2 2011/02/27 19:04:18 chainsaw Exp $
4
5 EAPI=3
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/releases/${MY_P}.tar.gz
13 mirror://gentoo/gentoo-asterisk-patchset-0.1.tar.bz2"
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="amd64 x86"
17
18 IUSE="alsa +caps dahdi doc freetds iconv jabber ldap lua newt +samples oss postgres radius snmp span speex ssl sqlite vorbis"
19
20 EPATCH_SUFFIX="patch"
21 PATCHES=( "${WORKDIR}/asterisk-patchset" )
22
23 RDEPEND="sys-libs/ncurses
24 dev-libs/popt
25 sys-libs/zlib
26 alsa? ( media-libs/alsa-lib )
27 caps? ( sys-libs/libcap )
28 dahdi? ( >=net-libs/libpri-1.4.7
29 net-misc/dahdi-tools )
30 freetds? ( dev-db/freetds )
31 iconv? ( virtual/libiconv )
32 jabber? ( dev-libs/iksemel )
33 ldap? ( net-nds/openldap )
34 lua? ( dev-lang/lua )
35 newt? ( dev-libs/newt )
36 postgres? ( dev-db/postgresql-base )
37 radius? ( net-dialup/radiusclient-ng )
38 snmp? ( net-analyzer/net-snmp )
39 span? ( media-libs/spandsp )
40 speex? ( media-libs/speex )
41 sqlite? ( dev-db/sqlite )
42 ssl? ( dev-libs/openssl )
43 vorbis? ( media-libs/libvorbis )"
44
45 DEPEND="${RDEPEND}
46 !<net-misc/asterisk-addons-1.6
47 !net-misc/asterisk-chan_unistim
48 !net-misc/zaptel"
49
50 PDEPEND="net-misc/asterisk-core-sounds
51 net-misc/asterisk-extra-sounds
52 net-misc/asterisk-moh-opsound"
53
54 S="${WORKDIR}/${MY_P}"
55
56 pkg_setup() {
57 CONFIG_CHECK="~!NF_CONNTRACK_SIP"
58 local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users
59 have reported that this module dropped critical SIP packets in their deployments. You
60 may want to disable it if you see such problems."
61 check_extra_config
62
63 enewgroup asterisk
64 enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
65 }
66
67 src_prepare() {
68 base_src_prepare
69 AT_M4DIR=autoconf eautoreconf
70 }
71
72 src_configure() {
73 econf \
74 --libdir="/usr/$(get_libdir)" \
75 --localstatedir="/var" \
76 --with-gsm=internal \
77 --with-popt \
78 --with-z \
79 $(use_with alsa asound) \
80 $(use_with caps cap) \
81 $(use_with dahdi pri) \
82 $(use_with dahdi tonezone) \
83 $(use_with dahdi) \
84 $(use_with freetds tds) \
85 $(use_with iconv) \
86 $(use_with jabber iksemel) \
87 $(use_with lua) \
88 $(use_with newt) \
89 $(use_with oss) \
90 $(use_with postgres) \
91 $(use_with radius) \
92 $(use_with snmp netsnmp) \
93 $(use_with span spandsp) \
94 $(use_with speex) \
95 $(use_with speex speexdsp) \
96 $(use_with sqlite sqlite3) \
97 $(use_with ssl crypto) \
98 $(use_with ssl) \
99 $(use_with vorbis ogg) \
100 $(use_with vorbis) || die "econf failed"
101
102 #
103 # blank out sounds/sounds.xml file to prevent
104 # asterisk from installing sounds files (we pull them in via
105 # asterisk-{core,extra}-sounds and asterisk-moh-opsound).
106 #
107 >"${S}"/sounds/sounds.xml
108 }
109
110 src_compile() {
111 ASTLDFLAGS="${LDFLAGS}" emake || die "emake failed"
112 }
113
114 src_install() {
115 # setup directory structure
116 #
117 mkdir -p "${D}"usr/$(get_libdir)/pkgconfig
118
119 emake DESTDIR="${D}" install || die "emake install failed"
120
121 if use samples; then
122 emake DESTDIR="${D}" samples || die "emake samples failed"
123 for conffile in "${D}"etc/asterisk/*.*
124 do
125 chown asterisk:asterisk $conffile
126 chmod 0660 $conffile
127 done
128 einfo "Sample files have been installed"
129 else
130 einfo "Skipping installation of sample files..."
131 rm -f "${D}"var/lib/asterisk/mohmp3/*
132 rm -f "${D}"var/lib/asterisk/sounds/demo-*
133 rm -f "${D}"var/lib/asterisk/agi-bin/*
134 rm -f "${D}"etc/asterisk/*
135 fi
136 rm -rf "${D}"var/spool/asterisk/voicemail/default
137
138 # keep directories
139 diropts -m 0770 -o asterisk -g asterisk
140 keepdir /etc/asterisk
141 keepdir /var/lib/asterisk
142 keepdir /var/run/asterisk
143 keepdir /var/spool/asterisk
144 keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
145 diropts -m 0750 -o asterisk -g asterisk
146 keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
147
148 newinitd "${FILESDIR}"/1.6.2/asterisk.initd2 asterisk
149 newconfd "${FILESDIR}"/1.6.0/asterisk.confd asterisk
150
151 # install the upgrade documentation
152 #
153 dodoc README UPGRADE* BUGS CREDITS
154
155 # install extra documentation
156 #
157 if use doc
158 then
159 dodoc doc/*.txt
160 dodoc doc/*.pdf
161 dodoc doc/PEERING
162 dodoc doc/CODING-GUIDELINES
163 dodoc doc/tex/*.pdf
164 fi
165
166 # install snmp mib files
167 #
168 if use snmp
169 then
170 insinto /usr/share/snmp/mibs/
171 doins doc/digium-mib.txt doc/asterisk-mib.txt
172 fi
173
174 # install SIP scripts; bug #300832
175 #
176 dodoc "${FILESDIR}/1.6.2/sip_calc_auth"
177 dodoc "${FILESDIR}/1.6.2/find_call_sip_trace.sh"
178 dodoc "${FILESDIR}/1.6.2/find_call_ids.sh"
179 dodoc "${FILESDIR}/1.6.2/call_data.txt"
180
181 insinto /etc/logrotate.d
182 newins "${FILESDIR}/1.6.2/asterisk.logrotate3" asterisk
183 }
184
185 pkg_postinst() {
186 #
187 # Announcements, warnings, reminders...
188 #
189 einfo "Asterisk has been installed"
190 einfo
191 elog "If you want to know more about asterisk, visit these sites:"
192 elog "http://www.asteriskdocs.org/"
193 elog "http://www.voip-info.org/wiki-Asterisk"
194 einfo
195 elog "http://www.automated.it/guidetoasterisk.htm"
196 einfo
197 elog "Gentoo VoIP IRC Channel:"
198 elog "#gentoo-voip @ irc.freenode.net"
199 }
200
201 pkg_config() {
202 einfo "Do you want to reset file permissions and ownerships (y/N)?"
203
204 read tmp
205 tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')"
206
207 if [[ "$tmp" = "y" ]] ||\
208 [[ "$tmp" = "yes" ]]
209 then
210 einfo "Resetting permissions to defaults..."
211
212 for x in spool run lib log; do
213 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
214 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
215 done
216
217 chown -R root:asterisk "${ROOT}"etc/asterisk
218 chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk
219
220 einfo "done"
221 else
222 einfo "skipping"
223 fi
224 }

  ViewVC Help
Powered by ViewVC 1.1.20