]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - Makefile
err.3: EXAMPLES: use EXIT_FAILURE rather than 1 as exit status
[thirdparty/man-pages.git] / Makefile
index 9efa7d2d54a504bd66b1eadf29ae79584c80bdab..49757c61b7c8fbbb2b81ae5d0bfa784ddbf07269 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,41 +1,14 @@
-# Do "make screen" first, if you want to protect already installed,
-# more up-to-date manual pages than the ones included in this package.
-# Do "make install" to copy the pages to their destination.
-# Do "make gz" or "make bz2" first if you use compressed source pages.
-
 DESTDIR=
 prefix?=/usr
 MANDIR=$(prefix)/share/man
 
-GZIP=gzip -9
-BZIP2=bzip2 -9
-
-all: screen remove install
-
-allgz: gz all
-
-allbz: bz2 all
-
-screen:
-       -mkdir not_installed
-       for i in man?/*; do \
-               if [ $(MANDIR)/"$$i" -nt "$$i" ]; then \
-                       cmp -s $(MANDIR)/"$$i" "$$i" > /dev/null 2>&1; \
-                       if [ "$$?" != 0 ]; then mv "$$i" not_installed; fi; \
-               fi; \
-       done
+all: remove install
 
 uninstall remove:
        for i in man?/*; do \
-               rm -f $(MANDIR)/"$$i" $(MANDIR)/"$$i".gz $(MANDIR)/"$$i".bz2; \
+               rm -f $(MANDIR)/"$$i" $(MANDIR)/"$$i".*; \
        done
 
-gz:
-       for i in man?; do $(GZIP) "$$i"/*; done
-
-bz2:
-       for i in man?; do $(BZIP2) "$$i"/*; done
-
 # Use with
 #  make HTDIR=/some/dir HTOPTS=whatever html
 # The sed removes the lines "Content-type: text/html\n\n"
@@ -53,7 +26,20 @@ install:
        for i in man?; do \
                install -d -m 755 $(DESTDIR)$(MANDIR)/"$$i" || exit $$?; \
                install -m 644 "$$i"/* $(DESTDIR)$(MANDIR)/"$$i" || exit $$?; \
+       done
+
+# Check if groff reports warnings (may be words of sentences not displayed)
+# from http://lintian.debian.org/tags/manpage-has-errors-from-man.html
+check-groff-warnings:
+       GROFF_LOG="$$(mktemp --tmpdir manpages-checksXXXX)" || exit $$?; \
+       for i in man?/*.[1-9]; \
+       do \
+               if grep -q 'SH.*NAME' "$$i"; then \
+                       LC_ALL=en_US.UTF-8 MANWIDTH=80 man --warnings -E UTF-8 -l "$$i" > /dev/null 2>| "$$GROFF_LOG"; \
+                       [ -s "$$GROFF_LOG" ] && { echo "$$i: "; cat "$$GROFF_LOG"; echo; }; \
+               fi; \
        done; \
+       rm -f "$$GROFF_LOG"
 
 # someone might also want to look at /var/catman/cat2 or so ...
 # a problem is that the location of cat pages varies a lot