Makefile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. DEFAULT_DESTDIR := /var/cms
  2. DESTDIR := $(DEFAULT_DESTDIR)
  3. DEFAULT_OWNER := www-data
  4. OWNER := $(DEFAULT_OWNER)
  5. DEFAULT_GROUP := www-data
  6. GROUP := $(DEFAULT_GROUP)
  7. INSTALL := install
  8. CP := cp
  9. CHOWN := chown
  10. all: help
  11. install: help
  12. help:
  13. @echo "Use make install-cms to install the cms.py script"
  14. @echo "Use make install-db to install the example database"
  15. @echo
  16. @echo "Use make install-world to install all of the above"
  17. @echo
  18. @echo "To adjust the install target path, set the DESTDIR variable."
  19. @echo "DESTDIR defaults to $(DEFAULT_DESTDIR)"
  20. @echo "To adjust the permissions of the target directories and files,"
  21. @echo "set the OWNER and GROUP variables."
  22. @echo "OWNER defaults to $(DEFAULT_OWNER)"
  23. @echo "GROUP defaults to $(DEFAULT_GROUP)"
  24. $(DESTDIR):
  25. $(INSTALL) -d -o $(OWNER) -g $(GROUP) -m 755 $(DESTDIR)
  26. install-cms: $(DESTDIR)
  27. $(INSTALL) -o $(OWNER) -g $(GROUP) -m 644 cms.py $(DESTDIR)/
  28. $(INSTALL) -o $(OWNER) -g $(GROUP) -m 644 index.wsgi $(DESTDIR)/
  29. install-db: $(DESTDIR)
  30. $(CP) -a example/db $(DESTDIR)/
  31. $(CHOWN) -R $(OWNER):$(GROUP) $(DESTDIR)/db
  32. install-world: install-cms install-db
  33. .PHONY: all help install install-cms install-db install-world