From aa49c2f1f1f89bca0ca6c6ed5c93c49f6e5c95e5 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Thu, 2 Oct 2014 18:06:17 +0200 Subject: sysvinit: generate init file when needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From now, if ./configure --with-sysvinit is done, we install init script and do not install systemd files. Original patch written by Jozef MlĂ­ch (jmlich@redhat.com). * Makefile.am (initscriptsdir, nodist_initscripts_DATA): New variables. New postgresql.init target. * configure.ac: Add --with-sysvinit option. * postgresql.init.in: New sysvinit template. * .gitignore: Mention postgresql.init. * NEWS: Document. --- Makefile.am | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 8aeac27..9301d56 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,8 +9,13 @@ libexec_SCRIPTS = postgresql$(DISTSUFF)-ctl \ userunitsdir = /etc/systemd/system +if WANT_SYSVINIT +initscriptsdir = $(prefix)/etc/init.d +nodist_initscripts_DATA = postgresql$(DISTSUFF).init +else systemdunitsdir = $(prefix)/lib/systemd/system nodist_systemdunits_DATA = postgresql$(DISTSUFF).service postgresql$(DISTSUFF)@.service +endif nodist_doc_DATA = $(README_DIST_BASENAME) @@ -25,6 +30,9 @@ postgresql$(DISTSUFF)-setup: postgresql-setup.in $(c_s) postgresql$(DISTSUFF)-check-db-dir: postgresql-check-db-dir.in $(c_s) $(INSTANTIATE_SCRIPT) +postgresql$(DISTSUFF).init: postgresql.init.in $(c_s) + $(INSTANTIATE) + # In ideal world, postgresql@.service would be hardlink to postgresql.service. # That would require, however, the rhbz#1141824 resolved so we could install # system-default drop-in file. Make a "almost" duplicate files now. @@ -48,7 +56,8 @@ GENERATED_FILES = $(bin_SCRIPTS) \ $(libexec_SCRIPTS) \ $(nodist_doc_DATA) \ $(pkgsysconf_DATA) \ - $(nodist_systemdunits_DATA) + $(nodist_systemdunits_DATA) \ + $(nodist_initscripts_DATA) CLEANFILES = $(GENERATED_FILES) $(TEST_GEN_FILES_LIST) -- cgit