]> 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 76534607210df1fcc971189b6a7e5fba8fdcc731..bcf1779c1a3fc95bc3c5400d1868d2bb9238cb80 100644 (file)
@@ -12,82 +12,127 @@ pkgconfdir = @PKGCONFDIR@
        sed -e s@:BINDIR:@${bindir}@ \
            -e s@:SBINDIR:@${sbindir}@ \
            -e s@:ETCDIR:@${pkgconfdir}@ \
+           -e s@:NETATALK_VERSION:@${NETATALK_VERSION}@ \
+           -e s@:PATH_NETATALK_LOCK:@${PATH_NETATALK_LOCK}@ \
            <$< >$@
 
 GENERATED_FILES = \
-       rc.afpd.netbsd          \
-       rc.atalk.redhat         \
-       rc.atalk.tru64          \
-       rc.atalk.bsd            \
-       rc.atalkd.netbsd        \
-       rc.atalk.suse           \
-       rc.papd.netbsd          \
-       rc.timelord.netbsd
-TEMPLATES = $(foreach f,$(GENERATED_FILES),$(f).tmpl)
-
-CLEANFILES = $(GENERATED_FILES)
-EXTRA_DIST = $(TEMPLATES) rc.atalk.cobalt rc.atalk.sysv
-
-install-data-hook: $(GENERATED_FILES)
+       rc.bsd \
+       rc.debian \
+       rc.gentoo \
+       rc.netbsd \
+       rc.redhat \
+       rc.solaris \
+       rc.suse \
+       service.systemd \
+       netatalk.xml
+
+TEMPLATES = \
+       rc.bsd.tmpl \
+       rc.debian.tmpl \
+       rc.gentoo.tmpl \
+       rc.netbsd.tmpl \
+       rc.redhat.tmpl \
+       rc.solaris.tmpl \
+       rc.suse.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
+# tools, like chkconfig, insserv or rc-update
+
+uninstall: uninstall-startup
 
 #
 # checking for "redhat" style sysv scripts:
 #
 
-if USE_REDHAT
+if USE_REDHAT_SYSV
+
+sysvdir        = $(INIT_DIR)
+sysv_SCRIPTS = netatalk
+
+$(sysv_SCRIPTS): rc.redhat
+       cp -f rc.redhat $(sysv_SCRIPTS)
+       chmod a+x $(sysv_SCRIPTS)
 
-sysvdir        = /etc/rc.d/init.d
-sysv_SCRIPTS = atalk
+install-data-hook:
+       -chkconfig --add $(sysv_SCRIPTS)
 
-atalk: rc.atalk.redhat
-       cp -f rc.atalk.redhat atalk
-       chmod a+x atalk
+uninstall-startup:
+       -chkconfig --del $(sysv_SCRIPTS)
+       rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS)
 
 endif
 
 #
-# checking for "SuSE" style sysv scripts:
+# checking for general systemd scripts:
 #
 
-if USE_SUSE
+if USE_SYSTEMD
+
+servicedir     = $(INIT_DIR)
+service_DATA   = netatalk.service
 
-sysvdir        = /etc/rc.d
-sysv_SCRIPTS = atalk
+netatalk.service: service.systemd
+       cp -f service.systemd netatalk.service
 
-atalk: rc.atalk.suse
-       cp -f rc.atalk.suse atalk
-       chmod a+x atalk
+install-data-hook:
+       -systemctl daemon-reload
+
+uninstall-startup:
+       -systemctl disable $(service_DATA)
+       rm -f $(DESTDIR)$(servicedir)/netatalk.service
+       -systemctl daemon-reload
 
 endif
 
 #
-#
-# checking for "cobalt" style sysv scripts:
+# checking for "Debian" style systemd scripts:
 #
 
-if USE_COBALT
+if USE_DEBIAN_SYSTEMD
 
-sysvdir        = /etc/rc.d/init.d
-sysv_SCRIPTS = atalk
+servicedir     = $(INIT_DIR)
+service_DATA   = netatalk.service
 
-atalk: rc.atalk.cobalt
-       cp -f rc.atalk.cobalt atalk
-       chmod a+x atalk
+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 "tru64" style sysv scripts:
+# checking for "SuSE" style sysv scripts:
 #
 
-if USE_TRU64
+if USE_SUSE_SYSV
+
+sysvdir        = $(INIT_DIR)
+sysv_SCRIPTS = netatalk
 
-sysvdir        = /sbin/init.d
-sysv_SCRIPTS = atalk
+$(sysv_SCRIPTS): rc.suse
+       cp -f rc.suse $(sysv_SCRIPTS)
+       chmod a+x $(sysv_SCRIPTS)
 
-atalk: rc.atalk.tru64
-       cp -f rc.atalk.tru64 atalk
-       chmod a+x atalk
+install-data-hook:
+       -insserv $(sysv_SCRIPTS)
+
+uninstall-startup:
+       -insserv -d $(sysv_SCRIPTS)
+       rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS)
 
 endif
 
@@ -97,23 +142,94 @@ endif
 
 if USE_NETBSD
 
-sysvdir = /etc/rc.d
-sysv_SCRIPTS = afp atalk pap timelord
-
-afpd: rc.afpd.netbsd
-       cp -f $< $@
+sysvdir = $(INIT_DIR)
+sysv_SCRIPTS = netatalk
 
-atalkd: rc.atalkd.netbsd
+netatalk: rc.netbsd
        cp -f $< $@
        chmod a+x $@
 
-papd: rc.papd.netbsd
-       cp -f $< $@
-       chmod a+x $@
+install-data-hook:
 
-timelord: rc.timelord.netbsd
-       cp -f $< $@
-       chmod a+x $@
+uninstall-hook:
+
+uninstall-startup: uninstall-am
+
+endif
+
+#
+# checking for Solaris init scripts
+#
+
+if USE_SOLARIS
+
+servicedir = $(INIT_DIR)
+service_DATA = netatalk.xml
+
+install-data-hook:
+       svccfg import netatalk.xml
+
+uninstall-startup:
+       svccfg delete network/netatalk
+
+endif
+
+#
+# checking for "Gentoo" style sysv scripts:
+#
+
+if USE_GENTOO
+
+sysvdir = $(INIT_DIR)
+sysv_SCRIPTS = netatalk
+
+$(sysv_SCRIPTS): rc.gentoo
+       cp -f rc.gentoo $(sysv_SCRIPTS)
+       chmod a+x $(sysv_SCRIPTS)
+
+install-data-hook:
+#      -rc-update add $(sysv_SCRIPTS) default
+
+uninstall-startup:
+#      -rc-update del $(sysv_SCRIPTS) default
+#      rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS)
+
+endif
+
+#
+# checking for "Debian" style sysv scripts:
+#
+
+if USE_DEBIAN_SYSV
+
+sysvdir = $(INIT_DIR)
+sysv_SCRIPTS = netatalk
+
+$(sysv_SCRIPTS): rc.debian
+       cp -f rc.debian $(sysv_SCRIPTS)
+       chmod a+x $(sysv_SCRIPTS)
+
+install-data-hook:
+#      update-rc.d $(sysv_SCRIPTS) defaults 90 10
+
+uninstall-startup:
+#      rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS)
+#      update-rc.d netatalk remove
+
+endif
+
+
+#
+# defaults, no init scripts installed
+#
+
+if USE_UNDEF
+
+install-data-hook:
+
+uninstall-hook:
+
+uninstall-startup: uninstall-am
 
 endif