summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Väth <martin@mvath.de>2015-10-11 11:26:48 +0200
committerMartin Väth <martin@mvath.de>2015-10-11 11:32:18 +0200
commit109d6b4f673a249aea4deeb0cdb5b54a21592410 (patch)
treeec3589a50dac5be54ef6248d1e0ff3a9fd3b41b4 /net-dialup/accounting
downloadmv-109d6b4f673a249aea4deeb0cdb5b54a21592410.tar.gz
mv-109d6b4f673a249aea4deeb0cdb5b54a21592410.tar.bz2
mv-109d6b4f673a249aea4deeb0cdb5b54a21592410.zip
Clear history for egencache --repo=mv --update-changelogs
Diffstat (limited to 'net-dialup/accounting')
-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
5 files changed, 92 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>