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 201 202 203 204 205 206 207
|
#! /usr/bin/make -f
## debian/rules file for syslog-ng 3.3+
## (C) 2010-2012 Laszlo Boszormenyi (GCS) <gcs@debian.hu>
## (C) 2011-2014 Gergely Nagy <algernon@madhouse-project.org>
##
## Released under the GPLv2+, see /usr/share/common-licenses/GPL-2 on
## Debian systems.
# For my own sanity, when debian/rules is ran without any argument,
# display something meaningful, instead of just running the first
# override.
help:
sensible-pager debian/README.source
##
#* Environment setup
#
# If DEB_BUILD_OPTIONS has "debug" in it, we want to pass
# --enable-debug to configure.
#
# We also want to build in a separate build directory:
# debian/build-tree, because it's just so much easier to ignore files
# in there.
#
# By the way, if one wants to pass extra flags to configure, that can
# be done with EXTRA_CONFIGURE_OPTS, we don't override it, only append
# to it.
##
ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS)))
EXTRA_CONFIGURE_OPTS += --enable-debug
endif
# We want to support building from a git tree, where the syslog-ng
# sources are in a submodule, in syslog-ng-*. Since we do not wish to
# update the rules for every major version if it can be helped, figure
# it out from the changelog instead.
UMAJOR = $(shell dpkg-parsechangelog | sed -n '/^Version:/s/^Version: //p' | cut -d. -f1,2)
export DH_OPTIONS += -O-Bdebian/build-tree --dbg-package=syslog-ng-dbg
CFLAGS ?= $(shell dpkg-buildflags --get CFLAGS)
LDFLAGS ?= $(shell dpkg-buildflags --get LDFLAGS)
MULTIARCH_PATH = $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
# We want to enforce systemd support on Linux, but disable it
# everywhere else.
ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH_OS),linux)
SYSTEMD_CONFIGURE_OPTS = --enable-systemd --with-systemd-journal=system
PACCT_CONFIGURE_OPTS = --enable-pacct
else
SYSTEMD_CONFIGURE_OPTS = --disable-systemd
PACCT_CONFIGURE_OPTS = --disable-pacct
endif
# If DH_QUIET is set, then we want silent mode.
# If DH_VERBOSE is set, we do not want silent mode.
# If neither is set, we want the default: verbose mode.
SILENT_MODE = --disable-silent-rules
ifneq (,${DH_QUIET})
SILENT_MODE = --enable-silent-rules
endif
ifneq (,${DH_VERBOSE})
SILENT_MODE = --disable-silent-rules
endif
##
#* Overrides for dh_auto*
##
# Oh, the joys of configure!
# We pass down all appropriate options, along with EXTRA_CONFIGURE_OPTS.
# This also sets SOURCE_REVISION to the debian package version.
override_dh_auto_configure:
install -d debian/build-tree
-rm -rf doc/man/*.?
SOURCE_REVISION="$(shell dpkg-parsechangelog | \
sed -n '/^Version:/s/^Version: //p')"; \
dh_auto_configure -- \
--build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \
--prefix=/usr \
--mandir=/usr/share/man \
--sysconfdir=/etc/syslog-ng \
--localstatedir=/var/lib/syslog-ng \
--libdir=/usr/lib/syslog-ng \
${SILENT_MODE} \
\
--enable-dynamic-linking \
--enable-ssl \
--enable-spoof-source \
--enable-tcp-wrapper \
--enable-sql \
--enable-mongodb \
--enable-json \
--enable-riemann \
--disable-java \
--enable-manpages \
--enable-amqp \
$(PACCT_CONFIGURE_OPTS) \
--enable-python \
\
--with-mongoc=system \
--with-ivykis=system \
--with-jsonc=system \
--with-librabbitmq-client=system \
\
--with-module-dir='$${exec_prefix}/lib/syslog-ng/${UMAJOR}' \
--with-systemdsystemunitdir="/lib/systemd/system" \
\
SOURCE_REVISION="$${SOURCE_REVISION}" \
${SYSTEMD_CONFIGURE_OPTS} \
${EXTRA_CONFIGURE_OPTS}
# The pkg-config .pc file is installed into ${libdir}/pkgconfig, but
# we override libdir above to place everything useful there. We want
# the .pc file elsewhere, though, so do that here at install time.
#
# Similarly, we want to install python modules to their proper place,
# and this is a great time to tell the build system where that is.
# Also removing .la files, these files don't needed and just confuse
# the list-missing option
override_dh_auto_install:
dh_auto_install -- \
pkgconfigdir=/usr/lib/$(MULTIARCH_PATH)/pkgconfig \
PYSETUP_OPTIONS="--install-layout=deb \
--root=$(CURDIR)/debian/tmp/"
find . -name \*.la | xargs --no-run-if-empty rm
# To get better test results, and actually see failing tests, we need
# to pass VERBOSE=1 to make when running the tests. Do that here.
override_dh_auto_test:
# disabled ATM
#dh_auto_test -- VERBOSE=1
##
#* Overrides for other debhelper commands
#
# Below are overrides for individual debhelper commands.
##
# Install the NEWS file as upstream changelog.
# Rationale: the ChangeLog file is an old artifact from the Arch
# times. It is not updated, and is obsolete.
override_dh_installchangelogs:
dh_installchangelogs NEWS.md
# Init files and whatnot were moved to syslog-ng-core, but we want to
# retain the old filenames.
override_dh_installinit:
dh_installinit --name syslog-ng --restart-after-upgrade
# Logrotate and Logcheck files were moved from syslog-ng to
# syslog-ng-core too, and like in init's case, we want to keep the old
# name.
override_dh_installlogrotate:
dh_installlogrotate --name syslog-ng
override_dh_installlogcheck:
dh_installlogcheck --name syslog-ng
# dh_makeshlibs wants to be clever and treat plugins as shared libs.
# Slap it in the face, and tell it not to. We also do not need any
# script modifications, as our single shared lib is in a private
# directory. On the other hand, we do want correct dependencies on
# anything that build-depends on syslog-ng-dev, so lets make a correct
# shlibs file for that, shall we?
#
override_dh_makeshlibs:
dh_makeshlibs -n -Xusr/lib/syslog-ng/${UMAJOR}
# Since syslog-ng depends on all the modules, and syslog-ng-core
# suggests the same set, and modules can come and go as new versions
# of syslog-ng come out, lets make our life easy, and provide a custom
# sng:Modules substvar, which has all the module packages listed. We
# also provide sng:CoreModules, which lists core modules that were
# part of syslog-ng (or it depended on them) previously, in 3.3.
override_dh_gencontrol:
dh_gencontrol -- -Vsng:Modules=$(shell debian/tools/list-modules.sh optional) \
-Vsng:CoreModules=$(shell debian/tools/list-modules.sh core)
# Sadly, dh_python2 barfs on --dbg-package=, so we work it around by
# clearing DH_OPTIONS here.
override_dh_python2:
DH_OPTIONS="" dh_python2
# Sadly, dh_python3 barfs on --dbg-package=, so we work it around by
# clearing DH_OPTIONS here.
override_dh_python3:
DH_OPTIONS="" dh_python3
##
#* Other, non-override targets
##
override_dh_missing:
dh_missing $(shell awk '{sub(/.*\//, "", $$1); print "-X"$$2"/"$$1}' debian/syslog-ng-mod-extra.install) --fail-missing
# By default, the arch:all syslog-ng package does not need anything
# built, so build-indep shall be empty. This avoids triggering another
# build attempt, which would fail due to autoreconf being run
# twice. It would also fail if no build-deps were installed (since the
# package has no build-dep-indeps, rightly so).
build-indep: ;
# And for the rest, there is debhelper!
%:
dh $@ --with autoreconf,systemd,python2
|