Skip to content

Add build/install logic for prun manpages #202

Merged
merged 3 commits into from
Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
setuid/setuid
prun/*.1
17 changes: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)" \
Expand All @@ -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 $@
4 changes: 4 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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