From 55fdc016a4a9f57ae7d756bc0a8834a8637d23d7 Mon Sep 17 00:00:00 2001 From: Bandie Date: Wed, 28 Mar 2018 04:51:23 +0200 Subject: [PATCH] =?UTF-8?q?Professional=20make=E2=84=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 5 +++-- man/Makefile | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 man/Makefile diff --git a/Makefile b/Makefile index e7b3616..78250bc 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ POSSIBLE_PAMDIRS = /lib/x86_64-linux-gnu/security /lib/security PAMDIR = $(shell make detect_pamdir) +MANDIR = /usr/share/man all: @which reboot >/dev/null @@ -19,7 +20,7 @@ detect_pamdir: @for d in $(POSSIBLE_PAMDIRS); do if [ ! -d $${d} ]; then continue; else printf "$${d}\n"; fi; done install_docs: - cd man && for f in `find . -name pam_panic.8 | sed 's/\/pam_panic.8//'`; do gzip -9 -c $${f}/pam_panic.8 > /usr/share/man/$${f}/pam_panic.8.gz; done + for f in `find . -name pam_panic.8 | sed 's/\/pam_panic.8//'`; do gzip -9 -c $${f}/pam_panic.8 > $(MANDIR)/$${f}/pam_panic.8.gz; done uninstall: PAMDIR=$(PAMDIR); rm $${PAMDIR}/pam_panic.so @@ -28,5 +29,5 @@ uninstall: install: PAMDIR=$(PAMDIR); if [ -z $${PAMDIR} ]; then printf "Error: PAM's shared object directory was not detected. If you know where it is, please add to POSSIBLE_PAMDIRS and make a pull request.\n"&& exit 1; else cp build/pam_panic.so $${PAMDIR}/pam_panic.so; fi - if [ ! -d /usr/share/man ]; then printf "Error: Where is the manpage directory?\n" && exit 1; else make install_docs; fi + if [ ! -d $(MANDIR) ]; then printf "Error: Where is the manpage directory?\n" && exit 1; else make install -C man -e "MANDIR = $(MANDIR)"; fi @printf "Done!\n" diff --git a/man/Makefile b/man/Makefile new file mode 100644 index 0000000..cbe8307 --- /dev/null +++ b/man/Makefile @@ -0,0 +1,2 @@ +install: + for f in `find . -name pam_panic.8 | sed 's/\/pam_panic.8//'`; do gzip -9 -c $${f}/pam_panic.8 > $(MANDIR)/$${f}/pam_panic.8.gz; done