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