Skip to content

Commit

Permalink
packaging/debian: support user-specified Python version [upstreamonly]
Browse files Browse the repository at this point in the history
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
  • Loading branch information
bazsi committed Apr 3, 2020
1 parent 9df0919 commit 0eaad73
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions packaging/debian/control
Expand Up @@ -26,6 +26,7 @@ Build-Depends: debhelper (>= 10~),
libhiredis-dev,
libriemann-client-dev (>= 1.6.0~),
librabbitmq-dev,
python <sng-python2>, python-dev <sng-python2>, python-setuptools <sng-python2>,
python3, python3-dev, pylint3, dh-python,
python3-nose, python3-ply, python3-setuptools,
dh-exec (>= 0.13~),
Expand Down
12 changes: 9 additions & 3 deletions packaging/debian/rules
Expand Up @@ -60,6 +60,12 @@ 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
endif

ifneq ($(filter sng-python2,$(DEB_BUILD_PROFILES)),)
PYTHON_VERSION = 2
else
PYTHON_VERSION = 3
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.
Expand Down Expand Up @@ -101,7 +107,7 @@ override_dh_auto_configure:
--enable-manpages \
$(PACCT_CONFIGURE_OPTS) \
--enable-python \
--with-python=3 \
--with-python=$(PYTHON_VERSION) \
--enable-snmp-dest \
--enable-http \
--enable-mongodb=auto \
Expand Down Expand Up @@ -135,7 +141,7 @@ override_dh_auto_install:
pkgconfigdir=/usr/lib/$(MULTIARCH_PATH)/pkgconfig
find . -name \*.la | xargs --no-run-if-empty rm
[ ! -f $(CURDIR)/debian/tmp/usr/share/syslog-ng/tools/merge-grammar.py ] || \
sed -i 's/ python$$/ python3/' \
sed -i 's/ python$$/ python$(PYTHON_VERSION)/' \
$(CURDIR)/debian/tmp/usr/share/syslog-ng/tools/merge-grammar.py

# To get better test results, and actually see failing tests, we need
Expand Down Expand Up @@ -216,4 +222,4 @@ build-indep: ;

# And for the rest, there is debhelper!
%:
dh $@ --with autoreconf,systemd,python3
dh $@ --with autoreconf,systemd,python$(PYTHON_VERSION)

0 comments on commit 0eaad73

Please sign in to comment.