summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-dialup')
-rw-r--r--net-dialup/accounting/Manifest1
-rw-r--r--net-dialup/accounting/accounting-1.60.45.3.1.ebuild76
-rw-r--r--net-dialup/accounting/files/ip-down.sh3
-rw-r--r--net-dialup/accounting/files/ip-up.sh4
-rw-r--r--net-dialup/accounting/metadata.xml8
-rw-r--r--net-dialup/martian-modem/Manifest1
-rw-r--r--net-dialup/martian-modem/files/martian-modem-20100123-grsecurity.patch15
-rw-r--r--net-dialup/martian-modem/files/martian-modem-20100123-makefile.patch34
-rw-r--r--net-dialup/martian-modem/files/martian-modem-kernel-3.8.patch22
-rw-r--r--net-dialup/martian-modem/files/martian-modem.conf.d45
-rw-r--r--net-dialup/martian-modem/files/martian-modem.init.d47
-rw-r--r--net-dialup/martian-modem/martian-modem-20100123-r2.ebuild93
-rw-r--r--net-dialup/martian-modem/metadata.xml13
13 files changed, 362 insertions, 0 deletions
diff --git a/net-dialup/accounting/Manifest b/net-dialup/accounting/Manifest
new file mode 100644
index 00000000..e92258e4
--- /dev/null
+++ b/net-dialup/accounting/Manifest
@@ -0,0 +1 @@
+DIST smpppd-1.60.45-3.1.src.rpm 175561 SHA256 2203eaf1e358219cd208ccb2bb104dd39408eb9b12411991b596ccc45a0b2f14 SHA512 7393891861de4dbb74f720f4db2f8a668081f643ec019a5764ae4ef03b2f088e89c566f1b6f5f2fea49b286830cb8d13d9629ef3a40ed30c94300a6d1c3b42c0 WHIRLPOOL 714c71822afd4ecfbe7f9b7653ac585fa298cf3acc44d709bcb3b80e0a62a0fbad2c62338123af727c9f6fe969a8de3e16f8cadf821f588c5b38d8a1d8bd1904
diff --git a/net-dialup/accounting/accounting-1.60.45.3.1.ebuild b/net-dialup/accounting/accounting-1.60.45.3.1.ebuild
new file mode 100644
index 00000000..91d88aad
--- /dev/null
+++ b/net-dialup/accounting/accounting-1.60.45.3.1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils rpm toolchain-funcs
+RESTRICT="mirror"
+
+MY_PN="smpppd"
+case "${PV}" in
+*.*.*.*)
+ MY_PV="${PV#*.*.*.}"
+ MY_PV=${PV%".${MY_PV}"}
+ MY_P="${MY_PN}-${MY_PV}-${PV#*.*.*.}"
+ ;;
+*)
+ MY_PV="${PV}"
+ MY_P="${MY_PN}-${MY_PV}"
+ ;;
+esac
+S="${WORKDIR}/${MY_PN}-${MY_PV}"
+DESCRIPTION="Give statistics about dialup connections. Originally part of SuSE's smpppd"
+HOMEPAGE="http://www.opensuse.org"
+SRC_URI="http://download.opensuse.org/source/distribution/11.3/repo/oss/suse/src/${MY_P}.src.rpm"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+test -z "${ACCOUNTING_LOG}" && ACCOUNTING_LOG="/var/log/accounting.log"
+
+DEPEND=">=net-dialup/ppp-2.4.4-r13"
+RDEPEND="${DEPEND}"
+
+CDIR="${S}/${MY_PN}"
+DDIR="${S}/doc"
+
+src_prepare() {
+ printf '%s "%s"\n' '#define VERSION' "${MY_PV}" >"${CDIR}"/config.h
+ sed -i -e's!^\(#define ACCOUNTING_LOG \).*$!\1"'"${ACCOUNTING_LOG}"'"!' \
+ "${CDIR}"/defines.h
+ sed -i -e's!/var/log/[^.]*\.log!'"${ACCOUNTING_LOG}"'!' \
+ "${DDIR}"/accounting.1
+ epatch_user
+}
+
+src_configure() {
+ :
+}
+
+src_compile() {
+ cd -- "${CDIR}"
+ "$(tc-getCXX)" ${CXXFLAGS} ${LDFLAGS} -o accounting \
+ accounting.cc utils.cc format.cc parse.cc tempus.cc filter.cc \
+ || die "compiling failed"
+}
+
+my_sedbin() {
+ dodir "${2%/*}"
+ sed -e "s!ACCOUNTING_LOG!${ACCOUNTING_LOG}!" -- "${1}" >"${D}/${2}"
+ fperms 755 "${2}"
+}
+
+src_install() {
+ dobin "${CDIR}/accounting"
+ doman "${DDIR}/accounting.1"
+ my_sedbin "${FILESDIR}"/ip-up.sh /etc/ppp/ip-up.d/80-accounting.sh
+ my_sedbin "${FILESDIR}"/ip-down.sh /etc/ppp/ip-down.d/10-accounting.sh
+}
+
+pkg_postinst() {
+ ewarn "The accounting tool only interprets ${ACCOUNTING_LOG}"
+ ewarn "This file is updated by scripts in /etc/ppp/ip-up.d and /etc/ppp/ip-down.d"
+ ewarn "You might want to modify these scripts (e.g. add provider info)."
+}
diff --git a/net-dialup/accounting/files/ip-down.sh b/net-dialup/accounting/files/ip-down.sh
new file mode 100644
index 00000000..10074598
--- /dev/null
+++ b/net-dialup/accounting/files/ip-down.sh
@@ -0,0 +1,3 @@
+#! /bin/sh
+echo `/bin/date --utc +'%F %X'` "${1}" d om "${BYTES_RCVD}" "${BYTES_SENT}" \
+ >>'ACCOUNTING_LOG'
diff --git a/net-dialup/accounting/files/ip-up.sh b/net-dialup/accounting/files/ip-up.sh
new file mode 100644
index 00000000..fa5618c0
--- /dev/null
+++ b/net-dialup/accounting/files/ip-up.sh
@@ -0,0 +1,4 @@
+#! /bin/sh
+[ -z "${PROVIDER}" ] && PROVIDER='Gentoo'
+echo `/bin/date --utc +'%F %X'` "${1}" u om "\"${PROVIDER} ${1}\"" \
+ >>'ACCOUNTING_LOG'
diff --git a/net-dialup/accounting/metadata.xml b/net-dialup/accounting/metadata.xml
new file mode 100644
index 00000000..73a6d343
--- /dev/null
+++ b/net-dialup/accounting/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>martin@mvath.de</email>
+ <name>Martin Väth</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/net-dialup/martian-modem/Manifest b/net-dialup/martian-modem/Manifest
new file mode 100644
index 00000000..5774fade
--- /dev/null
+++ b/net-dialup/martian-modem/Manifest
@@ -0,0 +1 @@
+DIST martian-full-20100123.tar.gz 275365 SHA256 bf3ad369dc90e3ef7952e6bb7873b3121ce79a855060a1b4b4e3a1d8e7d08ac3 SHA512 bcd51103792bd1d477ab81f8bbb591f3eb5341920e6b0b35e8ba066a50b8a6ddf076c0bc0d21cf686c8137f8164221635b3c296185283f6e20ce2d04709f69ec WHIRLPOOL b38fb4ea1e7282cf51547c4d6ab3423350dabe717ebe89efa20cc92148347d7e1b2fcc32085d3edc677768f7286715087034bace7f51415ce31a24d840c85c59
diff --git a/net-dialup/martian-modem/files/martian-modem-20100123-grsecurity.patch b/net-dialup/martian-modem/files/martian-modem-20100123-grsecurity.patch
new file mode 100644
index 00000000..332680d9
--- /dev/null
+++ b/net-dialup/martian-modem/files/martian-modem-20100123-grsecurity.patch
@@ -0,0 +1,15 @@
+--- kmodule/mfifo.h
++++ kmodule/mfifo.h
+@@ -20,7 +20,11 @@
+
+ void (*wrap) (mfifo_t *fifo, int *ending);
+ int (*space) (mfifo_t *fifo);
+-};
++}
++#ifdef __no_const
++__no_const
++#endif
++;
+
+ struct _mfifo {
+ /* struct circ_buf header; */
diff --git a/net-dialup/martian-modem/files/martian-modem-20100123-makefile.patch b/net-dialup/martian-modem/files/martian-modem-20100123-makefile.patch
new file mode 100644
index 00000000..e6ce7ca7
--- /dev/null
+++ b/net-dialup/martian-modem/files/martian-modem-20100123-makefile.patch
@@ -0,0 +1,34 @@
+--- martian-full-20100123/Makefile 2008-07-02 15:42:48.000000000 -0800
++++ martian-full-20100123.new/Makefile 2012-10-08 12:14:33.284275312 -0800
+@@ -1,10 +1,10 @@
+
+-KERNEL_DIR:=/lib/modules/$(shell uname -r)/build
+-SUBLEVEL:=$(shell echo $(KERNEL_DIR) | cut -d. -f3 | cut -d. -f1 | cut -d- -f1)
+-# support begins at SUBLEVEL 20
+-after20:=$(shell if [ "$(SUBLEVEL)" -gt 20 ] ;then echo OK; fi)
++#KERNEL_DIR:=/lib/modules/$(shell uname -r)/build
++#SUBLEVEL:=$(shell echo $(KERNEL_DIR) | cut -d. -f3 | cut -d. -f1 | cut -d- -f1)
++## support begins at SUBLEVEL 20
++#after20:=$(shell if [ "$(SUBLEVEL)" -gt 20 ] ;then echo OK; fi)
+
+-ifdef after20
++#ifdef after20
+ all:
+ $(MAKE) -C kmodule/ modules
+ $(MAKE) -C modem/ all
+@@ -14,11 +14,11 @@
+ $(MAKE) -C kmodule/ install
+ $(MAKE) -C modem/ install
+
+-else
+-20less:
+- @echo "The martian_dev.ko driver and the complementary helper martian_helper are for use with kernels after 2.6.20. Use the martian-20080407.tar.gz for earlier kernels."
++#else
++#20less:
++# @echo "The martian_dev.ko driver and the complementary helper martian_helper are for use with kernels after 2.6.20. Use the martian-20080407.tar.gz for earlier kernels."
+
+-endif
++#endif
+
+ clean:
+ $(MAKE) -C kmodule/ clean
diff --git a/net-dialup/martian-modem/files/martian-modem-kernel-3.8.patch b/net-dialup/martian-modem/files/martian-modem-kernel-3.8.patch
new file mode 100644
index 00000000..eb138df8
--- /dev/null
+++ b/net-dialup/martian-modem/files/martian-modem-kernel-3.8.patch
@@ -0,0 +1,22 @@
+--- kmodule/martian.c
++++ kmodule/martian.c
+@@ -46,6 +46,19 @@
+ #include "../martian.h"
+ #include "marsio.h"
+
++#ifndef __devinit
++#define __devinit
++#endif
++#ifndef __devexit
++#define __devexit
++#endif
++#ifndef __devexit_p
++#define __devexit_p
++#endif
++#ifndef __devinitdata
++#define __devinitdata
++#endif
++
+ /***** Driver globals *****/
+
+ struct proc_dir_entry *martians_proc_dir = NULL;
diff --git a/net-dialup/martian-modem/files/martian-modem.conf.d b/net-dialup/martian-modem/files/martian-modem.conf.d
new file mode 100644
index 00000000..47e2f62b
--- /dev/null
+++ b/net-dialup/martian-modem/files/martian-modem.conf.d
@@ -0,0 +1,45 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/martian-modem/files/martian-modem.conf.d,v 1.1 2012/12/15 16:41:36 pacho Exp $
+#
+### Configuration for martian-modem initscript
+#
+### DEVICE
+# Device that will martian-modem daemon create to act as modem device.
+# Default is /dev/ttySM0.
+#DEVICE="/dev/ttySM0"
+#
+#
+### USER/GROUP
+# User and group that will have access to the modem device.
+# Default values are nobody/dialout.
+# Note: the daemon itself needs to be run as root!
+#USER="nobody"
+#GROUP="dialout"
+#
+#
+### MARTIAN_OPTS
+# Other options to be passed to the daemon, see description below.
+# Defaults to empty.
+# --realtime - raise priority of threads to realtime.
+# --smp - true smp (symmetric multiprocessing) mode.
+# --country=<country> - two-letter code for the country.
+# Run `/usr/sbin/martian_modem --info countries` for list.
+# --no-cdclose - keep working with client when carrier lost.
+# --hide-pty - save pty from others as soon its open. Client
+# should notify it's here writing to device. For callback feature.
+#MARTIAN_OPTS=""
+#
+#
+### LOGGING
+# Should we log to syslog [YES/NO]
+# Default to YES. If you do not want this, say NO here to use LOGFILE instead.
+#USE_SYSLOG="YES"
+# Alternatively, you can log to a separate file. The default location is below.
+#LOGFILE="/var/log/martian-modem.log"
+#
+#
+### DEBUG
+# How verbose should the log be [1-5]
+# Default debug_level=1; debug_level=3 is suitable for normal debugging.
+#DEBUG_LEVEL=1
diff --git a/net-dialup/martian-modem/files/martian-modem.init.d b/net-dialup/martian-modem/files/martian-modem.init.d
new file mode 100644
index 00000000..540d14c5
--- /dev/null
+++ b/net-dialup/martian-modem/files/martian-modem.init.d
@@ -0,0 +1,47 @@
+#!/sbin/openrc-run
+
+daemon=/usr/sbin/martian_modem
+description="Initscript to run the userspace daemon for winmodems supported by martian-modem driver"
+
+: ${device:=${DEVICE:-/dev/ttySM0}}
+: ${logfile:=${LOGFILE:-/var/log/martian-modem.log}}
+: ${user:=${USER:-nobody}}
+: ${group:=${GROUP:-dialout}}
+: ${debug_level:=${DEBUG_LEVEL:-1}}
+: ${use_syslog:=${USE_SYSLOG:-YES}}
+pidfile=/var/run/${SVCNAME}.pid
+
+depend() {
+ need localmount
+ [ "${use_syslog}" = "YES" ] && use syslog
+}
+
+start() {
+ if [ -e /proc/modules ] ; then
+ local modem=
+ for modem in /dev/modem /dev/ttySM[0-9]* ; do
+ [ -e "${modem}" ] && break
+ done
+ fi
+ if [ ! -e "${modem}" ] ; then
+ modprobe martian-dev || eerror $? "Error loading martian-dev module"
+ fi
+
+ if ! yesno "${use_syslog}" ; then
+ martian_opts="${MARTIAN_OPTS} --log=${logfile}"
+ else
+ martian_opts="${MARTIAN_OPTS} --syslog"
+ fi
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec ${daemon} --user ${user}:${group} \
+ --pidfile ${pidfile} --make-pidfile --background \
+ -- ${martian_opts} --debug=${debug_level} ${device}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --pidfile ${pidfile}
+ eend $?
+}
diff --git a/net-dialup/martian-modem/martian-modem-20100123-r2.ebuild b/net-dialup/martian-modem/martian-modem-20100123-r2.ebuild
new file mode 100644
index 00000000..915fb342
--- /dev/null
+++ b/net-dialup/martian-modem/martian-modem-20100123-r2.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils linux-mod readme.gentoo
+
+MY_P="martian-full-${PV}"
+DESCRIPTION="ltmodem alternative driver providing support for Agere Systems winmodems"
+HOMEPAGE="http://packages.debian.org/sid/martian-modem-source http://phep2.technion.ac.il/linmodems/packages/ltmodem/kernel-2.6/martian"
+#SRC_URI="mirror://debian/pool/non-free/m/martian-modem/${MY_P}.tar.gz"
+#SRC_URI="http://phep2.technion.ac.il/linmodems/packages/ltmodem/kernel-2.6/martian/${MY_P}.tar.gz"
+SRC_URI="http://linmodems.technion.ac.il/packages/ltmodem/kernel-2.6/martian/${MY_P}.tar.gz"
+
+LICENSE="GPL-2 AgereSystems-WinModem"
+KEYWORDS="~amd64 ~x86 -*"
+IUSE=""
+SLOT=0
+
+DEPEND="!net-dialup/ltmodem"
+RDEPEND="!<sys-apps/openrc-0.13
+ ${DEPEND}"
+
+# Do NOT remove this. Stripping results in broken communication
+# with core state communication channel (also see QA_* stuff below)
+RESTRICT="strip"
+
+# contains proprietary precompiled 32 bit ltmdmobj.o
+QA_PREBUILT="usr/sbin/martian_modem"
+
+DISABLE_AUTOFORMATTING="true"
+DOC_CONTENTS="See /etc/conf.d/${PN} for configuration options.
+After you have finished the configuration, you need to run
+ /etc/init.d/${PN} start
+
+To run the userspace daemon automatically on every boot,
+just add it to a runlevel:
+ rc-update add ${PN} default
+
+If using net-dialup/wvdial, you need
+ Carrier Check = no
+line."
+
+S="${WORKDIR}/${P/modem/full}"
+MODULE_NAMES="martian_dev(ltmodem::kmodule)"
+CONFIG_CHECK="SERIAL_8250"
+SERIAL_8250_ERROR="This driver requires you to compile your kernel with serial core (CONFIG_SERIAL_8250) support."
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ if kernel_is 2 4; then
+ eerror "This driver works only with 2.6 kernels!"
+ die "unsupported kernel detected"
+ fi
+}
+
+src_prepare() {
+ # Exclude Makefile kernel version check, we used kernel_is above.
+ # TODO: More exactly, martian-modem-full-20100123 is for >kernel-2.6.20!
+ epatch "${FILESDIR}/${P}-makefile.patch"
+ epatch "${FILESDIR}/${P}-grsecurity.patch"
+
+ # fix compile on amd64
+ sed -i -e "/^HOST.*$/s:uname -i:uname -m:" modem/Makefile || die "sed failed"
+
+ BUILD_TARGETS="all"
+ BUILD_PARAMS="KERNEL_DIR='${KV_DIR}' SUBLEVEL='${KV_PATCH}'"
+
+ if kernel_is ge 3 8
+ then epatch "${FILESDIR}/${PN}-kernel-3.8.patch"
+ fi
+ epatch_user
+}
+
+src_install() {
+ linux-mod_src_install
+
+ # userspace daemon and initscripts stuff
+ dosbin modem/martian_modem
+ newconfd "${FILESDIR}/${PN}.conf.d" ${PN}
+ newinitd "${FILESDIR}/${PN}.init.d" ${PN}
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ if linux_chkconfig_present SMP ; then
+ elog "You have SMP (symmetric multi processor) support enabled in kernel."
+ elog "You should run martian-modem with --smp enabled in MARTIAN_OPTS."
+ fi
+ readme.gentoo_pkg_postinst
+}
diff --git a/net-dialup/martian-modem/metadata.xml b/net-dialup/martian-modem/metadata.xml
new file mode 100644
index 00000000..21c33b12
--- /dev/null
+++ b/net-dialup/martian-modem/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>rogerx.oss@gmail.com</email>
+ <name>Roger</name>
+ <description>Please assign bugs</description>
+</maintainer>
+<maintainer>
+ <email>pacho@gentoo.org</email>
+ <description>proxy-maintainer, please CC on bugs</description>
+</maintainer>
+</pkgmetadata>