kumquat-buildroot/package/syslog-ng/syslog-ng.mk

135 lines
3.9 KiB
Makefile
Raw Normal View History

################################################################################
#
# syslog-ng
#
################################################################################
# When updating the version, please check at runtime if the version in
# syslog-ng.conf header needs to be updated
SYSLOG_NG_VERSION = 3.28.1
SYSLOG_NG_SITE = https://github.com/balabit/syslog-ng/releases/download/syslog-ng-$(SYSLOG_NG_VERSION)
SYSLOG_NG_LICENSE = LGPL-2.1+ (syslog-ng core), GPL-2.0+ (modules)
SYSLOG_NG_LICENSE_FILES = COPYING GPL.txt LGPL.txt
SYSLOG_NG_DEPENDENCIES = host-bison host-flex host-pkgconf \
libglib2 openssl pcre
# We're patching configure.ac
SYSLOG_NG_AUTORECONF = YES
SYSLOG_NG_CONF_OPTS = --disable-manpages --localstatedir=/var/run \
--disable-java --disable-java-modules --disable-mongodb
ifeq ($(BR2_PACKAGE_GEOIP),y)
SYSLOG_NG_DEPENDENCIES += geoip
SYSLOG_NG_CONF_OPTS += --enable-geoip
else
SYSLOG_NG_CONF_OPTS += --disable-geoip
endif
ifeq ($(BR2_PACKAGE_LIBCAP),y)
SYSLOG_NG_DEPENDENCIES += libcap
SYSLOG_NG_CONF_OPTS += --enable-linux-caps
else
SYSLOG_NG_CONF_OPTS += --disable-linux-caps
endif
ifeq ($(BR2_PACKAGE_PYTHON),y)
SYSLOG_NG_DEPENDENCIES += python
SYSLOG_NG_CONF_OPTS += \
--enable-python \
--with-python=$(PYTHON_VERSION_MAJOR)
else ifeq ($(BR2_PACKAGE_PYTHON3),y)
SYSLOG_NG_DEPENDENCIES += python3
SYSLOG_NG_CONF_OPTS += \
--enable-python \
--with-python=$(PYTHON3_VERSION_MAJOR)
else
SYSLOG_NG_CONF_OPTS += --disable-python
endif
ifeq ($(BR2_PACKAGE_LIBESMTP),y)
SYSLOG_NG_DEPENDENCIES += libesmtp
SYSLOG_NG_CONF_OPTS += --enable-smtp
SYSLOG_NG_CONF_OPTS += --with-libesmtp="$(STAGING_DIR)/usr"
else
SYSLOG_NG_CONF_OPTS += --disable-smtp
endif
ifeq ($(BR2_PACKAGE_JSON_C),y)
SYSLOG_NG_DEPENDENCIES += json-c
SYSLOG_NG_CONF_OPTS += --enable-json
else
SYSLOG_NG_CONF_OPTS += --disable-json
endif
ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBUUID),y)
SYSLOG_NG_DEPENDENCIES += util-linux
endif
ifeq ($(BR2_PACKAGE_LIBNET),y)
SYSLOG_NG_DEPENDENCIES += libnet
SYSLOG_NG_CONF_OPTS += \
--with-libnet=$(STAGING_DIR)/usr/bin \
--enable-spoof-source
else
SYSLOG_NG_CONF_OPTS += --disable-spoof-source
endif
ifeq ($(BR2_PACKAGE_LIBCURL),y)
SYSLOG_NG_DEPENDENCIES += libcurl
SYSLOG_NG_CONF_OPTS += --enable-http
SYSLOG_NG_CONF_OPTS += --with-libcurl="$(STAGING_DIR)/usr"
else
SYSLOG_NG_CONF_OPTS += --disable-http
endif
ifeq ($(BR2_PACKAGE_RABBITMQ_C),y)
SYSLOG_NG_DEPENDENCIES += rabbitmq-c
SYSLOG_NG_CONF_OPTS += --enable-amqp
else
SYSLOG_NG_CONF_OPTS += --disable-amqp
endif
ifeq ($(BR2_INIT_SYSTEMD),y)
SYSLOG_NG_DEPENDENCIES += systemd
SYSLOG_NG_CONF_OPTS += \
--enable-systemd \
--with-systemdsystemunitdir=/usr/lib/systemd/system
else
SYSLOG_NG_CONF_OPTS += --disable-systemd
endif
package/syslog-ng: fix build if net-snmp is installed on the host If syslog-ng is selected in Buildroot and net-snmp is not, but net-snmp is found on the host machine (at least its net-snmp-config script) then compilation of syslog-ng fails with: CC modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest-grammar.lo CC modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest.lo CC modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest-plugin.lo arm-none-linux-gnueabi-gcc: ERROR: unsafe header/library path used in cross-compilation: '-I/usr/include' make[3]: *** [Makefile:17397: modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest-grammar.lo] Error 1 make[3]: *** Waiting for unfinished jobs.... arm-none-linux-gnueabi-gcc: ERROR: unsafe header/library path used in cross-compilation: '-I/usr/include' make[3]: *** [Makefile:17404: modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest.lo] Error 1 arm-none-linux-gnueabi-gcc: ERROR: unsafe header/library path used in cross-compilation: '-I/usr/include' make[3]: *** [Makefile:17411: modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest-plugin.lo] Error 1 make[2]: *** [Makefile:21428: all-recursive] Error 1 make[1]: *** [Makefile:8740: all] Error 2 make[1]: Leaving directory '.../buildroot/output/build/syslog-ng-3.25.1' make: *** [package/pkg-generic.mk:269: .../buildroot/output/build/syslog-ng-3.25.1/.stamp_built] Error 2 The path /usr/include is obtained via /usr/bin/net-snmp-config. The fix comprises two parts: 1. only enable net-snmp support in syslog-ng if the net-snmp package is enabled in Buildroot 2. for the case where net-snmp is selected in Buildroot, fix the configure script of syslog-ng to allow parsing --with-netsnmp=<path> correctly. Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Reviewed-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-03-16 16:01:05 +01:00
ifeq ($(BR2_PACKAGE_NETSNMP),y)
SYSLOG_NG_DEPENDENCIES += netsnmp
SYSLOG_NG_CONF_OPTS += --enable-snmp-dest
SYSLOG_NG_CONF_OPTS += --with-net-snmp="$(STAGING_DIR)/usr/bin"
package/syslog-ng: fix build if net-snmp is installed on the host If syslog-ng is selected in Buildroot and net-snmp is not, but net-snmp is found on the host machine (at least its net-snmp-config script) then compilation of syslog-ng fails with: CC modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest-grammar.lo CC modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest.lo CC modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest-plugin.lo arm-none-linux-gnueabi-gcc: ERROR: unsafe header/library path used in cross-compilation: '-I/usr/include' make[3]: *** [Makefile:17397: modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest-grammar.lo] Error 1 make[3]: *** Waiting for unfinished jobs.... arm-none-linux-gnueabi-gcc: ERROR: unsafe header/library path used in cross-compilation: '-I/usr/include' make[3]: *** [Makefile:17404: modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest.lo] Error 1 arm-none-linux-gnueabi-gcc: ERROR: unsafe header/library path used in cross-compilation: '-I/usr/include' make[3]: *** [Makefile:17411: modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest-plugin.lo] Error 1 make[2]: *** [Makefile:21428: all-recursive] Error 1 make[1]: *** [Makefile:8740: all] Error 2 make[1]: Leaving directory '.../buildroot/output/build/syslog-ng-3.25.1' make: *** [package/pkg-generic.mk:269: .../buildroot/output/build/syslog-ng-3.25.1/.stamp_built] Error 2 The path /usr/include is obtained via /usr/bin/net-snmp-config. The fix comprises two parts: 1. only enable net-snmp support in syslog-ng if the net-snmp package is enabled in Buildroot 2. for the case where net-snmp is selected in Buildroot, fix the configure script of syslog-ng to allow parsing --with-netsnmp=<path> correctly. Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Reviewed-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-03-16 16:01:05 +01:00
else
SYSLOG_NG_CONF_OPTS += --disable-snmp-dest
endif
define SYSLOG_NG_INSTALL_INIT_SYSV
$(INSTALL) -m 0755 -D package/syslog-ng/S01syslog-ng \
$(TARGET_DIR)/etc/init.d/S01syslog-ng
endef
# By default syslog-ng installs a .service that requires a config file at
# /etc/default, so provide one with the default values.
define SYSLOG_NG_INSTALL_INIT_SYSTEMD
mkdir $(TARGET_DIR)/usr/lib/systemd/system/syslog-ng@.service.d
printf '[Install]\nDefaultInstance=default\n' \
>$(TARGET_DIR)/usr/lib/systemd/system/syslog-ng@.service.d/buildroot-default-instance.conf
endef
# By default syslog-ng installs a number of sample configuration
# files. Some of these rely on optional features being
# enabled. Because of this buildroot uninstalls the shipped config
# files and provides a simplified configuration.
define SYSLOG_NG_FIXUP_CONFIG
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
DESTDIR=$(TARGET_DIR) scl-uninstall-local
$(INSTALL) -D -m 0644 package/syslog-ng/syslog-ng.conf \
$(TARGET_DIR)/etc/syslog-ng.conf
endef
SYSLOG_NG_POST_INSTALL_TARGET_HOOKS = SYSLOG_NG_FIXUP_CONFIG
$(eval $(autotools-package))