]> 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 0987865f8861586b2d58d7986ef16bc21c6ab50e..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 = \
@@ -23,7 +24,8 @@ GENERATED_FILES = \
        rc.redhat \
        rc.solaris \
        rc.suse \
-       service.systemd
+       service.systemd \
+       netatalk.xml
 
 TEMPLATES = \
        rc.bsd.tmpl \
@@ -33,10 +35,12 @@ TEMPLATES = \
        rc.redhat.tmpl \
        rc.solaris.tmpl \
        rc.suse.tmpl \
-       service.systemd.tmpl
+       service.systemd.tmpl \
+       netatalk.xml.tmpl
 
 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
@@ -50,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
@@ -72,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
@@ -94,7 +120,7 @@ endif
 
 if USE_SUSE_SYSV
 
-sysvdir        = /etc/init.d
+sysvdir        = $(INIT_DIR)
 sysv_SCRIPTS = netatalk
 
 $(sysv_SCRIPTS): rc.suse
@@ -116,7 +142,7 @@ endif
 
 if USE_NETBSD
 
-sysvdir = /etc/rc.d
+sysvdir = $(INIT_DIR)
 sysv_SCRIPTS = netatalk
 
 netatalk: rc.netbsd
@@ -137,23 +163,14 @@ endif
 
 if USE_SOLARIS
 
-sysvdir = /etc/init.d
-sysv_SCRIPTS = netatalk
-
-$(sysv_SCRIPTS): rc.solaris
-       cp -f rc.solaris $@
-       chmod a+x $@
+servicedir = $(INIT_DIR)
+service_DATA = netatalk.xml
 
 install-data-hook:
-       rm -f $(DESTDIR)/etc/rc2.d/S90$(sysv_SCRIPTS)
-       -ln -s ../init.d/$(sysv_SCRIPTS) $(DESTDIR)/etc/rc2.d/S90$(sysv_SCRIPTS)
-       rm -f $(DESTDIR)/etc/rc0.d/K04$(sysv_SCRIPTS)
-       -ln -s ../init.d/$(sysv_SCRIPTS) $(DESTDIR)/etc/rc0.d/K04$(sysv_SCRIPTS)
+       svccfg import netatalk.xml
 
 uninstall-startup:
-       rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) \
-               $(DESTDIR)/etc/rc2.d/S90$(sysv_SCRIPTS) \
-               $(DESTDIR)/etc/rc0.d/K04$(sysv_SCRIPTS)
+       svccfg delete network/netatalk
 
 endif
 
@@ -163,7 +180,7 @@ endif
 
 if USE_GENTOO
 
-sysvdir = /etc/init.d
+sysvdir = $(INIT_DIR)
 sysv_SCRIPTS = netatalk
 
 $(sysv_SCRIPTS): rc.gentoo
@@ -183,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