-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
159 lines (142 loc) · 3.36 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
HASHES = $(wildcard *.hash)
DESTDIR =
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
SBINDIR = $(PREFIX)/sbin
SYSCONFDIR = /etc
SYSSBINDIR = /sbin
BINS = \
apt-find-foreign \
argecho \
bson2json \
censored-for-email \
cert-expiry-check \
cert-expiry-finder \
ctre \
dbschemadiff \
difftac \
easycert \
efibootmirrorsetup \
etccleaner \
filespeed \
gelf-payload-decode \
gitbackhub \
git-failed-msg \
git-hook-postcommit-coloremail \
git-reapply-patch \
gitlab-hook-postcommit-coloremail \
hostsort \
ifupdown2netplan \
ikvmocr \
indirect-scp \
interfaces2netplan \
ip2net \
ipmikvm \
ipmiscrape \
keystone-swift-curl \
kubectl-sh-bash \
kubectl-sh-secret \
kubectl-sh-wrapper \
linux-kernel-autoremove \
lldpscan \
llssh \
logcolor \
make-master-secret-log \
mysql2csv \
mysqldumpdissect \
mysqlparseslow \
mysql-slave-skip-one-table \
mysql-slave-sync-table \
nbdig \
pdns-sql-slave-prune \
pgpg \
psdiff \
pve-macaddr-security \
sadfscheck \
sermon \
sh-c \
snap-autoremove \
sys-is-vm \
tls-sniff-ciphers \
udiff \
uwsgi-list \
uwsgi-log \
uwsgi-kill \
venvpatch \
wcheckrestart \
wdiffcount \
wgrep \
wtimedecode \
wtimediff \
wtimestamp \
wtrunc \
wvpn \
xdg-recent \
zabdig \
SBINS = \
arpfix \
fwdiff \
fwsniff \
multilb-sanity-check \
whatsmyboot \
SYSSBINS = \
mount.zfs-non-legacy \
OTHER = \
.gitignore \
Makefile \
README.rst \
gitlab-hook-postcommit-coloremail.example \
ikvmocr.js \
ikvmocr-1.png \
ikvmocr-2.png \
psdiff.hash \
psdiff.rst \
tcpdump247.default \
udiff.selftest \
OTHERX = \
tcpdump247 \
.PHONY: all clean deb hashes make_has_all_files all_bins_are_executable
.PHONY: all_other_has_no_x
all: hashes make_has_all_files all_bins_are_executable all_other_has_no_x
clean:
$(MAKE) -f udiff.selftest clean
test:
RUNTESTS=1 ./fwsniff && printf '\342\234\205\n\n'
RUNTESTS=1 ./ip2net && printf '\342\234\205\n\n'
RUNTESTS=1 ./llssh && printf '\342\234\205\n\n'
RUNTESTS=1 ./mysqldumpdissect && printf '\342\234\205\n\n'
$(MAKE) -f udiff.selftest && $(MAKE) -f udiff.selftest clean && \
printf '\342\234\205\n\n'
deb:
# Make sure a valid email with PGP key is in the changelog
dpkg-buildpackage -sa
install:
install -d $(DESTDIR)$(BINDIR)
install $(BINS) $(DESTDIR)$(BINDIR)
install -d $(DESTDIR)$(SBINDIR)
install $(SBINS) $(DESTDIR)$(SBINDIR)
install -d $(DESTDIR)$(SYSSBINDIR)
install $(SYSSBINS) $(DESTDIR)$(SYSSBINDIR)
#install -D -T tcpdump247 $(DESTDIR)$(SYSCONFDIR)/init.d/tcpdump247
#install -m0600 -D -T \
# tcpdump247.default $(DESTDIR)$(SYSCONFDIR)/default/tcpdump247
# salt.states.file.managed likes to have hashes to download, to check
# whether it has the newest version. See:
# https://docs.saltstack.com/en/latest/ref/states/all/
# salt.states.file.html#salt.states.file.managed
hashes: $(HASHES)
make_has_all_files:
@bash -c "diff -pu <(git ls-files | grep -vF / | sort -V) \
<(echo $(BINS) $(SBINS) $(SYSSBINS) $(OTHER) $(OTHERX) | \
tr ' ' '\n' | sort -V)"
all_bins_are_executable:
@ok=true; for bin in $(BINS) $(SBINS) $(SYSSBINDIR) $(OTHERX); do \
if ! test -x $$bin; then echo "$$bin: missing -x perms" >&2; \
ok=false; fi; done; $$ok
all_other_has_no_x:
@ok=true; for nox in $(OTHER); do \
if ! test -f $$nox || test -x $$nox; then \
echo "$$nox: unexpected perms/availability" >&2; \
ok=false; fi; done; $$ok
%.hash: % Makefile
sha256sum $< > $@