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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Oct 15 18:04:29 2010 UTC (9 years, 2 months ago) by chainsaw
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Remove old ebuilds & patches.

(Portage version: 2.1.9.18/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.11-r1.ebuild,v 1.1 2010/08/20 23:12: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 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 )
61
62 pkg_setup() {
63 CONFIG_CHECK="~!NF_CONNTRACK_SIP"
64 local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users
65 have reported that this module dropped critical SIP packets in their deployments. You
66 may want to disable it if you see such problems."
67 check_extra_config
68 }
69
70 src_prepare() {
71 base_src_prepare
72 AT_M4DIR=autoconf eautoreconf
73 }
74
75 src_configure() {
76 econf \
77 --libdir="/usr/$(get_libdir)" \
78 --localstatedir="/var" \
79 --with-gsm=internal \
80 --with-popt \
81 --with-z \
82 $(use_with alsa asound) \
83 $(use_with caps cap) \
84 $(use_with dahdi pri) \
85 $(use_with dahdi tonezone) \
86 $(use_with dahdi) \
87 $(use_with freetds tds) \
88 $(use_with iconv) \
89 $(use_with jabber iksemel) \
90 $(use_with lua) \
91 $(use_with misdn isdnnet) \
92 $(use_with misdn suppserv) \
93 $(use_with misdn) \
94 $(use_with newt) \
95 $(use_with oss) \
96 $(use_with postgres) \
97 $(use_with radius) \
98 $(use_with snmp netsnmp) \
99 $(use_with span spandsp) \
100 $(use_with speex) \
101 $(use_with speex speexdsp) \
102 $(use_with sqlite sqlite3) \
103 $(use_with ssl crypto) \
104 $(use_with ssl) \
105 $(use_with vorbis ogg) \
106 $(use_with vorbis) || die "econf failed"
107
108 #
109 # blank out sounds/sounds.xml file to prevent
110 # asterisk from installing sounds files (we pull them in via
111 # asterisk-{core,extra}-sounds and asterisk-moh-opsound.
112 #
113 >"${S}"/sounds/sounds.xml
114 }
115
116 src_compile() {
117 ASTLDFLAGS="${LDFLAGS}" emake || die "emake failed"
118 }
119
120 src_install() {
121 # setup directory structure
122 #
123 mkdir -p "${D}"usr/$(get_libdir)/pkgconfig
124
125 emake DESTDIR="${D}" install || die "emake install failed"
126
127 if use samples; then
128 emake DESTDIR="${D}" samples || die "emake samples failed"
129 for conffile in "${D}"etc/asterisk/*.*
130 do
131 chown asterisk:asterisk $conffile
132 chmod 0660 $conffile
133 done
134 einfo "Sample files have been installed"
135 else
136 einfo "Skipping installation of sample files..."
137 rm -f "${D}"var/lib/asterisk/mohmp3/*
138 rm -f "${D}"var/lib/asterisk/sounds/demo-*
139 rm -f "${D}"var/lib/asterisk/agi-bin/*
140 rm -f "${D}"etc/asterisk/*
141 fi
142 rm -rf "${D}"var/spool/asterisk/voicemail/default
143
144 # keep directories
145 diropts -m 0770 -o asterisk -g asterisk
146 keepdir /etc/asterisk
147 keepdir /var/lib/asterisk
148 keepdir /var/run/asterisk
149 keepdir /var/spool/asterisk
150 keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
151 diropts -m 0750 -o asterisk -g asterisk
152 keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
153
154 newinitd "${FILESDIR}"/1.6.2/asterisk.initd2 asterisk
155 newconfd "${FILESDIR}"/1.6.0/asterisk.confd asterisk
156
157 # some people like to keep the sources around for custom patching
158 # copy the whole source tree to /usr/src/asterisk-${PVF} and run make clean there
159 if use keepsrc
160 then
161 dodir /usr/src
162
163 ebegin "Copying sources into /usr/src"
164 cp -dPR "${S}" "${D}"/usr/src/${PF} || die "Unable to copy sources"
165 eend $?
166
167 ebegin "Cleaning source tree"
168 emake -C "${D}"/usr/src/${PF} clean &>/dev/null || die "Unable to clean sources"
169 eend $?
170
171 einfo "Clean sources are available in "${ROOT}"usr/src/${PF}"
172 fi
173
174 # install the upgrade documentation
175 #
176 dodoc README UPGRADE* BUGS CREDITS
177
178 # install snmp mib files
179 #
180 if use snmp
181 then
182 insinto /usr/share/snmp/mibs/
183 doins doc/digium-mib.txt doc/asterisk-mib.txt
184 fi
185
186 # install SIP scripts; bug #300832
187 #
188 dodoc "${FILESDIR}/1.6.2/sip_calc_auth"
189 dodoc "${FILESDIR}/1.6.2/find_call_sip_trace.sh"
190 dodoc "${FILESDIR}/1.6.2/find_call_ids.sh"
191 dodoc "${FILESDIR}/1.6.2/call_data.txt"
192
193 # install logrotate snippet; bug #329281
194 #
195 if use logrotate
196 then
197 insinto /etc/logrotate.d
198 newins "${FILESDIR}/1.6.2/asterisk.logrotate" asterisk
199 fi
200 }
201
202 pkg_preinst() {
203 enewgroup asterisk
204 enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
205 }
206
207 pkg_postinst() {
208 #
209 # Announcements, warnings, reminders...
210 #
211 einfo "Asterisk has been installed"
212 echo
213 elog "If you want to know more about asterisk, visit these sites:"
214 elog "http://www.asteriskdocs.org/"
215 elog "http://www.voip-info.org/wiki-Asterisk"
216 echo
217 elog "http://www.automated.it/guidetoasterisk.htm"
218 echo
219 elog "Gentoo VoIP IRC Channel:"
220 elog "#gentoo-voip @ irc.freenode.net"
221 echo
222 echo
223 elog "1.6.1 -> 1.6.2 changes that you may care about:"
224 elog "canreinvite -> directmedia (sip.conf)"
225 elog "extensive T.38 (fax) changes"
226 elog "http://svn.asterisk.org/svn/${PN}/tags/${PV}/UPGRADE.txt"
227 elog "or: bzless ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.bz2"
228 }
229
230 pkg_config() {
231 einfo "Do you want to reset file permissions and ownerships (y/N)?"
232
233 read tmp
234 tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')"
235
236 if [[ "$tmp" = "y" ]] ||\
237 [[ "$tmp" = "yes" ]]
238 then
239 einfo "Resetting permissions to defaults..."
240
241 for x in spool run lib log; do
242 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
243 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
244 done
245
246 chown -R root:asterisk "${ROOT}"etc/asterisk
247 chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk
248
249 einfo "done"
250 else
251 einfo "skipping"
252 fi
253 }

  ViewVC Help
Powered by ViewVC 1.1.20