python-web2py.mk 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. ################################################################################
  2. #
  3. # python-web2py
  4. #
  5. ################################################################################
  6. PYTHON_WEB2PY_VERSION = 2.20.4
  7. PYTHON_WEB2PY_SITE = $(call github,web2py,web2py,v$(PYTHON_WEB2PY_VERSION))
  8. PYTHON_WEB2PY_LICENSE = LGPL-3.0
  9. PYTHON_WEB2PY_LICENSE_FILES = LICENSE
  10. PYTHON_WEB2PY_DEPENDENCIES = $(if $(BR2_PACKAGE_PYTHON3),host-python3 python3,host-python python) \
  11. host-python-pydal host-python-yatl
  12. PYTHON_WEB2PY_EXCLUSIONS = \
  13. welcome.w2p \
  14. applications/examples \
  15. applications/welcome \
  16. deposit \
  17. docs \
  18. examples \
  19. extras \
  20. handlers \
  21. scripts \
  22. ABOUT \
  23. anyserver.py \
  24. CHANGELOG \
  25. Makefile \
  26. MANIFEST.in \
  27. README.markdown \
  28. setup.py \
  29. tox.ini
  30. define PYTHON_WEB2PY_GENERATE_PASSWORD
  31. $(HOST_DIR)/bin/python -c 'import os; \
  32. os.chdir("$(@D)"); \
  33. from gluon.main import save_password; \
  34. save_password($(BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD),8000)'
  35. endef
  36. ifeq ($(BR2_PACKAGE_PYTHON_WEB2PY_INSTALL_ADMIN),y)
  37. PYTHON_WEB2PY_POST_BUILD_HOOKS += PYTHON_WEB2PY_GENERATE_PASSWORD
  38. else
  39. PYTHON_WEB2PY_EXCLUSIONS += applications/admin
  40. endif
  41. define PYTHON_WEB2PY_INSTALL_TARGET_CMDS
  42. mkdir -p $(TARGET_DIR)/var/www/web2py
  43. rsync -a $(@D)/ $(TARGET_DIR)/var/www/web2py/ \
  44. $(addprefix --exclude=,$(PYTHON_WEB2PY_EXCLUSIONS))
  45. endef
  46. define PYTHON_WEB2PY_INSTALL_INIT_SYSV
  47. $(INSTALL) -m 0755 -D package/python-web2py/S51web2py \
  48. $(TARGET_DIR)/etc/init.d/S51web2py
  49. endef
  50. define PYTHON_WEB2PY_INSTALL_INIT_SYSTEMD
  51. $(INSTALL) -D -m 0644 package/python-web2py/web2py.service \
  52. $(TARGET_DIR)/usr/lib/systemd/system/web2py.service
  53. endef
  54. # www-data user and group are used for web2py. Because these user and group
  55. # are already set by buildroot, it is not necessary to redefine them.
  56. # See system/skeleton/etc/passwd
  57. # username: www-data uid: 33
  58. # groupname: www-data gid: 33
  59. #
  60. # So, we just need to create the directories used by web2py with the right
  61. # ownership.
  62. define PYTHON_WEB2PY_PERMISSIONS
  63. /var/www/web2py r 750 33 33 - - - - -
  64. endef
  65. $(eval $(generic-package))