Control: tags -1 patch

On Tue, 11 Apr 2023 15:43:51 +0200 Andreas Henriksson <andr...@fatal.se> wrote:
> Wrong path is used at:
> https://sources.debian.org/src/fail2ban/1.0.2-1/debian/rules/#L50
>
> Note that the path will likely change again in the future, so rather
> than hard-coding a path please consider finding the path via:
> pkg-config --variable=systemdsystemunitdir systemd
>
> (Note: you'll need to build-dep on pkg-config and systemd, for
> systemd.pc)
>
> Regards,
> Andreas Henriksson
>
>

Attaching a patch, the git repo seems to be in an inconsistent state/diverged from the archive.

diff --git a/debian/control b/debian/control
index fe386199..0b8c5421 100644
--- a/debian/control
+++ b/debian/control
@@ -13,6 +13,8 @@ Build-Depends:
  , python3-pyinotify
  , sqlite3
  , 2to3
+ , pkg-config
+ , systemd
 Homepage: https://www.fail2ban.org
 Vcs-Git: https://salsa.debian.org/python-team/packages/fail2ban.git
 Vcs-Browser: https://salsa.debian.org/python-team/packages/fail2ban
diff --git a/debian/rules b/debian/rules
index a2dd769c..3c0391ef 100755
--- a/debian/rules
+++ b/debian/rules
@@ -16,7 +16,7 @@ export PYBUILD_DISABLE_python2=1
 
 DESTDIR=$(CURDIR)/debian/fail2ban
 PYVERSION=$(shell py3versions -dv)
-
+SYSTEMD_SYSTEM_UNIT_DIR = $(shell pkg-config --variable=systemdsystemunitdir systemd)
 override_dh_clean:
 	rm -rf fail2ban.egg-info
 	-rm debian/fail2ban.init
@@ -45,11 +45,11 @@ override_dh_install:
 	install -d $(DESTDIR)/usr/share/bash-completion/completions
 	install -m 644 files/bash-completion $(DESTDIR)/usr/share/bash-completion/completions/fail2ban
 	: # Install systemd files
-	install -d $(DESTDIR)/usr/lib/systemd/system/
+	install -d $(DESTDIR)$(SYSTEMD_SYSTEM_UNIT_DIR)
 	install -d $(DESTDIR)/usr/lib/tmpfiles.d
-	install -m 644 build/fail2ban.service $(DESTDIR)/usr/lib/systemd/system
+	install -m 644 build/fail2ban.service $(DESTDIR)$(SYSTEMD_SYSTEM_UNIT_DIR)
 	install -m 644 files/fail2ban-tmpfiles.conf $(DESTDIR)/usr/lib/tmpfiles.d
-	install -d $(DESTDIR)/usr/lib/systemd/system
+	install -d $(DESTDIR)$(SYSTEMD_SYSTEM_UNIT_DIR)
 	: # Install default jail enabler
 	install -m 644 debian/debian-files/jail.d_defaults-debian.conf $(DESTDIR)/etc/fail2ban/jail.d/defaults-debian.conf
 	dh_install

Reply via email to