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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Dec 2 13:37:30 2010 UTC (9 years ago) by chainsaw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Consolidate patchset in a tarball on the mirrors, closes bug #344015 by Marcin BaczyƄski. Drop logrotate USE-flag, always install snippet, closes bug #344181 by Jeroen Roovers. Updated init script to fix restart bug by Jaco Kroon, closes bug #345307. Version bump closes bug #346737 by Jesse Adelman, with an honourable mention for Kerin Millar for pointing out some QA matters which are now fixed.

(Portage version: 2.1.9.25/cvs/Linux x86_64)

1 # Copyright 1999-2010 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.13-r1.ebuild,v 1.1 2010/09/16 17:31:54 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 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16
17 IUSE="alsa +caps dahdi debug doc freetds iconv jabber ldap lua keepsrc logrotate misdn newt +samples oss postgres radius snmp span speex ssl sqlite static vorbis"
18
19 RDEPEND="sys-libs/ncurses
20 dev-libs/popt
21 sys-libs/zlib
22 alsa? ( media-libs/alsa-lib )
23 caps? ( sys-libs/libcap )
24 dahdi? ( >=net-libs/libpri-1.4.7
25 net-misc/dahdi-tools )
26 freetds? ( dev-db/freetds )
27 iconv? ( virtual/libiconv )
28 jabber? ( dev-libs/iksemel )
29 ldap? ( net-nds/openldap )
30 lua? ( dev-lang/lua )
31 misdn? ( net-dialup/misdnuser )
32 newt? ( dev-libs/newt )
33 postgres? ( dev-db/postgresql-base )
34 radius? ( net-dialup/radiusclient-ng )
35 snmp? ( net-analyzer/net-snmp )
36 span? ( media-libs/spandsp )
37 speex? ( media-libs/speex )
38 sqlite? ( dev-db/sqlite )
39 ssl? ( dev-libs/openssl )
40 vorbis? ( media-libs/libvorbis )"
41
42 DEPEND="${RDEPEND}
43 !<net-misc/asterisk-addons-1.6
44 !net-misc/asterisk-chan_unistim
45 !net-misc/zaptel"
46
47 PDEPEND="net-misc/asterisk-core-sounds
48 net-misc/asterisk-extra-sounds
49 net-misc/asterisk-moh-opsound"
50
51 S="${WORKDIR}/${MY_P}"
52
53 PATCHES=(
54 "${FILESDIR}/1.6.2/${PN}-1.6.2.9-gsm-pic.patch"
55 "${FILESDIR}/1.6.2/${PN}-1.6.2.8-pri-missing-keyword.patch"
56 "${FILESDIR}/1.6.2/${PN}-1.6.2.8-inband-indications.patch"
57 "${FILESDIR}/1.6.1/${PN}-1.6.1-uclibc.patch"
58 "${FILESDIR}/1.6.2/${PN}-1.6.2.2-nv-faxdetect.patch"
59 "${FILESDIR}/1.6.2/${PN}-1.6.2.11-strip-noapi.patch"
60 "${FILESDIR}/1.6.2/${P}-iax2-peerstate.patch"
61 "${FILESDIR}/1.6.2/${P}-dahdiras-without-root.patch"
62 "${FILESDIR}/1.6.2/${P}-backport-bri-net-ptmp.patch"
63 )
64
65 pkg_setup() {
66 CONFIG_CHECK="~!NF_CONNTRACK_SIP"
67 local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users
68 have reported that this module dropped critical SIP packets in their deployments. You
69 may want to disable it if you see such problems."
70 check_extra_config
71 }
72
73 src_prepare() {
74 base_src_prepare
75 AT_M4DIR=autoconf eautoreconf
76 }
77
78 src_configure() {
79 econf \
80 --libdir="/usr/$(get_libdir)" \
81 --localstatedir="/var" \
82 --with-gsm=internal \
83 --with-popt \
84 --with-z \
85 $(use_with alsa asound) \
86 $(use_with caps cap) \
87 $(use_with dahdi pri) \
88 $(use_with dahdi tonezone) \
89 $(use_with dahdi) \
90 $(use_with freetds tds) \
91 $(use_with iconv) \
92 $(use_with jabber iksemel) \
93 $(use_with lua) \
94 $(use_with misdn isdnnet) \
95 $(use_with misdn suppserv) \
96 $(use_with misdn) \
97 $(use_with newt) \
98 $(use_with oss) \
99 $(use_with postgres) \
100 $(use_with radius) \
101 $(use_with snmp netsnmp) \
102 $(use_with span spandsp) \
103 $(use_with speex) \
104 $(use_with speex speexdsp) \
105 $(use_with sqlite sqlite3) \
106 $(use_with ssl crypto) \
107 $(use_with ssl) \
108 $(use_with vorbis ogg) \
109 $(use_with vorbis) || die "econf failed"
110
111 #
112 # blank out sounds/sounds.xml file to prevent
113 # asterisk from installing sounds files (we pull them in via
114 # asterisk-{core,extra}-sounds and asterisk-moh-opsound.
115 #
116 >"${S}"/sounds/sounds.xml
117 }
118
119 src_compile() {
120 ASTLDFLAGS="${LDFLAGS}" emake || die "emake failed"
121 }
122
123 src_install() {
124 # setup directory structure
125 #
126 mkdir -p "${D}"usr/$(get_libdir)/pkgconfig
127
128 emake DESTDIR="${D}" install || die "emake install failed"
129
130 if use samples; then
131 emake DESTDIR="${D}" samples || die "emake samples failed"
132 for conffile in "${D}"etc/asterisk/*.*
133 do
134 chown asterisk:asterisk $conffile
135 chmod 0660 $conffile
136 done
137 einfo "Sample files have been installed"
138 else
139 einfo "Skipping installation of sample files..."
140 rm -f "${D}"var/lib/asterisk/mohmp3/*
141 rm -f "${D}"var/lib/asterisk/sounds/demo-*
142 rm -f "${D}"var/lib/asterisk/agi-bin/*
143 rm -f "${D}"etc/asterisk/*
144 fi
145 rm -rf "${D}"var/spool/asterisk/voicemail/default
146
147 # keep directories
148 diropts -m 0770 -o asterisk -g asterisk
149 keepdir /etc/asterisk
150 keepdir /var/lib/asterisk
151 keepdir /var/run/asterisk
152 keepdir /var/spool/asterisk
153 keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
154 diropts -m 0750 -o asterisk -g asterisk
155 keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
156
157 newinitd "${FILESDIR}"/1.6.2/asterisk.initd2 asterisk
158 newconfd "${FILESDIR}"/1.6.0/asterisk.confd asterisk
159
160 # some people like to keep the sources around for custom patching
161 # copy the whole source tree to /usr/src/asterisk-${PVF} and run make clean there
162 if use keepsrc
163 then
164 dodir /usr/src
165
166 ebegin "Copying sources into /usr/src"
167 cp -dPR "${S}" "${D}"/usr/src/${PF} || die "Unable to copy sources"
168 eend $?
169
170 ebegin "Cleaning source tree"
171 emake -C "${D}"/usr/src/${PF} clean &>/dev/null || die "Unable to clean sources"
172 eend $?
173
174 einfo "Clean sources are available in "${ROOT}"usr/src/${PF}"
175 fi
176
177 # install the upgrade documentation
178 #
179 dodoc README UPGRADE* BUGS CREDITS
180
181 # install extra documentation
182 #
183 if use doc
184 then
185 dodoc doc/*.txt
186 dodoc doc/*.pdf
187 dodoc doc/PEERING
188 dodoc doc/CODING-GUIDELINES
189 dodoc doc/tex/*.pdf
190 fi
191
192 # install snmp mib files
193 #
194 if use snmp
195 then
196 insinto /usr/share/snmp/mibs/
197 doins doc/digium-mib.txt doc/asterisk-mib.txt
198 fi
199
200 # install SIP scripts; bug #300832
201 #
202 dodoc "${FILESDIR}/1.6.2/sip_calc_auth"
203 dodoc "${FILESDIR}/1.6.2/find_call_sip_trace.sh"
204 dodoc "${FILESDIR}/1.6.2/find_call_ids.sh"
205 dodoc "${FILESDIR}/1.6.2/call_data.txt"
206
207 # install logrotate snippet; bug #329281
208 #
209 if use logrotate
210 then
211 insinto /etc/logrotate.d
212 newins "${FILESDIR}/1.6.2/asterisk.logrotate2" asterisk
213 fi
214 }
215
216 pkg_preinst() {
217 enewgroup asterisk
218 enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
219 }
220
221 pkg_postinst() {
222 #
223 # Announcements, warnings, reminders...
224 #
225 einfo "Asterisk has been installed"
226 echo
227 elog "If you want to know more about asterisk, visit these sites:"
228 elog "http://www.asteriskdocs.org/"
229 elog "http://www.voip-info.org/wiki-Asterisk"
230 echo
231 elog "http://www.automated.it/guidetoasterisk.htm"
232 echo
233 elog "Gentoo VoIP IRC Channel:"
234 elog "#gentoo-voip @ irc.freenode.net"
235 echo
236 echo
237 elog "1.6.1 -> 1.6.2 changes that you may care about:"
238 elog "canreinvite -> directmedia (sip.conf)"
239 elog "extensive T.38 (fax) changes"
240 elog "http://svn.asterisk.org/svn/${PN}/tags/${PV}/UPGRADE.txt"
241 elog "or: bzless ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.bz2"
242 }
243
244 pkg_config() {
245 einfo "Do you want to reset file permissions and ownerships (y/N)?"
246
247 read tmp
248 tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')"
249
250 if [[ "$tmp" = "y" ]] ||\
251 [[ "$tmp" = "yes" ]]
252 then
253 einfo "Resetting permissions to defaults..."
254
255 for x in spool run lib log; do
256 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
257 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
258 done
259
260 chown -R root:asterisk "${ROOT}"etc/asterisk
261 chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk
262
263 einfo "done"
264 else
265 einfo "skipping"
266 fi
267 }

  ViewVC Help
Powered by ViewVC 1.1.20