2015-05-04 21:07:20 +00:00
|
|
|
PKG= openresolv
|
2011-03-18 12:09:27 +00:00
|
|
|
|
2015-05-04 21:07:20 +00:00
|
|
|
# Nasty hack so that make clean works without configure being run
|
|
|
|
_CONFIG_MK!= test -e config.mk && echo config.mk || echo config-null.mk
|
|
|
|
CONFIG_MK?= ${_CONFIG_MK}
|
|
|
|
include ${CONFIG_MK}
|
|
|
|
|
|
|
|
SBINDIR?= /sbin
|
|
|
|
SYSCONFDIR?= /etc
|
|
|
|
LIBEXECDIR?= /libexec/resolvconf
|
|
|
|
VARDIR?= /var/run/resolvconf
|
2011-03-18 12:09:27 +00:00
|
|
|
|
|
|
|
INSTALL?= install
|
|
|
|
SED?= sed
|
|
|
|
|
2016-07-20 03:52:04 +00:00
|
|
|
VERSION!= ${SED} -n 's/OPENRESOLV_VERSION="\(.*\)".*/\1/p' resolvconf.in
|
|
|
|
|
2011-03-18 12:09:27 +00:00
|
|
|
BINMODE?= 0755
|
|
|
|
DOCMODE?= 0644
|
|
|
|
MANMODE?= 0444
|
|
|
|
|
|
|
|
RESOLVCONF= resolvconf resolvconf.8 resolvconf.conf.5
|
|
|
|
SUBSCRIBERS= libc dnsmasq named pdnsd unbound
|
|
|
|
TARGET= ${RESOLVCONF} ${SUBSCRIBERS}
|
|
|
|
SRCS= ${TARGET:C,$,.in,} # pmake
|
|
|
|
SRCS:= ${TARGET:=.in} # gmake
|
|
|
|
|
2015-05-04 21:07:20 +00:00
|
|
|
SED_SBINDIR= -e 's:@SBINDIR@:${SBINDIR}:g'
|
2011-03-18 12:09:27 +00:00
|
|
|
SED_SYSCONFDIR= -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g'
|
|
|
|
SED_LIBEXECDIR= -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g'
|
|
|
|
SED_VARDIR= -e 's:@VARDIR@:${VARDIR}:g'
|
|
|
|
SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g'
|
2016-07-20 03:52:04 +00:00
|
|
|
SED_RESTARTCMD= -e 's:@RESTARTCMD@:${RESTARTCMD}:g'
|
|
|
|
SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g'
|
|
|
|
SED_STATUSARG= -e 's:@STATUSARG@:${STATUSARG}:g'
|
2011-03-18 12:09:27 +00:00
|
|
|
|
2015-05-04 21:07:20 +00:00
|
|
|
DISTPREFIX?= ${PKG}-${VERSION}
|
|
|
|
DISTFILEGZ?= ${DISTPREFIX}.tar.gz
|
2016-02-02 21:10:43 +00:00
|
|
|
DISTFILE?= ${DISTPREFIX}.tar.xz
|
2017-01-30 16:32:53 +00:00
|
|
|
DISTINFO= ${DISTFILE}.distinfo
|
|
|
|
DISTINFOSIGN= ${DISTINFO}.asc
|
|
|
|
CKSUM?= cksum -a SHA256
|
|
|
|
PGP?= netpgp
|
|
|
|
|
2015-05-04 21:07:20 +00:00
|
|
|
FOSSILID?= current
|
|
|
|
|
2011-03-18 12:09:27 +00:00
|
|
|
.SUFFIXES: .in
|
|
|
|
|
|
|
|
all: ${TARGET}
|
|
|
|
|
2016-07-20 03:52:04 +00:00
|
|
|
.in: Makefile ${CONFIG_MK}
|
2015-05-04 21:07:20 +00:00
|
|
|
${SED} ${SED_SBINDIR} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \
|
2016-07-20 03:52:04 +00:00
|
|
|
${SED_VARDIR} \
|
|
|
|
${SED_RCDIR} ${SED_RESTARTCMD} ${SED_RCDIR} ${SED_STATUSARG} \
|
2011-03-18 12:09:27 +00:00
|
|
|
$< > $@
|
|
|
|
|
|
|
|
clean:
|
2015-05-04 21:07:20 +00:00
|
|
|
rm -f ${TARGET}
|
2011-03-18 12:09:27 +00:00
|
|
|
|
|
|
|
distclean: clean
|
2017-01-30 16:32:53 +00:00
|
|
|
rm -f config.mk ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
|
2011-03-18 12:09:27 +00:00
|
|
|
|
|
|
|
installdirs:
|
|
|
|
|
2015-05-04 21:07:20 +00:00
|
|
|
proginstall: ${TARGET}
|
2011-03-18 12:09:27 +00:00
|
|
|
${INSTALL} -d ${DESTDIR}${SBINDIR}
|
|
|
|
${INSTALL} -m ${BINMODE} resolvconf ${DESTDIR}${SBINDIR}
|
|
|
|
${INSTALL} -d ${DESTDIR}${SYSCONFDIR}
|
|
|
|
test -e ${DESTDIR}${SYSCONFDIR}/resolvconf.conf || \
|
|
|
|
${INSTALL} -m ${DOCMODE} resolvconf.conf ${DESTDIR}${SYSCONFDIR}
|
|
|
|
${INSTALL} -d ${DESTDIR}${LIBEXECDIR}
|
|
|
|
${INSTALL} -m ${DOCMODE} ${SUBSCRIBERS} ${DESTDIR}${LIBEXECDIR}
|
2015-05-04 21:07:20 +00:00
|
|
|
|
|
|
|
maninstall:
|
2011-03-18 12:09:27 +00:00
|
|
|
${INSTALL} -d ${DESTDIR}${MANDIR}/man8
|
|
|
|
${INSTALL} -m ${MANMODE} resolvconf.8 ${DESTDIR}${MANDIR}/man8
|
|
|
|
${INSTALL} -d ${DESTDIR}${MANDIR}/man5
|
|
|
|
${INSTALL} -m ${MANMODE} resolvconf.conf.5 ${DESTDIR}${MANDIR}/man5
|
|
|
|
|
2015-05-04 21:07:20 +00:00
|
|
|
install: proginstall maninstall
|
|
|
|
|
2011-03-18 12:09:27 +00:00
|
|
|
import:
|
2015-05-04 21:07:20 +00:00
|
|
|
rm -rf /tmp/${DISTPREFIX}
|
|
|
|
${INSTALL} -d /tmp/${DISTPREFIX}
|
2016-02-02 21:10:43 +00:00
|
|
|
cp README ${SRCS} /tmp/${DISTPREFIX}
|
2015-05-04 21:07:20 +00:00
|
|
|
|
|
|
|
dist:
|
|
|
|
fossil tarball --name ${DISTPREFIX} ${FOSSILID} ${DISTFILEGZ}
|
2016-02-02 21:10:43 +00:00
|
|
|
gunzip -c ${DISTFILEGZ} | xz >${DISTFILE}
|
2015-05-04 21:07:20 +00:00
|
|
|
rm ${DISTFILEGZ}
|
2017-01-30 16:32:53 +00:00
|
|
|
|
|
|
|
distinfo: dist
|
|
|
|
rm -f ${DISTINFO} ${DISTINFOSIGN}
|
|
|
|
${CKSUM} ${DISTFILE} >${DISTINFO}
|
|
|
|
#printf "SIZE (${DISTFILE}) = %s\n" $$(wc -c <${DISTFILE}) >>${DISTINFO}
|
|
|
|
${PGP} --clearsign --output=${DISTINFOSIGN} ${DISTINFO}
|
|
|
|
chmod 644 ${DISTINFOSIGN}
|
|
|
|
ls -l ${DISTFILE} ${DISTINFO} ${DISTINFOSIGN}
|