Skip to content

Commit

Permalink
packaging: AxoSyslog deb packages
Browse files Browse the repository at this point in the history
Signed-off-by: László Várady <[email protected]>
  • Loading branch information
MrAnno committed May 17, 2024
1 parent b76616a commit ac08974
Show file tree
Hide file tree
Showing 64 changed files with 228 additions and 197 deletions.
26 changes: 13 additions & 13 deletions packaging/debian/README.source
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
syslog-ng Debian sources
AxoSyslog Debian sources
========================

This is the Debian packaging of syslog-ng. It is a non-trivial
This is the Debian packaging of AxoSyslog. It is a non-trivial
packaging, not for the faint of heart, but rest assured, every quirk,
every strange solution is there for a reason, and this document is
here to explain the details.
Expand All @@ -15,25 +15,25 @@ documented there. If there is conflict between this document and

### Maintainer scripts

Both syslog-ng-core, and a few of the older modules have maintainer
Both axosyslog-core, and a few of the older modules have maintainer
scripts, for various purposes.

In the case of **syslog-ng-core**, the `postrm` takes care of
In the case of **axosyslog-core**, the `postrm` takes care of
disabling (on remove) or removing (on purge) the logrotate
configuration files, and also removes the control socket and the
persist file, along with the `/var/lib/syslog-ng` directory, if it is
empty.

The `preinst` for **syslog-ng-core** restores any disabled logrotate
The `preinst` for **axosyslog-core** restores any disabled logrotate
configs, and if upgrading from a version that had symlinked conffiles,
removes those too, before unpacking the upgrade.

And the last maintainer script of **syslog-ng-core**, the `prerm`
And the last maintainer script of **axosyslog-core**, the `prerm`
stops the `syslog.socket` if using systemd, so that we do not get
re-enabled by socket activation during remove.

Some module packages, namely **syslog-ng-mod-json**,
**syslog-ng-mod-sql**, and **syslog-ng-mod-mongodb** also have a
Some module packages, namely **axosyslog-mod-json**,
**axosyslog-mod-sql**, and **axosyslog-mod-mongodb** also have a
`postinst`, which removes the old activation conffile that shipped
with syslog-ng versions prior to 3.4

Expand All @@ -46,7 +46,7 @@ configuration snippet, that declares a syslog-ng variable with the
appropriate value.

On kFreeBSD, we install one version, on Linux, another. This is done
from debian/syslog-ng-core.install, via `dh-exec`.
from debian/axosyslog-core.install, via `dh-exec`.

This way, the main configuration file remains the same on all
architectures, only this little snippet changes, which makes it easier
Expand All @@ -55,24 +55,24 @@ to maintain the whole.
### Shared library ABI versions

Upstream builds a `libsyslog-ng-$MAJOR.so.$N` shared library, which we
ship in `syslog-ng-core`, because it is not a general purpose library.
ship in `axosyslog-core`, because it is not a general purpose library.

### Control variables

We have three custom control variables, which are referenced by
`debian/control`: **${sng:CoreModules}**, and **${sng:Modules}**. They will be
used for dependencies.

The `syslog-ng` meta package has to depend on core modules, because at
some point in the past, they were part of the monolithic `syslog-ng`
The `axosyslog` meta package has to depend on core modules, because at
some point in the past, they were part of the monolithic `axosyslog`
package, and for smooth upgrades, we need to keep all formerly
installed modules installed. Being a meta package, it also recommends
the other modules.

The list of Core modules is a hard-coded list (**sql**, **mongodb**,
**json**), but the optional modules are generated at build time, by
looking at `debian/control` and finding all packages with names
starting with `syslog-ng-mod-`.
starting with `axosyslog-mod-`.

We use the `debian/tools/list-modules.sh` script to construct these
lists for us, and in `debian/rules`, we override `dh_gencontrol` to
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
279 changes: 155 additions & 124 deletions packaging/debian/control

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packaging/debian/copyright
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: syslog-ng
Upstream-Name: axosyslog
Upstream-Contact: Syslog-ng users' and developers' mailing list <[email protected]>
Source: git://github.com/syslog-ng/syslog-ng.git
Source: git://github.com/axoflow/axosyslog.git
Copyright: Copyright (C) Balázs Scheidler
Copyright (C) BalaBit IT Security Ltd.

