aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am35
1 files changed, 35 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 05d8c5b..5834e07 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,2 +1,37 @@
SUBDIRS = src
dist_doc_DATA = README.txt
+
+transform_name = @program_transform_name@
+hydrilla_new_name = `echo hydrilla | sed '$(transform_name)'`
+subst_perform = sed -e 's|[@]hydrilla[@]|'$(hydrilla_new_name)'|g' \
+ -e 's|[@]bindir[@]|$(bindir)|g' \
+ -e 's|[@]runstatedir[@]|$(runstatedir)|g' \
+ -e 's|[@]logdir[@]|$(localstatedir)/log|g'
+
+
+bin_SCRIPTS =
+CLEANFILES =
+EXTRA_DIST =
+
+# SysV init script
+CLEANFILES += daemon/sysv
+EXTRA_DIST += daemon/sysv.in
+
+$(srcdir)/daemon/sysv: $(srcdir)/daemon/sysv.in $(srcdir)/Makefile
+ $(subst_perform) < $< > $@
+
+sysv_script_dest_loc = $(DESTDIR)/etc/init.d
+sysv_script_dest_path = $(sysv_script_dest_loc)/$(hydrilla_new_name)
+
+install-sysv-script: $(srcdir)/daemon/sysv
+ $(MKDIR_P) $(sysv_script_dest_loc)
+ $(INSTALL_SCRIPT) $< $(sysv_script_dest_path)
+
+uninstall-sysv-script:
+ rm -f $(DESTDIR)/$(sysv_script_dest_path)
+
+# Inform Automake about our special (un)install rules
+install-exec-local: install-sysv-script
+uninstall-local: uninstall-sysv-script
+
+.PHONY: install-sysv-script uninstall-sysv-script