Release openresolv-3.5.6
[openresolv] / Makefile
1 include config.mk
2
3 NAME=           openresolv
4 VERSION=        3.5.6
5 PKG=            ${NAME}-${VERSION}
6
7 INSTALL?=       install
8 SED?=           sed
9
10 BINMODE?=       0755
11 DOCMODE?=       0644
12 MANMODE?=       0444
13
14 RESOLVCONF=     resolvconf resolvconf.8 resolvconf.conf.5
15 SUBSCRIBERS=    libc dnsmasq named pdnsd unbound
16 TARGET=         ${RESOLVCONF} ${SUBSCRIBERS}
17 SRCS=           ${TARGET:C,$,.in,} # pmake
18 SRCS:=          ${TARGET:=.in} # gmake
19
20 SED_SBINDIR=            -e 's:@SBINDIR@:${SBINDIR}:g'
21 SED_SYSCONFDIR=         -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g'
22 SED_LIBEXECDIR=         -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g'
23 SED_VARDIR=             -e 's:@VARDIR@:${VARDIR}:g'
24 SED_RCDIR=              -e 's:@RCDIR@:${RCDIR}:g'
25 SED_RESTARTCMD=         -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g'
26
27 .SUFFIXES: .in
28
29 all: ${TARGET}
30
31 .in:
32         ${SED}  ${SED_SBINDIR} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \
33                 ${SED_VARDIR} ${SED_RCDIR} ${SED_RESTARTCMD} \
34                 $< > $@
35
36 clean:
37         rm -f ${TARGET} openresolv-${VERSION}.tar.bz2
38
39 distclean: clean
40         rm -f config.mk
41
42 installdirs:
43
44 install: ${TARGET}
45         ${INSTALL} -d ${DESTDIR}${SBINDIR}
46         ${INSTALL} -m ${BINMODE} resolvconf ${DESTDIR}${SBINDIR}
47         ${INSTALL} -d ${DESTDIR}${SYSCONFDIR}
48         test -e ${DESTDIR}${SYSCONFDIR}/resolvconf.conf || \
49         ${INSTALL} -m ${DOCMODE} resolvconf.conf ${DESTDIR}${SYSCONFDIR}
50         ${INSTALL} -d ${DESTDIR}${LIBEXECDIR}
51         ${INSTALL} -m ${DOCMODE} ${SUBSCRIBERS} ${DESTDIR}${LIBEXECDIR}
52         ${INSTALL} -d ${DESTDIR}${MANDIR}/man8
53         ${INSTALL} -m ${MANMODE} resolvconf.8 ${DESTDIR}${MANDIR}/man8
54         ${INSTALL} -d ${DESTDIR}${MANDIR}/man5
55         ${INSTALL} -m ${MANMODE} resolvconf.conf.5 ${DESTDIR}${MANDIR}/man5
56
57 import:
58         rm -rf /tmp/${PKG}
59         ${INSTALL} -d /tmp/${PKG}
60         cp README ${SRCS} /tmp/${PKG}
61
62 dist: import
63         cp configure Makefile resolvconf.conf /tmp/${PKG}
64         tar cvjpf ${PKG}.tar.bz2 -C /tmp ${PKG} 
65         rm -rf /tmp/${PKG} 
66         ls -l ${PKG}.tar.bz2