python-web2py.mk 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ################################################################################
  2. #
  3. # python-web2py
  4. #
  5. ################################################################################
  6. PYTHON_WEB2PY_VERSION = R-2.12.3
  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. define PYTHON_WEB2PY_INSTALL_TARGET_CMDS
  12. $(HOST_DIR)/usr/bin/python2 -c 'import os; \
  13. os.chdir("$(@D)"); \
  14. from gluon.main import save_password; \
  15. save_password($(BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD),8000)'
  16. mkdir -p $(TARGET_DIR)/var/www/web2py
  17. cp -dpfr $(@D)/* $(TARGET_DIR)/var/www/web2py
  18. endef
  19. define PYTHON_WEB2PY_INSTALL_INIT_SYSV
  20. $(INSTALL) -m 0755 -D package/python-web2py/S51web2py \
  21. $(TARGET_DIR)/etc/init.d/S51web2py
  22. endef
  23. define PYTHON_WEB2PY_INSTALL_INIT_SYSTEMD
  24. $(INSTALL) -D -m 0644 package/python-web2py/web2py.service \
  25. $(TARGET_DIR)/usr/lib/systemd/system/web2py.service
  26. mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
  27. ln -fs ../../../../usr/lib//systemd/system/web2py.service \
  28. $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/web2py.service
  29. endef
  30. # www-data user and group are used for web2py. Because these user and group
  31. # are already set by buildroot, it is not necessary to redefine them.
  32. # See system/skeleton/etc/passwd
  33. # username: www-data uid: 33
  34. # groupname: www-data gid: 33
  35. #
  36. # So, we just need to create the directories used by web2py with the right
  37. # ownership.
  38. define PYTHON_WEB2PY_PERMISSIONS
  39. /var/www/web2py r 750 33 33 - - - - -
  40. endef
  41. $(eval $(generic-package))