From 98034286ac83388dcd290fd3caba499188ac1331 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 6 May 2015 15:53:12 +0900 Subject: [PATCH] Substitute bindir in nghttpx.service --- contrib/.gitignore | 1 + contrib/Makefile.am | 17 +++++++++++------ contrib/{nghttpx.service => nghttpx.service.in} | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) rename contrib/{nghttpx.service => nghttpx.service.in} (73%) diff --git a/contrib/.gitignore b/contrib/.gitignore index a08baf90..c2d09c33 100644 --- a/contrib/.gitignore +++ b/contrib/.gitignore @@ -1 +1,2 @@ nghttpx-init +nghttpx.service diff --git a/contrib/Makefile.am b/contrib/Makefile.am index 8f12126f..596dc431 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -21,19 +21,24 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -EXTRA_DIST = nghttpx-init.in nghttpx.service nghttpx-logrotate +configfiles = nghttpx-init nghttpx.service + +EXTRA_DIST = $(configfiles:%=%.in) nghttpx-logrotate edit = sed -e 's|@bindir[@]|$(bindir)|g' -nghttpx-init: Makefile +nghttpx-init: %: $(srcdir)/%.in rm -f $@ $@.tmp - $(edit) $(srcdir)/$@.in > $@.tmp + $(edit) $< > $@.tmp chmod +x $@.tmp mv $@.tmp $@ -nghttpx-init: $(srcdir)/nghttpx-init.in +nghttpx.service: %: $(srcdir)/%.in + $(edit) $< > $@ -all-local: nghttpx-init +$(configfiles): Makefile + +all-local: $(configfiles) clean-local: - -rm -f nghttpx-init nghttpx-init.tmp + -rm -f nghttpx-init.tmp $(configfiles) diff --git a/contrib/nghttpx.service b/contrib/nghttpx.service.in similarity index 73% rename from contrib/nghttpx.service rename to contrib/nghttpx.service.in index 71367be4..9c7f851e 100644 --- a/contrib/nghttpx.service +++ b/contrib/nghttpx.service.in @@ -4,7 +4,7 @@ After=network.target [Service] Type=simple -ExecStart=/usr/bin/nghttpx --errorlog-syslog +ExecStart=@bindir@/nghttpx --errorlog-syslog [Install] WantedBy=multi-user.target