aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
blob: 5834e0778dc76756af385554e82133fd396e48fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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