/[gentoo-x86]/net-misc/zaptel/zaptel-1.0.6.ebuild
Gentoo

Contents of /net-misc/zaptel/zaptel-1.0.6.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Mon Sep 19 19:45:56 2005 UTC (14 years, 2 months ago) by stkn
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +1 -1 lines
FILE REMOVED
Removed outdated ebuilds.
(Portage version: 2.0.51.22-r2)

1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/zaptel-1.0.6.ebuild,v 1.10 2005/09/15 02:38:26 stkn Exp $
4
5 IUSE="devfs26 bri florz"
6
7 inherit toolchain-funcs eutils linux-mod
8
9 BRI_VERSION="0.2.0-RC7k"
10 FLORZ_VERSION="0.2.0-RC7j_florz-4"
11
12 DESCRIPTION="Drivers for Digium and ZapataTelephony cards"
13 HOMEPAGE="http://www.asterisk.org"
14 SRC_URI="ftp://ftp.digium.com/pub/telephony/zaptel/old/zaptel-${PV}.tar.gz
15 bri? ( http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz )
16 florz? ( http://zaphfc.florz.dyndns.org/zaphfc_${FLORZ_VERSION}.diff.gz )"
17
18 SLOT="0"
19 LICENSE="GPL-2"
20 KEYWORDS="~x86 ~ppc ~amd64"
21
22 DEPEND="virtual/libc
23 virtual/linux-sources
24 >=dev-libs/newt-0.50.0"
25
26 pkg_setup() {
27 linux-mod_pkg_setup
28
29 # show an nice warning message about zaptel not supporting devfs on 2.6
30 if kernel_is 2 6 && linux_chkconfig_present DEVFS_FS ; then
31 echo
32 einfo "You're using a 2.6 kernel with DEVFS."
33 einfo "The Zaptel drivers won't work unless you either:"
34 einfo " * switch to udev"
35 einfo " * write a script that re-creates the necessary device nodes for you"
36 einfo " * enable the devfs26 useflag (see below)"
37 einfo ""
38 einfo "There's an experimental patch which adds devfs support when using linux-2.6, but:"
39 einfo " 1. It's an ugly hack atm and needs a cleanup..."
40 einfo " 2. I was only abled to test loding / unloading with the ztd-eth driver..."
41 einfo " 3. I _really_ don't know if it works with real hardware..."
42 einfo " 4. It disables udev support to avoid conflicts"
43 eerror " 5. And more important: This is not officially supported by Digium / the Asterisk project!"
44 einfo ""
45 einfo "If you're still interested, abort now (ctrl+c) and enable the devfs26 USE-flag"
46 einfo "Feedback and bug-reports should go to: stkn@gentoo.org"
47 einfo "You have been warned!"
48 echo
49 einfo "Sleeping 20 Seconds..."
50 epause 20
51 fi
52 }
53
54 src_unpack() {
55 unpack ${A}
56
57 cd ${S}
58 # >= 1.0.3 requires new patch (-modulesd patch renamed to -gentoo)
59 epatch ${FILESDIR}/${PN}-1.0.3-gentoo.diff
60
61 # remove all from install target
62 sed -i -e "s#^\(install:\)[ \t]\+all[ \t]\+\(.*\)#\1 \2#" Makefile
63
64 # enable ztdummy...
65 sed -i -e "s:#\( ztdummy.*\):\1:" Makefile
66
67 # devfs support
68 if use devfs26; then
69 einfo "Enabling experimental devfs support for linux-2.6..."
70 epatch ${FILESDIR}/${PN}-1.0.4-experimental-devfs26.diff
71
72 # disable udev
73 sed -i -e "s:#define[\t ]\+\(CONFIG_ZAP_UDEV\):#undef \1:" \
74 zconfig.h
75 fi
76
77 # apply patch for gcc-3.4.x if that's the compiler in use...
78 # fixes (#76707)
79 if use x86 && [[ `gcc-fullversion` = "3.4.3" ]]; then
80 epatch ${FILESDIR}/${PN}-1.0.4-gcc34.patch
81 fi
82
83 # try to apply bristuff patch
84 if use bri; then
85 einfo "Patching zaptel w/ BRI stuff (${BRI_VERSION})"
86 epatch ${FILESDIR}/zaptel-bristuff-${BRI_VERSION}.patch
87
88 cd ${WORKDIR}/bristuff-${BRI_VERSION}
89
90 if use florz; then
91 einfo "Using florz patches (${FLORZ_VERSION}) for zaphfc"
92 epatch ${WORKDIR}/zaphfc_${FLORZ_VERSION}.diff
93 fi
94
95 # patch includes
96 sed -i -e "s:^#include.*zaptel\.h.*:#include <zaptel.h>:" \
97 qozap/qozap.c \
98 zaphfc/zaphfc.c
99
100 # patch makefiles
101 sed -i -e "s:^ZAP[\t ]*=.*:ZAP=-I${S}:" \
102 -e "s:^MODCONF=.*:MODCONF=/etc/modules.d/zaptel:" \
103 -e "s:linux-2.6:linux:g" \
104 qozap/Makefile \
105 zaphfc/Makefile
106
107 sed -i -e "s:^\(CFLAGS+=-I. \).*:\1 \$(ZAP):" \
108 zaphfc/Makefile
109 fi
110
111 # replace `uname -r` with ${KV_FULL} in all Makefiles
112 find ${WORKDIR} -iname "Makefile" -exec sed -i -e "s:\`uname -r\`:${KV_FULL}:g" {} \;
113 }
114
115 src_compile() {
116 # TODO: bristuff modules
117
118 make ARCH=$(tc-arch-kernel) KERNEL_SOURCE=/usr/src/linux || die
119
120 if use bri; then
121 cd ${WORKDIR}/bristuff-${BRI_VERSION}
122 make ARCH=$(tc-arch-kernel) -C qozap || die
123 make ARCH=$(tc-arch-kernel) -C zaphfc || die
124 fi
125 }
126
127 src_install() {
128 make INSTALL_PREFIX=${D} install || die
129
130 dodoc ChangeLog README README.udev README.Linux26 README.fxsusb zaptel.init
131 dodoc zaptel.conf.sample LICENSE zaptel.sysconfig
132
133 # additional tools
134 dobin ztmonitor ztspeed zttest
135
136 if use bri; then
137 einfo "Installing bri"
138 cd ${WORKDIR}/bristuff-${BRI_VERSION}
139
140 insinto /lib/modules/${KV_FULL}/misc
141 doins qozap/qozap.${KV_OBJ}
142 doins zaphfc/zaphfc.${KV_OBJ}
143
144 # install example configs for octoBRI and quadBRI
145 insinto /etc
146 doins qozap/zaptel.conf.octoBRI
147 newins qozap/zaptel.conf zaptel.conf.quadBRI
148 newins zaphfc/zaptel.conf zaptel.conf.zaphfc
149
150 insinto /etc/asterisk
151 doins qozap/zapata.conf.octoBRI
152 newins qozap/zapata.conf zapata.conf.quadBRI
153 newins zaphfc/zapata.conf zapata.conf.zaphfc
154
155 docinto bristuff
156 dodoc CHANGES INSTALL
157
158 docinto bristuff/qozap
159 dodoc qozap/LICENSE qozap/TODO qozap/*.conf*
160
161 docinto bristuff/zaphfc
162 dodoc zaphfc/LICENSE zaphfc/*.conf
163 fi
164
165 # install init script
166 exeinto /etc/init.d
167 newexe ${FILESDIR}/zaptel.rc6 zaptel
168 insinto /etc/conf.d
169 newins ${FILESDIR}/zaptel.confd zaptel
170 }
171
172 pkg_postinst() {
173 linux-mod_pkg_postinst
174
175 if use devfs26; then
176 ewarn "*** Warning! ***"
177 ewarn "Devfs support for linux-2.6 is experimental and not"
178 ewarn "supported by digium or the asterisk project!"
179 echo
180 ewarn "Send bug-reports to: stkn@gentoo.org"
181 fi
182
183 echo
184 einfo "Use the /etc/init.d/zaptel script to load zaptel.conf settings on startup!"
185 echo
186
187 # devfs26 disables udev ... so don't nag users
188 if ! use devfs26; then
189 # FIXME!! Can we (we should) do this automatically
190 einfo "If you're using udev add the following to"
191 einfo "/etc/udev/rules.d/50-udev.rules (as in README.udev):"
192 einfo "# Section for zaptel device"
193 einfo "KERNEL=\"zapctl\", NAME=\"zap/ctl\""
194 einfo "KERNEL=\"zaptimer\", NAME=\"zap/timer\""
195 einfo "KERNEL=\"zapchannel\", NAME=\"zap/channel\""
196 einfo "KERNEL=\"zappseudo\", NAME=\"zap/pseudo\""
197 einfo "KERNEL=\"zap[0-9]*\", NAME=\"zap/%n\""
198 echo
199 fi
200
201 if use bri; then
202 einfo "Bristuff configs have been merged as:"
203 einfo ""
204 einfo "${ROOT}etc/"
205 einfo " zaptel.conf.zaphfc"
206 einfo " zaptel.conf.quadBRI"
207 einfo " zaptel.conf.octoBRI"
208 einfo ""
209 einfo "${ROOT}etc/asterisk/"
210 einfo " zapata.conf.zaphfc"
211 einfo " zapata.conf.quadBRI"
212 einfo " zapata.conf.octoBRI"
213 echo
214 fi
215 }

  ViewVC Help
Powered by ViewVC 1.1.20