aboutsummaryrefslogtreecommitdiffstats
path: root/etc/init.d/Makefile.am
blob: 5f70fc658dfdfb98c63138076191ffbbe31d3f09 (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
38
39
40
41
42
43
44
initdir = $(DEFAULT_INIT_DIR)
init_SCRIPTS = zfs-import zfs-mount zfs-share zfs-zed

initcommondir = $(sysconfdir)/zfs
initcommon_SCRIPTS = zfs-functions

initconfdir = $(DEFAULT_INITCONF_DIR)
initconf_SCRIPTS = zfs

EXTRA_DIST = \
	$(top_srcdir)/etc/init.d/zfs-functions.in \
	$(top_srcdir)/etc/init.d/zfs-share.in \
	$(top_srcdir)/etc/init.d/zfs-import.in \
	$(top_srcdir)/etc/init.d/zfs-mount.in \
	$(top_srcdir)/etc/init.d/zfs-zed.in \
	$(top_srcdir)/etc/init.d/zfs.in

$(init_SCRIPTS) $(initconf_SCRIPTS) $(initcommon_SCRIPTS): $(EXTRA_DIST)
	-(if [ -e /etc/debian_version ]; then \
		NFS_SRV=nfs-kernel-server; \
	  else \
		NFS_SRV=nfs; \
	  fi; \
	  if [ -e /etc/gentoo-release ]; then \
		SHELL=/sbin/runscript; \
	  else \
		SHELL=/bin/sh; \
	  fi; \
	  $(SED) -e 's,@bindir\@,$(bindir),g' \
		 -e 's,@sbindir\@,$(sbindir),g' \
		 -e 's,@udevdir\@,$(udevdir),g' \
		 -e 's,@udevruledir\@,$(udevruledir),g' \
		 -e 's,@sysconfdir\@,$(sysconfdir),g' \
		 -e 's,@initconfdir\@,$(initconfdir),g' \
		 -e 's,@initdir\@,$(initdir),g' \
		 -e 's,@runstatedir\@,$(runstatedir),g' \
		 -e "s,@SHELL\@,$$SHELL,g" \
		 -e "s,@NFS_SRV\@,$$NFS_SRV,g" \
		 "$(top_srcdir)/etc/init.d/$@.in" >'$@'; \
	  [ '$@' = 'zfs-functions' -o '$@' = 'zfs' ] || \
		chmod +x '$@')

distclean-local::
	-$(RM) $(init_SCRIPTS) $(initcommon_SCRIPTS) $(initconf_SCRIPTS)