diff src/Makefile @ 0:9f8d79c98fd2 0.4.0

initial public release
author Arkadiusz Juszczyk <ark@wobblyhead.net>
date 2026-10-26 11:29 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Makefile	Mon Oct 26 11:29:10 2026 +0100
@@ -0,0 +1,44 @@
+# vim:ts=8:
+PROG=	botblockd
+SRCS=	main.c config.c ip.c whitelist.c pf.c suspect.c logtail.c
+MAN=	${PROG}.8
+WARNS=	6
+
+# pidfile(3) lives in libutil
+LDADD=	-lutil
+
+# man page and packaging payload live outside src/
+.PATH:	${.CURDIR}/../man
+
+# Default to /usr/local-style layout; the port can override PREFIX if needed.
+PREFIX?=	/usr/local
+BINDIR=		${PREFIX}/sbin
+MANDIR=		${PREFIX}/share/man/man
+CFLAGS+=	-DPREFIX=\"${PREFIX}\"
+
+# release tarballs carry a one-line VERSION file at the top level
+BOTBLOCKD_VERSION!=	cat ${.CURDIR}/../VERSION 2>/dev/null || echo unknown
+CFLAGS+=	-DBOTBLOCKD_VERSION=\"${BOTBLOCKD_VERSION}\"
+
+# Where the extras go
+ETCDIR=		${PREFIX}/etc/botblockd
+RCDIR=		${PREFIX}/etc/rc.d
+EXAMPLESDIR=	${PREFIX}/share/examples/${PROG}
+CONFDIR=	${.CURDIR}/../conf
+CONF_FILES=	conf.sample whitelist.sample
+EXAMPLE_FILES=	pf.conf.sample
+
+afterinstall:
+	${INSTALL} -d ${DESTDIR}${ETCDIR}
+	${INSTALL} -d ${DESTDIR}${RCDIR}
+	${INSTALL} -d ${DESTDIR}${EXAMPLESDIR}
+.for f in ${CONF_FILES}
+	${INSTALL} -m 644 ${CONFDIR}/${f} ${DESTDIR}${ETCDIR}/${f}
+.endfor
+	${INSTALL} -m 555 ${CONFDIR}/rc.d/botblockd ${DESTDIR}${RCDIR}/botblockd
+	sed -i '' "s|%%PREFIX%%|${PREFIX}|g" ${DESTDIR}${RCDIR}/botblockd
+.for f in ${EXAMPLE_FILES}
+	${INSTALL} -m 644 ${CONFDIR}/${f} ${DESTDIR}${EXAMPLESDIR}/${f}
+.endfor
+
+.include <bsd.prog.mk>