summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKylie McClain <kylie@somas.is>2020-09-24 18:25:35 -0400
committerKylie McClain <kylie@somas.is>2020-09-24 21:01:17 -0400
commit0d040c32c8947f002d2b2db6fd3b55098e79ba87 (patch)
tree1a96ec300f4d605883cc84db38f116e19fb71a49
parent405cf24ccebeb6d6d5c98a9bc506d70d4ee21964 (diff)
downloadcatsit-0d040c32c8947f002d2b2db6fd3b55098e79ba87.tar.gz
catsit-0d040c32c8947f002d2b2db6fd3b55098e79ba87.tar.xz
catsit-0d040c32c8947f002d2b2db6fd3b55098e79ba87.zip
Allow for changing the /sbin directory
Some Linux distributions merge /sbin and /bin.
-rw-r--r--Makefile17
-rwxr-xr-xconfigure1
2 files changed, 10 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 5bed65b..f5ce2a8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
PREFIX ?= /usr/local
+SBINDIR ?= ${PREFIX}/sbin
MANDIR ?= ${PREFIX}/man
RUNDIR ?= /var/run
ETCDIR ?= ${PREFIX}/etc
@@ -10,14 +11,14 @@ dev: tags all
-include config.mk
-BINS = catsit catsitd
-MAN8 = ${BINS:=.8}
+SBINS = catsit catsitd
+MAN8 = ${SBINS:=.8}
MAN5 = catsit.conf.5
OBJS += daemon.o
OBJS += service.o
-all: ${BINS}
+all: ${SBINS}
catsitd: ${OBJS}
${CC} ${LDFLAGS} ${OBJS} ${LDLIBS} -o $@
@@ -33,12 +34,12 @@ tags: *.c *.h
ctags -w *.c *.h
clean:
- rm -f ${BINS} ${OBJS} ${RC_SCRIPT} compat_sys_signame_linux.h tags
+ rm -f ${SBINS} ${OBJS} ${RC_SCRIPT} compat_sys_signame_linux.h tags
-install: ${BINS} ${MAN5} ${MAN8}
- install -d ${DESTDIR}${PREFIX}/sbin ${DESTDIR}${ETCDIR}/rc.d
+install: ${SBINS} ${MAN5} ${MAN8}
+ install -d ${DESTDIR}${SBINDIR} ${DESTDIR}${ETCDIR}/rc.d
install -d ${DESTDIR}${MANDIR}/man5 ${DESTDIR}${MANDIR}/man8
- install ${BINS} ${DESTDIR}${PREFIX}/sbin
+ install ${SBINS} ${DESTDIR}${SBINDIR}
install -m 644 ${MAN5} ${DESTDIR}${MANDIR}/man5
install -m 644 ${MAN8} ${DESTDIR}${MANDIR}/man8
@@ -46,7 +47,7 @@ install-rc: ${RC_SCRIPT}
install ${RC_SCRIPT} ${DESTDIR}${ETCDIR}/rc.d
uninstall:
- rm -f ${BINS:%=${DESTDIR}${PREFIX}/sbin/%}
+ rm -f ${SBINS:%=${DESTDIR}${SBINDIR/%}
rm -f ${MAN5:%=${DESTDIR}${MANDIR}/man5/%}
rm -f ${MAN8:%=${DESTDIR}${MANDIR}/man8/%}
diff --git a/configure b/configure
index 18e3b02..8923ba5 100755
--- a/configure
+++ b/configure
@@ -35,6 +35,7 @@ esac
for opt; do
case "${opt}" in
(--prefix=*) echo "PREFIX = ${opt#*=}" ;;
+ (--sbindir=*) echo "SBINDIR = ${opt#*=}" ;;
(--mandir=*) echo "MANDIR = ${opt#*=}" ;;
(--sysconfdir=*) echo "ETCDIR = ${opt#*=}" ;;
(*) echo "warning: unsupported option ${opt}" >&2 ;;