]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | # Do "make screen" first, if you want to protect already installed, |
2 | # more up-to-date manual pages than the ones included in this package. | |
3 | # Do "make install" to copy the pages to their destination. | |
4 | # Do "make gz" or "make bz2" first if you use compressed source pages. | |
5 | ||
8636e34a | 6 | DESTDIR= |
c7b4971b MK |
7 | prefix?=/usr |
8 | MANDIR=$(prefix)/share/man | |
fea681da MK |
9 | |
10 | GZIP=gzip -9 | |
11 | BZIP2=bzip2 -9 | |
12 | ||
13 | all: screen remove install | |
14 | ||
15 | allgz: gz all | |
16 | ||
17 | allbz: bz2 all | |
18 | ||
19 | screen: | |
6f92d1d7 | 20 | mkdir -p not_installed |
fea681da MK |
21 | for i in man?/*; do \ |
22 | if [ $(MANDIR)/"$$i" -nt "$$i" ]; then \ | |
23 | cmp -s $(MANDIR)/"$$i" "$$i" > /dev/null 2>&1; \ | |
24 | if [ "$$?" != 0 ]; then mv "$$i" not_installed; fi; \ | |
25 | fi; \ | |
26 | done | |
27 | ||
5ee63e78 | 28 | uninstall remove: |
980d08c0 | 29 | for i in man?/*; do \ |
fea681da MK |
30 | rm -f $(MANDIR)/"$$i" $(MANDIR)/"$$i".gz $(MANDIR)/"$$i".bz2; \ |
31 | done | |
32 | ||
33 | gz: | |
980d08c0 | 34 | for i in man?; do $(GZIP) "$$i"/*; done |
fea681da MK |
35 | |
36 | bz2: | |
980d08c0 | 37 | for i in man?; do $(BZIP2) "$$i"/*; done |
fea681da MK |
38 | |
39 | # Use with | |
40 | # make HTDIR=/some/dir HTOPTS=whatever html | |
41 | # The sed removes the lines "Content-type: text/html\n\n" | |
42 | html: | |
43 | @if [ x$(HTDIR) = x ]; then echo "You must set HTDIR."; else \ | |
44 | for i in man?; do \ | |
45 | [ -d $(HTDIR)/"$$i" ] || mkdir -p $(HTDIR)/"$$i"; \ | |
46 | find "$$i/" -type f | while read f; do \ | |
47 | (cd "$$i"; man2html $(HTOPTS) `basename $$f`) | \ | |
48 | sed -e '1,2d' > $(HTDIR)/"$$i"/`basename $$f`.html; \ | |
49 | done; \ | |
50 | done; fi | |
51 | ||
fea681da | 52 | install: |
980d08c0 | 53 | for i in man?; do \ |
8636e34a MK |
54 | install -d -m 755 $(DESTDIR)$(MANDIR)/"$$i" || exit $$?; \ |
55 | install -m 644 "$$i"/* $(DESTDIR)$(MANDIR)/"$$i" || exit $$?; \ | |
fea681da | 56 | done; \ |
fea681da | 57 | |
251da60b SP |
58 | # Check if groff reports warnings (may be words of sentances not displayed) |
59 | # from http://lintian.debian.org/tags/manpage-has-errors-from-man.html | |
60 | GROFF_LOG := $(shell mktemp /tmp/manpages-checksXXXX) | |
61 | check-groff-warnings: | |
62 | for i in man?/*.[1-9]; \ | |
63 | do \ | |
64 | if grep -q 'SH.*NAME' $$i; then \ | |
65 | LC_ALL=en_US.UTF-8 MANWIDTH=80 man --warnings -E UTF-8 -l $$i > /dev/null 2>$(GROFF_LOG); \ | |
66 | [ -s $(GROFF_LOG) ] && ( echo "$$i: " ; cat $(GROFF_LOG) ; echo "" ); \ | |
67 | rm $(GROFF_LOG) 2>/dev/null; \ | |
68 | fi \ | |
69 | done | |
70 | ||
fea681da MK |
71 | # someone might also want to look at /var/catman/cat2 or so ... |
72 | # a problem is that the location of cat pages varies a lot |