summaryrefslogtreecommitdiff
path: root/recipes/ulogd
diff options
context:
space:
mode:
authorRoman I Khimov <khimov@altell.ru>2010-03-05 14:39:25 +0300
committerRoman I Khimov <khimov@altell.ru>2010-03-23 20:44:28 +0300
commit58b2dab3bd0253a164ee350382462f279555b7d1 (patch)
treef9e2ead7f4dbd418b73eaa0c77f6273c224eb85a /recipes/ulogd
parent4ca8c8807133f150e2f8e17e8855eeb4c4d72064 (diff)
ulogd: new recipe
Signed-off-by: Roman I Khimov <khimov@altell.ru>
Diffstat (limited to 'recipes/ulogd')
-rw-r--r--recipes/ulogd/files/init61
-rw-r--r--recipes/ulogd/files/ulogd-hash-style-gnu.patch43
-rw-r--r--recipes/ulogd/files/ulogd-kill-uname-in-rules.patch13
-rw-r--r--recipes/ulogd/ulogd_1.24.bb23
4 files changed, 140 insertions, 0 deletions
diff --git a/recipes/ulogd/files/init b/recipes/ulogd/files/init
new file mode 100644
index 0000000000..75cb408ab5
--- /dev/null
+++ b/recipes/ulogd/files/init
@@ -0,0 +1,61 @@
+#!/bin/sh
+#
+# /etc/init.d/ulogd
+#
+
+NAME="ulogd"
+DAEMON="/usr/sbin/ulogd"
+CONFIG="/etc/ulogd.conf"
+PIDFILE="/var/run/${NAME}.pid"
+
+
+# Gracefully exit if there is no daemon (debian way of life)
+if [ ! -x "${DAEMON}" ]; then
+ exit 0
+fi
+
+# Check for config file
+if [ ! -f ${CONFIG} ]; then
+ echo "Error: There is no config file for $NAME" >&2
+ exit 1;
+fi
+
+case "$1" in
+ start)
+ echo -n "Starting $NAME: "
+ start-stop-daemon --start --quiet --make-pidfile --pidfile "${PIDFILE}" --background --exec ${DAEMON} -- -c ${CONFIG}
+ RET=$?
+ if [ "$?" == "0" ]; then
+ echo "done."
+ else
+ echo "FAILED!"
+ fi
+ exit $RET
+ ;;
+ stop)
+ echo -n "Stopping $NAME:"
+ start-stop-daemon --stop --quiet --oknodo --pidfile "${PIDFILE}" && echo "done." || echo "FAILED!"
+ ;;
+ status)
+ echo -n "ulogd "
+ start-stop-daemon -q -K -t -x $DAEMON
+ RET=$?
+ if [ "$RET" == "0" ]; then
+ PID=`cat $PIDFILE`
+ echo "($PID) is running"
+ else
+ echo "is not running"
+ exit $RET
+ fi
+ ;;
+ restart)
+ $0 start
+ $0 stop
+ ;;
+
+ *)
+ echo "Usage: /etc/init.d/ulogd {start|stop|status|restart}"
+ exit 1
+esac
+
+exit 0
diff --git a/recipes/ulogd/files/ulogd-hash-style-gnu.patch b/recipes/ulogd/files/ulogd-hash-style-gnu.patch
new file mode 100644
index 0000000000..9da385f507
--- /dev/null
+++ b/recipes/ulogd/files/ulogd-hash-style-gnu.patch
@@ -0,0 +1,43 @@
+Index: ulogd-1.24/extensions/Makefile.in
+===================================================================
+--- ulogd-1.24.orig/extensions/Makefile.in 2010-03-23 18:04:14.000000000 +0300
++++ ulogd-1.24/extensions/Makefile.in 2010-03-23 18:03:58.000000000 +0300
+@@ -18,10 +18,10 @@
+ $(CC) $(SH_CFLAGS) -o $@ -c $<
+
+ $(SHARED_LIBS): %.so: %_sh.o
+- $(LD) -shared -o $@ $< -lc
++ $(LD) --hash-style=gnu -shared -o $@ $< -lc
+
+ ulogd_SYSLOG.so: printpkt.o ulogd_SYSLOG_sh.o
+- $(LD) -shared -o $@ $^ -lc
++ $(LD) --hash-style=gnu -shared -o $@ $^ -lc
+
+ %_sh.o: %.c
+ $(CC) $(SH_CFLAGS) -o $@ -c $<
+Index: ulogd-1.24/pcap/Makefile.in
+===================================================================
+--- ulogd-1.24.orig/pcap/Makefile.in 2010-03-23 18:04:28.000000000 +0300
++++ ulogd-1.24/pcap/Makefile.in 2010-03-23 18:04:47.000000000 +0300
+@@ -14,7 +14,7 @@
+ distrib:
+
+ $(SHARED_LIBS): %.so: %_sh.o
+- $(LD) -shared -o $@ $< -lc -lpcap
++ $(LD) --hash-style=gnu -shared -o $@ $< -lc -lpcap
+
+ %_sh.o: %.c
+ $(CC) $(SH_CFLAGS) -o $@ -c $<
+Index: ulogd-1.24/Makefile.in
+===================================================================
+--- ulogd-1.24.orig/Makefile.in 2010-03-23 18:05:59.000000000 +0300
++++ ulogd-1.24/Makefile.in 2010-03-23 18:06:52.000000000 +0300
+@@ -63,7 +63,7 @@
+ @for d in $(SUBDIRS); do if ! make -C $$d; then exit 1; fi; done
+
+ ulogd: ulogd.c $(LIBIPULOG) include/ulogd/ulogd.h conffile/conffile.o $(LIBIPULOG)/libipulog.a ulogd.conf
+- $(CC) $(CFLAGS) -rdynamic $< conffile/conffile.o $(LIBIPULOG)/libipulog.a -o $@ $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -rdynamic $< conffile/conffile.o $(LIBIPULOG)/libipulog.a -o $@ $(LIBS)
+
+ edit = sed -e 's,@libdir\@,$(ULOGD_LIB_PATH),g'
+
diff --git a/recipes/ulogd/files/ulogd-kill-uname-in-rules.patch b/recipes/ulogd/files/ulogd-kill-uname-in-rules.patch
new file mode 100644
index 0000000000..d2fca81f05
--- /dev/null
+++ b/recipes/ulogd/files/ulogd-kill-uname-in-rules.patch
@@ -0,0 +1,13 @@
+Index: ulogd-1.24/Rules.make.in
+===================================================================
+--- ulogd-1.24.orig/Rules.make.in 2010-03-05 14:09:27.000000000 +0300
++++ ulogd-1.24/Rules.make.in 2010-03-05 14:09:39.000000000 +0300
+@@ -22,7 +22,7 @@
+ CFLAGS+=-DULOGD_CONFIGFILE=\"$(ULOGD_CONFIGFILE)\"
+ # doesn't work for subdirs
+ #CFLAGS+=$(INCIPULOG) $(INCCONFFILE)
+-CFLAGS+=-I/lib/modules/`uname -r`/build/include
++#CFLAGS+=-I/lib/modules/`uname -r`/build/include
+ #CFLAGS+=@DEFS@
+ #CFLAGS+=-g -DDEBUG -DDEBUG_MYSQL -DDEBUG_PGSQL
+
diff --git a/recipes/ulogd/ulogd_1.24.bb b/recipes/ulogd/ulogd_1.24.bb
new file mode 100644
index 0000000000..2b641be407
--- /dev/null
+++ b/recipes/ulogd/ulogd_1.24.bb
@@ -0,0 +1,23 @@
+DESCRIPTION = "Userspace logging daemon for netfilter/iptables related logging"
+LICENSE = "GPL"
+DEPENDS = "libpcap"
+
+SRC_URI = " \
+ http://www.netfilter.org/projects/ulogd/files/ulogd-${PV}.tar.bz2;name=tar \
+ file://ulogd-kill-uname-in-rules.patch;patch=1 \
+ file://ulogd-hash-style-gnu.patch;patch=1 \
+ file://init \
+ "
+SRC_URI[tar.md5sum] = "05b4ed2926b9a22aaeaf642917bbf8ff"
+SRC_URI[tar.sha256sum] = "63a6069d9b537d8a6d6a4d99beeb4ccc0a853717414da3a6e0ce230a34d0e057"
+
+PARALLEL_MAKE = ""
+
+inherit autotools update-rc.d
+
+INITSCRIPT_NAME = "ulogd"
+
+do_install_append() {
+ install -d ${D}/${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/ulogd
+} \ No newline at end of file