-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
70 lines (56 loc) · 2.6 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
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
PROVEFLAGS += -j$(NUMJOBS)
endif
build: cleanthedocs manpages
docs: html/index.html
html/index.html: mkdocs.yml Makefile docs/*.md
env LC_ALL=C.UTF-8 mkdocs build --clean
# Avoid any inclusion of either external or embedded JS code. Avoids
# privacy breaches (and lintian correctly warns about this).
cleanthedocs: docs
find html -name '*.html' | while read file; do \
egrep -v '<link [^>]*href=.https?://[^/"]*/[^>]*>|<(img|script)[^>]*src="(https?:)?//|<link rel="stylesheet" href="\.\.?/css/highlight\.css">' "$$file" | \
perl -E 'local $$/; my $$input=<>; $$input =~ s:<script[^>]*>[^<]*</script>\n*|<(form|input).*?>|</form>\n*::gsm; print $$input;' | \
sponge "$$file"; \
sed -e 's:href="./\([^"]*\)/">:href="./\1/index.html">:g' -i $$file; \
done
rm -rf html/js/ html/css/highlight.css
manpages: unburden-home-dir.1
%.1: docs/%.1.md
ronn --manual="Unburden Your Home Directory" -r --pipe $< > $@
index:
perl -nE 'if (/^ - "?(.+[^"])"?: (\S*?)\.md$$/) { say "* [$$1]($$2)"; }' < mkdocs.yml
pureperltest:
perl -c bin/unburden-home-dir
prove $(PROVEFLAGS) t/*.t
test: pureperltest checkbashisms
checkbashisms:
checkbashisms Xsession.d/* share/*.sh
determine-coverage:
cover -delete
prove --exec 'env -u TMPDIR -u XDG_RUNTIME_DIR PERL5OPT=-MDevel::Cover=-ignore_re,^t/ perl' t/*.t
prove --exec 'env TMPDIR=/foo XDG_RUNTIME_DIR=/bar PERL5OPT=-MDevel::Cover=-ignore_re,^t/ perl' t/*.t
cover: determine-coverage
cover -select bin/unburden-home-dir -report html_basic
coveralls: determine-coverage
cover -select bin/unburden-home-dir -report coveralls
codecov: determine-coverage
cover -select bin/unburden-home-dir -report codecov
codecovbash: determine-coverage
cover -select bin/unburden-home-dir -report codecovbash
install: unburden-home-dir.1
install -d $(DESTDIR)/etc/X11/Xsession.d/
install -d $(DESTDIR)/usr/bin/
install -d $(DESTDIR)/usr/share/man/man1/
install -d $(DESTDIR)/usr/share/unburden-home-dir/
install -m 755 bin/unburden-home-dir $(DESTDIR)/usr/bin/
install -m 644 share/common.sh $(DESTDIR)/usr/share/unburden-home-dir/
install -m 644 Xsession.d/95unburden-home-dir $(DESTDIR)/etc/X11/Xsession.d/
install -m 644 Xsession.d/25unburden-home-dir-xdg $(DESTDIR)/etc/X11/Xsession.d/
install -m 644 etc/unburden-home-dir etc/unburden-home-dir.list $(DESTDIR)/etc/
sed -e 's/^\([^#]\)/#\1/' -i $(DESTDIR)/etc/unburden-home-dir.list
gzip -9cn unburden-home-dir.1 > $(DESTDIR)/usr/share/man/man1/unburden-home-dir.1.gz
clean:
rm -rf html/
rm -f *.[0-9]