Port ulogd to -ng
authorFlorian Fainelli <florian@openwrt.org>
Sat, 26 Aug 2006 08:49:48 +0000 (08:49 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Sat, 26 Aug 2006 08:49:48 +0000 (08:49 +0000)
SVN-Revision: 4678

net/ulogd/Makefile [new file with mode: 0644]
net/ulogd/files/ulogd.default [new file with mode: 0644]
net/ulogd/files/ulogd.init [new file with mode: 0644]
net/ulogd/patches/ulogd-1.23-inc-patch.patch [new file with mode: 0644]
net/ulogd/patches/ulogd-1.23-pcap_ldflags.patch [new file with mode: 0644]

diff --git a/net/ulogd/Makefile b/net/ulogd/Makefile
new file mode 100644 (file)
index 0000000..8d3d177
--- /dev/null
@@ -0,0 +1,140 @@
+#
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# $Id$
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ulogd
+PKG_VERSION:=1.24
+PKG_RELEASE:=1
+PKG_MD5SUM:=05b4ed2926b9a22aaeaf642917bbf8ff
+
+PKG_SOURCE_URL:=ftp://ftp.netfilter.org/pub/ulogd/ \
+       ftp://ftp.be.netfilter.org/pub/netfilter/ulogd/ \
+       ftp://ftp.de.netfilter.org/pub/netfilter/ulogd/ \
+       ftp://ftp.no.netfilter.org/pub/netfilter/ulogd/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_CAT:=bzcat
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+
+define Package/ulogd
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+iptables
+  MENU:=1
+  TITLE:=Netfilter userspace logging daemon
+  DESCRIPTION:=The netfilter userspace logging daemon\\\
+  URL:=http://gnumonks.org/projects/ulogd
+endef
+
+define Package/ulogd/conffiles
+/etc/default/ulogd
+/etc/ulogd.conf
+endef
+
+define Package/ulogd-mod-mysql
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=ulogd +libmysqlclient
+  TITLE:=Output plugin for logging into a MySQL database
+endef
+
+define Package/ulogd-mod-pcap
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=ulogd +libpcap
+  TITLE:=Output plugin for logging into pcap format
+endef
+
+define Package/ulogd-mod-pgsql
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=ulogd +libpq
+  TITLE:=Output plugin for logging into a PostgreSQL database
+endef
+
+define Package/ulogd-mod-sqlite
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=ulogd +libsqlite3
+  TITLE:=Output plugin for logging into an SQLite database
+endef
+
+define Package/ulogd-mod-extra
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=ulogd
+  TITLE:=All other plugins
+endef
+
+include $(INCLUDE_DIR)/package.mk
+
+ifneq ($(Package/ulogd-mod-mysql),)
+ULOGD_MYSQL_OPTION:=--with-mysql=$(STAGING_DIR)/usr
+endif
+
+ifneq ($(Package/ulogd-mod-pcap),)
+ULOGD_PCAP_HEADER:=yes
+else
+ULOGD_PCAP_HEADER:=no
+endif
+
+ifneq ($(Package/ulogd-mod-pgsql),)
+ULOGD_PGSQL_OPTION:=--with-pgsql=$(STAGING_DIR)/usr
+endif
+
+ifneq ($(Package/ulogd-mod-sqlite),)
+ULOGD_SQLITE_OPTION:=--with-sqlite3=$(STAGING_DIR)/usr
+endif
+
+define Build/Configure
+$(call Build/Configure/Default,--enable-shared \
+                       --disable-static \
+                       $(ULOGD_MYSQL_OPTION) \
+                       $(ULOGD_PGSQL_OPTION) \
+                       $(ULOGD_SQLITE_OPTION),ac_cv_header_pcap_h=$(ULOGD_PCAP_HEADER))
+endef
+
+define Build/Compile
+$(call Build/Compile/Default,DESTDIR="$(PKG_INSTALL_DIR)" \
+               STAGING_DIR=$(STAGING_DIR) \
+               all install)
+endef
+
+define Package/ulogd/install   
+       install -d -m0755 $(1)/etc
+       $(CP) $(PKG_INSTALL_DIR)/etc/ulogd.conf $(1)/etc/
+       install -d -m0755 $(1)/etc/default
+       install -m0644 ./files/ulogd.default $(1)/etc/default/ulogd
+       install -d -m0755 $(1)/etc/init.d
+       install -m0755 ./files/ulogd.init $(1)/etc/init.d/ulogd
+       ln -sf ulogd $(1)/etc/init.d/S49ulogd
+       install -d -m0755 $(1)/usr/lib/ulogd
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ulogd/ulogd_BASE.so $(1)/usr/lib/ulogd/
+       install -d -m0755 $(1)/usr/sbin
+       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ulogd $(1)/usr/sbin/
+endef
+
+define BuildPlugin
+  define Package/$(1)/install
+       install -m0755 -d $$(1)/usr/lib/ulogd
+       for m in $(2); do \
+               $(CP) $(PKG_INSTALL_DIR)/usr/lib/ulogd/ulogd_$$$$$$$${m}.so $$(1)/usr/lib/ulogd/ ; \
+       done
+  endef
+
+  $$(eval $$(call BuildPackage,$(1)))
+endef
+
+$(eval $(call BuildPackage,ulogd))
+$(eval $(call BuildPlugin,ulogd-mod-mysql,MYSQL))
+$(eval $(call BuildPlugin,ulogd-mod-pcap,PCAP))
+$(eval $(call BuildPlugin,ulogd-mod-pgsql,PGSQL))
+$(eval $(call BuildPlugin,ulogd-mod-sqlite,SQLITE3))
+$(eval $(call BuildPlugin,ulogd-mod-extra,LOCAL LOGEMU OPRINT PWSNIFF SYSLOG))
diff --git a/net/ulogd/files/ulogd.default b/net/ulogd/files/ulogd.default
new file mode 100644 (file)
index 0000000..86bf444
--- /dev/null
@@ -0,0 +1 @@
+OPTIONS="-d"
\ No newline at end of file
diff --git a/net/ulogd/files/ulogd.init b/net/ulogd/files/ulogd.init
new file mode 100644 (file)
index 0000000..d3863c5
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+BIN=ulogd
+DEFAULT=/etc/default/$BIN
+LOG_D=/var/log
+[ -f $DEFAULT ] && . $DEFAULT
+
+case $1 in
+ start)
+  $BIN $OPTIONS
+  ;;
+ *)
+  echo "usage: $0 (start)"
+  exit 1
+esac
+
+exit $?
diff --git a/net/ulogd/patches/ulogd-1.23-inc-patch.patch b/net/ulogd/patches/ulogd-1.23-inc-patch.patch
new file mode 100644 (file)
index 0000000..b472112
--- /dev/null
@@ -0,0 +1,24 @@
+diff -ruN ulogd-1.23-old/Rules.make.in ulogd-1.23-new/Rules.make.in
+--- ulogd-1.23-old/Rules.make.in       2005-02-19 22:32:40.000000000 +0100
++++ ulogd-1.23-new/Rules.make.in       2005-05-27 07:45:18.000000000 +0200
+@@ -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 -ruN ulogd-1.23-old/libipulog/Makefile.in ulogd-1.23-new/libipulog/Makefile.in
+--- ulogd-1.23-old/libipulog/Makefile.in       2004-03-23 23:36:06.000000000 +0100
++++ ulogd-1.23-new/libipulog/Makefile.in       2005-05-27 07:44:21.000000000 +0200
+@@ -1,7 +1,7 @@
+ #
+ include @top_srcdir@/Rules.make
+-CFLAGS+=-Iinclude -I/usr/src/linux/include
++CFLAGS+=-Iinclude
+ libipulog.a: libipulog.o
+       $(LD) -i $< -o $@
diff --git a/net/ulogd/patches/ulogd-1.23-pcap_ldflags.patch b/net/ulogd/patches/ulogd-1.23-pcap_ldflags.patch
new file mode 100644 (file)
index 0000000..d451823
--- /dev/null
@@ -0,0 +1,12 @@
+diff -urN ulogd-1.23/pcap/Makefile.in ulogd-1.23.new/pcap/Makefile.in
+--- ulogd-1.23/pcap/Makefile.in        2004-03-23 23:36:04.000000000 +0100
++++ ulogd-1.23.new/pcap/Makefile.in    2006-04-19 11:30:45.000000000 +0200
+@@ -14,7 +14,7 @@
+ distrib:
+ $(SHARED_LIBS): %.so: %_sh.o
+-      $(LD) -shared -o $@ $< -lc -lpcap
++      $(LD) -shared -o $@ $< -lc -lpcap -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib
+ %_sh.o: %.c
+       $(CC) $(SH_CFLAGS) -o $@ -c $<