logrotate: enable selinux support
[buildroot-gz.git] / package / syslog-ng / syslog-ng.mk
blob61fc48fd4a06898fbc0ece568a47e2e68768a6ac
1 ################################################################################
3 # syslog-ng
5 ################################################################################
7 SYSLOG_NG_VERSION = 3.9.1
8 SYSLOG_NG_SITE = https://github.com/balabit/syslog-ng/releases/download/syslog-ng-$(SYSLOG_NG_VERSION)
9 SYSLOG_NG_LICENSE = LGPLv2.1+ (syslog-ng core), GPLv2+ (modules)
10 SYSLOG_NG_LICENSE_FILES = COPYING
11 SYSLOG_NG_DEPENDENCIES = host-bison host-flex host-pkgconf \
12 eventlog libglib2 openssl pcre
13 # rabbit-mq needs -lrt
14 SYSLOG_NG_CONF_ENV = LIBS=-lrt
15 SYSLOG_NG_CONF_OPTS = --disable-manpages --localstatedir=/var/run \
16 --disable-java --disable-java-modules
18 # We override busybox's S01logging init script
19 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
20 SYSLOG_NG_DEPENDENCIES += busybox
21 endif
23 ifeq ($(BR2_PACKAGE_GEOIP),y)
24 SYSLOG_NG_DEPENDENCIES += geoip
25 SYSLOG_NG_CONF_OPTS += --enable-geoip
26 else
27 SYSLOG_NG_CONF_OPTS += --disable-geoip
28 endif
30 ifeq ($(BR2_PACKAGE_LIBCAP),y)
31 SYSLOG_NG_DEPENDENCIES += libcap
32 SYSLOG_NG_CONF_OPTS += --enable-linux-caps
33 else
34 SYSLOG_NG_CONF_OPTS += --disable-linux-caps
35 endif
37 ifeq ($(BR2_PACKAGE_PYTHON),y)
38 SYSLOG_NG_DEPENDENCIES += python
39 SYSLOG_NG_CONF_OPTS += \
40 --enable-python \
41 --with-python=$(PYTHON_VERSION_MAJOR)
42 else ifeq ($(BR2_PACKAGE_PYTHON3),y)
43 SYSLOG_NG_DEPENDENCIES += python3
44 SYSLOG_NG_CONF_OPTS += \
45 --enable-python \
46 --with-python=$(PYTHON3_VERSION_MAJOR)
47 else
48 SYSLOG_NG_CONF_OPTS += \
49 --disable-python \
50 --without-python
51 endif
53 ifeq ($(BR2_PACKAGE_LIBESMTP),y)
54 SYSLOG_NG_DEPENDENCIES += libesmtp
55 SYSLOG_NG_CONF_OPTS += --enable-smtp
56 SYSLOG_NG_CONF_OPTS += --with-libesmtp="$(STAGING_DIR)/usr"
57 else
58 SYSLOG_NG_CONF_OPTS += --disable-smtp
59 endif
61 ifeq ($(BR2_PACKAGE_JSON_C),y)
62 SYSLOG_NG_DEPENDENCIES += json-c
63 SYSLOG_NG_CONF_OPTS += --enable-json
64 else
65 SYSLOG_NG_CONF_OPTS += --disable-json
66 endif
68 ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBUUID),y)
69 SYSLOG_NG_DEPENDENCIES += util-linux
70 endif
72 ifeq ($(BR2_PACKAGE_LIBNET),y)
73 SYSLOG_NG_DEPENDENCIES += libnet
74 SYSLOG_NG_CONF_OPTS += --enable-spoof-source
75 else
76 SYSLOG_NG_CONF_OPTS += --disable-spoof-source
77 endif
79 ifeq ($(BR2_PACKAGE_LIBCURL),y)
80 SYSLOG_NG_DEPENDENCIES += libcurl
81 SYSLOG_NG_CONF_OPTS += --enable-http
82 SYSLOG_NG_CONF_OPTS += --with-libcurl="$(STAGING_DIR)/usr"
83 else
84 SYSLOG_NG_CONF_OPTS += --disable-http
85 endif
87 ifeq ($(BR2_INIT_SYSTEMD),y)
88 SYSLOG_NG_DEPENDENCIES += systemd
89 SYSLOG_NG_CONF_OPTS += \
90 --enable-systemd \
91 --with-systemdsystemunitdir=/usr/lib/systemd/system
92 else
93 SYSLOG_NG_CONF_OPTS += --disable-systemd
94 endif
96 define SYSLOG_NG_INSTALL_INIT_SYSV
97 $(INSTALL) -m 0755 -D package/syslog-ng/S01logging \
98 $(TARGET_DIR)/etc/init.d/S01logging
99 endef
101 # By default syslog-ng installs a number of sample configuration
102 # files. Some of these rely on optional features being
103 # enabled. Because of this buildroot uninstalls the shipped config
104 # files and provides a simplified configuration.
105 define SYSLOG_NG_FIXUP_CONFIG
106 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
107 DESTDIR=$(TARGET_DIR) scl-uninstall-local
108 $(INSTALL) -D -m 0644 package/syslog-ng/syslog-ng.conf \
109 $(TARGET_DIR)/etc/syslog-ng.conf
110 endef
112 SYSLOG_NG_POST_INSTALL_TARGET_HOOKS = SYSLOG_NG_FIXUP_CONFIG
114 $(eval $(autotools-package))