-
Notifications
You must be signed in to change notification settings - Fork 137
/
Makefile.am
88 lines (62 loc) · 2.72 KB
/
Makefile.am
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Author: Tobi Oetiker <[email protected]>
# License: Public Domain
AUTOMAKE_OPTIONS = foreign
SUFFIXES = .1 .man .pm
SUBDIRS = lib thirdparty debian
BIN = bin/@PACKAGE@ bin/znapzendzetup bin/znapzendztatz
PM = @PERL_MODULES_EXTRA_DIST@
MAN = man/znapzend.1 man/znapzendzetup.1 man/znapzendztatz.1
POD = doc/znapzend.pod doc/znapzendzetup.pod doc/znapzendztatz.pod
RM_F = $(RM) -f
GENERATED_EXTRADIST = $(MAN)
EXTRA_DIST = VERSION COPYRIGHT README.md LICENSE CHANGES AUTHORS cpanfile.common cpanfile.test $(BIN) $(PM) \
$(GENERATED_EXTRADIST) init/README.md init/org.znapzend.plist.in init/znapzend.default \
init/znapzend.service.in init/znapzend.sysv.in init/znapzend.upstart.in init/znapzend.xml.in \
t/autoscrub.t t/ssh t/znapzend.t t/znapzendztatz.t t/mbuffer \
t/zfs t/znapzendzetup.t t/zpool \
debian/znapzend.links.in
YEAR = @CONFIG_YEAR@
DATE = @CONFIG_DATE@
if ENABLE_SVCINSTALL
svcdir = @SVCINSTALLDIR@
svc_DATA = init/znapzend.xml
endif
datadir = $(prefix)
README.md COPYRIGHT: VERSION
$(AM_V_GEN)$(PERL) -i -p -e 's/\d{4}-\d{2}-\d{2}/$(DATE)/g;s/[0-4]\.\d+\.\d+/$(PACKAGE_VERSION)/g' $@
README: README.md
cp README.md README
imandir = $(mandir)/man1
iman_DATA = $(MAN)
doc/%.pod: bin/% VERSION
$(AM_V_GEN)mkdir -p doc;grep -A100000 '=head1 NAME' $< > $@
man/%.1: bin/% VERSION
$(AM_V_GEN)mkdir -p man; test $(POD2MAN) = "no" || $(POD2MAN) --release=$(VERSION) --center=$(PACKAGE_NAME) $< > $@
dist_bin_SCRIPTS = $(BIN)
# Regenerate MAN pages and perl POD files from original script sources
docs: $(POD) $(MAN)
dist-hook: docs
$(PERL) -i -p -e 's/^my .*#\s*VERSION/my \$$VERSION = q{$(PACKAGE_VERSION)}; # VERSION/' $(distdir)/$(BIN)
install-exec-hook:
[ "$(PERL5LIB)" = "" ] || cd "$(DESTDIR)$(exec_prefix)" && $(PERL) -i -p -e 's{.*# PERL5LIB}{use lib qw($(PERL5LIB)); # PERL5LIB}' $(BIN) || true
cd "$(DESTDIR)$(exec_prefix)" && $(PERL) -i -p -e 's{^use .*# LIBDIR}{use lib qw($(libdir)); # LIBDIR}' $(BIN)
cd "$(DESTDIR)$(exec_prefix)" && $(PERL) -i -p -e 's{^#!.*perl.*}{#!$(PERL)};' $(BIN)
cpanfile: cpanfile.common
cp "$?" "$@"
test-deps:
+cd thirdparty && $(MAKE) $(AM_MAKEFLAGS) test-deps
if !DEB_BUILD
check: test-deps
@echo "NOTE: You may want to also/instead run test.sh" >&2
$(PERL) -Ithirdparty/lib/perl5 "-MExtUtils::Command::MM" "-e" "test_harness(1, 'lib','thirdparty/lib/perl5')" $(srcdir)/t/*.t
endif
# Clean up files that may be generated by the likes of
# `DEBUG_ZNAPZEND_SELFTEST_REWRITE=yes ./t/znapzend.t`
clean-selftest-rewritten:
$(RM_F) */*.selftest-rewritten */*/*.selftest-rewritten
clean-pidfiles:
if test -n "`ls znapzend*.pid 2>/dev/null || true`" ; then \
kill -15 `cat znapzend*.pid` || true ; \
$(RM) znapzend*.pid ; \
fi
clean-local: clean-selftest-rewritten clean-pidfiles