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