Initial import of the sangoma wanpipe ebuild
authorStefan Knoblich <stkn@gentoo.org>
Wed, 31 Aug 2005 23:57:04 +0000 (23:57 +0000)
committerStefan Knoblich <stkn@gentoo.org>
Wed, 31 Aug 2005 23:57:04 +0000 (23:57 +0000)
Package-Manager: portage-2.0.51.22-r2

net-misc/wanpipe/ChangeLog [new file with mode: 0644]
net-misc/wanpipe/Manifest [new file with mode: 0644]
net-misc/wanpipe/files/digest-wanpipe-2.3.2_p4 [new file with mode: 0644]
net-misc/wanpipe/files/wanpipe-2.3.2_p4-gcc34.diff [new file with mode: 0644]
net-misc/wanpipe/metadata.xml [new file with mode: 0644]
net-misc/wanpipe/wanpipe-2.3.2_p4.ebuild [new file with mode: 0644]

diff --git a/net-misc/wanpipe/ChangeLog b/net-misc/wanpipe/ChangeLog
new file mode 100644 (file)
index 0000000..ec50229
--- /dev/null
@@ -0,0 +1,14 @@
+# ChangeLog for net-misc/wanpipe
+# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/wanpipe/ChangeLog,v 1.1 2005/08/31 23:57:04 stkn Exp $
+
+*wanpipe-2.3.2_p4 (31 Aug 2005)
+
+  31 Aug 2005; Stefan Knoblich <stkn@gentoo.org> +metadata.xml,
+  +files/wanpipe-2.3.2_p4-gcc34.diff, +wanpipe-2.3.2_p4.ebuild:
+  Initial import. Ebuild is still in alpha state, hard-masked for now.
+  Building the drivers works fine, loading the wanpipe module
+  fails with "No such device" (as expected). No further testing
+  could be done, due to the lack of hardware and a T1/E1 line
+  (that's why there's no init script too).
+
diff --git a/net-misc/wanpipe/Manifest b/net-misc/wanpipe/Manifest
new file mode 100644 (file)
index 0000000..6724c45
--- /dev/null
@@ -0,0 +1,5 @@
+MD5 44cf247f04cc83413fcb40ed59d0847a metadata.xml 248
+MD5 3cbb956c199f57eab082e3b052d0dfbf ChangeLog 667
+MD5 0a60f5435896afd34bbd02e9a6d1ef1c wanpipe-2.3.2_p4.ebuild 5431
+MD5 a2e004ccfe869825d025a43d1262dd1d files/wanpipe-2.3.2_p4-gcc34.diff 239
+MD5 1c8be1e0d344dc6c31cc15fb7c5c4ae0 files/digest-wanpipe-2.3.2_p4 65
diff --git a/net-misc/wanpipe/files/digest-wanpipe-2.3.2_p4 b/net-misc/wanpipe/files/digest-wanpipe-2.3.2_p4
new file mode 100644 (file)
index 0000000..5870c0c
--- /dev/null
@@ -0,0 +1 @@
+MD5 4063dad8d932a1db5f6c6bfa89fdcf3f wanpipe-2.3.2-4.tgz 5146047
diff --git a/net-misc/wanpipe/files/wanpipe-2.3.2_p4-gcc34.diff b/net-misc/wanpipe/files/wanpipe-2.3.2_p4-gcc34.diff
new file mode 100644 (file)
index 0000000..1abec52
--- /dev/null
@@ -0,0 +1,11 @@
+--- build-tmp/src/sdla_edu.c.orig      2005-09-01 00:10:11.000000000 +0000
++++ build-tmp/src/sdla_edu.c   2005-09-01 00:10:53.000000000 +0000
+@@ -777,7 +777,7 @@
+         skb->mac.raw  = skb->data;
+         netif_rx(skb);
+ rx_exit:
+-      
++      ;
+ }
+ 
+ 
diff --git a/net-misc/wanpipe/metadata.xml b/net-misc/wanpipe/metadata.xml
new file mode 100644 (file)
index 0000000..10f27dc
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>voip</herd>
+<maintainer>
+  <email>stkn@gentoo.org</email>
+  <name>Stefan Knoblich</name>
+</maintainer>
+</pkgmetadata>
diff --git a/net-misc/wanpipe/wanpipe-2.3.2_p4.ebuild b/net-misc/wanpipe/wanpipe-2.3.2_p4.ebuild
new file mode 100644 (file)
index 0000000..ac152c4
--- /dev/null
@@ -0,0 +1,217 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/wanpipe/wanpipe-2.3.2_p4.ebuild,v 1.1 2005/08/31 23:57:04 stkn Exp $
+
+inherit eutils toolchain-funcs linux-mod
+
+DESCRIPTION="Driver for Sangoma WAN cards"
+HOMEPAGE="http://www.sangoma.com/"
+SRC_URI="ftp://ftp.sangoma.com/linux/current_wanpipe/${P//_p/-}.tgz"
+
+LICENSE=""
+SLOT="0"
+KEYWORDS="~x86"
+
+LICENSE="WANPIPE"
+
+IUSE="adsl"
+
+RDEPEND="sys-libs/ncurses
+        >=net-misc/zaptel-1.2.0_beta1"
+
+DEPEND="sys-devel/flex
+       ${RDEPEND}"
+
+S=${WORKDIR}/${PN}
+S_BUILD=${WORKDIR}/build-tmp
+
+# Test log:
+#
+# Compile OK: linux-2.6.12.2
+#                      (zaptel-1.0.8 + /usr/include/zaptel hack)
+#            linux-2.4.29-nd1
+#                      (zaptel-1.0.7-r1 + /usr/include/zaptel hack)
+#             linux-2.6.11.12-grsec
+#                      (zaptel-1.2.0_pre20050817 + /usr/include/zaptel)
+#             linux-2.6.12
+#                      (zaptel-1.2.0_beta1)
+
+pkg_setup() {
+       local n
+
+       ewarn "****************************** WARNING! ******************************"
+       ewarn "*                                                                    *"
+       ewarn "* ALPHA QUALITY EBUILD                                               *"
+       ewarn "*                                                                    *"
+       ewarn "* Sangoma drivers built with this ebuild are _completely_ untested!  *"
+       ewarn "* (Due to lack of hardware and a T1/E1 line)                         *"
+       ewarn "*                                                                    *"
+       ewarn "* There is no init script to setup the card(s) on startup!           *"
+       ewarn "*                                                                    *"
+       ewarn "* You have been warned!                                              *"
+       ewarn "*    - stkn                                                          *"
+       ewarn "****************************** WARNING! ******************************"
+       echo
+       ebeep
+
+       n=10
+       while [[ $n -gt 0 ]]; do
+               echo -en "  Waiting $n seconds...\r"
+               sleep 1
+               (( n-- ))
+       done
+}
+
+
+src_unpack() {
+       local binobj
+
+       unpack ${A}
+
+       # Instead of patching stuff in /usr/src/linux, we'll
+       # copy all needed files to ${S_BUILD} and build everything
+       # there
+
+       # let's go...
+       cd ${S}
+
+       mkdir -p ${S_BUILD}/{src,include}
+       mkdir -p ${S_BUILD}/src/{mod,tmp}
+       ln -s ${S_BUILD}/src ${S_BUILD}/src/modinfo
+       ln -s ${S_BUILD}/src ${S_BUILD}/src/common
+
+       cp -dPR /usr/src/linux/drivers/net/wan/*.{c,h} ${S_BUILD}/src
+       cp -dPR /usr/src/linux/include/linux           ${S_BUILD}/include
+
+       cp ${S}/patches/kdrivers/src/wanrouter/*.c     ${S_BUILD}/src
+       cp ${S}/patches/kdrivers/src/wan_aften/*.c     ${S_BUILD}/src
+       cp ${S}/patches/kdrivers/src/net/*.c           ${S_BUILD}/src
+
+       cp ${S}/patches/kdrivers/include/*.h           ${S_BUILD}/include/linux
+
+       sed -i  -e "s:\(-I/usr/src/linux/include \):-I${S_BUILD}/include \1:g" \
+               -e "s:-I/usr/src/zaptel:-I/usr/include/zaptel:g" \
+               ${S}/Makefile
+
+       #
+       # step 2: select the right binary modules and copy them
+       #
+       if [[ "$(gcc-major-version)" == "2" ]]; then
+               binobj="gcc2"
+       else
+               binobj="gcc3"
+       fi
+
+       binobj="${binobj}.$(uname -m)"
+
+       linux_chkconfig_present REGPARM \
+               && binobj="${binobj}.regparm" \
+
+       cp patches/kdrivers/src/net/wanpipe_adsl.${binobj}.o ${S_BUILD}/src/wanpipe_adsl.o
+       cp patches/kdrivers/src/net/wanpipe_atm.${binobj}.o  ${S_BUILD}/src/wanpipe_atm.o
+       # fix the makefile...
+       sed -i  -e "s:../adsl/wanpipe_adsl.o:common/wanpipe_adsl.o:g" \
+               -e "s:../atm/wanpipe_atm.o:common/wanpipe_atm.o:g" \
+               ${S}/Makefile
+
+       # these are needed too, wanpipe won't load otherwise
+       sed -i  -e "s:^\(WANPIPE_FILE_LIST.*\):\1 sdla_edu.o sdla_bitstrm.o sdla_adccp.o sdla_sdlc.o sdla_mp_fr.o sdla_pos.o:" \
+               ${S}/Makefile
+
+       # fix Makefile for amd64
+       use amd64 && \
+               sed -i  -e "s:-march=\$(ARCH):-march=k8 -mcmodel=kernel:" \
+                       -e "s:\(-mpreferred-stack-boundary\)=2:\1=4:" \
+                       -e "s:^\(LD_ELF=\).*:\1-m elf_x86_64:" \
+                       ${S}/Makefile
+
+       # apply patch for gcc3.4 (todo: change path in patch to ${S}/...)
+       cd ${WORKDIR}
+       epatch ${FILESDIR}/${P}-gcc34.diff
+}
+
+
+
+src_compile() {
+       #
+       # well for the drivers, all that's left to do is:
+       #
+       cd ${S_BUILD}/src
+       make -f ${S}/Makefile || die "Error building drivers!"
+
+       #
+       # Build utilities
+       #
+       einfo "Building utils..."
+       cd ${S}/util
+       make \
+               SYSINC=${S_BUILD}/include \
+               PROTOCOL_DEFS=$(use adsl && echo "-DCONFIG_PRODUCT_WANPIPE_ADSL")
+
+       #
+       # Build WanCfg tool
+       #
+       einfo "Building WanCfg tool..."
+       make -C wancfg all \
+               SYSINC=${S_BUILD}/include
+
+       #
+       # Build misc utilities
+       #
+       einfo "Building misc utilities..."
+       make -C misc clean all \
+               SYSINC=${S_BUILD}/include
+
+       #
+       # Build API (for development)
+       #
+#      if ! use minimal; then
+#              einfo "Building development API..."
+#              cd ${S}/api
+#              make \
+#                      SYSINC=${S_BUILD}/include
+#      else
+#              einfo "Skipping API build..."
+#      fi
+}
+
+src_install() {
+       #
+       # install kernel modules
+       #
+       insinto /lib/modules/${KV_FULL}/extra
+       doins ${S_BUILD}/src/mod/*.${KV_OBJ}
+
+       #
+       # install firmware
+       #
+       insinto /lib/firmware
+       doins firmware/*.sfm
+
+       #
+       # install tools
+       #
+       einfo "Installing utils..."
+       cd ${S}/util
+       make install \
+               WAN_VIRTUAL=${D}
+
+       einfo "Installing misc utilities..."
+       make -C misc install \
+               WAN_VIRTUAL=${D}
+       cd ${S}
+
+       #
+       # install config + scripts
+       #
+#      newconfd ${FILESDIR}/wanpipe.confd wanpipe
+
+       #
+       # finally install docs
+       #
+       dodoc doc/README* doc/ANNOUNCE doc/COPYING doc/LICENSE
+       dodoc doc/*.txt
+
+       insinto /usr/share/doc/${PF}
+       doins doc/*.pdf doc/*.sfm
+}