blob: fc837838a77bc860d1b96de3920fae27c8a144ae [file] [log] [blame]
Filip Pytloun940f66d2016-04-14 14:11:51 +02001DESTDIR=/
2SALTENVDIR=/usr/share/salt-formulas/env
3RECLASSDIR=/usr/share/salt-formulas/reclass
4FORMULANAME=$(shell grep name: metadata.yml|head -1|cut -d : -f 2|grep -Eo '[a-z0-9\-]*')
5
6all:
7 @echo "make install - Install into DESTDIR"
8 @echo "make test - Run tests"
9 @echo "make clean - Cleanup after tests run"
10
11install:
12 # Formula
13 [ -d $(DESTDIR)/$(SALTENVDIR) ] || mkdir -p $(DESTDIR)/$(SALTENVDIR)
14 cp -a $(FORMULANAME) $(DESTDIR)/$(SALTENVDIR)/
15 [ ! -d _modules ] || cp -a _modules $(DESTDIR)/$(SALTENVDIR)/
16 [ ! -d _states ] || cp -a _states $(DESTDIR)/$(SALTENVDIR)/ || true
17 # Metadata
18 [ -d $(DESTDIR)/$(RECLASSDIR)/service/$(FORMULANAME) ] || mkdir -p $(DESTDIR)/$(RECLASSDIR)/service/$(FORMULANAME)
19 cp -a metadata/service/* $(DESTDIR)/$(RECLASSDIR)/service/$(FORMULANAME)
20
21test:
22 [ ! -d tests ] || (cd tests; ./run_tests.sh)
23
24clean:
25 [ ! -d tests/build ] || rm -rf tests/build
26 [ ! -d build ] || rm -rf build