summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-01-20 00:14:48 (EST)
committer P. J. McDermott <pjm@nac.net>2012-01-20 00:20:02 (EST)
commitcf47c930398b3095b7487855b14a1ab7f924b82f (patch)
tree9d0c29cc4f6c7315d581bdfcf79bc6b2570ccdf0
parent9f273e592a8b8eb77ee03160bca204be9c0ef406 (diff)
Add MANDIR option and macro to build system.
-rw-r--r--Makefile.in5
-rwxr-xr-xconfigure14
2 files changed, 18 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index 298a7ae..0fa8b2f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -24,6 +24,7 @@ INSTALL = @install@
SRCDIR = @srcdir@
PREFIX = @prefix@
BINDIR = @bindir@
+MANDIR = @mandir@
.PHONY: all
all:
@@ -41,6 +42,8 @@ install: all
@$(INSTALL) -D "$(SRCDIR)/src/oh-installfiles" "$(DESTDIR)/$(BINDIR)/oh-installfiles"
@printf ' INSTALL src/oh-buildopk\n'
@$(INSTALL) -D "$(SRCDIR)/src/oh-buildopk" "$(DESTDIR)/$(BINDIR)/oh-buildopk"
+ @printf ' INSTALL man/opkbuild.1\n'
+ @$(INSTALL) -D "$(SRCDIR)/man/opkbuild.1" "$(DESTDIR)/$(MANDIR)/man1/opkbuild.1"
.PHONY: uninstall
uninstall:
@@ -52,3 +55,5 @@ uninstall:
@rm "$(DESTDIR)/$(BINDIR)/oh-installfiles"
@printf ' RM oh-buildopk\n'
@rm "$(DESTDIR)/$(BINDIR)/oh-buildopk"
+ @printf ' RM opkbuild.1\n'
+ @rm "$(DESTDIR)/$(MANDIR)/man1/opkbuild.1"
diff --git a/configure b/configure
index 49ae28c..b726c23 100755
--- a/configure
+++ b/configure
@@ -46,6 +46,8 @@ Installation directories:
default: /usr/local
--bindir=BINDIR install scripts in BINDIR
default: PREFIX/bin
+ --mandir=MANDIR install manual pages in MANDIR
+ default: PREFIX/share/man
EOF
}
@@ -96,6 +98,11 @@ while true; do
BINDIR="\${PREFIX}/${2}"
shift 2
;;
+ --mandir)
+ # Leave PREFIX unexpanded for now, in case it isn't set yet.
+ MANDIR="\${PREFIX}/${2}"
+ shift 2
+ ;;
--)
shift
break
@@ -120,8 +127,12 @@ fi
if [ -z "${BINDIR}" ]; then
BINDIR=${PREFIX}/bin
fi
+if [ -z "${MANDIR}" ]; then
+ MANDIR=${PREFIX}/man
+fi
# Expand PREFIX if it's there.
eval "BINDIR=${BINDIR}"
+eval "MANDIR=${MANDIR}"
find_dependency()
{
@@ -161,7 +172,8 @@ s&@shell@&${SHELL}&
s&@install@&${INSTALL} -c&
s&@srcdir@&${SRCDIR}&
s&@prefix@&${PREFIX}&
-s&@bindir@&${BINDIR}&"
+s&@bindir@&${BINDIR}&
+s&@mandir@&${MANDIR}&"
# Replace configuration variables in Makefile.in
sed "$sed_script" ${SRCDIR}/Makefile.in > Makefile