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

Contents of /net-misc/asterisk-addons/asterisk-addons-1.2.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Wed Jan 10 22:46:21 2007 UTC (12 years, 11 months ago) by gustavoz
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Cleaned up old wrt #160038
(Portage version: 2.1.1-r2)
 (Signed Manifest commit)

1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk-addons/asterisk-addons-1.2.1.ebuild,v 1.2 2006/11/23 20:36:56 vivo Exp $
4
5 IUSE="mysql sqlite h323"
6
7 inherit eutils flag-o-matic
8
9 ## TODO:
10 #
11 # - cleanup
12 #
13
14 SQLITE_PV="3.2.1"
15
16 MY_P="${P/_/-}"
17
18 DESCRIPTION="Additional Plugins for Asterisk"
19 HOMEPAGE="http://www.asterisk.org/"
20 SRC_URI="http://ftp.digium.com/pub/asterisk/${MY_P}.tar.gz
21 sqlite? ( http://www.sqlite.org/sqlite-${SQLITE_PV}.tar.gz )"
22
23 S=${WORKDIR}/${MY_P}
24
25 SLOT="0"
26 LICENSE="GPL-2"
27 KEYWORDS="~x86"
28
29 DEPEND=">=net-misc/asterisk-1.2.0
30 mysql? ( virtual/mysql )"
31
32 pkg_setup() {
33 local n dosleep=0
34 einfo "Running pre-flight checks..."
35
36 if use h323 && built_with_use net-misc/asterisk h323; then
37 echo
38 ewarn "h323: Emerging ${PN} with the h323 flag enabled will overwrite asterisk's chan_h323.so!"
39 ewarn "h323: Be sure to upgrade ${ROOT}etc/asterisk/h323.conf afterwards!"
40 dosleep=1
41 fi
42
43 if use sqlite && built_with_use net-misc/asterisk sqlite; then
44 echo
45 ewarn "sqlite: Emerging ${PN} with the sqlite flag enabled will overwrite asterisk's res_sqlite.so!"
46 ewarn "sqlite: Be sure to upgrade ${ROOT}etc/asterisk/res_sqlite.conf afterwards!"
47 dosleep=1
48 fi
49
50 echo
51 if [[ $dosleep -gt 0 ]]; then
52 ebeep
53 n=10
54 while [[ $n -gt 0 ]]; do
55 echo -en " Waiting $n seconds...\r"
56 sleep 1
57 (( n-- ))
58 done
59 fi
60 }
61
62 src_unpack() {
63 unpack ${A}
64 cd ${S}
65
66 #
67 # gentoo patchset
68 #
69 epatch ${FILESDIR}/${PN}-1.2.0-gentoo-base.diff
70 epatch ${FILESDIR}/${PN}-1.2.0-gentoo-res_sqlite3.diff
71 epatch ${FILESDIR}/${PN}-1.2.0-gentoo-ooh323c.diff
72
73 # patch sqlite
74 if use sqlite; then
75 cd ${WORKDIR}/sqlite-${SQLITE_PV}
76
77 epatch ${FILESDIR}/sqlite-${SQLITE_PV}-data-corruption.patch
78 epunt_cxx
79 fi
80
81 # rebuild ooh323c configure
82 if use h323; then
83 cd ${S}/asterisk-ooh323c
84 libtoolize --copy --force || die "libtoolize failed"
85 fi
86 }
87
88 src_compile() {
89 append-flags -fPIC
90
91 emake -j1 || die "Make failed"
92
93 if use sqlite; then
94 cd ${WORKDIR}/sqlite-${SQLITE_PV}
95 econf --enable-threadsafe || die ""
96 emake || die ""
97
98 cd ${S}
99 emake -j1 -C res_sqlite3 \
100 SQLITEDIR=${WORKDIR}/sqlite-${SQLITE_PV} || die "Make res_sqlite failed"
101 fi
102
103 if use h323; then
104 cd ${S}/asterisk-ooh323c
105 econf || die "econf failed"
106 emake || die "emake failed"
107 fi
108 }
109
110 src_install() {
111 make DESTDIR=${D} install || die "Make install failed"
112
113 if use sqlite; then
114 make -C res_sqlite3 \
115 DESTDIR=${D} install || die "Make install res_sqlite3 failed"
116 fi
117
118 if use h323; then
119 make -C asterisk-ooh323c \
120 DESTDIR=${D} install || die "Make instal ooh323c failed"
121 fi
122
123 # install standard docs...
124 dodoc README
125 dodoc doc/cdr_mysql.txt
126
127 insinto /usr/share/doc/${PF}
128 doins configs/*.sample
129
130 if use sqlite; then
131 cd ${S}/res_sqlite3
132 docinto res_sqlite3
133 dodoc README
134 insinto /usr/share/doc/${PF}/res_sqlite3
135 doins res_sqlite.conf dialplan.sql
136 keepdir /var/lib/asterisk/sqlite
137 fi
138
139 if use h323; then
140 cd ${S}/asterisk-ooh323c
141 docinto chan_ooh323c
142 dodoc AUTHORS INSTALL NEWS README COPYING ChangeLog
143 dodoc h323.conf.sample extensions.conf.sample
144
145 insinto /etc/asterisk
146 newins h323.conf.sample h323.conf
147 fi
148
149 cd ${S}
150
151 if use mysql; then
152 insinto /etc/asterisk
153 newins configs/cdr_mysql.conf.sample cdr_mysql.conf
154 newins configs/res_mysql.conf.sample res_mysql.conf
155 fi
156
157 einfo "Fixing permissions"
158 chown -R root:asterisk ${D}etc/asterisk
159 chmod -R u=rwX,g=rX,o= ${D}etc/asterisk
160
161 chown -R asterisk:asterisk ${D}var/lib/asterisk
162 chmod -R u=rwX,g=rX,o= ${D}var/lib/asterisk
163 }
164
165 #pkg_postinst() {
166 # #
167 # # Announcements, warnings, reminders...
168 # #
169 #}

  ViewVC Help
Powered by ViewVC 1.1.20