diff --git a/.gitignore b/.gitignore index 2f683ef..41c83a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ setuid/setuid +prun/*.1 diff --git a/Makefile b/Makefile index 9810ebc..e984744 100644 --- a/Makefile +++ b/Makefile @@ -64,13 +64,18 @@ INSTALL=install -v INSTALL_PROGRAM = $(INSTALL) INSTALL_DATA = $(INSTALL) -m 644 -all: - @echo 'Nothing to be done. Ready for "make install"' +manpages += prun/prun.1 prun/pman.1 prun/ptype.1 -install: +all: $(manpages) + +clean: + @rm -f $(manpages) + +install: all @prefix="$(prefix)" usr_prefix="$(usr_prefix)" usrlocal_prefix="$(usrlocal_prefix)" \ root_exec_prefix="$(root_exec_prefix)" root_bindir="$(root_bindir)" root_sbindir="$(root_sbindir)" \ usr_exec_prefix="$(usr_exec_prefix)" usr_bindir="$(usr_bindir)" usr_sbindir="$(usr_sbindir)" \ + usr_mandir="$(usr_mandir)" \ usrlocal_exec_prefix="$(usrlocal_exec_prefix)" usrlocal_bindir="$(usrlocal_bindir)" usrlocal_sbindir="$(usrlocal_sbindir)" \ sysconfdir="$(sysconfdir)" systemdunitdir="$(systemdunitdir)" \ udev_rulesdir="$(udev_rulesdir)" udev_helperdir="$(udev_helperdir)" \ @@ -79,6 +84,8 @@ install: DESTDIR="$(DESTDIR)" \ ./install.sh -.PHONY: all install - +.PHONY: all install clean +%.1: %.md + @if [ "$$UID" = 0 ]; then echo "Please build (\`make\`) as non-root before running \`make install\` as root" >&2;exit 1;fi + pandoc --standalone --to man $< -o $@ diff --git a/install.sh b/install.sh index 4668108..385614b 100755 --- a/install.sh +++ b/install.sh @@ -21,6 +21,7 @@ fi : ${usr_exec_prefix:=$usr_prefix} : ${usr_bindir:=$usr_exec_prefix/bin} : ${usr_sbindir:=$usr_exec_prefix/sbin} +: ${usr_mandir:=$usr_exec_prefix/man} : ${usrlocal_exec_prefix:=$usrlocal_prefix} : ${usrlocal_bindir:=$usrlocal_exec_prefix/bin} @@ -223,6 +224,9 @@ install_data mxshadow/mxshadow.conf "$DESTDIR$sysconfdir/m install_data mxshadow/mxshadow.service "$DESTDIR$systemdunitdir/mxshadow.service" install_data misc_etc_files/nsswitch.conf "$DESTDIR$sysconfdir/nsswitch.conf" install_exec vmcontrol/vmcontrol.pl "$DESTDIR$usr_bindir/vmcontrol.pl" +install_data prun/prun.1 "$DESTDIR$usr_mandir/man1/prun.1" +install_data prun/ptype.1 "$DESTDIR$usr_mandir/man1/ptype.1" +install_data prun/pman.1 "$DESTDIR$usr_mandir/man1/pman.1" postinstall exit