Rejig our Makefile to better support NetBSD. We now talk to /var/run/resolvconf direc...
[openresolv] / Makefile
1 NAME=           openresolv
2 VERSION=        1.3
3 PKG=            ${NAME}-${VERSION}
4
5 INSTALL?=       install
6 MANPREFIX?=     /usr/share
7 VARBASE?=       /var
8
9 BINMODE?=       0755
10 MANMODE?=       0444
11
12 SYSCONFDIR?=    ${PREFIX}/etc/resolvconf
13 BINDIR=         /sbin
14 MANDIR?=        ${MANPREFIX}/man
15
16 RESOLVCONF=     resolvconf resolvconf.8
17 SUBSCRIBERS=    libc dnsmasq named
18 TARGET=         ${RESOLVCONF} ${SUBSCRIBERS}
19
20 .SUFFIXES: .in
21
22 all: ${TARGET}
23
24 .in:
25         sed -e 's:@PREFIX@:${PREFIX}:g' \
26                 -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \
27                 -e 's:@VARBASE@:${VARBASE}:g' \
28                 $@.in > $@
29
30 clean:
31         rm -f ${TARGET} openresolv-${VERSION}.tar.bz2
32
33 install: ${TARGET}
34         ${INSTALL} -d ${DESTDIR}${PREFIX}${BINDIR}
35         ${INSTALL} -m ${BINMODE} resolvconf ${DESTDIR}${PREFIX}${BINDIR}
36         ${INSTALL} -d ${DESTDIR}${SYSCONFDIR}/resolv.conf.d
37         ${INSTALL} -d ${DESTDIR}${SYSCONFDIR}/update-libc.d
38         ${INSTALL} -d ${DESTDIR}${SYSCONFDIR}/update.d
39         ${INSTALL} -m ${BINMODE} ${SUBSCRIBERS} ${DESTDIR}${SYSCONFDIR}/update.d
40         ${INSTALL} -d ${DESTDIR}${MANDIR}/man8
41         ${INSTALL} -m ${MANMODE} resolvconf.8 ${DESTDIR}${MANDIR}/man8
42
43 dist:
44         ${INSTALL} -d /tmp/${PKG}
45         cp -RPp . /tmp/${PKG}
46         (cd /tmp/${PKG}; ${MAKE} clean)
47         rm -rf /tmp/${PKG}/*.bz2 /tmp/${PKG}/.git /tmp/${PKG}/.gitignore
48         tar cvjpf ${PKG}.tar.bz2 -C /tmp ${PKG} 
49         rm -rf /tmp/${PKG} 
50         ls -l ${PKG}.tar.bz2