]> arthur.barton.de Git - netatalk.git/blobdiff - distrib/initscripts/Makefile.am
NEW: configure option "--with-init-style=debian-systemd" for Debian 8 jessieand later
[netatalk.git] / distrib / initscripts / Makefile.am
index 4b88ba9d39f6ac37bc4195ff89f0b9459fcb951a..bcf1779c1a3fc95bc3c5400d1868d2bb9238cb80 100644 (file)
@@ -13,6 +13,7 @@ pkgconfdir = @PKGCONFDIR@
            -e s@:SBINDIR:@${sbindir}@ \
            -e s@:ETCDIR:@${pkgconfdir}@ \
            -e s@:NETATALK_VERSION:@${NETATALK_VERSION}@ \
+           -e s@:PATH_NETATALK_LOCK:@${PATH_NETATALK_LOCK}@ \
            <$< >$@
 
 GENERATED_FILES = \
@@ -39,6 +40,7 @@ TEMPLATES = \
 
 CLEANFILES = $(GENERATED_FILES) $(sysv_SCRIPTS) $(service_DATA) afpd cnid_metad
 EXTRA_DIST = $(TEMPLATES)
+noinst_DATA = $(GENERATED_FILES)
 
 # overwrite automake uninstall
 # not beautiful, but this way we can call the OS specific init script
@@ -52,7 +54,7 @@ uninstall: uninstall-startup
 
 if USE_REDHAT_SYSV
 
-sysvdir        = /etc/rc.d/init.d
+sysvdir        = $(INIT_DIR)
 sysv_SCRIPTS = netatalk
 
 $(sysv_SCRIPTS): rc.redhat
@@ -74,7 +76,29 @@ endif
 
 if USE_SYSTEMD
 
-servicedir     = /lib/systemd/system
+servicedir     = $(INIT_DIR)
+service_DATA   = netatalk.service
+
+netatalk.service: service.systemd
+       cp -f service.systemd netatalk.service
+
+install-data-hook:
+       -systemctl daemon-reload
+
+uninstall-startup:
+       -systemctl disable $(service_DATA)
+       rm -f $(DESTDIR)$(servicedir)/netatalk.service
+       -systemctl daemon-reload
+
+endif
+
+#
+# checking for "Debian" style systemd scripts:
+#
+
+if USE_DEBIAN_SYSTEMD
+
+servicedir     = $(INIT_DIR)
 service_DATA   = netatalk.service
 
 netatalk.service: service.systemd
@@ -96,7 +120,7 @@ endif
 
 if USE_SUSE_SYSV
 
-sysvdir        = /etc/init.d
+sysvdir        = $(INIT_DIR)
 sysv_SCRIPTS = netatalk
 
 $(sysv_SCRIPTS): rc.suse
@@ -118,7 +142,7 @@ endif
 
 if USE_NETBSD
 
-sysvdir = /etc/rc.d
+sysvdir = $(INIT_DIR)
 sysv_SCRIPTS = netatalk
 
 netatalk: rc.netbsd
@@ -139,7 +163,7 @@ endif
 
 if USE_SOLARIS
 
-servicedir = /lib/svc/manifest/network/
+servicedir = $(INIT_DIR)
 service_DATA = netatalk.xml
 
 install-data-hook:
@@ -156,7 +180,7 @@ endif
 
 if USE_GENTOO
 
-sysvdir = /etc/init.d
+sysvdir = $(INIT_DIR)
 sysv_SCRIPTS = netatalk
 
 $(sysv_SCRIPTS): rc.gentoo
@@ -176,9 +200,9 @@ endif
 # checking for "Debian" style sysv scripts:
 #
 
-if USE_DEBIAN
+if USE_DEBIAN_SYSV
 
-sysvdir = /etc/init.d
+sysvdir = $(INIT_DIR)
 sysv_SCRIPTS = netatalk
 
 $(sysv_SCRIPTS): rc.debian