2
1

python-web2py.mk 2.1 KB

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