Add some extra knobs so that it slides into the FreeBSD file layout.
[openresolv] / Makefile
1 DESTDIR =
2 PREFIX = /
3 ROOT = $(DESTDIR)$(PREFIX)
4 INSTALL = install 
5 ETCDIR = $(ROOT)/etc/resolvconf
6 SHAREDIR = $(ROOT)/usr/share/man
7 MANDIR = $(SHAREDIR)/man8
8 BINDIR = $(ROOT)/sbin
9 VARDIR = $(DESTDIR)/var/run
10 UPDATEDIR = $(ETCDIR)/update.d
11
12 default:
13
14 install:
15         $(INSTALL) -d $(ETCDIR)/resolv.conf.d
16         $(INSTALL) -d $(UPDATEDIR)
17         $(INSTALL) -d $(ETCDIR)/update-libc.d
18         $(INSTALL) -d $(MANDIR)
19         $(INSTALL) -d $(BINDIR)
20         $(INSTALL) -d $(VARDIR)/resolvconf
21         $(INSTALL) resolvconf $(BINDIR)
22         $(INSTALL) libc $(UPDATEDIR)
23         if test "$(PREFIX)" "!=" "/"; then \
24                 for x in $(BINDIR)/resolvconf $(UPDATEDIR)/libc; do \
25                 sed -i.bak -e s':^PREFIX=.*:PREFIX="$(PREFIX)":' "$$x"; rm "$$x".bak; \
26                 done; \
27                 fi;
28         $(INSTALL) -m 644 resolvconf.8 $(MANDIR)
29         ln -snf /var/run/resolvconf $(ETCDIR)/run