Ensure resolv.conf is created with the correct umask.
[openresolv] / Makefile
1 NAME = openresolv
2 VERSION = 1.0
3 PKG = $(NAME)-$(VERSION)
4
5 DESTDIR =
6 PREFIX =
7 MANPREFIX ?= /usr/share
8 ROOT = $(DESTDIR)$(PREFIX)
9 ETCDIR = $(ROOT)/etc/resolvconf
10 MANDIR = $(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 INSTALL ?= install
20
21 .SUFFIXES: .in
22
23 all: $(TARGET)
24
25 .in:
26         sed -e s':^PREFIX=.*:PREFIX="$(PREFIX)":' $@.in > $@
27
28 resolvconf.8: resolvconf.8.in
29         sed -e 's:%%PREFIX%%:$(PREFIX):g' $@.in > $@
30
31 clean:
32         rm -f $(TARGET) openresolv-$(VERSION).tar.bz2
33
34 install: $(TARGET)
35         $(INSTALL) -d $(BINDIR)
36         $(INSTALL) -d $(VARDIR)/resolvconf
37         $(INSTALL) resolvconf $(BINDIR)
38         $(INSTALL) -d $(MANDIR)
39         $(INSTALL) -d $(ETCDIR)/resolv.conf.d
40         $(INSTALL) -d $(ETCDIR)/update-libc.d
41         $(INSTALL) -d $(UPDATEDIR)
42         $(INSTALL) $(SUBSCRIBERS) $(UPDATEDIR)
43         $(INSTALL) -m 0644 resolvconf.8 $(MANDIR)
44         ln -snf /var/run/resolvconf $(ETCDIR)/run
45
46 dist:
47         $(INSTALL) -d /tmp/$(PKG)
48         cp -RPp . /tmp/$(PKG)
49         (cd /tmp/$(PKG); $(MAKE) clean)
50         rm -rf /tmp/$(PKG)/*.bz2 /tmp/$(PKG)/.git
51         tar cvjpf $(PKG).tar.bz2 -C /tmp $(PKG) 
52         rm -rf /tmp/$(PKG) 
53         ls -l $(PKG).tar.bz2