xref: /OK3568_Linux_fs/buildroot/package/rsyslog/rsyslog.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1################################################################################
2#
3# rsyslog
4#
5################################################################################
6
7RSYSLOG_VERSION = 8.2010.0
8RSYSLOG_SITE = http://rsyslog.com/files/download/rsyslog
9RSYSLOG_LICENSE = GPL-3.0, LGPL-3.0, Apache-2.0
10RSYSLOG_LICENSE_FILES = COPYING COPYING.LESSER COPYING.ASL20
11RSYSLOG_CPE_ID_VENDOR = rsyslog
12# rsyslog uses weak permissions for generating log files.
13# Ignoring this CVE as Buildroot normally doesn't have local users and a build
14# could customize the rsyslog.conf to be more restrictive ($FileCreateMode 0640)
15RSYSLOG_IGNORE_CVES += CVE-2015-3243
16RSYSLOG_DEPENDENCIES = zlib libestr liblogging libfastjson host-pkgconf
17RSYSLOG_CONF_ENV = ac_cv_prog_cc_c99='-std=c99'
18RSYSLOG_PLUGINS = imdiag imfile impstats imptcp \
19	mmanon mmaudit mmfields mmjsonparse mmpstrucdata mmsequence mmutf8fix \
20	mail omprog omruleset omstdout omuxsock \
21	pmaixforwardedfrom pmciscoios pmcisconames pmlastmsg pmsnare
22
23ifeq ($(BR2_PACKAGE_LIBRELP),y)
24RSYSLOG_DEPENDENCIES += librelp
25RSYSLOG_PLUGINS += relp
26endif
27
28RSYSLOG_CONF_OPTS = --disable-generate-man-pages \
29	$(foreach x,$(call qstrip,$(RSYSLOG_PLUGINS)),--enable-$(x))
30
31# Disable items requiring libcurl
32RSYSLOG_CONF_OPTS += --disable-elasticsearch \
33	--disable-clickhouse \
34	--disable-omhttp \
35	--disable-fmhttp \
36	--disable-imdocker \
37	--disable-omhttpfs \
38	--disable-mmkubernetes
39
40ifeq ($(BR2_PACKAGE_CIVETWEB_LIB),y)
41RSYSLOG_DEPENDENCIES += civetweb
42RSYSLOG_CONF_OPTS += --enable-imhttp
43else
44RSYSLOG_CONF_OPTS += --disable-imhttp
45endif
46
47ifeq ($(BR2_PACKAGE_GNUTLS),y)
48RSYSLOG_DEPENDENCIES += gnutls
49RSYSLOG_CONF_OPTS += --enable-gnutls
50else
51RSYSLOG_CONF_OPTS += --disable-gnutls
52endif
53
54ifeq ($(BR2_PACKAGE_LIBEE),y)
55RSYSLOG_DEPENDENCIES += libee
56endif
57
58ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
59RSYSLOG_DEPENDENCIES += libgcrypt
60RSYSLOG_CONF_ENV += LIBGCRYPT_CONFIG=$(STAGING_DIR)/usr/bin/libgcrypt-config
61RSYSLOG_CONF_OPTS += --enable-libgcrypt
62else
63RSYSLOG_CONF_OPTS += --disable-libgcrypt
64endif
65
66ifeq ($(BR2_PACKAGE_LIBPCAP),y)
67RSYSLOG_DEPENDENCIES += libpcap
68RSYSLOG_CONF_OPTS += --enable-impcap
69else
70RSYSLOG_CONF_OPTS += --disable-impcap
71endif
72
73ifeq ($(BR2_PACKAGE_MYSQL),y)
74RSYSLOG_DEPENDENCIES += mysql
75RSYSLOG_CONF_OPTS += --enable-mysql
76RSYSLOG_CONF_ENV += ac_cv_prog_MYSQL_CONFIG=$(STAGING_DIR)/usr/bin/mysql_config
77else
78RSYSLOG_CONF_OPTS += --disable-mysql
79endif
80
81ifeq ($(BR2_PACKAGE_POSTGRESQL),y)
82RSYSLOG_DEPENDENCIES += postgresql
83RSYSLOG_CONF_OPTS += --enable-pgsql
84RSYSLOG_CONF_ENV += ac_cv_prog_PG_CONFIG=$(STAGING_DIR)/usr/bin/pg_config
85else
86RSYSLOG_CONF_OPTS += --disable-pgsql
87endif
88
89ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBUUID),y)
90RSYSLOG_DEPENDENCIES += util-linux
91RSYSLOG_CONF_OPTS += --enable-uuid
92else
93RSYSLOG_CONF_OPTS += --disable-uuid
94endif
95
96ifeq ($(BR2_INIT_SYSTEMD),y)
97RSYSLOG_CONF_OPTS += \
98	--enable-imjournal \
99	--enable-omjournal \
100	--with-systemdsystemunitdir=/usr/lib/systemd/system
101RSYSLOG_DEPENDENCIES += systemd
102else
103RSYSLOG_CONF_OPTS += \
104	--disable-imjournal \
105	--disable-omjournal
106endif
107
108define RSYSLOG_INSTALL_INIT_SYSTEMD
109	$(INSTALL) -m 0755 -D package/rsyslog/rsyslog.service \
110		$(TARGET_DIR)/usr/lib/systemd/system/rsyslog.service
111endef
112
113define RSYSLOG_INSTALL_INIT_SYSV
114	$(INSTALL) -m 0755 -D package/rsyslog/S01rsyslogd \
115		$(TARGET_DIR)/etc/init.d/S01rsyslogd
116endef
117
118define RSYSLOG_INSTALL_CONF
119	$(INSTALL) -m 0644 -D $(@D)/platform/redhat/rsyslog.conf \
120		$(TARGET_DIR)/etc/rsyslog.conf
121	mkdir -p $(TARGET_DIR)/etc/rsyslog.d
122endef
123
124RSYSLOG_POST_INSTALL_TARGET_HOOKS += RSYSLOG_INSTALL_CONF
125
126$(eval $(autotools-package))
127