xref: /freebsd/sbin/resolvconf/Makefile (revision cdebaff820b2a4915a16cedfd511823d78aab171)
1# $FreeBSD$
2
3PACKAGE=runtime
4DIST=		${.CURDIR}/../../contrib/openresolv
5.PATH:		${DIST}
6
7SCRIPTS=	resolvconf
8
9FILES=		libc dnsmasq named pdnsd pdns_recursor unbound
10FILESDIR=	/libexec/resolvconf
11
12MAN=		resolvconf.conf.5 resolvconf.8
13
14CLEANFILES=	${SCRIPTS} ${FILES} ${MAN}
15
16SYSCONFDIR=	/etc
17RCDIR=		${SYSCONFDIR}/rc.d
18VARDIR=		/var/run/resolvconf
19SBINDIR=	/sbin
20
21# We don't assume to restart the services in /sbin.  So, though
22# our service(8) is in /usr/sbin, we can use it, here.
23CMD1_WITH_ARG=		\1 onestatus >/dev/null 2>\&1
24CMD2_WITH_ARG=		\1 restart
25RESTARTCMD_WITH_ARG=	/usr/sbin/service ${CMD1_WITH_ARG} \&\& /usr/sbin/service ${CMD2_WITH_ARG}
26CMD1=		\\$$1 onestatus >/dev/null 2>\&1
27CMD2=		\\$$1 restart
28RESTARTCMD=	"/usr/sbin/service ${CMD1} \&\& /usr/sbin/service ${CMD2}"
29
30.for f in ${SCRIPTS} ${FILES} ${MAN}
31${f}:	${f}.in
32	sed	-e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \
33		-e 's:@LIBEXECDIR@:${FILESDIR}:g' \
34		-e 's:@VARDIR@:${VARDIR}:g' \
35		-e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD_WITH_ARG}:g' \
36		-e 's:@RESTARTCMD@:${RESTARTCMD}:g' \
37		-e 's:@RCDIR@:${RCDIR}:g' \
38		-e 's:@SBINDIR@:${SBINDIR}:g' \
39		-e 's: vpn : ng[0-9]*&:g' \
40		${DIST}/$@.in > $@
41.endfor
42
43.include <bsd.prog.mk>
44