aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2019-08-20 19:54:28 -0300
committerLeonardo Arena <rnalrd@alpinelinux.org>2019-08-21 06:10:34 +0000
commit691ecba8669201978868e7a0946108e21c3b27aa (patch)
tree0ab9959ac3551a89642eefb27dc920aac99ec8a9
parentea44a237f386fd3a86d851ecdd36407de21e4406 (diff)
downloadaports-691ecba8669201978868e7a0946108e21c3b27aa.tar.gz
aports-691ecba8669201978868e7a0946108e21c3b27aa.tar.bz2
aports-691ecba8669201978868e7a0946108e21c3b27aa.tar.xz
main/pmacct: upgrade to 1.7.3
- Build uacctd daemon by enabling nflog - Use supervise-dameon for proper process supervision - Add name and description to daemons - Remove examples since they contain compiled code
-rw-r--r--main/pmacct/APKBUILD47
-rw-r--r--main/pmacct/mariadb.patch25
-rw-r--r--main/pmacct/nfacctd.conf3
-rw-r--r--main/pmacct/pmacct.initd30
-rw-r--r--main/pmacct/pmacctd.conf3
-rw-r--r--main/pmacct/pmacctd.confd (renamed from main/pmacct/pmacct.confd)0
-rw-r--r--main/pmacct/pmacctd.initd30
-rw-r--r--main/pmacct/sfacctd.conf3
-rw-r--r--main/pmacct/uacctd.conf3
9 files changed, 54 insertions, 90 deletions
diff --git a/main/pmacct/APKBUILD b/main/pmacct/APKBUILD
index 4c34e9d21e..12638740ea 100644
--- a/main/pmacct/APKBUILD
+++ b/main/pmacct/APKBUILD
@@ -1,23 +1,22 @@
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=pmacct
-pkgver=1.7.0
+pkgver=1.7.3
pkgrel=0
pkgdesc="Measure, account, classify, aggregate and export IPv4 and IPv6 traffic"
url="http://www.pmacct.net/"
arch="all"
-license="GPL"
+license="GPL-2.0-or-later"
makedepends="bsd-compat-headers libpcap-dev mariadb-connector-c-dev postgresql-dev
- zlib-dev jansson-dev sqlite-dev"
-subpackages="$pkgname-doc"
-source="http://www.pmacct.net/$pkgname-$pkgver.tar.gz
- mariadb.patch
- pmacct.initd
- pmacct.confd
+ zlib-dev jansson-dev sqlite-dev libnetfilter_log-dev"
+subpackages="$pkgname-doc $pkgname-openrc"
+source="http://www.pmacct.net/pmacct-$pkgver.tar.gz
+ pmacctd.initd
+ pmacctd.confd
pmacctd.conf
sfacctd.conf
nfacctd.conf
- uacctd.conf"
-builddir="$srcdir/$pkgname-$pkgver"
+ uacctd.conf
+ "
prepare() {
default_prepare
@@ -35,14 +34,11 @@ build() {
--infodir=/usr/share/info \
--enable-pgsql \
--enable-64bit \
- --enable-threads \
--enable-mysql \
--enable-sqlite3 \
- --enable-ipv6 \
- --enable-v4-mapped \
--enable-jansson \
- || return 1
- make || return 1
+ --enable-nflog
+ make
}
package() {
@@ -50,8 +46,8 @@ package() {
make DESTDIR="$pkgdir" install
- install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/pmacctd
- install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/pmacctd
+ install -m755 -D "$srcdir"/${pkgname}d.initd "$pkgdir"/etc/init.d/pmacctd
+ install -m644 -D "$srcdir"/${pkgname}d.confd "$pkgdir"/etc/conf.d/pmacctd
install -m644 -D "$srcdir"/pmacctd.conf "$pkgdir"/etc/pmacctd.conf
install -m644 -D "$srcdir"/nfacctd.conf "$pkgdir"/etc/nfacctd.conf
install -m644 -D "$srcdir"/sfacctd.conf "$pkgdir"/etc/sfacctd.conf
@@ -59,18 +55,15 @@ package() {
ln -s /etc/init.d/pmacctd "$pkgdir"/etc/init.d/nfacctd &>/dev/null
ln -s /etc/init.d/pmacctd "$pkgdir"/etc/init.d/sfacctd &>/dev/null
ln -s /etc/init.d/pmacctd "$pkgdir"/etc/init.d/uacctd &>/dev/null
- mkdir -p $pkgdir/usr/share/doc/pmacct/examples
mkdir -p $pkgdir/usr/share/doc/pmacct/sql
- cp -r examples/* $pkgdir/usr/share/doc/pmacct/examples
cp sql/README.* $pkgdir/usr/share/doc/pmacct
cp sql/* $pkgdir/usr/share/doc/pmacct/sql
}
-sha512sums="14f1cecc562f008d9b79259f885fc3a1d0a74efa4840d6150277c9bb3c67a233ca9a6b921d9d83fd488d1eb6f535075d7fbf53de0036c48611ffcbf5eb7559b5 pmacct-1.7.0.tar.gz
-dab77f60a6ef1914eaa817d1faeee7bdae0ffbde9f7473d43495b1ee3087ac826735f5a0f30f7cadacfa82a03731a506fc40f5c08aa1fdcfb34bcee370460039 mariadb.patch
-b109f2d64c83d6749a8c81784204e54a68ec7bbc146242f02e1fa7061647acc887921cdbf90a5ecc81186a87a5b4a5175a3b5e25f92e51b5dd1426fb390ef754 pmacct.initd
-6078607dde8619f8fa5698f217c40a7e46ed85843923abecc87652d2e9df6db677898ee1965367247e6ac838d907533a8b1c7ab0515f3f2dc6f3fd4eb14bd5be pmacct.confd
-fa1ead3ee4374ad84cccc0e7043fc86e95da555e2bde3815f03953587f03a609ec3aea227ebf85c9636e071921c5b094359d71d15055f866c05e113cda3b347b pmacctd.conf
-b0547fa413108087aacff490fa9f9aa5c9114acb82f40903a8150a47ffdb72765c52ce708c2feaa6fd225469ee8b7a4f1bfa3e48e512f6e8ffecb83d483cdec4 sfacctd.conf
-acb3c869f3e553ba10ab76e302e37f47391b4ddf1b2531ca00017b843750d7224a67a85516acc94c1016759ecf0fb874103d913e599672a5c279345067f40d45 nfacctd.conf
-b0547fa413108087aacff490fa9f9aa5c9114acb82f40903a8150a47ffdb72765c52ce708c2feaa6fd225469ee8b7a4f1bfa3e48e512f6e8ffecb83d483cdec4 uacctd.conf"
+sha512sums="09d0e6721760035112cb0c7936fe177f7858b19fa1df2c7da84822dc816413e7c6bace35fe45ad32930961183d61f9e4f3a4879747be45f47ab658a3e0f055b2 pmacct-1.7.3.tar.gz
+62418cf66d44099ca93926d3ef9fc2d9b93922fd6edbb1d079d4f10063ad63bf922e60ebf128a86282bd0891afbddc380f9723fa1e82e128dd79feccc759645d pmacctd.initd
+6078607dde8619f8fa5698f217c40a7e46ed85843923abecc87652d2e9df6db677898ee1965367247e6ac838d907533a8b1c7ab0515f3f2dc6f3fd4eb14bd5be pmacctd.confd
+119f69c0ba49609ddbe8455cfa53cb45f94b5dc26b745292bc30422f97a3002dfc5e8b6d63ef17e8a8a5497adbcd64c9edf4476336e5c27144e1d2094a8e6c0a pmacctd.conf
+a02d3b0c2ce56a11d965c395033ebec8e64581b7e9f60a128e8864521eeacf69a0d6a3994b47d3f3c252cd4b8ebbdc3406711fe305a80267aa151bc2da60f93f sfacctd.conf
+8534411d0bb2c56d627c30f7fa60253fe5a4a2cf3119eb429f414d71cf181fa1ce94b1bb31d5e0f9fbf996afeb2cf7af39e14bd86948f00de8d2ee44ad874434 nfacctd.conf
+a02d3b0c2ce56a11d965c395033ebec8e64581b7e9f60a128e8864521eeacf69a0d6a3994b47d3f3c252cd4b8ebbdc3406711fe305a80267aa151bc2da60f93f uacctd.conf"
diff --git a/main/pmacct/mariadb.patch b/main/pmacct/mariadb.patch
deleted file mode 100644
index ded2d0faf4..0000000000
--- a/main/pmacct/mariadb.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff --git a/src/mysql_plugin.c b/src/mysql_plugin.c
-index d2503e7..d477270 100644
---- a/src/mysql_plugin.c
-+++ b/src/mysql_plugin.c
-@@ -668,8 +668,9 @@ void MY_DB_Connect(struct DBdesc *db, char *host)
- MYSQL *dbptr = db->desc;
-
- if (!db->fail) {
-+ my_bool reconnect = 1;
- mysql_init(db->desc);
-- dbptr->reconnect = TRUE;
-+ mysql_options(db->desc, MYSQL_OPT_RECONNECT, &reconnect);
- if (!mysql_real_connect(db->desc, host, config.sql_user, config.sql_passwd, config.sql_db, 0, NULL, 0)) {
- sql_db_fail(db);
- MY_get_errmsg(db);
-@@ -768,5 +769,9 @@ void MY_init_default_values(struct insert_data *idata)
-
- void MY_mysql_get_version()
- {
-+#ifdef MARIADB_CLIENT_VERSION_STR
-+ printf("MySQL %s\n", MARIADB_CLIENT_VERSION_STR);
-+#else
- printf("MySQL %s\n", MYSQL_SERVER_VERSION);
-+#endif
- }
diff --git a/main/pmacct/nfacctd.conf b/main/pmacct/nfacctd.conf
index 47397d9076..b5bf7d9dc7 100644
--- a/main/pmacct/nfacctd.conf
+++ b/main/pmacct/nfacctd.conf
@@ -1,7 +1,6 @@
! Sample default config file
-daemonize: true
-pidfile: /var/run/pmacctd.pid
+daemonize: false
syslog: daemon
! sql_host: localhost
diff --git a/main/pmacct/pmacct.initd b/main/pmacct/pmacct.initd
deleted file mode 100644
index d7cf092108..0000000000
--- a/main/pmacct/pmacct.initd
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/net-analyzer/pmacct/files/$SVCNAME-init.d,v 1.4 2009/06/01 09:48:41 pva Exp $
-
-depend() {
- need net
- after firewall
-}
-
-checkconfig() {
- if [ ! -e /etc/$SVCNAME.conf ] ; then
- eerror "You need an /etc/$SVCNAME.conf file to run $SVCNAME"
- return 1
- fi
-}
-
-start() {
- checkconfig || return 1
- ebegin "Starting $SVCNAME"
- start-stop-daemon --start --pidfile /var/run/$SVCNAME.pid --exec /usr/sbin/$SVCNAME \
- -- -D -f /etc/$SVCNAME.conf -F /var/run/$SVCNAME.pid ${OPTS}
- eend $?
-}
-
-stop() {
- ebegin "Stopping $SVCNAME"
- start-stop-daemon --stop --pidfile /var/run/$SVCNAME.pid --exec /usr/sbin/$SVCNAME
- eend $?
-}
diff --git a/main/pmacct/pmacctd.conf b/main/pmacct/pmacctd.conf
index d64189ede4..6d9f6b4883 100644
--- a/main/pmacct/pmacctd.conf
+++ b/main/pmacct/pmacctd.conf
@@ -1,7 +1,6 @@
! Sample configuration file
-daemonize: true
-pidfile: /var/run/pmacctd.pid
+daemonize: false
syslog: daemon
! sql_host: localhost
diff --git a/main/pmacct/pmacct.confd b/main/pmacct/pmacctd.confd
index c6557c8074..c6557c8074 100644
--- a/main/pmacct/pmacct.confd
+++ b/main/pmacct/pmacctd.confd
diff --git a/main/pmacct/pmacctd.initd b/main/pmacct/pmacctd.initd
new file mode 100644
index 0000000000..5c83194117
--- /dev/null
+++ b/main/pmacct/pmacctd.initd
@@ -0,0 +1,30 @@
+#!/sbin/openrc-run
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/net-analyzer/pmacct/files/$SVCNAME-init.d,v 1.4 2009/06/01 09:48:41 pva Exp $
+
+supervisor=supervise-daemon
+
+name="$RC_SVCNAME"
+
+case "$RC_SVCNAME" in
+ pmacctd) description="promiscuous mode accounting daemon" ;;
+ nfacctd) description="netflow accounting daemon" ;;
+ sfacctd) description="sflow accounting daemon" ;;
+ uacctd) description="ulog accounting daemon" ;;
+esac
+
+command="/usr/sbin/$RC_SVCNAME"
+command_args="-f /etc/$RC_SVCNAME.conf $OPTS"
+
+depend() {
+ need net
+ after firewall
+}
+
+checkconfig() {
+ if [ ! -e /etc/"$RC_SVCNAME".conf ] ; then
+ eerror "You need an /etc/$RC_SVCNAME.conf file to run $RC_SVCNAME"
+ return 1
+ fi
+}
diff --git a/main/pmacct/sfacctd.conf b/main/pmacct/sfacctd.conf
index d175e31134..4affbbebe0 100644
--- a/main/pmacct/sfacctd.conf
+++ b/main/pmacct/sfacctd.conf
@@ -1,5 +1,4 @@
-daemonize: true
-pidfile: /var/run/pmacctd.pid
+daemonize: false
syslog: daemon
! sql_host: localhost
diff --git a/main/pmacct/uacctd.conf b/main/pmacct/uacctd.conf
index d175e31134..4affbbebe0 100644
--- a/main/pmacct/uacctd.conf
+++ b/main/pmacct/uacctd.conf
@@ -1,5 +1,4 @@
-daemonize: true
-pidfile: /var/run/pmacctd.pid
+daemonize: false
syslog: daemon
! sql_host: localhost