Fix hardcoded path in service file

This commit is contained in:
Zdenek Dohnal 2022-05-06 10:14:10 +02:00
parent 296641ebcc
commit 74c78a03f0
2 changed files with 73 additions and 1 deletions

View File

@ -0,0 +1,66 @@
From 811310768250b2ae61280f7b63ee1e36e3365893 Mon Sep 17 00:00:00 2001
From: Zdenek Dohnal <zdohnal@redhat.com>
Date: Thu, 5 May 2022 15:58:30 +0200
Subject: [PATCH] configure.ac: Don't hardcode a path into .service file
---
configure | 3 ++-
configure.ac | 5 ++++-
lprint.service => lprint.service.in | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
rename lprint.service => lprint.service.in (71%)
diff --git a/configure b/configure
index a8d6f8f..b346b71 100755
--- a/configure
+++ b/configure
@@ -4112,7 +4112,7 @@ then :
fi
-ac_config_files="$ac_config_files Makefile"
+ac_config_files="$ac_config_files Makefile lprint.service"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -4801,6 +4801,7 @@ do
case $ac_config_target in
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "lprint.service") CONFIG_FILES="$CONFIG_FILES lprint.service" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
diff --git a/configure.ac b/configure.ac
index 5301080..55691bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -232,5 +232,8 @@ AC_ARG_WITH(ldflags, AS_HELP_STRING([--with-ldflags=...], [Specify additional LD
])
dnl Generate the Makefile...
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([
+ Makefile
+ lprint.service
+])
AC_OUTPUT
diff --git a/lprint.service b/lprint.service.in
similarity index 71%
rename from lprint.service
rename to lprint.service.in
index 596865a..301d825 100644
--- a/lprint.service
+++ b/lprint.service.in
@@ -7,7 +7,7 @@ Requires=avahi-daemon.socket
WantedBy=multi-user.target
[Service]
-ExecStart=/usr/local/bin/lprint server -o log-file=- -o log-level=debug
+ExecStart=@bindir@/lprint server -o log-file=- -o log-level=debug
Type=simple
Restart=on-failure
--
2.35.1

View File

@ -3,7 +3,7 @@
Name: lprint
Version: 1.1.0
Release: 2%{?dist}
Release: 3%{?dist}
Summary: A Label Printer Application
License: ASL 2.0
@ -16,6 +16,9 @@ Source0: https://github.com/michaelrsweet/%{name}/releases/download/v%{version}/
# - /etc is for admin overrides, distro defaults must be in /usr/lib
# https://github.com/michaelrsweet/lprint/pull/50
Patch01: 0001-configure-Add-with-systemd-option.patch
# the path to the command was hardcoded
# https://github.com/michaelrsweet/lprint/pull/63
Patch02: 0001-configure.ac-Don-t-hardcode-a-path-into-.service-fil.patch
# dns-sd support for register/sharing devices
@ -101,6 +104,9 @@ export CC=%{__cc}
%changelog
* Fri May 06 2022 Zdenek Dohnal <zdohnal@redhat.com> - 1.1.0-3
- path to lprint was hardcoded in service file
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild