New Saltstack Salt formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 line
927B

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