CATEGORY:=Administration
TITLE:=A powerful syslog daemon
URL:=https://www.syslog-ng.com/products/open-source-log-management/
- DEPENDS:=+libpcre +glib2 +libopenssl +libpthread +librt +zlib +libdbi +libjson-c +libcurl +libuuid
+ DEPENDS:=+libpcre +glib2 +libopenssl +libpthread +librt +zlib +libdbi +libjson-c +libcurl +libuuid +SYSLOGNG_LOGROTATE:logrotate
endef
define Package/syslog-ng/description
/etc/scl.conf
endef
+define Package/syslog-ng/config
+config SYSLOGNG_LOGROTATE
+ bool "Logrotate support"
+ depends on PACKAGE_syslog-ng
+ default n
+ help
+ It adds support for logrotate functionality.
+
+config SYSLOGNG_LOGROTATE_MAXSIZE
+ string "Maximum size of /var/log/messages log file"
+ depends on SYSLOGNG_LOGROTATE
+ default "1M"
+ help
+ Log files are rotated when they grow bigger than defined size bytes.
+
+config SYSLOGNG_LOGROTATE_ROTATE_COUNT
+ int "Maximum rotation count for /var/log/messages log file"
+ depends on SYSLOGNG_LOGROTATE
+ default 1
+ help
+ Log files are rotated count times before being removed or mailed to
+ the address specified in a mail directive. If count is 0, old
+ versions are removed rather than rotated.
+endef
+
define Build/Configure
$(SED) 's,-I/usr/include,,' $(PKG_BUILD_DIR)/configure
$(Build/Configure/Default)
endef
+LOGROTATE_MAXSIZE:=$(call qstrip,$(CONFIG_SYSLOGNG_LOGROTATE_MAXSIZE))
+LOGROTATE_ROTATE:=$(call qstrip,$(CONFIG_SYSLOGNG_LOGROTATE_ROTATE_COUNT))
+
CONFIGURE_ARGS += \
--disable-afsnmp \
$(call autoconf_bool,CONFIG_IPV6,ipv6) \
$(INSTALL_DIR) $(1)/usr/share/syslog-ng/include/
$(CP) -r ./files/scl $(1)/usr/share/syslog-ng/include/
+
+ifneq ($(strip $(CONFIG_SYSLOGNG_LOGROTATE)),)
+ $(INSTALL_DIR) $(1)/etc/logrotate.d
+ sed \
+ -e 's#@MAXSIZE@#$(LOGROTATE_MAXSIZE)#g' \
+ -e 's#@ROTATE@#$(LOGROTATE_ROTATE)#g' \
+ ./files/syslog-ng.logrotate > $(1)/etc/logrotate.d/syslog-ng.conf
+endif
endef
define Package/syslog-ng/postinst