1 |
# MPD VPN |
2 |
# |
3 |
# Douglas Thrift |
4 |
# |
5 |
# $Id$ |
6 |
|
7 |
SHELL := $(shell which bash) |
8 |
mpd := $(shell hostname -s).xml |
9 |
recon := $(shell hostname -s).dat |
10 |
|
11 |
all: mpd.conf mpd.links recon.dat |
12 |
|
13 |
mpd.xml: $(mpd) mpd.xsl |
14 |
saxon -o $@ $< $(word 2, $+) |
15 |
|
16 |
mpd.conf: mpd.xml conf.xsl |
17 |
saxon -o $@ $< $(word 2, $+) |
18 |
|
19 |
mpd.links: mpd.xml links.xsl |
20 |
saxon -o $@ $< $(word 2, $+) |
21 |
|
22 |
recon.dat: $(recon) |
23 |
cp -v $< $@ |
24 |
|
25 |
.PHONY: install clean |
26 |
|
27 |
install: all |
28 |
install -pv -m 0644 mpd.conf mpd.links /usr/local/etc/mpd |
29 |
ifeq ($(shell cat ~/.mpd-nsupdate.key 2> /dev/null),) |
30 |
install -pv -g wheel -m 0600 -o root /dev/null ~/.mpd-nsupdate.key |
31 |
. mpd-common.sh; echo $$name $$secret > ~/.mpd-nsupdate.key |
32 |
endif |
33 |
install -pv -m 0644 mpd-common.sh ~/bin/mpd-common.sh |
34 |
install -pv -m 0644 recon.dat ~ |
35 |
install -pv mpd-up.sh mpd-down.sh recon.sh sniper.sh ~/bin |
36 |
|
37 |
clean: |
38 |
-rm -f mpd.xml mpd.conf mpd.links |