summaryrefslogtreecommitdiff
path: root/community/ulogd
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-08-23 23:14:30 +0000
committerroot <root@rshg054.dnsready.net>2011-08-23 23:14:30 +0000
commit9254c2bc6500471b22eead69781ddef84f87e2bf (patch)
treec4afa4b28422f98d69f9b2594705e164e8c3049c /community/ulogd
parent64e290184042563a240e2d6d15c02e06703d00ee (diff)
Tue Aug 23 23:14:30 UTC 2011
Diffstat (limited to 'community/ulogd')
-rw-r--r--community/ulogd/PKGBUILD44
-rw-r--r--community/ulogd/logrotate10
-rw-r--r--community/ulogd/rc54
3 files changed, 108 insertions, 0 deletions
diff --git a/community/ulogd/PKGBUILD b/community/ulogd/PKGBUILD
new file mode 100644
index 000000000..f972df1ea
--- /dev/null
+++ b/community/ulogd/PKGBUILD
@@ -0,0 +1,44 @@
+# $Id: PKGBUILD 54641 2011-08-22 09:44:28Z spupykin $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Maintainer: Sebastien Luttringer <seblu+arch@seblu.net>
+# Contributor: Dale Blount <dale@archlinux.org>
+# Contributor: Sergej Pupykin <ps@lx-ltd.ru>
+
+pkgname=ulogd
+pkgver=1.24
+pkgrel=6
+pkgdesc='Userspace Packet Logging for netfilter'
+arch=('i686' 'x86_64')
+url='http://www.netfilter.org/projects/ulogd/index.html'
+license=('GPL2')
+makedepends=('mysql' 'postgresql' 'sqlite3' 'libpcap')
+optdepends=('postgresql-libs'
+ 'sqlite3'
+ 'libpcap'
+ 'libmysqlclient')
+backup=('etc/ulogd.conf')
+source=("ftp://ftp.netfilter.org/pub/$pkgname/$pkgname-$pkgver.tar.bz2"
+ 'rc'
+ 'logrotate')
+md5sums=('05b4ed2926b9a22aaeaf642917bbf8ff'
+ 'a408932d8cdd9d5993783e2e808b1e85'
+ 'fe40b3073b7474a77e0b8b0bfd19ab63')
+
+build() {
+ cd $pkgname-$pkgver
+ export MAKEFLAGS="-j1"
+ ./configure --prefix=/usr --sysconfdir=/etc --with-mysql --with-pgsql --with-sqlite3
+ make || true
+ (cd mysql && ld -shared -L/usr/lib -L/usr/lib -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -o ulogd_MYSQL.so ulogd_MYSQL_sh.o -lc)
+ make
+}
+
+package() {
+ cd $pkgname-$pkgver
+ make DESTDIR="$pkgdir" install
+ chmod 644 "$pkgdir/etc/ulogd.conf"
+ install -d -m 755 "$pkgdir/usr/share/ulogd"
+ install -m644 doc/*.table "$pkgdir/usr/share/ulogd"
+ install -D -m644 "$srcdir/logrotate" "$pkgdir/etc/logrotate.d/ulogd"
+ install -D -m755 "$srcdir/rc" "$pkgdir/etc/rc.d/ulogd"
+}
diff --git a/community/ulogd/logrotate b/community/ulogd/logrotate
new file mode 100644
index 000000000..c104ad511
--- /dev/null
+++ b/community/ulogd/logrotate
@@ -0,0 +1,10 @@
+/var/log/ulogd.* {
+ missingok
+ notifempty
+ sharedscripts
+ create 0640 root root
+
+ postrotate
+ [ -e /var/run/ulogd.pid ] && /etc/rc.d/ulogd restart > /dev/null
+ endscript
+}
diff --git a/community/ulogd/rc b/community/ulogd/rc
new file mode 100644
index 000000000..756abdf86
--- /dev/null
+++ b/community/ulogd/rc
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+get_pid() {
+ pidof /usr/sbin/ulogd
+}
+
+case "$1" in
+ start)
+ stat_busy "Starting ulogd daemon"
+
+ [ -f /var/run/ulog.pid ] && rm -f /var/run/ulog.pid
+ PID=`get_pid`
+ if [ -z "$PID" ]; then
+ /usr/sbin/ulogd -d
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ else
+ echo `get_pid` > /var/run/ulogd.pid
+ add_daemon ulogd
+ stat_done
+ fi
+ else
+ stat_fail
+ exit 1
+ fi
+ ;;
+
+ stop)
+ stat_busy "Stopping ulog daemon"
+ PID=`get_pid`
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ exit 1
+ else
+ rm -f /var/run/ulogd.pid &> /dev/null
+ rm_daemon ulogd
+ stat_done
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0