Port syslog-ng to -ng
authorFlorian Fainelli <florian@openwrt.org>
Tue, 8 Aug 2006 14:56:43 +0000 (14:56 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Tue, 8 Aug 2006 14:56:43 +0000 (14:56 +0000)
SVN-Revision: 4541

admin/syslog-ng/Makefile [new file with mode: 0644]
admin/syslog-ng/files/syslog-ng.conf [new file with mode: 0644]
admin/syslog-ng/files/syslog-ng.init [new file with mode: 0755]
admin/syslog-ng/patches/01-no_lfl.patch [new file with mode: 0644]

diff --git a/admin/syslog-ng/Makefile b/admin/syslog-ng/Makefile
new file mode 100644 (file)
index 0000000..1ef4e72
--- /dev/null
@@ -0,0 +1,64 @@
+#
+# 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:=syslog-ng
+PKG_VERSION:=1.6.9
+PKG_RELEASE:=1
+PKG_MD5SUM:=5280a86b4f5c25b2ba157c8cea302cf0
+
+PKG_SOURCE_URL:=http://www.balabit.com/downloads/syslog-ng/stable/src \
+               http://www.balabit.com/downloads/syslog-ng/1.6/src
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_CAT:=zcat
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+PKG_INIT_LEVEL:=60
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/syslog-ng
+  SECTION:=admin
+  CATEGORY:=Administration
+  DEPENDS:=+libol
+  TITLE:=A powerful syslog daemon
+  DESCRIPTION:=syslog-ng reads and logs messages to the  system  console,  log\\\
+       files, other machines and/or users as specified by its\\\
+       configuration file.\\\
+  URL:=http://www.balabit.com/products/syslog_ng/
+endef
+
+define Package/syslog-ng/conffiles
+/etc/syslog-ng/syslog-ng.conf
+endef
+
+define Build/Configure
+$(call Build/Configure/Default,--disable-dependency-tracking \
+                        --disable-full-static \
+                        --enable-tcp-wrapper \
+                        --with-libol="$(STAGING_DIR)/usr/bin",CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/usr/include/libol" \
+               LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/usr/lib/libol")
+endef
+
+define Build/Compile   
+$(call Build/Compile/Default,DESTDIR="$(PKG_INSTALL_DIR)" \
+               all install)
+endef
+
+define Package/syslog-ng/install       
+       install -d -m0755 $(1)/usr/sbin
+       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/syslog-ng $(1)/usr/sbin/
+       install -d -m0755 $(1)/etc/init.d
+       install -m0755 ./files/syslog-ng.init $(1)/etc/init.d/S$(PKG_INIT_LEVEL)syslog-ng
+       install -d -m0755 $(1)/etc/syslog-ng
+       install -m0644 ./files/syslog-ng.conf $(1)/etc/syslog-ng/
+endef
+
+$(eval $(call BuildPackage,syslog-ng))
diff --git a/admin/syslog-ng/files/syslog-ng.conf b/admin/syslog-ng/files/syslog-ng.conf
new file mode 100644 (file)
index 0000000..658abea
--- /dev/null
@@ -0,0 +1,16 @@
+options { 
+       chain_hostnames(off); 
+       sync(0); 
+
+       # The default action of syslog-ng 1.6.0 is to log a STATS line
+       # to the file every 10 minutes.  That's pretty ugly after a while.
+       # Change it to every 12 hours so you get a nice daily update of
+       # how many messages syslog-ng missed (0).
+       stats(43200); 
+};
+
+source src { unix-stream("/dev/log"); internal(); };
+
+destination messages { file("/var/log/messages"); };
+
+log { source(src); destination(messages); };
diff --git a/admin/syslog-ng/files/syslog-ng.init b/admin/syslog-ng/files/syslog-ng.init
new file mode 100755 (executable)
index 0000000..40472ed
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+syslog_start() {
+  [ -f /etc/syslog-ng/syslog-ng.conf ] || {
+    echo "/etc/syslog-ng/syslog-ng.conf does not exist !";
+    exit 0;
+  };
+  [ -d /var/run ] || mkdir -p /var/run
+  [ -x /usr/sbin/syslog-ng ] && /usr/sbin/syslog-ng
+}
+
+syslog_stop() {
+  killall syslog-ng
+}
+
+case "$1" in
+  start)
+       syslog_start
+       ;;
+  stop)
+       syslog_stop
+       ;;
+  restart)
+       syslog_stop
+       sleep 1s
+       syslog_start
+       ;;
+  reload)
+       kill -HUP `cat /var/run/syslog-ng.pid` &>/dev/null
+       ;;
+  *)
+       echo "Usage: $0 <start|stop|restart|reload>"
+       ;;
+esac
diff --git a/admin/syslog-ng/patches/01-no_lfl.patch b/admin/syslog-ng/patches/01-no_lfl.patch
new file mode 100644 (file)
index 0000000..e17a5c6
--- /dev/null
@@ -0,0 +1,50 @@
+diff -urN syslog-ng-1.6.9/Makefile.in syslog-ng-1.6.9.new/Makefile.in
+--- syslog-ng-1.6.9/Makefile.in        2005-11-23 09:58:28.000000000 +0100
++++ syslog-ng-1.6.9.new/Makefile.in    2006-03-23 19:02:04.000000000 +0100
+@@ -64,7 +64,7 @@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
+ LEX = @LEX@
+-LEXLIB = @LEXLIB@
++LEXLIB =
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+ LIBOBJS = @LIBOBJS@
+ LIBOL_DIR = @LIBOL_DIR@
+diff -urN syslog-ng-1.6.9/configure syslog-ng-1.6.9.new/configure
+--- syslog-ng-1.6.9/configure  2005-11-23 09:58:29.000000000 +0100
++++ syslog-ng-1.6.9.new/configure      2006-03-23 21:56:43.000000000 +0100
+@@ -3160,7 +3160,7 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lfl  $LIBS"
++LIBS="$LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+diff -urN syslog-ng-1.6.9/src/Makefile.in syslog-ng-1.6.9.new/src/Makefile.in
+--- syslog-ng-1.6.9/src/Makefile.in    2005-11-23 09:58:37.000000000 +0100
++++ syslog-ng-1.6.9.new/src/Makefile.in        2006-03-23 19:02:27.000000000 +0100
+@@ -64,7 +64,7 @@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LDFLAGS = @LDFLAGS@
+ LEX = @LEX@
+-LEXLIB = @LEXLIB@
++LEXLIB =
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+ LIBOBJS = @LIBOBJS@
+ LIBOL_DIR = @LIBOL_DIR@
+diff -urN syslog-ng-1.6.9/src/cfg-lex.c syslog-ng-1.6.9.new/src/cfg-lex.c
+--- syslog-ng-1.6.9/src/cfg-lex.c      2005-11-15 19:41:46.000000000 +0100
++++ syslog-ng-1.6.9.new/src/cfg-lex.c  2006-03-23 19:03:25.000000000 +0100
+@@ -666,7 +666,9 @@
+ #ifdef __cplusplus
+ extern "C" int yywrap (void );
+ #else
+-extern int yywrap (void );
++int yywrap (void ) {
++      return 1;
++}
+ #endif
+ #endif