Expand Down
2 changes: 1 addition & 1 deletion packaging/debian/gbp.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[DEFAULT]
debian-branch = debian/unstable
debian-tag = debian/syslog-ng-%(version)s
debian-tag = debian/axosyslog-%(version)s
upstream-branch = upstream/3.x

overlay = True
Expand Down
36 changes: 18 additions & 18 deletions packaging/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ 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
# We want to support building from a git tree, where the axosyslog
# sources are in a submodule, in axosyslog-*. 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
export DH_OPTIONS += -O-Bdebian/build-tree --dbg-package=axosyslog-dbg

CFLAGS ?= $(shell dpkg-buildflags --get CFLAGS)
LDFLAGS ?= $(shell dpkg-buildflags --get LDFLAGS)
Expand All @@ -57,23 +57,23 @@ PACCT_CONFIGURE_OPTS = --disable-pacct
endif

ifneq ($(filter nojava,$(DEB_BUILD_PROFILES)),)
DH_OPTIONS += -Nsyslog-ng-mod-java -Nsyslog-ng-mod-kafka -Nsyslog-ng-mod-java-common-lib -Nsyslog-ng-mod-elastic -Nsyslog-ng-mod-java-http -Nsyslog-ng-mod-hdfs
DH_OPTIONS += -Naxosyslog-mod-java -Naxosyslog-mod-kafka -Naxosyslog-mod-java-common-lib -Naxosyslog-mod-elastic -Naxosyslog-mod-java-http -Naxosyslog-mod-hdfs
else
export GRADLE_USER_HOME = /tmp/gradle
endif

PYTHON_VERSION = 3

ifneq ($(filter sng-nokafka,$(DEB_BUILD_PROFILES)),)
DH_OPTIONS += -Nsyslog-ng-mod-rdkafka
DH_OPTIONS += -Naxosyslog-mod-rdkafka
endif

ifneq ($(filter sng-nomqtt,$(DEB_BUILD_PROFILES)),)
DH_OPTIONS += -Nsyslog-ng-mod-mqtt
DH_OPTIONS += -Naxosyslog-mod-mqtt
endif

ifneq ($(filter sng-nogrpc,$(DEB_BUILD_PROFILES)),)
DH_OPTIONS += -Nsyslog-ng-mod-grpc
DH_OPTIONS += -Naxosyslog-mod-grpc
endif

# If DH_QUIET is set, then we want silent mode.
Expand Down Expand Up @@ -175,36 +175,36 @@ override_dh_auto_test:
override_dh_installchangelogs:
dh_installchangelogs NEWS.md

# Init files and whatnot were moved to syslog-ng-core, but we want to
# Init files and whatnot were moved to axosyslog-core, but we want to
# retain the old filenames.
override_dh_installinit:
dh_installinit --name syslog-ng --restart-after-upgrade
dh_installinit --name axosyslog --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
# Logrotate and Logcheck files were moved from axosyslog to
# axosyslog-core too, and like in init's case, we want to keep the old
# name.
override_dh_installlogrotate:
dh_installlogrotate --name syslog-ng
dh_installlogrotate --name axosyslog

override_dh_installlogcheck:
dh_installlogcheck --name syslog-ng
dh_installlogcheck --name axosyslog

# 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
# anything that build-depends on axosyslog-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
# Since axosyslog depends on all the modules, and axosyslog-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
# of axosyslog 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.
# part of axosyslog (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)
Expand All @@ -221,7 +221,7 @@ override_dh_python3:
override_dh_missing:
dh_missing --fail-missing

# By default, the arch:all syslog-ng package does not need anything
# By default, the arch:all axosyslog 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
Expand Down
44 changes: 22 additions & 22 deletions packaging/debian/tests/control
Original file line number Diff line number Diff line change
@@ -1,89 +1,89 @@
Tests: basic
Depends: syslog-ng-core
Depends: axosyslog-core
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng
Depends: axosyslog
Restrictions: allow-stderr

