2015-04-14 17:05:04 +02:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# python-web2py
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2017-09-04 09:03:08 +02:00
|
|
|
PYTHON_WEB2PY_VERSION = R-2.15.4
|
2015-04-14 17:05:04 +02:00
|
|
|
PYTHON_WEB2PY_SITE = $(call github,web2py,web2py,$(PYTHON_WEB2PY_VERSION))
|
2017-03-30 15:43:35 +02:00
|
|
|
PYTHON_WEB2PY_LICENSE = LGPL-3.0
|
2015-04-14 17:05:04 +02:00
|
|
|
PYTHON_WEB2PY_LICENSE_FILES = LICENSE
|
2017-09-04 09:03:08 +02:00
|
|
|
PYTHON_WEB2PY_DEPENDENCIES = $(if $(BR2_PACKAGE_PYTHON3),host-python3 python3,host-python python) \
|
|
|
|
python-pydal host-python-pydal
|
2015-04-14 17:05:04 +02:00
|
|
|
|
2017-06-28 10:15:12 +02:00
|
|
|
PYTHON_WEB2PY_EXCLUSIONS = \
|
|
|
|
welcome.w2p \
|
|
|
|
applications/examples \
|
|
|
|
applications/welcome \
|
|
|
|
deposit \
|
|
|
|
docs \
|
|
|
|
examples \
|
|
|
|
extras \
|
|
|
|
handlers \
|
|
|
|
scripts \
|
|
|
|
ABOUT \
|
|
|
|
anyserver.py \
|
|
|
|
CHANGELOG \
|
|
|
|
Makefile \
|
|
|
|
MANIFEST.in \
|
|
|
|
README.markdown \
|
|
|
|
setup.py \
|
|
|
|
tox.ini
|
|
|
|
|
2017-06-28 10:15:13 +02:00
|
|
|
define PYTHON_WEB2PY_GENERATE_PASSWORD
|
2017-09-04 09:03:08 +02:00
|
|
|
$(HOST_DIR)/bin/python -c 'import os; \
|
2015-04-14 17:05:04 +02:00
|
|
|
os.chdir("$(@D)"); \
|
|
|
|
from gluon.main import save_password; \
|
|
|
|
save_password($(BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD),8000)'
|
2017-06-28 10:15:13 +02:00
|
|
|
endef
|
|
|
|
|
2017-06-28 10:15:14 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_PYTHON_WEB2PY_INSTALL_ADMIN),y)
|
2017-06-28 10:15:13 +02:00
|
|
|
PYTHON_WEB2PY_POST_BUILD_HOOKS += PYTHON_WEB2PY_GENERATE_PASSWORD
|
2017-06-28 10:15:14 +02:00
|
|
|
else
|
|
|
|
PYTHON_WEB2PY_EXCLUSIONS += applications/admin
|
|
|
|
endif
|
2017-06-28 10:15:13 +02:00
|
|
|
|
|
|
|
define PYTHON_WEB2PY_INSTALL_TARGET_CMDS
|
2015-04-14 17:05:04 +02:00
|
|
|
mkdir -p $(TARGET_DIR)/var/www/web2py
|
2017-06-28 10:15:12 +02:00
|
|
|
rsync -a $(@D)/ $(TARGET_DIR)/var/www/web2py/ \
|
|
|
|
$(addprefix --exclude=,$(PYTHON_WEB2PY_EXCLUSIONS))
|
2015-04-14 17:05:04 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define PYTHON_WEB2PY_INSTALL_INIT_SYSV
|
|
|
|
$(INSTALL) -m 0755 -D package/python-web2py/S51web2py \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S51web2py
|
|
|
|
endef
|
|
|
|
|
|
|
|
define PYTHON_WEB2PY_INSTALL_INIT_SYSTEMD
|
|
|
|
$(INSTALL) -D -m 0644 package/python-web2py/web2py.service \
|
|
|
|
$(TARGET_DIR)/usr/lib/systemd/system/web2py.service
|
|
|
|
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
|
|
|
|
ln -fs ../../../../usr/lib//systemd/system/web2py.service \
|
|
|
|
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/web2py.service
|
|
|
|
endef
|
|
|
|
|
2015-11-04 19:46:07 +01:00
|
|
|
# www-data user and group are used for web2py. Because these user and group
|
|
|
|
# are already set by buildroot, it is not necessary to redefine them.
|
|
|
|
# See system/skeleton/etc/passwd
|
|
|
|
# username: www-data uid: 33
|
|
|
|
# groupname: www-data gid: 33
|
|
|
|
#
|
|
|
|
# So, we just need to create the directories used by web2py with the right
|
|
|
|
# ownership.
|
2015-04-14 17:05:04 +02:00
|
|
|
define PYTHON_WEB2PY_PERMISSIONS
|
2015-11-04 19:46:07 +01:00
|
|
|
/var/www/web2py r 750 33 33 - - - - -
|
2015-04-14 17:05:04 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(generic-package))
|