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