xref: /freebsd/sys/contrib/openzfs/cmd/zed/zed.d/Makefile.am (revision 7be9a3b45356747f9fcb6d69a722c1c95f8060bf)
1include $(top_srcdir)/config/Rules.am
2include $(top_srcdir)/config/Substfiles.am
3include $(top_srcdir)/config/Shellcheck.am
4
5EXTRA_DIST += README
6
7zedconfdir = $(sysconfdir)/zfs/zed.d
8
9dist_zedconf_DATA = \
10	zed-functions.sh \
11	zed.rc
12
13SHELLCHECKSCRIPTS = zed-functions.sh zed.rc
14SHELLCHECK_OPTS = --enable=all
15SHELLCHECK_SHELL = dash
16
17zedexecdir = $(zfsexecdir)/zed.d
18
19dist_zedexec_SCRIPTS = \
20	all-debug.sh \
21	all-syslog.sh \
22	data-notify.sh \
23	generic-notify.sh \
24	resilver_finish-notify.sh \
25	scrub_finish-notify.sh \
26	statechange-led.sh \
27	statechange-notify.sh \
28	vdev_clear-led.sh \
29	vdev_attach-led.sh \
30	pool_import-led.sh \
31	resilver_finish-start-scrub.sh \
32	trim_finish-notify.sh
33
34nodist_zedexec_SCRIPTS = history_event-zfs-list-cacher.sh
35
36SUBSTFILES += $(nodist_zedexec_SCRIPTS)
37
38zedconfdefaults = \
39	all-syslog.sh \
40	data-notify.sh \
41	history_event-zfs-list-cacher.sh \
42	resilver_finish-notify.sh \
43	scrub_finish-notify.sh \
44	statechange-led.sh \
45	statechange-notify.sh \
46	vdev_clear-led.sh \
47	vdev_attach-led.sh \
48	pool_import-led.sh \
49	resilver_finish-start-scrub.sh
50
51install-data-hook:
52	$(MKDIR_P) "$(DESTDIR)$(zedconfdir)"
53	for f in $(zedconfdefaults); do \
54	  test -f "$(DESTDIR)$(zedconfdir)/$${f}" -o \
55	       -L "$(DESTDIR)$(zedconfdir)/$${f}" || \
56	    ln -s "$(zedexecdir)/$${f}" "$(DESTDIR)$(zedconfdir)"; \
57	done
58	chmod 0600 "$(DESTDIR)$(zedconfdir)/zed.rc"
59
60# False positive: 1>&"${ZED_FLOCK_FD}" looks suspiciously similar to a >&filename bash extension
61CHECKBASHISMS_IGNORE = -e 'should be >word 2>&1' -e '&"$${ZED_FLOCK_FD}"'
62