xref: /OK3568_Linux_fs/buildroot/package/syslog-ng/syslog-ng.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# syslog-ng
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun# When updating the version, please check at runtime if the version in
8*4882a593Smuzhiyun# syslog-ng.conf header needs to be updated
9*4882a593SmuzhiyunSYSLOG_NG_VERSION = 3.34.1
10*4882a593SmuzhiyunSYSLOG_NG_SITE = https://github.com/balabit/syslog-ng/releases/download/syslog-ng-$(SYSLOG_NG_VERSION)
11*4882a593SmuzhiyunSYSLOG_NG_LICENSE = LGPL-2.1+ (syslog-ng core), GPL-2.0+ (modules)
12*4882a593SmuzhiyunSYSLOG_NG_LICENSE_FILES = COPYING GPL.txt LGPL.txt
13*4882a593SmuzhiyunSYSLOG_NG_CPE_ID_VENDOR = oneidentity
14*4882a593SmuzhiyunSYSLOG_NG_DEPENDENCIES = host-bison host-flex host-pkgconf \
15*4882a593Smuzhiyun	libglib2 openssl pcre
16*4882a593Smuzhiyun# We're patching configure.ac
17*4882a593SmuzhiyunSYSLOG_NG_AUTORECONF = YES
18*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS = --disable-manpages --localstatedir=/var/run \
19*4882a593Smuzhiyun	--disable-java --disable-java-modules --disable-mongodb
20*4882a593Smuzhiyun
21*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_GEOIP),y)
22*4882a593SmuzhiyunSYSLOG_NG_DEPENDENCIES += geoip
23*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --enable-geoip
24*4882a593Smuzhiyunelse
25*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --disable-geoip
26*4882a593Smuzhiyunendif
27*4882a593Smuzhiyun
28*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBCAP),y)
29*4882a593SmuzhiyunSYSLOG_NG_DEPENDENCIES += libcap
30*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --enable-linux-caps
31*4882a593Smuzhiyunelse
32*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --disable-linux-caps
33*4882a593Smuzhiyunendif
34*4882a593Smuzhiyun
35*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_PYTHON),y)
36*4882a593SmuzhiyunSYSLOG_NG_DEPENDENCIES += python
37*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += \
38*4882a593Smuzhiyun	--enable-python \
39*4882a593Smuzhiyun	--with-python=$(PYTHON_VERSION_MAJOR)
40*4882a593Smuzhiyunelse ifeq ($(BR2_PACKAGE_PYTHON3),y)
41*4882a593SmuzhiyunSYSLOG_NG_DEPENDENCIES += python3
42*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += \
43*4882a593Smuzhiyun	--enable-python \
44*4882a593Smuzhiyun	--with-python=$(PYTHON3_VERSION_MAJOR)
45*4882a593Smuzhiyunelse
46*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --disable-python
47*4882a593Smuzhiyunendif
48*4882a593Smuzhiyun
49*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBESMTP),y)
50*4882a593SmuzhiyunSYSLOG_NG_DEPENDENCIES += libesmtp
51*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --enable-smtp
52*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --with-libesmtp="$(STAGING_DIR)/usr"
53*4882a593Smuzhiyunelse
54*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --disable-smtp
55*4882a593Smuzhiyunendif
56*4882a593Smuzhiyun
57*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_JSON_C),y)
58*4882a593SmuzhiyunSYSLOG_NG_DEPENDENCIES += json-c
59*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --enable-json
60*4882a593Smuzhiyunelse
61*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --disable-json
62*4882a593Smuzhiyunendif
63*4882a593Smuzhiyun
64*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBUUID),y)
65*4882a593SmuzhiyunSYSLOG_NG_DEPENDENCIES += util-linux
66*4882a593Smuzhiyunendif
67*4882a593Smuzhiyun
68*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBNET),y)
69*4882a593SmuzhiyunSYSLOG_NG_DEPENDENCIES += libnet
70*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += \
71*4882a593Smuzhiyun	--with-libnet=$(STAGING_DIR)/usr/bin \
72*4882a593Smuzhiyun	--enable-spoof-source
73*4882a593Smuzhiyunelse
74*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --disable-spoof-source
75*4882a593Smuzhiyunendif
76*4882a593Smuzhiyun
77*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBCURL),y)
78*4882a593SmuzhiyunSYSLOG_NG_DEPENDENCIES += libcurl
79*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --enable-http
80*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --with-libcurl="$(STAGING_DIR)/usr"
81*4882a593Smuzhiyunelse
82*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --disable-http
83*4882a593Smuzhiyunendif
84*4882a593Smuzhiyun
85*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_RABBITMQ_C),y)
86*4882a593SmuzhiyunSYSLOG_NG_DEPENDENCIES += rabbitmq-c
87*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --enable-amqp
88*4882a593Smuzhiyunelse
89*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --disable-amqp
90*4882a593Smuzhiyunendif
91*4882a593Smuzhiyun
92*4882a593Smuzhiyunifeq ($(BR2_INIT_SYSTEMD),y)
93*4882a593SmuzhiyunSYSLOG_NG_DEPENDENCIES += systemd
94*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += \
95*4882a593Smuzhiyun	--enable-systemd \
96*4882a593Smuzhiyun	--with-systemdsystemunitdir=/usr/lib/systemd/system
97*4882a593Smuzhiyunelse
98*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --disable-systemd
99*4882a593Smuzhiyunendif
100*4882a593Smuzhiyun
101*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NETSNMP),y)
102*4882a593SmuzhiyunSYSLOG_NG_DEPENDENCIES += netsnmp
103*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --enable-afsnmp
104*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --with-net-snmp="$(STAGING_DIR)/usr/bin"
105*4882a593Smuzhiyunelse
106*4882a593SmuzhiyunSYSLOG_NG_CONF_OPTS += --disable-afsnmp
107*4882a593Smuzhiyunendif
108*4882a593Smuzhiyun
109*4882a593Smuzhiyundefine SYSLOG_NG_INSTALL_INIT_SYSV
110*4882a593Smuzhiyun	$(INSTALL) -m 0755 -D package/syslog-ng/S01syslog-ng \
111*4882a593Smuzhiyun		$(TARGET_DIR)/etc/init.d/S01syslog-ng
112*4882a593Smuzhiyunendef
113*4882a593Smuzhiyun
114*4882a593Smuzhiyun# By default syslog-ng installs a .service that requires a config file at
115*4882a593Smuzhiyun# /etc/default, so provide one with the default values.
116*4882a593Smuzhiyundefine SYSLOG_NG_INSTALL_INIT_SYSTEMD
117*4882a593Smuzhiyun	mkdir -p $(TARGET_DIR)/usr/lib/systemd/system/syslog-ng@.service.d
118*4882a593Smuzhiyun	printf '[Install]\nDefaultInstance=default\n' \
119*4882a593Smuzhiyun		>$(TARGET_DIR)/usr/lib/systemd/system/syslog-ng@.service.d/buildroot-default-instance.conf
120*4882a593Smuzhiyunendef
121*4882a593Smuzhiyun
122*4882a593Smuzhiyun# By default syslog-ng installs a number of sample configuration
123*4882a593Smuzhiyun# files. Some of these rely on optional features being
124*4882a593Smuzhiyun# enabled. Because of this buildroot uninstalls the shipped config
125*4882a593Smuzhiyun# files and provides a simplified configuration.
126*4882a593Smuzhiyundefine SYSLOG_NG_FIXUP_CONFIG
127*4882a593Smuzhiyun	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
128*4882a593Smuzhiyun		DESTDIR=$(TARGET_DIR) scl-uninstall-local
129*4882a593Smuzhiyun	$(INSTALL) -D -m 0644 package/syslog-ng/syslog-ng.conf \
130*4882a593Smuzhiyun		$(TARGET_DIR)/etc/syslog-ng.conf
131*4882a593Smuzhiyunendef
132*4882a593Smuzhiyun
133*4882a593SmuzhiyunSYSLOG_NG_POST_INSTALL_TARGET_HOOKS = SYSLOG_NG_FIXUP_CONFIG
134*4882a593Smuzhiyun
135*4882a593Smuzhiyun$(eval $(autotools-package))
136