Match copyright in other subscribers
[openresolv] / Makefile
1 include config.mk
2
3 NAME=           openresolv
4 VERSION=        3.3.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_PREFIX=             -e 's:@PREFIX@:${PREFIX}: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_RESTARTCMD=         -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g'
25
26 .SUFFIXES: .in
27
28 all: ${TARGET}
29
30 .in:
31         ${SED}  ${SED_PREFIX} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \
32                 ${SED_VARDIR} ${SED_RESTARTCMD} \
33                 $< > $@
34
35 clean:
36         rm -f ${TARGET} openresolv-${VERSION}.tar.bz2
37
38 installdirs:
39
40 install: ${TARGET}
41         ${INSTALL} -d ${DESTDIR}${SBINDIR}
42         ${INSTALL} -m ${BINMODE} resolvconf ${DESTDIR}${SBINDIR}
43         ${INSTALL} -d ${DESTDIR}${SYSCONFDIR}
44         test -e ${DESTDIR}${SYSCONFDIR}/resolvconf.conf || \
45         ${INSTALL} -m ${DOCMODE} resolvconf.conf ${DESTDIR}${SYSCONFDIR}
46         ${INSTALL} -d ${DESTDIR}${LIBEXECDIR}
47         ${INSTALL} -m ${DOCMODE} ${SUBSCRIBERS} ${DESTDIR}${LIBEXECDIR}
48         ${INSTALL} -d ${DESTDIR}${MANDIR}/man8
49         ${INSTALL} -m ${MANMODE} resolvconf.8 ${DESTDIR}${MANDIR}/man8
50         ${INSTALL} -d ${DESTDIR}${MANDIR}/man5
51         ${INSTALL} -m ${MANMODE} resolvconf.conf.5 ${DESTDIR}${MANDIR}/man5
52
53 import:
54         rm -rf /tmp/${PKG}
55         ${INSTALL} -d /tmp/${PKG}
56         cp README ${SRCS} /tmp/${PKG}
57
58 dist: import
59         cp Makefile resolvconf.conf /tmp/${PKG}
60         tar cvjpf ${PKG}.tar.bz2 -C /tmp ${PKG} 
61         rm -rf /tmp/${PKG} 
62         ls -l ${PKG}.tar.bz2