summaryrefslogtreecommitdiffstats
path: root/rules/syslogng.make
blob: bbed6438ef98c44c87fd896b2c716626e0d03fe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# -*-makefile-*-
# $Id: template 4453 2006-01-29 13:28:16Z rsc $
#
# Copyright (C) 2006 by Robert Schwebel
#
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_SYSLOGNG) += syslogng

#
# Paths and names
#
SYSLOGNG_VERSION	:= 1.9.11
SYSLOGNG		:= syslog-ng-$(SYSLOGNG_VERSION)
SYSLOGNG_SUFFIX		:= tar.gz
SYSLOGNG_URL		:= http://www.balabit.com/downloads/syslog-ng/1.9/src/$(SYSLOGNG).$(SYSLOGNG_SUFFIX)
SYSLOGNG_SOURCE		:= $(SRCDIR)/$(SYSLOGNG).$(SYSLOGNG_SUFFIX)
SYSLOGNG_DIR		:= $(BUILDDIR)/$(SYSLOGNG)


# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

syslogng_get: $(STATEDIR)/syslogng.get

$(STATEDIR)/syslogng.get: $(syslogng_get_deps_default)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(SYSLOGNG_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, SYSLOGNG)

# ----------------------------------------------------------------------------
# Extract
# ----------------------------------------------------------------------------

syslogng_extract: $(STATEDIR)/syslogng.extract

$(STATEDIR)/syslogng.extract: $(syslogng_extract_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(SYSLOGNG_DIR))
	@$(call extract, SYSLOGNG)
	@$(call patchin, SYSLOGNG)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

syslogng_prepare: $(STATEDIR)/syslogng.prepare

SYSLOGNG_PATH	:= PATH=$(CROSS_PATH)
SYSLOGNG_ENV 	:= $(CROSS_ENV)

#
# autoconf
#
SYSLOGNG_AUTOCONF := \
	$(CROSS_AUTOCONF_USR) \
	--enable-dynamic-linking \
	--disable-dependency-tracking \
	--disable-debug \
	--enable-ipv6 \
	--disable-sun-streams \
	--disable-sun-door
#
# FIXME:
# --enable-ipv6: disabling ipv6 is broken, fails in
#	src/afinet.c:303: undefined reference to `g_sockaddr_inet6_new'
#	src/afinet.c:304: undefined reference to `g_sockaddr_inet6_new'
#	src/afinet.c:246: undefined reference to `g_sockaddr_inet6_new'
#
# --disable-sun-streams: feature broken. Depends on some header files
#      configure detects as missing, but sources includes them
# --disable-sun-door: feature broken. Depends on some header files
#      configure detects as missing, but sources includes them
#
ifdef PTXCONF_SYSLOGNG_TCPWRAPPER
SYSLOGNG_AUTOCONF += --enable-tcp-wrapper
else
SYSLOGNG_AUTOCONF += --disable-tcp-wrapper
endif

ifdef PTXCONF_SYSLOGNG_SPOOF_SOURCE
SYSLOGNG_AUTOCONF += --enable-spoof-source
else
SYSLOGNG_AUTOCONF += --disable-spoof-source
endif

$(STATEDIR)/syslogng.prepare: $(syslogng_prepare_deps_default)
	@$(call targetinfo, $@)
	@$(call clean, $(SYSLOGNG_DIR)/config.cache)
	cd $(SYSLOGNG_DIR) && \
		$(SYSLOGNG_PATH) $(SYSLOGNG_ENV) \
		./configure $(SYSLOGNG_AUTOCONF)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------

syslogng_compile: $(STATEDIR)/syslogng.compile

$(STATEDIR)/syslogng.compile: $(syslogng_compile_deps_default)
	@$(call targetinfo, $@)
	cd $(SYSLOGNG_DIR) && $(SYSLOGNG_PATH) make
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

syslogng_install: $(STATEDIR)/syslogng.install

$(STATEDIR)/syslogng.install: $(syslogng_install_deps_default)
	@$(call targetinfo, $@)
	@$(call install, SYSLOGNG)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

syslogng_targetinstall: $(STATEDIR)/syslogng.targetinstall

$(STATEDIR)/syslogng.targetinstall: $(syslogng_targetinstall_deps_default)
	@$(call targetinfo, $@)

	@$(call install_init, syslogng)
	@$(call install_fixup, syslogng,PACKAGE,syslogng)
	@$(call install_fixup, syslogng,PRIORITY,optional)
	@$(call install_fixup, syslogng,VERSION,$(SYSLOGNG_VERSION))
	@$(call install_fixup, syslogng,SECTION,base)
	@$(call install_fixup, syslogng,AUTHOR,"Robert Schwebel <r.schwebel\@pengutronix.de>")
	@$(call install_fixup, syslogng,DEPENDS,)
	@$(call install_fixup, syslogng,DESCRIPTION,missing)

	@$(call install_copy, syslogng, 0, 0, 0755, \
		$(SYSLOGNG_DIR)/src/syslog-ng, /sbin/syslog-ng)

ifdef PTXCONF_ROOTFS_ETC_INITD_SYSLOGNG_STARTSCRIPT
ifdef PTXCONF_ROOTFS_ETC_INITD_SYSLOGNG_DEFAULT
# install the generic one
	@$(call install_copy, syslogng, 0, 0, 0755, \
		$(PTXDIST_TOPDIR)/generic/etc/init.d/syslog-ng, \
		/etc/init.d/syslog-ng, n)
endif
ifdef PTXCONF_ROOTFS_ETC_INITD_SYSLOGNG_USER
# install users one
	@$(call install_copy, syslogng, 0, 0, 0755, \
		$(PTXDIST_WORKSPACE)/projectroot/etc/init.d/syslog-ng, \
		/etc/init.d/syslog-ng, n)
endif
#
# FIXME: Is this packet the right location for the link?
#
ifneq ($(PTXCONF_ROOTFS_ETC_INITD_SYSLOGNG_LINK),"")
	@$(call install_copy, syslogng, 0, 0, 0755, /etc/rc.d)
	@$(call install_link, syslogng, ../init.d/syslog-ng, \
		/etc/rc.d/$(PTXCONF_ROOTFS_ETC_INITD_SYSLOGNG_LINK))
endif
endif

ifdef PTXCONF_ROOTFS_ETC_SYSLOGNG_CONFIG
ifdef PTXCONF_ROOTFS_ETC_SYSLOGNG_CONFIG_DEFAULT
# install the generic one
	@$(call install_copy, syslogng, 0, 0, 0644, \
		$(PTXDIST_TOPDIR)/generic/etc/syslog-ng.conf, \
		/etc/syslog-ng.conf)
endif
ifdef PTXCONF_ROOTFS_ETC_SYSLOGNG_CONFIG_USER
# install users one
	@$(call install_copy, syslogng, 0, 0, 0644, \
		$(PTXDIST_WORKSPACE)/projectroot/etc/syslog-ng.conf, \
		/etc/syslog-ng.conf)
endif
endif
	@$(call install_finish, syslogng)

	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------

syslogng_clean:
	rm -rf $(STATEDIR)/syslogng.*
	rm -rf $(IMAGEDIR)/syslogng_*
	rm -rf $(SYSLOGNG_DIR)

# vim: syntax=make