4 # Nasty hack so that make clean works without configure being run
5 _CONFIG_MK!= test -e config.mk && echo config.mk || echo config-null.mk
6 CONFIG_MK?= ${_CONFIG_MK}
11 LIBEXECDIR?= /libexec/resolvconf
12 VARDIR?= /var/run/resolvconf
14 RESTARTCMD?= if ${RCDIR}/\1 status >/dev/null 2>\&1; then \
15 ${RCDIR}/\1 restart; \
25 RESOLVCONF= resolvconf resolvconf.8 resolvconf.conf.5
26 SUBSCRIBERS= libc dnsmasq named pdnsd unbound
27 TARGET= ${RESOLVCONF} ${SUBSCRIBERS}
28 SRCS= ${TARGET:C,$,.in,} # pmake
29 SRCS:= ${TARGET:=.in} # gmake
31 SED_SBINDIR= -e 's:@SBINDIR@:${SBINDIR}:g'
32 SED_SYSCONFDIR= -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g'
33 SED_LIBEXECDIR= -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g'
34 SED_VARDIR= -e 's:@VARDIR@:${VARDIR}:g'
35 SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g'
36 SED_RESTARTCMD= -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g'
38 DISTPREFIX?= ${PKG}-${VERSION}
39 DISTFILEGZ?= ${DISTPREFIX}.tar.gz
40 DISTFILE?= ${DISTPREFIX}.tar.xz
48 ${SED} ${SED_SBINDIR} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \
49 ${SED_VARDIR} ${SED_RCDIR} ${SED_RESTARTCMD} \
56 rm -f config.mk ${DISTFILE}
60 proginstall: ${TARGET}
61 ${INSTALL} -d ${DESTDIR}${SBINDIR}
62 ${INSTALL} -m ${BINMODE} resolvconf ${DESTDIR}${SBINDIR}
63 ${INSTALL} -d ${DESTDIR}${SYSCONFDIR}
64 test -e ${DESTDIR}${SYSCONFDIR}/resolvconf.conf || \
65 ${INSTALL} -m ${DOCMODE} resolvconf.conf ${DESTDIR}${SYSCONFDIR}
66 ${INSTALL} -d ${DESTDIR}${LIBEXECDIR}
67 ${INSTALL} -m ${DOCMODE} ${SUBSCRIBERS} ${DESTDIR}${LIBEXECDIR}
70 ${INSTALL} -d ${DESTDIR}${MANDIR}/man8
71 ${INSTALL} -m ${MANMODE} resolvconf.8 ${DESTDIR}${MANDIR}/man8
72 ${INSTALL} -d ${DESTDIR}${MANDIR}/man5
73 ${INSTALL} -m ${MANMODE} resolvconf.conf.5 ${DESTDIR}${MANDIR}/man5
75 install: proginstall maninstall
78 rm -rf /tmp/${DISTPREFIX}
79 ${INSTALL} -d /tmp/${DISTPREFIX}
80 cp README ${SRCS} /tmp/${DISTPREFIX}
83 fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ}
84 gunzip -c ${DISTFILEGZ} | xz >${DISTFILE}