-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
124 lines (85 loc) · 2.9 KB
/
Makefile
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#
# Makefile for 'slaughter'.
#
# Steve
# --
#
#
# Only used to build distribution tarballs.
#
DIST_PREFIX = ${TMP}
VERSION = 2.5
BASE = slaughter
#
# Where we install the modules we provide, the binaries, and the config directory.
#
BIN_PREFIX = /sbin
ETC_PREFIX = /etc
#
# We install to /usr/share/perl5 if it exists. Otherwise to wherever
# the perl 'sitelib' value points.
#
# NOTE: We deliberately avoided using "ifeq" - it isn't portable.
#
LIB_PREFIX=`test -d /usr/share/perl5 && echo /usr/share/perl5 || perl -MConfig -e 'print $$Config{'sitelib'}'`
clean:
-find . -name '*~' -delete
-find . -name '*.bak' -delete
-find . -name '*.tdy' -delete
-find . -name '*.log' -delete
-rm -f ./debian/files ./debian/*.substvars
-if [ -d ./debian/slaughter2-client ] ; then rm -rf ./debian/slaughter2-client; fi
-if [ -d ./html ] ; then rm -rf ./html; fi
-rm ./slaughter.1 || true
tidy:
perltidy ./bin/slaughter $$(find . -name '*.pm' -print) || true
test-install:
@echo "We'll install into: $(LIB_PREFIX)"
install: clean
mkdir -p $(LIB_PREFIX) || true
cp lib/Slaughter.pm ${LIB_PREFIX}/
mkdir -p $(LIB_PREFIX)/Slaughter || true
cp lib/Slaughter/*.pm ${LIB_PREFIX}/Slaughter/
mkdir -p $(LIB_PREFIX)/Slaughter/API || true
cp lib/Slaughter/API/*.pm ${LIB_PREFIX}/Slaughter/API/
mkdir -p $(LIB_PREFIX)/Slaughter/Info || true
cp lib/Slaughter/Info/*.pm ${LIB_PREFIX}/Slaughter/Info/
mkdir -p $(LIB_PREFIX)/Slaughter/Transport || true
cp lib/Slaughter/Transport/*.pm ${LIB_PREFIX}/Slaughter/Transport/
mkdir -p $(LIB_PREFIX)/Slaughter/Packages || true
cp lib/Slaughter/Packages/*.pm ${LIB_PREFIX}/Slaughter/Packages/
mkdir -p $(BIN_PREFIX) || true
cp ./bin/slaughter $(BIN_PREFIX)/
mkdir -p $(ETC_PREFIX) || true
uninstall:
rm -f $(LIB_PREFIX)/Slaughter.pm
rm -rf $(LIB_PREFIX)/Slaughter/
rm -f $(BIN_PREFIX)/slaughter
rm -rf $(ETC_PREFIX)/slaughter
release: tidy clean pod
rm -rf $(DIST_PREFIX)/$(BASE)-$(VERSION)
rm -f $(DIST_PREFIX)/$(BASE)-$(VERSION).tar.gz
cp -R . $(DIST_PREFIX)/$(BASE)-$(VERSION)
rm -rf $(DIST_PREFIX)/$(BASE)-$(VERSION)/debian
rm -rf $(DIST_PREFIX)/$(BASE)-$(VERSION)/skx
rm -rf $(DIST_PREFIX)/$(BASE)-$(VERSION)/.hg*
perl -pi -e "s/__UNRELEASED__/$(VERSION)/g" $(DIST_PREFIX)/$(BASE)-$(VERSION)/bin/slaughter
cd $(DIST_PREFIX) && tar -cvf $(DIST_PREFIX)/$(BASE)-$(VERSION).tar $(BASE)-$(VERSION)/
gzip $(DIST_PREFIX)/$(BASE)-$(VERSION).tar
mv $(DIST_PREFIX)/$(BASE)-$(VERSION).tar.gz .
rm -rf $(DIST_PREFIX)/$(BASE)-$(VERSION)
gpg --armour --detach-sign $(BASE)-$(VERSION).tar.gz
echo $(VERSION) > .version
test:
prove --shuffle t/
#
# Anything below here is only useful if you're working with the remote
# mercurial repository - because the ./skx/ directory is not bundled with
# the tarball releases.
#
pod:
./skx/make-pod ./html
skx-test:
[ -d skx/ ] && for i in skx/test-*; do $$i ; done
skx-sync-examples:
[ -d skx/ ] && ./skx/sync-examples