X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=distrib%2Finitscripts%2FMakefile.am;h=2d1cb3ab566b63d8fc30e744faa794c1a6d5a210;hb=539bab5ea7c47c713759aac42cc0a0d9806ba73f;hp=2a46bf6ef795bbf8e9023a7010454e2f4ef5a5f1;hpb=b19bf8b3569ca2fc8199b55306482f71db14dd89;p=netatalk.git diff --git a/distrib/initscripts/Makefile.am b/distrib/initscripts/Makefile.am index 2a46bf6e..2d1cb3ab 100644 --- a/distrib/initscripts/Makefile.am +++ b/distrib/initscripts/Makefile.am @@ -12,32 +12,83 @@ 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.atalk.redhat \ - rc.atalk.tru64 \ - rc.atalk.bsd \ - rc.atalk.suse -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 = /etc/rc.d/init.d -sysv_SCRIPTS = atalk +sysv_SCRIPTS = netatalk + +$(sysv_SCRIPTS): rc.redhat + cp -f rc.redhat $(sysv_SCRIPTS) + chmod a+x $(sysv_SCRIPTS) + +install-data-hook: + -chkconfig --add $(sysv_SCRIPTS) + +uninstall-startup: + -chkconfig --del $(sysv_SCRIPTS) + rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) + +endif + +# +# checking for general systemd scripts: +# + +if USE_SYSTEMD + +servicedir = /lib/systemd/system +service_DATA = netatalk.service + +netatalk.service: service.systemd + cp -f service.systemd netatalk.service -atalk: rc.atalk.redhat - cp -f rc.atalk.redhat 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 @@ -45,44 +96,118 @@ endif # checking for "SuSE" style sysv scripts: # -if USE_SUSE +if USE_SUSE_SYSV + +sysvdir = /etc/init.d +sysv_SCRIPTS = netatalk -sysvdir = /etc/rc.d -sysv_SCRIPTS = atalk +$(sysv_SCRIPTS): rc.suse + cp -f rc.suse $(sysv_SCRIPTS) + chmod a+x $(sysv_SCRIPTS) -atalk: rc.atalk.suse - cp -f rc.atalk.suse atalk - chmod a+x atalk +install-data-hook: + -insserv $(sysv_SCRIPTS) + +uninstall-startup: + -insserv -d $(sysv_SCRIPTS) + rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) endif # +# checking for NetBSD init scripts +# + +if USE_NETBSD + +sysvdir = /etc/rc.d +sysv_SCRIPTS = netatalk + +netatalk: rc.netbsd + cp -f $< $@ + chmod a+x $@ + +install-data-hook: + +uninstall-hook: + +uninstall-startup: uninstall-am + +endif + # -# checking for "cobalt" style sysv scripts: +# checking for Solaris init scripts # -if USE_COBALT +if USE_SOLARIS -sysvdir = /etc/rc.d/init.d -sysv_SCRIPTS = atalk +servicedir = /lib/svc/manifest/network/ +service_DATA = netatalk.xml + +install-data-hook: + svccfg import netatalk.xml -atalk: rc.atalk.cobalt - cp -f rc.atalk.cobalt atalk - chmod a+x atalk +uninstall-startup: + svccfg delete network/netatalk endif # -# checking for "tru64" style sysv scripts: +# checking for "Gentoo" style sysv scripts: # -if USE_TRU64 +if USE_GENTOO + +sysvdir = /etc/init.d +sysv_SCRIPTS = netatalk + +$(sysv_SCRIPTS): rc.gentoo + cp -f rc.gentoo $(sysv_SCRIPTS) + chmod a+x $(sysv_SCRIPTS) -sysvdir = /sbin/init.d -sysv_SCRIPTS = atalk +install-data-hook: +# -rc-update add $(sysv_SCRIPTS) default -atalk: rc.atalk.tru64 - cp -f rc.atalk.tru64 atalk - chmod a+x atalk +uninstall-startup: +# -rc-update del $(sysv_SCRIPTS) default +# rm -f $(DESTDIR)$(sysvdir)/$(sysv_SCRIPTS) endif + +# +# checking for "Debian" style sysv scripts: +# + +if USE_DEBIAN + +sysvdir = /etc/init.d +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 +