From 632064d227ed0f2e79b92ce97ac2b98cf2dbff5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Fri, 2 Aug 2013 02:49:29 +0200 Subject: [PATCH] Use autoconf sbindir in systemd units --- Makefile.in | 9 ++++++++- configure.ac | 1 + systemd/{fcgiwrap@.service => fcgiwrap@.service.in} | 2 +- systemd/{fcgiwrap@.socket => fcgiwrap@.socket.in} | 0 4 files changed, 10 insertions(+), 2 deletions(-) rename systemd/{fcgiwrap@.service => fcgiwrap@.service.in} (64%) rename systemd/{fcgiwrap@.socket => fcgiwrap@.socket.in} (100%) diff --git a/Makefile.in b/Makefile.in index ba7d65c..1cdc5b8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -4,7 +4,7 @@ datarootdir = .PHONY: clean distclean -all: fcgiwrap +all: fcgiwrap systemd/fcgiwrap@.socket systemd/fcgiwrap@.service install: all install -d -m 755 $(targetdir) install -m 755 fcgiwrap $(targetdir) @@ -21,9 +21,16 @@ CFLAGS = @AM_CFLAGS@ fcgiwrap: fcgiwrap.c +systemd/fcgiwrap@.socket: systemd/fcgiwrap@.socket.in + $(SED) -e 's,[@]sbindir[@],@sbindir@,g' < $< > $@ + +systemd/fcgiwrap@.service: systemd/fcgiwrap@.service.in + $(SED) -e 's,[@]sbindir[@],@sbindir@,g' < $< > $@ + #>+ 21 clean: -rm -f fcgiwrap + -rm -f systemd/fcgiwrap@.socket systemd/fcgiwrap@.service #>+ 21 distclean: clean diff --git a/configure.ac b/configure.ac index bb3674e..cd347be 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,7 @@ AC_SUBST([AM_CFLAGS]) # Checks for programs. AC_PROG_CC PKG_PROG_PKG_CONFIG +AC_PROG_SED # Create the config.h. AC_CONFIG_HEADERS([config.h]) diff --git a/systemd/fcgiwrap@.service b/systemd/fcgiwrap@.service.in similarity index 64% rename from systemd/fcgiwrap@.service rename to systemd/fcgiwrap@.service.in index 9993f65..cb2bab0 100644 --- a/systemd/fcgiwrap@.service +++ b/systemd/fcgiwrap@.service.in @@ -3,5 +3,5 @@ Description=Simple CGI Server for user %I After=nss-user-lookup.target [Service] -ExecStart=/usr/sbin/fcgiwrap -s /run/fcgiwrap-%I.sock +ExecStart=@sbindir@/fcgiwrap -s /run/fcgiwrap-%I.sock User=%I diff --git a/systemd/fcgiwrap@.socket b/systemd/fcgiwrap@.socket.in similarity index 100% rename from systemd/fcgiwrap@.socket rename to systemd/fcgiwrap@.socket.in