All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 0/2]  Web2py and pydal new packages
@ 2015-04-13 13:57 Angelo Compagnucci
  2015-04-13 13:57 ` [Buildroot] [PATCH v2 1/2] package/python-pydal: new package Angelo Compagnucci
  2015-04-13 13:57 ` [Buildroot] [PATCH v2 2/2] package/python-web2py: " Angelo Compagnucci
  0 siblings, 2 replies; 12+ messages in thread
From: Angelo Compagnucci @ 2015-04-13 13:57 UTC (permalink / raw)
  To: buildroot

This patch adds web2py python web application framework and pydal,
it's database abstraction layer.
This is the first package to use the new recursive makedevs syntax,
indeed it runs as www-data non privileged user.


Angelo Compagnucci (2):
  package/python-pydal: new package
  package/python-web2py: new package

 package/Config.in                      |  2 ++
 package/python-pydal/Config.in         |  2 ++
 package/python-pydal/python-pydal.mk   | 13 ++++++++++
 package/python-web2py/Config.in        | 26 +++++++++++++++++++
 package/python-web2py/S51web2py        | 25 ++++++++++++++++++
 package/python-web2py/python-web2py.mk | 46 ++++++++++++++++++++++++++++++++++
 package/python-web2py/web2py.service   | 11 ++++++++
 7 files changed, 125 insertions(+)
 create mode 100644 package/python-pydal/Config.in
 create mode 100644 package/python-pydal/python-pydal.mk
 create mode 100644 package/python-web2py/Config.in
 create mode 100644 package/python-web2py/S51web2py
 create mode 100644 package/python-web2py/python-web2py.mk
 create mode 100644 package/python-web2py/web2py.service

-- 
1.9.1

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v2 1/2] package/python-pydal: new package
  2015-04-13 13:57 [Buildroot] [PATCH v2 0/2] Web2py and pydal new packages Angelo Compagnucci
@ 2015-04-13 13:57 ` Angelo Compagnucci
  2015-04-13 14:17   ` Thomas Petazzoni
  2015-04-13 13:57 ` [Buildroot] [PATCH v2 2/2] package/python-web2py: " Angelo Compagnucci
  1 sibling, 1 reply; 12+ messages in thread
From: Angelo Compagnucci @ 2015-04-13 13:57 UTC (permalink / raw)
  To: buildroot

This package adds the python-pydal dependency for web2py.
This is a submodule and used by web2py only.

Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
 package/Config.in                    |  1 +
 package/python-pydal/Config.in       |  2 ++
 package/python-pydal/python-pydal.mk | 13 +++++++++++++
 3 files changed, 16 insertions(+)
 create mode 100644 package/python-pydal/Config.in
 create mode 100644 package/python-pydal/python-pydal.mk

diff --git a/package/Config.in b/package/Config.in
index c27fc20..839b80a 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -592,6 +592,7 @@ menu "external python modules"
 	source "package/python-psutil/Config.in"
 	source "package/python-pyasn/Config.in"
 	source "package/python-pycrypto/Config.in"
+	source "package/python-pydal/Config.in"
 	source "package/python-pyftpdlib/Config.in"
 	source "package/python-pygame/Config.in"
 	source "package/python-pyinotify/Config.in"
diff --git a/package/python-pydal/Config.in b/package/python-pydal/Config.in
new file mode 100644
index 0000000..eda2f77
--- /dev/null
+++ b/package/python-pydal/Config.in
@@ -0,0 +1,2 @@
+config BR2_PACKAGE_PYTHON_PYDAL
+	bool
diff --git a/package/python-pydal/python-pydal.mk b/package/python-pydal/python-pydal.mk
new file mode 100644
index 0000000..a88bf8b
--- /dev/null
+++ b/package/python-pydal/python-pydal.mk
@@ -0,0 +1,13 @@
+################################################################################
+#
+# python-pydal
+#
+################################################################################
+
+PYTHON_PYDAL_VERSION = v15.03
+PYTHON_PYDAL_SITE = https://github.com/web2py/pydal.git
+PYTHON_PYDAL_SITE_METHOD = git
+PYTHON_PYDAL_LICENSE = BSDv3
+PYTHON_PYDAL_LICENSE_FILES = LICENSE
+
+$(eval $(generic-package))
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v2 2/2] package/python-web2py: new package
  2015-04-13 13:57 [Buildroot] [PATCH v2 0/2] Web2py and pydal new packages Angelo Compagnucci
  2015-04-13 13:57 ` [Buildroot] [PATCH v2 1/2] package/python-pydal: new package Angelo Compagnucci
@ 2015-04-13 13:57 ` Angelo Compagnucci
  2015-04-13 14:21   ` Thomas Petazzoni
  1 sibling, 1 reply; 12+ messages in thread
From: Angelo Compagnucci @ 2015-04-13 13:57 UTC (permalink / raw)
  To: buildroot

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.
This patch is a big rework using the new introduced feature of recursive
permission to run web2py application server as non root user.

Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
Changelog:

v1 -> v2:
 * Adding python2 dependency only (suggested by Yegor)

 package/Config.in                      |  1 +
 package/python-web2py/Config.in        | 26 +++++++++++++++++++
 package/python-web2py/S51web2py        | 25 ++++++++++++++++++
 package/python-web2py/python-web2py.mk | 46 ++++++++++++++++++++++++++++++++++
 package/python-web2py/web2py.service   | 11 ++++++++
 5 files changed, 109 insertions(+)
 create mode 100644 package/python-web2py/Config.in
 create mode 100644 package/python-web2py/S51web2py
 create mode 100644 package/python-web2py/python-web2py.mk
 create mode 100644 package/python-web2py/web2py.service

diff --git a/package/Config.in b/package/Config.in
index 839b80a..fd4296c 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -618,6 +618,7 @@ menu "external python modules"
 	source "package/python-twisted/Config.in"
 	source "package/python-urwid/Config.in"
 	source "package/python-versiontools/Config.in"
+	source "package/python-web2py/Config.in"
 	source "package/python-webpy/Config.in"
 	source "package/python-werkzeug/Config.in"
 	source "package/python-ws4py/Config.in"
diff --git a/package/python-web2py/Config.in b/package/python-web2py/Config.in
new file mode 100644
index 0000000..c376856
--- /dev/null
+++ b/package/python-web2py/Config.in
@@ -0,0 +1,26 @@
+config BR2_PACKAGE_PYTHON_WEB2PY
+	bool "python-web2py"
+	depends on BR2_PACKAGE_PYTHON
+	select BR2_PACKAGE_PYTHON_PYDAL
+	select BR2_PACKAGE_ZLIB
+	select BR2_PACKAGE_PYTHON_ZLIB
+	select BR2_PACKAGE_EXPAT
+	select BR2_PACKAGE_PYTHON_PYEXPAT
+	select BR2_PACKAGE_SQLITE
+	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 0000000..55a2ad8
--- /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 /usr/share/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 0000000..828b662
--- /dev/null
+++ b/package/python-web2py/python-web2py.mk
@@ -0,0 +1,46 @@
+################################################################################
+#
+# python-web2py
+#
+################################################################################
+
+PYTHON_WEB2PY_VERSION = R-2.10.3
+PYTHON_WEB2PY_SITE = https://github.com/web2py/web2py.git
+PYTHON_WEB2PY_SITE_METHOD = git
+PYTHON_WEB2PY_LICENSE = LGPLv3
+PYTHON_WEB2PY_LICENSE_FILES = LICENSE
+PYTHON_WEB2PY_DEPENDENCIES = python sqlite
+
+define PYTHON_WEB2PY_PYDAL_COPY
+	cp -rf $(PYTHON_PYDAL_SRCDIR)/*  $(@D)/gluon/packages/dal/
+endef
+
+PYTHON_WEB2PY_POST_EXTRACT_HOOKS += PYTHON_WEB2PY_PYDAL_COPY
+
+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)/usr/share/web2py
+	cp -dpfr $(@D)/* $(TARGET_DIR)/usr/share/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)/etc/systemd/system/web2py.service
+	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+	ln -fs ../web2py.service \
+		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/web2py.service
+endef
+
+define PYTHON_WEB2PY_PERMISSIONS
+	/usr/share/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 0000000..87d0416
--- /dev/null
+++ b/package/python-web2py/web2py.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Web2py daemon
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=/usr/share/web2py/web2py.py --nogui -a '<recycle>' -i 0.0.0.0 -p 8000
+User=www-data
+
+[Install]
+WantedBy=multi-user.target
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v2 1/2] package/python-pydal: new package
  2015-04-13 13:57 ` [Buildroot] [PATCH v2 1/2] package/python-pydal: new package Angelo Compagnucci
@ 2015-04-13 14:17   ` Thomas Petazzoni
  2015-04-13 14:34     ` Angelo Compagnucci
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2015-04-13 14:17 UTC (permalink / raw)
  To: buildroot

Dear Angelo Compagnucci,

On Mon, 13 Apr 2015 15:57:26 +0200, Angelo Compagnucci wrote:

> diff --git a/package/python-pydal/Config.in b/package/python-pydal/Config.in
> new file mode 100644
> index 0000000..eda2f77
> --- /dev/null
> +++ b/package/python-pydal/Config.in
> @@ -0,0 +1,2 @@
> +config BR2_PACKAGE_PYTHON_PYDAL
> +	bool

I understand that the source code for this package is copied into the
web2py code, so that's why it's a prompt-less package. Is it the only
way of doing things?

> diff --git a/package/python-pydal/python-pydal.mk b/package/python-pydal/python-pydal.mk
> new file mode 100644
> index 0000000..a88bf8b
> --- /dev/null
> +++ b/package/python-pydal/python-pydal.mk
> @@ -0,0 +1,13 @@
> +################################################################################
> +#
> +# python-pydal
> +#
> +################################################################################
> +
> +PYTHON_PYDAL_VERSION = v15.03
> +PYTHON_PYDAL_SITE = https://github.com/web2py/pydal.git
> +PYTHON_PYDAL_SITE_METHOD = git

github function?

> +PYTHON_PYDAL_LICENSE = BSDv3

BSDv3 does not exist. You're confusing GPLv3 and BSD-3c.

> +PYTHON_PYDAL_LICENSE_FILES = LICENSE
> +
> +$(eval $(generic-package))

A comment above this to explain why we have this generic-package that
doesn't do anything.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v2 2/2] package/python-web2py: new package
  2015-04-13 13:57 ` [Buildroot] [PATCH v2 2/2] package/python-web2py: " Angelo Compagnucci
@ 2015-04-13 14:21   ` Thomas Petazzoni
  2015-04-13 14:43     ` Angelo Compagnucci
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2015-04-13 14:21 UTC (permalink / raw)
  To: buildroot

Dear Angelo Compagnucci,

On Mon, 13 Apr 2015 15:57:27 +0200, Angelo Compagnucci wrote:

> diff --git a/package/python-web2py/Config.in b/package/python-web2py/Config.in
> new file mode 100644
> index 0000000..c376856
> --- /dev/null
> +++ b/package/python-web2py/Config.in
> @@ -0,0 +1,26 @@
> +config BR2_PACKAGE_PYTHON_WEB2PY
> +	bool "python-web2py"
> +	depends on BR2_PACKAGE_PYTHON
> +	select BR2_PACKAGE_PYTHON_PYDAL
> +	select BR2_PACKAGE_ZLIB

Not needed.

> +	select BR2_PACKAGE_PYTHON_ZLIB
> +	select BR2_PACKAGE_EXPAT

Ditto.

> +	select BR2_PACKAGE_PYTHON_PYEXPAT
> +	select BR2_PACKAGE_SQLITE

Ditto.

Those are already selected by BR2_PACKAGE_PYTHON_{ZLIB,PYEXPAT,SQLITE}
respectively.

> diff --git a/package/python-web2py/python-web2py.mk b/package/python-web2py/python-web2py.mk
> new file mode 100644
> index 0000000..828b662
> --- /dev/null
> +++ b/package/python-web2py/python-web2py.mk
> @@ -0,0 +1,46 @@
> +################################################################################
> +#
> +# python-web2py
> +#
> +################################################################################
> +
> +PYTHON_WEB2PY_VERSION = R-2.10.3
> +PYTHON_WEB2PY_SITE = https://github.com/web2py/web2py.git
> +PYTHON_WEB2PY_SITE_METHOD = git

github function?

> +PYTHON_WEB2PY_LICENSE = LGPLv3
> +PYTHON_WEB2PY_LICENSE_FILES = LICENSE
> +PYTHON_WEB2PY_DEPENDENCIES = python sqlite

It really depends on sqlite itself? Or only the Python sqlite module?

> +define PYTHON_WEB2PY_PYDAL_COPY
> +	cp -rf $(PYTHON_PYDAL_SRCDIR)/*  $(@D)/gluon/packages/dal/
> +endef
> +
> +PYTHON_WEB2PY_POST_EXTRACT_HOOKS += PYTHON_WEB2PY_PYDAL_COPY
> +
> +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)/usr/share/web2py
> +	cp -dpfr $(@D)/* $(TARGET_DIR)/usr/share/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)/etc/systemd/system/web2py.service

I think we changed the installation of .service files to /usr/lib. See
commit af17811662595ad1db0a992a3a7446c79d40d578 for example.

> +	mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
> +	ln -fs ../web2py.service \
> +		$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/web2py.service
> +endef
> +
> +define PYTHON_WEB2PY_PERMISSIONS
> +	/usr/share/web2py  r  750  www-data  www-data  -  -  -  -  -
> +endef
> +
> +$(eval $(generic-package))

This package has a setup.py. Any reason why you're not using it,
together with the python-package infrastructure?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v2 1/2] package/python-pydal: new package
  2015-04-13 14:17   ` Thomas Petazzoni
@ 2015-04-13 14:34     ` Angelo Compagnucci
  2015-04-13 21:04       ` Thomas Petazzoni
  0 siblings, 1 reply; 12+ messages in thread
From: Angelo Compagnucci @ 2015-04-13 14:34 UTC (permalink / raw)
  To: buildroot

Dear Thomas Petazzoni,

2015-04-13 16:17 GMT+02:00 Thomas Petazzoni
<thomas.petazzoni@free-electrons.com>:
> Dear Angelo Compagnucci,
>
> On Mon, 13 Apr 2015 15:57:26 +0200, Angelo Compagnucci wrote:
>
>> diff --git a/package/python-pydal/Config.in b/package/python-pydal/Config.in
>> new file mode 100644
>> index 0000000..eda2f77
>> --- /dev/null
>> +++ b/package/python-pydal/Config.in
>> @@ -0,0 +1,2 @@
>> +config BR2_PACKAGE_PYTHON_PYDAL
>> +     bool
>
> I understand that the source code for this package is copied into the
> web2py code, so that's why it's a prompt-less package. Is it the only
> way of doing things?

No. Unfortunately buildroot doesn't support git submodules: the
download helper makes a bare clone and zip the results without git
informations, so it's not possible to do a submodule init in a
POST_EXTRACT action.

The only way is to add a dummy package for the submodule and copy the
downloaded content to appropriate folders. I was inspired by other
packages (ex sunxi-mali-prop) that use the same exact method.

>> diff --git a/package/python-pydal/python-pydal.mk b/package/python-pydal/python-pydal.mk
>> new file mode 100644
>> index 0000000..a88bf8b
>> --- /dev/null
>> +++ b/package/python-pydal/python-pydal.mk
>> @@ -0,0 +1,13 @@
>> +################################################################################
>> +#
>> +# python-pydal
>> +#
>> +################################################################################
>> +
>> +PYTHON_PYDAL_VERSION = v15.03
>> +PYTHON_PYDAL_SITE = https://github.com/web2py/pydal.git
>> +PYTHON_PYDAL_SITE_METHOD = git
>
> github function?

Using this method I can use alternatively both commit id or tag.
Usually web2py uses a tagged pydal version as a submodule, sometimes
not.

>> +PYTHON_PYDAL_LICENSE = BSDv3
>
> BSDv3 does not exist. You're confusing GPLv3 and BSD-3c.

Doh! Probably also the original author is wrong:

"License
pyDAL is released under the BSDv3 License.
For further details, please check the LICENSE file."

I will submit a PR to Giovanni Barillari!

>> +PYTHON_PYDAL_LICENSE_FILES = LICENSE
>> +
>> +$(eval $(generic-package))
>
> A comment above this to explain why we have this generic-package that
> doesn't do anything.

Ok!

>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v2 2/2] package/python-web2py: new package
  2015-04-13 14:21   ` Thomas Petazzoni
@ 2015-04-13 14:43     ` Angelo Compagnucci
  2015-04-13 21:10       ` Thomas Petazzoni
  0 siblings, 1 reply; 12+ messages in thread
From: Angelo Compagnucci @ 2015-04-13 14:43 UTC (permalink / raw)
  To: buildroot

Dear Thomas Petazzoni,

2015-04-13 16:21 GMT+02:00 Thomas Petazzoni
<thomas.petazzoni@free-electrons.com>:
> Dear Angelo Compagnucci,
>
> On Mon, 13 Apr 2015 15:57:27 +0200, Angelo Compagnucci wrote:
>
>> diff --git a/package/python-web2py/Config.in b/package/python-web2py/Config.in
>> new file mode 100644
>> index 0000000..c376856
>> --- /dev/null
>> +++ b/package/python-web2py/Config.in
>> @@ -0,0 +1,26 @@
>> +config BR2_PACKAGE_PYTHON_WEB2PY
>> +     bool "python-web2py"
>> +     depends on BR2_PACKAGE_PYTHON
>> +     select BR2_PACKAGE_PYTHON_PYDAL
>> +     select BR2_PACKAGE_ZLIB
>
> Not needed.

Ok!

>
>> +     select BR2_PACKAGE_PYTHON_ZLIB
>> +     select BR2_PACKAGE_EXPAT
>
> Ditto.

Ok!

>
>> +     select BR2_PACKAGE_PYTHON_PYEXPAT
>> +     select BR2_PACKAGE_SQLITE
>
> Ditto.

Ok!

>
> Those are already selected by BR2_PACKAGE_PYTHON_{ZLIB,PYEXPAT,SQLITE}
> respectively.
>
>> diff --git a/package/python-web2py/python-web2py.mk b/package/python-web2py/python-web2py.mk
>> new file mode 100644
>> index 0000000..828b662
>> --- /dev/null
>> +++ b/package/python-web2py/python-web2py.mk
>> @@ -0,0 +1,46 @@
>> +################################################################################
>> +#
>> +# python-web2py
>> +#
>> +################################################################################
>> +
>> +PYTHON_WEB2PY_VERSION = R-2.10.3
>> +PYTHON_WEB2PY_SITE = https://github.com/web2py/web2py.git
>> +PYTHON_WEB2PY_SITE_METHOD = git
>
> github function?

Ok, I will use it.

>> +PYTHON_WEB2PY_LICENSE = LGPLv3
>> +PYTHON_WEB2PY_LICENSE_FILES = LICENSE
>> +PYTHON_WEB2PY_DEPENDENCIES = python sqlite
>
> It really depends on sqlite itself? Or only the Python sqlite module?

It depends on python sqlite, I will look into setting the proper
dependencies. Probably only python would suffice, cause python-sqlite
is always compiled with python cause it's selected.

>> +define PYTHON_WEB2PY_PYDAL_COPY
>> +     cp -rf $(PYTHON_PYDAL_SRCDIR)/*  $(@D)/gluon/packages/dal/
>> +endef
>> +
>> +PYTHON_WEB2PY_POST_EXTRACT_HOOKS += PYTHON_WEB2PY_PYDAL_COPY
>> +
>> +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)/usr/share/web2py
>> +     cp -dpfr $(@D)/* $(TARGET_DIR)/usr/share/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)/etc/systemd/system/web2py.service
>
> I think we changed the installation of .service files to /usr/lib. See
> commit af17811662595ad1db0a992a3a7446c79d40d578 for example.

Ouch! I will fix it!

>> +     mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
>> +     ln -fs ../web2py.service \
>> +             $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/web2py.service
>> +endef
>> +
>> +define PYTHON_WEB2PY_PERMISSIONS
>> +     /usr/share/web2py  r  750  www-data  www-data  -  -  -  -  -
>> +endef
>> +
>> +$(eval $(generic-package))
>
> This package has a setup.py. Any reason why you're not using it,
> together with the python-package infrastructure?

I can try! Honestly, I've not explored the option cause web2py is self
contained and it doesn't require installation. It uses a writable
directory for served applications, so suing a custom directory un
/usr/share with writing permission setted to www-data seemed the most
sensible choice.

Thank you!

>
> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v2 1/2] package/python-pydal: new package
  2015-04-13 14:34     ` Angelo Compagnucci
@ 2015-04-13 21:04       ` Thomas Petazzoni
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2015-04-13 21:04 UTC (permalink / raw)
  To: buildroot

Dear Angelo Compagnucci,

On Mon, 13 Apr 2015 16:34:44 +0200, Angelo Compagnucci wrote:

> No. Unfortunately buildroot doesn't support git submodules: the
> download helper makes a bare clone and zip the results without git
> informations, so it's not possible to do a submodule init in a
> POST_EXTRACT action.
> 
> The only way is to add a dummy package for the submodule and copy the
> downloaded content to appropriate folders. I was inspired by other
> packages (ex sunxi-mali-prop) that use the same exact method.

No, that's not the only way. Just package python-pydal as a normal
Python module, that can be selected independently from python-web2py.
Ignore completely that it is a submodule of python-web2py, because we
don't care: python-web2py simply does "import pydal", so as long as
python-pydal has been installed, everything will be alright.

> >> +PYTHON_PYDAL_VERSION = v15.03
> >> +PYTHON_PYDAL_SITE = https://github.com/web2py/pydal.git
> >> +PYTHON_PYDAL_SITE_METHOD = git
> >
> > github function?
> 
> Using this method I can use alternatively both commit id or tag.

I don't get it, with the github function you can define a commit id or
a tag.

> >> +PYTHON_PYDAL_LICENSE = BSDv3
> >
> > BSDv3 does not exist. You're confusing GPLv3 and BSD-3c.
> 
> Doh! Probably also the original author is wrong:
> 
> "License
> pyDAL is released under the BSDv3 License.
> For further details, please check the LICENSE file."
> 
> I will submit a PR to Giovanni Barillari!

Yes, the author is wrong, I looked at the license, and it's a BSD-3c.

> >> +PYTHON_PYDAL_LICENSE_FILES = LICENSE
> >> +
> >> +$(eval $(generic-package))
> >
> > A comment above this to explain why we have this generic-package that
> > doesn't do anything.
> 
> Ok!

Well, in fact, change it to a Python package that does something:

Something along the lines of:

diff --git a/package/python-pydal/Config.in b/package/python-pydal/Config.in
index eda2f77..303762d 100644
--- a/package/python-pydal/Config.in
+++ b/package/python-pydal/Config.in
@@ -1,2 +1,2 @@
 config BR2_PACKAGE_PYTHON_PYDAL
-       bool
+       bool "python-pydal"
diff --git a/package/python-pydal/python-pydal.mk b/package/python-pydal/python-pydal.mk
index a88bf8b..25eaf56 100644
--- a/package/python-pydal/python-pydal.mk
+++ b/package/python-pydal/python-pydal.mk
@@ -5,9 +5,9 @@
 ################################################################################
 
 PYTHON_PYDAL_VERSION = v15.03
-PYTHON_PYDAL_SITE = https://github.com/web2py/pydal.git
-PYTHON_PYDAL_SITE_METHOD = git
-PYTHON_PYDAL_LICENSE = BSDv3
+PYTHON_PYDAL_SITE = $(call github,web2py,pydal,$(PYTHON_PYDAL_VERSION))
+PYTHON_PYDAL_LICENSE = BSD-3c
 PYTHON_PYDAL_LICENSE_FILES = LICENSE
+PYTHON_PYDAL_SETUP_TYPE = setuptools
 
-$(eval $(generic-package))
+$(eval $(python-package))

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v2 2/2] package/python-web2py: new package
  2015-04-13 14:43     ` Angelo Compagnucci
@ 2015-04-13 21:10       ` Thomas Petazzoni
  2015-04-14  8:46         ` Angelo Compagnucci
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2015-04-13 21:10 UTC (permalink / raw)
  To: buildroot

Dear Angelo Compagnucci,

On Mon, 13 Apr 2015 16:43:08 +0200, Angelo Compagnucci wrote:

> dependencies. Probably only python would suffice, cause python-sqlite
> is always compiled with python cause it's selected.

There is no such thing as python-sqlite. There is only python, which
may or may not have the sqlite functionality. In such cases, what you
have to do is:

 1/ At the Config.in level, make sure you select the relevant options,
    i.e BR2_PACKAGE_PYTHON_SQLITE (or BR2_PACKAGE_PYTHON3_SQLITE if you
    want to support Python 3)

 2/ At the .mk level, depend on the appropriate package, in this case
    'python' (or 'python3')

> > This package has a setup.py. Any reason why you're not using it,
> > together with the python-package infrastructure?
> 
> I can try! Honestly, I've not explored the option cause web2py is self
> contained and it doesn't require installation. It uses a writable
> directory for served applications, so suing a custom directory un
> /usr/share with writing permission setted to www-data seemed the most
> sensible choice.

Installing with python-package seems to work, but it does not install
the web2py.py program itself, so it should be done separately. Also, it
is a bit weird that the whole thing has to be part of a www-data
writable directory, no?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v2 2/2] package/python-web2py: new package
  2015-04-13 21:10       ` Thomas Petazzoni
@ 2015-04-14  8:46         ` Angelo Compagnucci
  2015-04-14  8:56           ` Thomas Petazzoni
  0 siblings, 1 reply; 12+ messages in thread
From: Angelo Compagnucci @ 2015-04-14  8:46 UTC (permalink / raw)
  To: buildroot

Dear Thomas Petazzoni,

2015-04-13 23:10 GMT+02:00 Thomas Petazzoni
<thomas.petazzoni@free-electrons.com>:
> Dear Angelo Compagnucci,
>
> On Mon, 13 Apr 2015 16:43:08 +0200, Angelo Compagnucci wrote:
>
>> dependencies. Probably only python would suffice, cause python-sqlite
>> is always compiled with python cause it's selected.
>
> There is no such thing as python-sqlite. There is only python, which
> may or may not have the sqlite functionality. In such cases, what you
> have to do is:
>
>  1/ At the Config.in level, make sure you select the relevant options,
>     i.e BR2_PACKAGE_PYTHON_SQLITE (or BR2_PACKAGE_PYTHON3_SQLITE if you
>     want to support Python 3)
>
>  2/ At the .mk level, depend on the appropriate package, in this case
>     'python' (or 'python3')

Ok!

>> > This package has a setup.py. Any reason why you're not using it,
>> > together with the python-package infrastructure?
>>
>> I can try! Honestly, I've not explored the option cause web2py is self
>> contained and it doesn't require installation. It uses a writable
>> directory for served applications, so suing a custom directory un
>> /usr/share with writing permission setted to www-data seemed the most
>> sensible choice.
>
> Installing with python-package seems to work, but it does not install
> the web2py.py program itself, so it should be done separately.

Yes, I tried and it's practically useless.

> Also, it
> is a bit weird that the whole thing has to be part of a www-data
> writable directory, no?

Honestly, more or less all the application framework I saw in the past
runs in a www-data owned directory, I can think of joomla, redmine an
many others I poked with.
Probably do you want a more finer grain in the permission table, like
giving writable permissions only to the directories that really need
it, I can try!

Thank you!

>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v2 2/2] package/python-web2py: new package
  2015-04-14  8:46         ` Angelo Compagnucci
@ 2015-04-14  8:56           ` Thomas Petazzoni
  2015-04-14 10:31             ` Angelo Compagnucci
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2015-04-14  8:56 UTC (permalink / raw)
  To: buildroot

Dear Angelo Compagnucci,

On Tue, 14 Apr 2015 10:46:21 +0200, Angelo Compagnucci wrote:

> >> I can try! Honestly, I've not explored the option cause web2py is self
> >> contained and it doesn't require installation. It uses a writable
> >> directory for served applications, so suing a custom directory un
> >> /usr/share with writing permission setted to www-data seemed the most
> >> sensible choice.
> >
> > Installing with python-package seems to work, but it does not install
> > the web2py.py program itself, so it should be done separately.
> 
> Yes, I tried and it's practically useless.

Well, the setup.py can be fixed to also install web2py.py, or the
web2py.py can be installed by Buildroot separately, using a post
install hook.

> Honestly, more or less all the application framework I saw in the past
> runs in a www-data owned directory, I can think of joomla, redmine an
> many others I poked with.
> Probably do you want a more finer grain in the permission table, like
> giving writable permissions only to the directories that really need
> it, I can try!

Well, if the Python modules of web2py get installed by the setup.py
script, they are installed in /usr/lib/python<version>/site-packages/.
And clearly, we do not want to directory to be owned by www-data.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v2 2/2] package/python-web2py: new package
  2015-04-14  8:56           ` Thomas Petazzoni
@ 2015-04-14 10:31             ` Angelo Compagnucci
  0 siblings, 0 replies; 12+ messages in thread
From: Angelo Compagnucci @ 2015-04-14 10:31 UTC (permalink / raw)
  To: buildroot

Dear Thomas Petazzoni,

2015-04-14 10:56 GMT+02:00 Thomas Petazzoni
<thomas.petazzoni@free-electrons.com>:
> Dear Angelo Compagnucci,
>
> On Tue, 14 Apr 2015 10:46:21 +0200, Angelo Compagnucci wrote:
>
>> >> I can try! Honestly, I've not explored the option cause web2py is self
>> >> contained and it doesn't require installation. It uses a writable
>> >> directory for served applications, so suing a custom directory un
>> >> /usr/share with writing permission setted to www-data seemed the most
>> >> sensible choice.
>> >
>> > Installing with python-package seems to work, but it does not install
>> > the web2py.py program itself, so it should be done separately.
>>
>> Yes, I tried and it's practically useless.
>
> Well, the setup.py can be fixed to also install web2py.py, or the
> web2py.py can be installed by Buildroot separately, using a post
> install hook.

honestly, i don't think it's really necessary to use python distutils
infrastructure to install web2py, it's not even considered in the
official documentation. Probably because the installation is ususally
don copying web2py in a folder reacheable by apache and configuring it
for use with wsgi, or via the internal webserver.
The official setup-web2py-ubuntu.sh distributed with the application
makes a /home/www-data directory and adds a apache/wsgi virtualhost.

>> Honestly, more or less all the application framework I saw in the past
>> runs in a www-data owned directory, I can think of joomla, redmine an
>> many others I poked with.
>> Probably do you want a more finer grain in the permission table, like
>> giving writable permissions only to the directories that really need
>> it, I can try!
>
> Well, if the Python modules of web2py get installed by the setup.py
> script, they are installed in /usr/lib/python<version>/site-packages/.
> And clearly, we do not want to directory to be owned by www-data.

Yes, true, cause web2py is usually installed as an apache served
application in an apache www-data owned directory.
For the of simplicity, I choose to adopt the same method, but without
using an apache virtualhost way too overkill, but use the internal
webserver.

I'm preparing a new patch in which web2py will be installed in the
more suited /var/www/ directory.

Sincerely, Angelo

>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-04-14 10:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-13 13:57 [Buildroot] [PATCH v2 0/2] Web2py and pydal new packages Angelo Compagnucci
2015-04-13 13:57 ` [Buildroot] [PATCH v2 1/2] package/python-pydal: new package Angelo Compagnucci
2015-04-13 14:17   ` Thomas Petazzoni
2015-04-13 14:34     ` Angelo Compagnucci
2015-04-13 21:04       ` Thomas Petazzoni
2015-04-13 13:57 ` [Buildroot] [PATCH v2 2/2] package/python-web2py: " Angelo Compagnucci
2015-04-13 14:21   ` Thomas Petazzoni
2015-04-13 14:43     ` Angelo Compagnucci
2015-04-13 21:10       ` Thomas Petazzoni
2015-04-14  8:46         ` Angelo Compagnucci
2015-04-14  8:56           ` Thomas Petazzoni
2015-04-14 10:31             ` Angelo Compagnucci

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.