Move subscribers to libexec as they really don't belong in /etc
[openresolv] / Makefile
1 NAME=           openresolv
2 VERSION=        2.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}${SYSCONFDIR}
45         ${INSTALL} -m ${DOCMODE} resolv.conf.head ${DESTDIR}${SYSCONFDIR}
46         ${INSTALL} -d ${DESTDIR}${MANDIR}/man8
47         ${INSTALL} -m ${MANMODE} resolvconf.8 ${DESTDIR}${MANDIR}/man8
48
49 dist:
50         ${INSTALL} -d /tmp/${PKG}
51         cp -RPp . /tmp/${PKG}
52         (cd /tmp/${PKG}; ${MAKE} clean)
53         rm -rf /tmp/${PKG}/*.bz2 /tmp/${PKG}/.svn
54         tar cvjpf ${PKG}.tar.bz2 -C /tmp ${PKG} 
55         rm -rf /tmp/${PKG} 
56         ls -l ${PKG}.tar.bz2