Eolisation de l'applicatif MSE

apps.mk 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #
  2. # NE PAS EDITER CE FICHIER
  3. #
  4. # Utiliser <appli>.mk à inclure à la fin de Makefile
  5. # Le variables suivantes sont a votre disposition :
  6. #
  7. # SRC_APPS : Répertoire des sources de l'application
  8. # SRC_APPS_PLUGIN : Répertoires des plugins pour l'application
  9. # SRC_APPS_LANG : Répértoires des traductions
  10. #
  11. ##########################
  12. # Application web envole #
  13. ##########################
  14. ifneq (, $(filter oui web, $(PKGAPPS)))
  15. # Envole
  16. sharenvole_PROG_DIR := $(DESTDIR)/usr/share/envole/$(SOURCE)
  17. SRC_APPS := src/$(SOURCE)-$(VERSION)
  18. SRC_APPS_PLUGIN := src/plugins-$(VERSION)
  19. SRC_APPS_LANG := src/lang-$(VERSION)
  20. APPS_DEST := $(DESTDIR)/var/www/html/$(SOURCE)
  21. LANG_DEST := $(APPS_DEST)/lang
  22. PLUGIN_DEST := $(APPS_DEST)/plugin
  23. # Sanity check
  24. ifeq (, $(filter-out X.X, $(strip $(VERSION))))
  25. $(error $$(VERSION) variable has incorrect value '$(VERSION)')
  26. endif
  27. ifeq (, $(strip $(wildcard $(SRC_APPS))))
  28. $(error $$(PKGAPPS) is enable but $$(SRC_APPS)='$(SRC_APPS)' does not exist)
  29. endif
  30. endif
  31. ##########################
  32. # Application EOLE flask #
  33. ##########################
  34. ifneq (, $(filter flask, $(PKGAPPS)))
  35. # Sanity check
  36. ifeq (, $(filter-out XXX, $(strip $(FLASK_MODULE))))
  37. $(error $$(FLASK_MODULE) variable has incorrect value '$(FLASK_MODULE)')
  38. endif
  39. ifeq (, $(strip $(wildcard src/$(FLASK_MODULE).conf)))
  40. $(error missing eoleflask configuration file 'src/$(FLASK_MODULE).conf')
  41. endif
  42. # Static files
  43. SRC_APPS := src/$(FLASK_MODULE)/static
  44. APPS_MOUNT_POINT:= $(shell sed -ne 's|^"MOUNT_POINT"[[:space:]]*:[[:space:]]*"/\([^"]*\)",|\1|p' \
  45. src/$(FLASK_MODULE).conf)
  46. APPS_DEST := $(DESTDIR)/usr/share/eole/flask/$(APPS_MOUNT_POINT)/static
  47. SRC_APPS_PLUGIN := nonexistent
  48. SRC_APPS_LANG := nonexistent
  49. # eole-flask configuration
  50. src_DATA_DIR := $(DESTDIR)/etc/eole/flask/available
  51. endif
  52. ################
  53. # Common rules #
  54. ################
  55. ifneq (, $(filter oui web flask, $(PKGAPPS)))
  56. install-apps-dirs::
  57. test ! -d $(SRC_APPS) || $(INSTALL_DIRECTORY) $(APPS_DEST)
  58. test ! -d $(SRC_APPS_LANG) || $(INSTALL_DIRECTORY) $(LANG_DEST)
  59. test ! -d $(SRC_APPS_PLUGIN) || $(INSTALL_DIRECTORY) $(PLUGIN_DEST)
  60. install-apps:: install-apps-dirs
  61. # Installation de l'application
  62. $(call fc_install_file,$(INSTALL_RECURSIVE),$(SRC_APPS),$(APPS_DEST))
  63. # Installation des répertoires de plugins
  64. $(call fc_install_file,$(INSTALL_RECURSIVE),$(SRC_APPS_PLUGIN),$(PLUGIN_DEST))
  65. # Installation des répertoires de traductions (lang)
  66. $(call fc_install_file,$(INSTALL_RECURSIVE),$(SRC_APPS_LANG),$(LANG_DEST))
  67. ## Add install-apps
  68. install:: install-apps
  69. endif
  70. .PHONY: install-apps install-apps-dirs