summaryrefslogtreecommitdiff
path: root/net/djbdns-run/Makefile
blob: 981ebabb8a6fd7e99d354b00a86a9febd15c61fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# $NetBSD: Makefile,v 1.3 2004/09/02 08:23:02 schmonz Exp $
#

DISTNAME=		djbdns-run-20040902
CATEGORIES=		net
MASTER_SITES=		# empty
DISTFILES=		# empty

MAINTAINER=		schmonz@NetBSD.org
COMMENT=		Configures djbdns to cache and serve queries

DEPENDS_DJBDNS=		djbdns>=1.05nb5:../../net/djbdns
DEPENDS+=		${DEPENDS_DJBDNS}
DEPENDS+=		daemontools-[0-9]*:../../sysutils/daemontools
DEPENDS+=		ucspi-tcp-[0-9]*:../../net/ucspi-tcp

PKG_INSTALLATION_TYPES=	overwrite pkgviews

WRKSRC=			${WRKDIR}
NO_CHECKSUM=		# defined

USE_PKGINSTALL=		yes
INSTALL_EXTRA_TMPL+=	${PKGDIR}/INSTALL
MAKE_DIRS+=		${PKG_SYSCONFDIR}/axfrdns
MAKE_DIRS+=		${PKG_SYSCONFDIR}/dnscache/ip
MAKE_DIRS+=		${PKG_SYSCONFDIR}/dnscache/servers
MAKE_DIRS+=		${PKG_SYSCONFDIR}/tinydns
PKG_GROUPS=		djbdns
PKG_USERS+=		dnslog:djbdns::dnslog
PKG_USERS+=		axfrdns:djbdns::axfrdns
PKG_USERS+=		dnscache:djbdns::dnscache
PKG_USERS+=		tinydns:djbdns::tinydns
RCD_SCRIPTS=		axfrdns dnscache tinydns
FILES_SUBST+=		PKGNAME=${PKGNAME}

INSTALLATION_DIRS=	bin share/doc/djbdns-run

.include "../../mk/bsd.prefs.mk"

# Detect the PKG_SYSCONFDIR of the installed djbdns, so we can create
# config files there and refer to them from rc.d scripts.
.if !empty(PHASES_AFTER_EXTRACT:M${PKG_PHASE})
INSTALLED_DJBDNS!= ${PKG_BEST_EXISTS} ${DEPENDS_DJBDNS:C/:.*$//:Q:S/\ / /g}
.  if empty(INSTALLED_DJBDNS:M*_not_found_)
.    if !defined(PKG_SYSCONFDIR.djbdns-run)
PKG_SYSCONFDIR.djbdns-run!= \
	${PKG_INFO} -qB ${INSTALLED_DJBDNS} |				\
		${SED} -n '/^PKG_SYSCONFDIR=/s|^PKG_SYSCONFDIR=[ 	]*||p'
.    endif
.  endif
.endif

do-build:
	@${SED} ${FILES_SUBST_SED} ${FILESDIR}/README.pkgsrc		\
		> ${WRKDIR}/README.pkgsrc
	@${SED} ${FILES_SUBST_SED} ${FILESDIR}/dnscache-showctl.sh	\
		> ${WRKDIR}/dnscache-showctl
	@${SED} ${FILES_SUBST_SED} ${FILESDIR}/tinydns-showctl.sh	\
		> ${WRKDIR}/tinydns-showctl

do-install:
	${INSTALL_SCRIPT} ${WRKDIR}/dnscache-showctl ${PREFIX}/bin
	${INSTALL_SCRIPT} ${WRKDIR}/tinydns-showctl ${PREFIX}/bin
	${INSTALL_DATA} ${WRKDIR}/README.pkgsrc ${PREFIX}/share/doc/djbdns-run

.include "../../mk/bsd.pkg.mk"