generated from gaoyang3513/SDK_RK3288
[Mod] First commit
This commit is contained in:
34
package/python-web2py/Config.in
Normal file
34
package/python-web2py/Config.in
Normal file
@ -0,0 +1,34 @@
|
||||
config BR2_PACKAGE_PYTHON_WEB2PY
|
||||
bool "python-web2py"
|
||||
select BR2_PACKAGE_PYTHON_PYDAL # runtime
|
||||
select BR2_PACKAGE_PYTHON3_ZLIB # runtime
|
||||
select BR2_PACKAGE_PYTHON3_PYEXPAT # runtime
|
||||
select BR2_PACKAGE_PYTHON3_SQLITE # runtime
|
||||
select BR2_PACKAGE_PYTHON_YATL # runtime
|
||||
help
|
||||
web2py is a free open source full-stack framework for rapid
|
||||
development of fast, scalable, secure and portable
|
||||
database-driven web-based applications.
|
||||
|
||||
http://web2py.com
|
||||
|
||||
if BR2_PACKAGE_PYTHON_WEB2PY
|
||||
|
||||
config BR2_PACKAGE_PYTHON_WEB2PY_INSTALL_ADMIN
|
||||
bool "install admin panel application"
|
||||
default y
|
||||
help
|
||||
This option install web2py admin panel application.
|
||||
It can be removed to save space on embedded systems.
|
||||
|
||||
if BR2_PACKAGE_PYTHON_WEB2PY_INSTALL_ADMIN
|
||||
|
||||
config BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD
|
||||
string "admin panel password"
|
||||
default web2py
|
||||
help
|
||||
Set the admin panel password.
|
||||
|
||||
endif
|
||||
|
||||
endif
|
||||
25
package/python-web2py/S51web2py
Normal file
25
package/python-web2py/S51web2py
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting web2py: "
|
||||
start-stop-daemon -S -q -m -p /run/web2py.pid \
|
||||
-c www-data \
|
||||
-b -x /var/www/web2py/web2py.py \
|
||||
-- --nogui -a '"<recycle>"' -i 0.0.0.0 -p 8000
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping web2py: "
|
||||
start-stop-daemon -K -q -p /run/web2py.pid
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
restart)
|
||||
"$0" stop
|
||||
sleep 1
|
||||
"$0" start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
;;
|
||||
esac
|
||||
3
package/python-web2py/python-web2py.hash
Normal file
3
package/python-web2py/python-web2py.hash
Normal file
@ -0,0 +1,3 @@
|
||||
# sha256 locally computed
|
||||
sha256 d4a15fc15254d3fa9e9e9b5a726ae51a0989b7d740d53fd7c3d5b81ac6b8274e python-web2py-2.22.5.tar.gz
|
||||
sha256 2aae96826184a492bc799add49aed7b29036e7aba2d2294fb65053bd30fe55fe LICENSE
|
||||
76
package/python-web2py/python-web2py.mk
Normal file
76
package/python-web2py/python-web2py.mk
Normal file
@ -0,0 +1,76 @@
|
||||
################################################################################
|
||||
#
|
||||
# python-web2py
|
||||
#
|
||||
################################################################################
|
||||
|
||||
PYTHON_WEB2PY_VERSION = 2.22.5
|
||||
PYTHON_WEB2PY_SITE = $(call github,web2py,web2py,v$(PYTHON_WEB2PY_VERSION))
|
||||
PYTHON_WEB2PY_LICENSE = LGPL-3.0
|
||||
PYTHON_WEB2PY_LICENSE_FILES = LICENSE
|
||||
PYTHON_WEB2PY_CPE_ID_VENDOR = web2py
|
||||
PYTHON_WEB2PY_CPE_ID_PRODUCT = web2py
|
||||
PYTHON_WEB2PY_DEPENDENCIES = host-python3 python3 \
|
||||
host-python-pydal host-python-yatl
|
||||
|
||||
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
|
||||
|
||||
define PYTHON_WEB2PY_GENERATE_PASSWORD
|
||||
$(HOST_DIR)/bin/python -c 'import os; \
|
||||
os.chdir("$(@D)"); \
|
||||
from gluon.main import save_password; \
|
||||
save_password($(BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD),8000)'
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_PACKAGE_PYTHON_WEB2PY_INSTALL_ADMIN),y)
|
||||
PYTHON_WEB2PY_POST_BUILD_HOOKS += PYTHON_WEB2PY_GENERATE_PASSWORD
|
||||
else
|
||||
PYTHON_WEB2PY_EXCLUSIONS += applications/admin
|
||||
endif
|
||||
|
||||
define PYTHON_WEB2PY_INSTALL_TARGET_CMDS
|
||||
mkdir -p $(TARGET_DIR)/var/www/web2py
|
||||
rsync -a $(@D)/ $(TARGET_DIR)/var/www/web2py/ \
|
||||
$(addprefix --exclude=,$(PYTHON_WEB2PY_EXCLUSIONS))
|
||||
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
|
||||
endef
|
||||
|
||||
# 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.
|
||||
define PYTHON_WEB2PY_PERMISSIONS
|
||||
/var/www/web2py r 750 33 33 - - - - -
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
11
package/python-web2py/web2py.service
Normal file
11
package/python-web2py/web2py.service
Normal file
@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Web2py daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/var/www/web2py/web2py.py --nogui -a '<recycle>' -i 0.0.0.0 -p 8000
|
||||
User=www-data
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user