Tests: basic
Depends: @
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core
Depends: axosyslog-core
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-mongodb
Depends: axosyslog-core, axosyslog-mod-mongodb
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-sql
Depends: axosyslog-core, axosyslog-mod-sql
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-smtp
Depends: axosyslog-core, axosyslog-mod-smtp
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-amqp
Depends: axosyslog-core, axosyslog-mod-amqp
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-geoip2
Depends: axosyslog-core, axosyslog-mod-geoip2
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-redis
Depends: axosyslog-core, axosyslog-mod-redis
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-stomp
Depends: axosyslog-core, axosyslog-mod-stomp
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-riemann
Depends: axosyslog-core, axosyslog-mod-riemann
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-graphite
Depends: axosyslog-core, axosyslog-mod-graphite
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-python
Depends: axosyslog-core, axosyslog-mod-python
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-add-contextual-data
Depends: axosyslog-core, axosyslog-mod-add-contextual-data
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-getent
Depends: axosyslog-core, axosyslog-mod-getent
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-stardate
Depends: axosyslog-core, axosyslog-mod-stardate
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-map-value-pairs
Depends: axosyslog-core, axosyslog-mod-map-value-pairs
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-snmptrapd-parser
Depends: axosyslog-core, axosyslog-mod-snmptrapd-parser
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-xml-parser
Depends: axosyslog-core, axosyslog-mod-xml-parser
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-extra
Depends: axosyslog-core, axosyslog-mod-extra
Restrictions: allow-stderr

Tests: basic
Depends: syslog-ng-core, syslog-ng-mod-tag-parser
Depends: axosyslog-core, axosyslog-mod-tag-parser
Restrictions: allow-stderr

#Tests: upgrade
Expand All @@ -98,4 +98,4 @@ Depends: @, sysvinit-core
Restrictions: needs-root, allow-stderr

#Tests: compile-incubator
#Depends: build-essential, syslog-ng-dev, fakeroot, debhelper, dh-autoreconf, automake, liblua5.2-dev, libperl-dev, python-dev, libgrok-dev, libtokyocabinet-dev, librdkafka-dev, libzmq3-dev, libmongo-client-dev
#Depends: build-essential, axosyslog-dev, fakeroot, debhelper, dh-autoreconf, automake, liblua5.2-dev, libperl-dev, python-dev, libgrok-dev, libtokyocabinet-dev, librdkafka-dev, libzmq3-dev, libmongo-client-dev
28 changes: 14 additions & 14 deletions packaging/debian/tests/upgrade
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/bin/sh -e

orig_version=$(apt-cache policy syslog-ng | grep "500$" | awk '{print $1}')
orig_version=$(apt-cache policy axosyslog | grep "500$" | awk '{print $1}')

apt_line=""
for pkg in syslog-ng \
syslog-ng-core \
syslog-ng-mod-mongodb \
syslog-ng-mod-sql \
syslog-ng-mod-smtp \
syslog-ng-mod-amqp \
syslog-ng-mod-geoip2 \
syslog-ng-mod-redis \
syslog-ng-mod-stomp \
syslog-ng-mod-riemann \
syslog-ng-mod-graphite \
syslog-ng-mod-python \
syslog-ng-mod-add-contextual-data
for pkg in axosyslog \
axosyslog-core \
axosyslog-mod-mongodb \
axosyslog-mod-sql \
axosyslog-mod-smtp \
axosyslog-mod-amqp \
axosyslog-mod-geoip2 \
axosyslog-mod-redis \
axosyslog-mod-stomp \
axosyslog-mod-riemann \
axosyslog-mod-graphite \
axosyslog-mod-python \
axosyslog-mod-add-contextual-data
do
apt_line="$apt_line $pkg=$orig_version"
done
Expand Down
4 changes: 2 additions & 2 deletions packaging/debian/tools/list-modules.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /bin/sh

CORE_MODULES="syslog-ng-mod-sql syslog-ng-mod-mongodb"
ALL_MODULES=$(echo $(grep "^Package: syslog-ng-mod-" debian/control | cut -d: -f 2))
CORE_MODULES="axosyslog-mod-sql axosyslog-mod-mongodb"
ALL_MODULES=$(echo $(grep "^Package: axosyslog-mod-" debian/control | cut -d: -f 2))

case "$1" in
"core")
Expand Down
2 changes: 1 addition & 1 deletion packaging/debian/watch
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version=3

https://github.com/syslog-ng/syslog-ng/tags .*/syslog-ng-([\d\.]+)\.tar\.gz
https://github.com/axoflow/axosyslog/tags .*/axosyslog-([\d\.]+)\.tar\.gz

0 comments on commit ac08974

Please sign in to comment.