summaryrefslogtreecommitdiff
path: root/package/python-web2py
diff options
context:
space:
mode:
authorAngelo Compagnucci <angelo.compagnucci@gmail.com>2015-04-14 17:05:04 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-07-23 22:21:52 +0200
commit7c0fab65aae632fc820edbe570c40f93c765dd64 (patch)
treebedb5e26ac8a4ae244657390111e2bfef4de7148 /package/python-web2py
parent84057b2eaddf093cfa97377c6f1aa01a3aa8cc4b (diff)
package/python-web2py: new package
This patch adds web2py package. web2py is a free open source full-stack framework for rapid development of fast, scalable, secure and portable database-driven web-based applications. [Thomas: fixup symbolic link to the systemd service file.] Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/python-web2py')
-rw-r--r--package/python-web2py/Config.in23
-rw-r--r--package/python-web2py/S51web2py25
-rw-r--r--package/python-web2py/python-web2py.mk39
-rw-r--r--package/python-web2py/web2py.service11
4 files changed, 98 insertions, 0 deletions
diff --git a/package/python-web2py/Config.in b/package/python-web2py/Config.in
new file mode 100644
index 000000000..b10d3a48a
--- /dev/null
+++ b/package/python-web2py/Config.in
@@ -0,0 +1,23 @@
+config BR2_PACKAGE_PYTHON_WEB2PY
+ bool "python-web2py"
+ depends on BR2_PACKAGE_PYTHON
+ select BR2_PACKAGE_PYTHON_PYDAL
+ select BR2_PACKAGE_PYTHON_ZLIB
+ select BR2_PACKAGE_PYTHON_PYEXPAT
+ select BR2_PACKAGE_PYTHON_SQLITE
+ 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_PASSWORD
+ string "admin panel password"
+ default web2py
+ help
+ Set the admin panel password.
+
+endif
diff --git a/package/python-web2py/S51web2py b/package/python-web2py/S51web2py
new file mode 100644
index 000000000..1da9ef4fd
--- /dev/null
+++ b/package/python-web2py/S51web2py
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+case "$1" in
+ start)
+ echo -n "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)
+ echo -n "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
diff --git a/package/python-web2py/python-web2py.mk b/package/python-web2py/python-web2py.mk
new file mode 100644
index 000000000..641d7ef9e
--- /dev/null
+++ b/package/python-web2py/python-web2py.mk
@@ -0,0 +1,39 @@
+################################################################################
+#
+# python-web2py
+#
+################################################################################
+
+PYTHON_WEB2PY_VERSION = R-2.10.3
+PYTHON_WEB2PY_SITE = $(call github,web2py,web2py,$(PYTHON_WEB2PY_VERSION))
+PYTHON_WEB2PY_LICENSE = LGPLv3
+PYTHON_WEB2PY_LICENSE_FILES = LICENSE
+PYTHON_WEB2PY_DEPENDENCIES = python python-pydal host-python-pydal
+
+define PYTHON_WEB2PY_INSTALL_TARGET_CMDS
+ $(HOST_DIR)/usr/bin/python2 -c 'import os; \
+ os.chdir("$(@D)"); \
+ from gluon.main import save_password; \
+ save_password($(BR2_PACKAGE_PYTHON_WEB2PY_PASSWORD),8000)'
+ mkdir -p $(TARGET_DIR)/var/www/web2py
+ cp -dpfr $(@D)/* $(TARGET_DIR)/var/www/web2py
+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
+
+define PYTHON_WEB2PY_PERMISSIONS
+ /var/www/web2py r 750 www-data www-data - - - - -
+endef
+
+$(eval $(generic-package))
diff --git a/package/python-web2py/web2py.service b/package/python-web2py/web2py.service
new file mode 100644
index 000000000..0274bd8c5
--- /dev/null
+++ b/package/python-web2py/web2py.service
@@ -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