+if USE_REDHAT_SYSV
+
+sysvdir = /etc/rc.d/init.d
+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
+
+install-data-hook:
+ -systemctl daemon-reload
+
+uninstall-startup:
+ -systemctl disable $(service_DATA)
+ rm -f $(DESTDIR)$(servicedir)/netatalk.service
+ -systemctl daemon-reload
+
+endif
+
+#
+# checking for "SuSE" style sysv scripts:
+#
+
+if USE_SUSE_SYSV
+
+sysvdir = /etc/init.d
+sysv_SCRIPTS = netatalk
+
+$(sysv_SCRIPTS): rc.suse
+ cp -f rc.suse $(sysv_SCRIPTS)
+ chmod a+x $(sysv_SCRIPTS)
+
+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: