public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 0/3] [RFC] www-nginx/ category and nginx-module.eclass
@ 2021-02-14 16:20 jonas.licht
  2021-02-14 16:20 ` [gentoo-dev] [PATCH 1/3] profiles/categories: add www-nginx jonas.licht
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: jonas.licht @ 2021-02-14 16:20 UTC (permalink / raw)
  To: gentoo-dev; +Cc: Jonas Licht

From: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>

Hi,

as my personal need and which I read from Bugs #573710 and #648334 is to add support for external 3rd party modules to nginx.
Currently all modules a included in the www-server/nginx ebuild and are build in into the nginx binary.
Since around 5 years ago nginx added support for dynamic modules.
These modules are build with the nginx build system and generates a shared object which can be loaded on runtime.
The build config file of the module needs support for that too.
To build a module as a dynamic module you need the nginx source code.
On the configure step you add --add-dynamic-module=<path-to-module-src> to the configure command.
In the src_compile step you can use the Maketarget modules to only build the module.

I have created an eclass which uses the nginx source code and the source code of the module.
To use the same configure options as the running nginx, I obtain them by parsing nginx -V.
After compiling and linking the eclass reads the config file of the module to get the correct so file name for installing.
I've chossen /usr/$(get_libdir)/nginx/modules as installation path.
If you now want to load the kaltura/nginx-vod-module, you simple add load_module lib64/nginx/modules/ngx_http_vod_module.so; to your nginx.conf file.
As the module must be build for a specific version of nginx, my idea is to
set the concatenation of the versions from nginx and the module as version of the
module ebuild. I can simply parse that with ver_cut.

The patches contains a new category www-nginx, to be the place for nginx module ebuilds, the nginx-module eclass and a sample consumer.
I've also opened PR #16053 on Github.

Best regards,
Jonas

Jonas Licht (3):
  profiles/categories: add www-nginx
  Add nginx-module.eclass
  www-nginx/nginx-vod-module: add new package

 eclass/nginx-module.eclass                    | 73 +++++++++++++++++++
 profiles/categories                           |  1 +
 www-nginx/metadata.xml                        |  7 ++
 www-nginx/nginx-vod-module/Manifest           |  2 +
 www-nginx/nginx-vod-module/metadata.xml       | 12 +++
 .../nginx-vod-module-1.18.0.1.25.ebuild       | 21 ++++++
 6 files changed, 116 insertions(+)
 create mode 100644 eclass/nginx-module.eclass
 create mode 100644 www-nginx/metadata.xml
 create mode 100644 www-nginx/nginx-vod-module/Manifest
 create mode 100644 www-nginx/nginx-vod-module/metadata.xml
 create mode 100644 www-nginx/nginx-vod-module/nginx-vod-module-1.18.0.1.25.ebuild

-- 
2.26.2



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

* [gentoo-dev] [PATCH 1/3] profiles/categories: add www-nginx
  2021-02-14 16:20 [gentoo-dev] [PATCH 0/3] [RFC] www-nginx/ category and nginx-module.eclass jonas.licht
@ 2021-02-14 16:20 ` jonas.licht
  2021-02-14 16:20 ` [gentoo-dev] [PATCH 2/3] Add nginx-module.eclass jonas.licht
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: jonas.licht @ 2021-02-14 16:20 UTC (permalink / raw)
  To: gentoo-dev; +Cc: Jonas Licht

From: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>

Signed-off-by: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>
---
 profiles/categories    | 1 +
 www-nginx/metadata.xml | 7 +++++++
 2 files changed, 8 insertions(+)
 create mode 100644 www-nginx/metadata.xml

diff --git a/profiles/categories b/profiles/categories
index 0ac1f2f33f3..fc9484d1235 100644
--- a/profiles/categories
+++ b/profiles/categories
@@ -152,6 +152,7 @@ www-apache
 www-apps
 www-client
 www-misc
+www-nginx
 www-plugins
 www-servers
 x11-apps
diff --git a/www-nginx/metadata.xml b/www-nginx/metadata.xml
new file mode 100644
index 00000000000..340ce767d0e
--- /dev/null
+++ b/www-nginx/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+	<longdescription lang="en">
+		The www-nginx category contains modules for the Nginx Webserver.
+	</longdescription>
+</catmetadata>
-- 
2.26.2



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

* [gentoo-dev] [PATCH 2/3] Add nginx-module.eclass
  2021-02-14 16:20 [gentoo-dev] [PATCH 0/3] [RFC] www-nginx/ category and nginx-module.eclass jonas.licht
  2021-02-14 16:20 ` [gentoo-dev] [PATCH 1/3] profiles/categories: add www-nginx jonas.licht
@ 2021-02-14 16:20 ` jonas.licht
  2021-02-14 17:56   ` Michał Górny
  2021-02-14 16:20 ` [gentoo-dev] [PATCH 3/3] www-nginx/nginx-vod-module: add new package jonas.licht
  2021-02-28 17:36 ` [gentoo-dev] [PATCH v2 0/3] Version 2 jonas.licht
  3 siblings, 1 reply; 11+ messages in thread
From: jonas.licht @ 2021-02-14 16:20 UTC (permalink / raw)
  To: gentoo-dev; +Cc: Jonas Licht

From: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>

Signed-off-by: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>
---
 eclass/nginx-module.eclass | 73 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 eclass/nginx-module.eclass

diff --git a/eclass/nginx-module.eclass b/eclass/nginx-module.eclass
new file mode 100644
index 00000000000..178982af285
--- /dev/null
+++ b/eclass/nginx-module.eclass
@@ -0,0 +1,73 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: nginx-module.eclass
+# @MAINTAINER:
+# Jonas Licht <jonas.licht@gmail.com>
+# @AUTHOR:
+# Jonas Licht <jonas.licht@gmail.com>
+# @BLURB: Provide a set of functions to build nginx dynamic modules.
+# @DESCRIPTION:
+# Eclass to make dynamic nginx modules.
+# As these modules are hardly build against one nginx version we use version cut to indicate the nginx version too.
+# The first three parts of the version must represent the nginx version,
+# the remaining part displays the module version.
+#
+# To build a nginx module the whole nginx source code is needed,
+# therfore we set the SRC_URI to the nginx source archive.
+# The module archive must be added with SRC_URI+=
+
+case ${EAPI:-0} in
+	7) ;;
+	*) die "This eclass only supports EAPI 7" ;;
+esac
+
+# @ECLASS-VARIABLE:	NGX_PV
+# @DESCRIPTION:
+# Uses version cut of the first three parts of the version to determine the proposed nginx version.
+# This version is used for SRC_URI, BDPEND and compiling process.
+NGX_PV=$(ver_cut 1-3)
+
+# @ECLASS-VARIABLE: MODULE_PV
+# @DESCRIPTION:
+# Uses version cut to get the version of the module.
+# Variable can uses for SRC_URI.
+MODULE_PV=$(ver_cut 4-)
+
+BDPEND="=www-servers/nginx-${NGX_PV}:="
+SRC_URI="https://nginx.org/download/nginx-${NGX_PV}.tar.gz
+	"
+
+S="${WORKDIR}/nginx-${NGX_PV}"
+
+EXPORT_FUNCTIONS src_configure src_compile src_install
+
+# @FUNCTION: nginx-module_src_configure
+# @USAGE: [additional-args]
+# @DESCRIPTION:
+# Parses the configure from the original nginx binary by exicution 'nginx -V' and adds the package as dynamic module.
+nginx-module_src_configure() {
+	if [ `grep -c "\.[[:space:]]auto/module" ${WORKDIR}/${PN}-${MODULE_PV}/config` -eq 0 ]; then
+		die "module uses old unsupported static config file syntax: https://www.nginx.com/resources/wiki/extending/converting/"
+	fi
+	#grep nginx configure from nginx -V add drop all other external modules
+	NGX_ORIGIN_CONFIGURE=`nginx -V 2>&1 | grep "configure arguments:" | cut -d: -f2 | sed "s/--add-module=\([^\s]\)*\s/ /"`
+	./configure ${NGX_ORIGIN_CONFIGURE} --add-dynamic-module="../${PN}-${MODULE_PV}" "$@" || die "configure failed"
+}
+
+# @FUNCTION: nginx-module_src_compile
+# @USAGE: [additional-args]
+# @DESCRIPTION:
+# Runs 'make modules' to only build our package module.
+nginx-module_src_compile() {
+	emake modules "$@"
+}
+
+# @FUNCTION: nginx-module_src_install
+# @DESCRIPTION:
+# Parses the module config file to get the so file name and install the shared object file to '/usr/$(get_libdir)/nginx/modules'
+nginx-module_src_install() {
+	NGX_MODULE_NAME=`grep ${WORKDIR}/${PN}-${MODULE_PV}/config -e "ngx_addon_name" | cut -d= -f2`
+	exeinto /usr/$(get_libdir)/nginx/modules
+	doexe ${S}/objs/${NGX_MODULE_NAME}.so
+}
-- 
2.26.2



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

* [gentoo-dev] [PATCH 3/3] www-nginx/nginx-vod-module: add new package
  2021-02-14 16:20 [gentoo-dev] [PATCH 0/3] [RFC] www-nginx/ category and nginx-module.eclass jonas.licht
  2021-02-14 16:20 ` [gentoo-dev] [PATCH 1/3] profiles/categories: add www-nginx jonas.licht
  2021-02-14 16:20 ` [gentoo-dev] [PATCH 2/3] Add nginx-module.eclass jonas.licht
@ 2021-02-14 16:20 ` jonas.licht
  2021-02-28 17:36 ` [gentoo-dev] [PATCH v2 0/3] Version 2 jonas.licht
  3 siblings, 0 replies; 11+ messages in thread
From: jonas.licht @ 2021-02-14 16:20 UTC (permalink / raw)
  To: gentoo-dev; +Cc: Jonas Licht

From: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>

Bug: https://bugs.gentoo.org/648334
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>
---
 www-nginx/nginx-vod-module/Manifest           |  2 ++
 www-nginx/nginx-vod-module/metadata.xml       | 12 +++++++++++
 .../nginx-vod-module-1.18.0.1.25.ebuild       | 21 +++++++++++++++++++
 3 files changed, 35 insertions(+)
 create mode 100644 www-nginx/nginx-vod-module/Manifest
 create mode 100644 www-nginx/nginx-vod-module/metadata.xml
 create mode 100644 www-nginx/nginx-vod-module/nginx-vod-module-1.18.0.1.25.ebuild

diff --git a/www-nginx/nginx-vod-module/Manifest b/www-nginx/nginx-vod-module/Manifest
new file mode 100644
index 00000000000..3e56021f4a4
--- /dev/null
+++ b/www-nginx/nginx-vod-module/Manifest
@@ -0,0 +1,2 @@
+DIST nginx-1.18.0.tar.gz 1039530 BLAKE2B a8962a6af96acb043ff0c3dc4ad5192083773c449950aff53b01f6f7c46a2a540eb061a43432acccd753fa71067b1451d75f440ba5526575b78608be9d40a50b SHA512 8c21eeb62ab6e32e436932500f700bd2fb99fd2d29e43c08a5bfed4714c189c29c7141db551fcd5d2437303b7439f71758f7407dfd3e801e704e45e7daa78ddb
+DIST nginx-vod-module-1.25.tar.gz 446830 BLAKE2B c1bf218c83ccee76fa4e6414b209585931a271577a8aa7b71ba9634ad82193ed9bbd06dd3cf780f085edde604f0e08e56d40b9e0658f5bd307735a1848b20d5a SHA512 11a97ffa28d6078aa57ad1821421928f6e2a05235a2f384cd2b498e7998f1025edc1ee163a900937ee251b49bd9381813e71248e67d537531b91a998b1610c56
diff --git a/www-nginx/nginx-vod-module/metadata.xml b/www-nginx/nginx-vod-module/metadata.xml
new file mode 100644
index 00000000000..fc0ed57d848
--- /dev/null
+++ b/www-nginx/nginx-vod-module/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+    <maintainer type="person">
+        <email>jonas.licht@gmail.com</email>
+        <name>Jonas Licht</name>
+    </maintainer>
+    <maintainer type="project">
+        <email>proxy-maint@gentoo.org</email>
+        <name>Proxy Maintainers</name>
+    </maintainer>
+</pkgmetadata>
diff --git a/www-nginx/nginx-vod-module/nginx-vod-module-1.18.0.1.25.ebuild b/www-nginx/nginx-vod-module/nginx-vod-module-1.18.0.1.25.ebuild
new file mode 100644
index 00000000000..093a60a2449
--- /dev/null
+++ b/www-nginx/nginx-vod-module/nginx-vod-module-1.18.0.1.25.ebuild
@@ -0,0 +1,21 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit nginx-module
+
+DESCRIPTION="NGINX-based MP4 Repackager"
+HOMEPAGE="https://github.com/kaltura/nginx-vod-module"
+SRC_URI+="https://github.com/kaltura/nginx-vod-module/archive/${MODULE_PV}.tar.gz -> ${PN}-${MODULE_PV}.tar.gz"
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="
+	dev-libs/libxml2
+	media-video/ffmpeg
+	sys-libs/zlib
+"
+RDEPEND="${DEPEND}"
-- 
2.26.2



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

* Re: [gentoo-dev] [PATCH 2/3] Add nginx-module.eclass
  2021-02-14 16:20 ` [gentoo-dev] [PATCH 2/3] Add nginx-module.eclass jonas.licht
@ 2021-02-14 17:56   ` Michał Górny
  0 siblings, 0 replies; 11+ messages in thread
From: Michał Górny @ 2021-02-14 17:56 UTC (permalink / raw)
  To: gentoo-dev; +Cc: Jonas Licht

On Sun, 2021-02-14 at 17:20 +0100, jonas.licht@fem.tu-ilmenau.de wrote:
> From: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>
> 
> Signed-off-by: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>
> ---
>  eclass/nginx-module.eclass | 73 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 73 insertions(+)
>  create mode 100644 eclass/nginx-module.eclass
> 
> diff --git a/eclass/nginx-module.eclass b/eclass/nginx-module.eclass
> new file mode 100644
> index 00000000000..178982af285
> --- /dev/null
> +++ b/eclass/nginx-module.eclass
> @@ -0,0 +1,73 @@
> +# Copyright 2021 Gentoo Authors
> +# Distributed under the terms of the GNU General Public License v2
> +
> +# @ECLASS: nginx-module.eclass
> +# @MAINTAINER:
> +# Jonas Licht <jonas.licht@gmail.com>
> +# @AUTHOR:
> +# Jonas Licht <jonas.licht@gmail.com>
> +# @BLURB: Provide a set of functions to build nginx dynamic modules.
> +# @DESCRIPTION:
> +# Eclass to make dynamic nginx modules.
> +# As these modules are hardly build against one nginx version we use version cut to indicate the nginx version too.
> +# The first three parts of the version must represent the nginx version,
> +# the remaining part displays the module version.
> +#
> +# To build a nginx module the whole nginx source code is needed,
> +# therfore we set the SRC_URI to the nginx source archive.
> +# The module archive must be added with SRC_URI+=
> +
> +case ${EAPI:-0} in
> +	7) ;;
> +	*) die "This eclass only supports EAPI 7" ;;
> +esac
> +
> +# @ECLASS-VARIABLE:	NGX_PV

It seems you've used tab instead of space here.

Also is there any reason to use 'NGX' instead of 'NGINX'?  This doesn't
seem to save much.

> +# @DESCRIPTION:
> +# Uses version cut of the first three parts of the version to determine the proposed nginx version.

'proposed nginx version' sounds weird.  Maybe 'nginx version providing
the module' or sth like that.

> +# This version is used for SRC_URI, BDPEND and compiling process.
> +NGX_PV=$(ver_cut 1-3)
> +
> +# @ECLASS-VARIABLE: MODULE_PV
> +# @DESCRIPTION:
> +# Uses version cut to get the version of the module.
> +# Variable can uses for SRC_URI.

This seems to entirely miss the point that it's used pretty much
everywhere.

> +MODULE_PV=$(ver_cut 4-)
> +
> +BDPEND="=www-servers/nginx-${NGX_PV}:="
> +SRC_URI="https://nginx.org/download/nginx-${NGX_PV}.tar.gz
> +	"
Why the extra newline + indent?

> +
> +S="${WORKDIR}/nginx-${NGX_PV}"
> +
> +EXPORT_FUNCTIONS src_configure src_compile src_install
> +
> +# @FUNCTION: nginx-module_src_configure
> +# @USAGE: [additional-args]
> +# @DESCRIPTION:
> +# Parses the configure from the original nginx binary by exicution 'nginx -V' and adds the package as dynamic module.
> +nginx-module_src_configure() {
> +	if [ `grep -c "\.[[:space:]]auto/module" ${WORKDIR}/${PN}-${MODULE_PV}/config` -eq 0 ]; then

Use $() instead of ``, quote ${WORKDIR}.


> +		die "module uses old unsupported static config file syntax: https://www.nginx.com/resources/wiki/extending/converting/"
> +	fi
> +	#grep nginx configure from nginx -V add drop all other external modules
> +	NGX_ORIGIN_CONFIGURE=`nginx -V 2>&1 | grep "configure arguments:" | cut -d: -f2 | sed "s/--add-module=\([^\s]\)*\s/ /"`
> +	./configure ${NGX_ORIGIN_CONFIGURE} --add-dynamic-module="../${PN}-${MODULE_PV}" "$@" || die "configure failed"
> +}
> +
> +# @FUNCTION: nginx-module_src_compile
> +# @USAGE: [additional-args]
> +# @DESCRIPTION:
> +# Runs 'make modules' to only build our package module.
> +nginx-module_src_compile() {
> +	emake modules "$@"
> +}
> +
> +# @FUNCTION: nginx-module_src_install
> +# @DESCRIPTION:
> +# Parses the module config file to get the so file name and install the shared object file to '/usr/$(get_libdir)/nginx/modules'
> +nginx-module_src_install() {
> +	NGX_MODULE_NAME=`grep ${WORKDIR}/${PN}-${MODULE_PV}/config -e "ngx_addon_name" | cut -d= -f2`
> +	exeinto /usr/$(get_libdir)/nginx/modules
> +	doexe ${S}/objs/${NGX_MODULE_NAME}.so
> +}

-- 
Best regards,
Michał Górny




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

* [gentoo-dev] [PATCH v2 0/3] Version 2
  2021-02-14 16:20 [gentoo-dev] [PATCH 0/3] [RFC] www-nginx/ category and nginx-module.eclass jonas.licht
                   ` (2 preceding siblings ...)
  2021-02-14 16:20 ` [gentoo-dev] [PATCH 3/3] www-nginx/nginx-vod-module: add new package jonas.licht
@ 2021-02-28 17:36 ` jonas.licht
  2021-02-28 17:36   ` [gentoo-dev] [PATCH v2 1/3] profiles/categories: add www-nginx jonas.licht
                     ` (3 more replies)
  3 siblings, 4 replies; 11+ messages in thread
From: jonas.licht @ 2021-02-28 17:36 UTC (permalink / raw)
  To: gentoo-dev; +Cc: Jonas Licht

From: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>

Please see version two.

Jonas Licht (3):
  profiles/categories: add www-nginx
  Add nginx-module.eclass
  www-nginx/nginx-vod-module: add new package

 eclass/nginx-module.eclass                    | 72 +++++++++++++++++++
 profiles/categories                           |  1 +
 www-nginx/metadata.xml                        |  7 ++
 www-nginx/nginx-vod-module/Manifest           |  2 +
 www-nginx/nginx-vod-module/metadata.xml       | 12 ++++
 .../nginx-vod-module-1.18.0.1.25.ebuild       | 21 ++++++
 6 files changed, 115 insertions(+)
 create mode 100644 eclass/nginx-module.eclass
 create mode 100644 www-nginx/metadata.xml
 create mode 100644 www-nginx/nginx-vod-module/Manifest
 create mode 100644 www-nginx/nginx-vod-module/metadata.xml
 create mode 100644 www-nginx/nginx-vod-module/nginx-vod-module-1.18.0.1.25.ebuild

-- 
2.26.2



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

* [gentoo-dev] [PATCH v2 1/3] profiles/categories: add www-nginx
  2021-02-28 17:36 ` [gentoo-dev] [PATCH v2 0/3] Version 2 jonas.licht
@ 2021-02-28 17:36   ` jonas.licht
  2021-02-28 17:36   ` [gentoo-dev] [PATCH v2 2/3] Add nginx-module.eclass jonas.licht
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: jonas.licht @ 2021-02-28 17:36 UTC (permalink / raw)
  To: gentoo-dev; +Cc: Jonas Licht

From: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>

Signed-off-by: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>
---
 profiles/categories    | 1 +
 www-nginx/metadata.xml | 7 +++++++
 2 files changed, 8 insertions(+)
 create mode 100644 www-nginx/metadata.xml

diff --git a/profiles/categories b/profiles/categories
index 0ac1f2f33f3..fc9484d1235 100644
--- a/profiles/categories
+++ b/profiles/categories
@@ -152,6 +152,7 @@ www-apache
 www-apps
 www-client
 www-misc
+www-nginx
 www-plugins
 www-servers
 x11-apps
diff --git a/www-nginx/metadata.xml b/www-nginx/metadata.xml
new file mode 100644
index 00000000000..340ce767d0e
--- /dev/null
+++ b/www-nginx/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+	<longdescription lang="en">
+		The www-nginx category contains modules for the Nginx Webserver.
+	</longdescription>
+</catmetadata>
-- 
2.26.2



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

* [gentoo-dev] [PATCH v2 2/3] Add nginx-module.eclass
  2021-02-28 17:36 ` [gentoo-dev] [PATCH v2 0/3] Version 2 jonas.licht
  2021-02-28 17:36   ` [gentoo-dev] [PATCH v2 1/3] profiles/categories: add www-nginx jonas.licht
@ 2021-02-28 17:36   ` jonas.licht
  2021-02-28 17:36   ` [gentoo-dev] [PATCH v2 3/3] www-nginx/nginx-vod-module: add new package jonas.licht
  2021-12-13 21:12   ` [gentoo-dev] [PATCH v2 0/3] Version 2 Jonas Licht
  3 siblings, 0 replies; 11+ messages in thread
From: jonas.licht @ 2021-02-28 17:36 UTC (permalink / raw)
  To: gentoo-dev; +Cc: Jonas Licht

From: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>

Signed-off-by: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>
---
 eclass/nginx-module.eclass | 72 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 eclass/nginx-module.eclass

diff --git a/eclass/nginx-module.eclass b/eclass/nginx-module.eclass
new file mode 100644
index 00000000000..d9f9bbdb89c
--- /dev/null
+++ b/eclass/nginx-module.eclass
@@ -0,0 +1,72 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: nginx-module.eclass
+# @MAINTAINER:
+# Jonas Licht <jonas.licht@gmail.com>
+# @AUTHOR:
+# Jonas Licht <jonas.licht@gmail.com>
+# @BLURB: Provide a set of functions to build nginx dynamic modules.
+# @DESCRIPTION:
+# Eclass to make dynamic nginx modules.
+# As these modules are hardly build against one nginx version we use version cut to indicate the nginx version too.
+# The first three parts of the version must represent the nginx version,
+# the remaining part displays the module version.
+#
+# To build a nginx module the whole nginx source code is needed,
+# therfore we set the SRC_URI to the nginx source archive.
+# The module archive must be added with SRC_URI+=
+
+case ${EAPI:-0} in
+	7) ;;
+	*) die "This eclass only supports EAPI 7" ;;
+esac
+
+# @ECLASS-VARIABLE: NGINX_PV
+# @DESCRIPTION:
+# Uses version cut of the first three parts of the version to determine the nginx version providing the module.
+# This version is used for SRC_URI, BDPEND and compiling process.
+NGINX_PV=$(ver_cut 1-3)
+
+# @ECLASS-VARIABLE: MODULE_PV
+# @DESCRIPTION:
+# Uses version cut to get the version of the module.
+# Variable can be used for SRC_URI of the nginx module.
+MODULE_PV=$(ver_cut 4-)
+
+BDPEND="=www-servers/nginx-${NGINX_PV}:="
+SRC_URI="https://nginx.org/download/nginx-${NGINX_PV}.tar.gz"
+
+S="${WORKDIR}/nginx-${NGINX_PV}"
+
+EXPORT_FUNCTIONS src_configure src_compile src_install
+
+# @FUNCTION: nginx-module_src_configure
+# @USAGE: [additional-args]
+# @DESCRIPTION:
+# Parses the configure from the original nginx binary by exicution 'nginx -V' and adds the package as dynamic module.
+nginx-module_src_configure() {
+	if [ $(grep -c "\.[[:space:]]auto/module" "${WORKDIR}/${PN}-${MODULE_PV}/config") -eq 0 ]; then
+		die "module uses old unsupported static config file syntax: https://www.nginx.com/resources/wiki/extending/converting/"
+	fi
+	#grep nginx configure from nginx -V add drop all other external modules
+	NGINX_ORIGIN_CONFIGURE=$(nginx -V 2>&1 | grep "configure arguments:" | cut -d: -f2 | sed "s/--add-module=\([^\s]\)*\s/ /")
+	./configure ${NGINX_ORIGIN_CONFIGURE} --add-dynamic-module="../${PN}-${MODULE_PV}" "$@" || die "configure failed"
+}
+
+# @FUNCTION: nginx-module_src_compile
+# @USAGE: [additional-args]
+# @DESCRIPTION:
+# Runs 'make modules' to only build our package module.
+nginx-module_src_compile() {
+	emake modules "$@"
+}
+
+# @FUNCTION: nginx-module_src_install
+# @DESCRIPTION:
+# Parses the module config file to get the so file name and install the shared object file to '/usr/$(get_libdir)/nginx/modules'
+nginx-module_src_install() {
+	NGINX_MODULE_NAME=$(grep ${WORKDIR}/${PN}-${MODULE_PV}/config -e "ngx_addon_name" | cut -d= -f2)
+	exeinto /usr/$(get_libdir)/nginx/modules
+	doexe ${S}/objs/${NGINX_MODULE_NAME}.so
+}
-- 
2.26.2



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

* [gentoo-dev] [PATCH v2 3/3] www-nginx/nginx-vod-module: add new package
  2021-02-28 17:36 ` [gentoo-dev] [PATCH v2 0/3] Version 2 jonas.licht
  2021-02-28 17:36   ` [gentoo-dev] [PATCH v2 1/3] profiles/categories: add www-nginx jonas.licht
  2021-02-28 17:36   ` [gentoo-dev] [PATCH v2 2/3] Add nginx-module.eclass jonas.licht
@ 2021-02-28 17:36   ` jonas.licht
  2021-12-13 21:12   ` [gentoo-dev] [PATCH v2 0/3] Version 2 Jonas Licht
  3 siblings, 0 replies; 11+ messages in thread
From: jonas.licht @ 2021-02-28 17:36 UTC (permalink / raw)
  To: gentoo-dev; +Cc: Jonas Licht

From: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>

Bug: https://bugs.gentoo.org/648334
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>
---
 www-nginx/nginx-vod-module/Manifest           |  2 ++
 www-nginx/nginx-vod-module/metadata.xml       | 12 +++++++++++
 .../nginx-vod-module-1.18.0.1.25.ebuild       | 21 +++++++++++++++++++
 3 files changed, 35 insertions(+)
 create mode 100644 www-nginx/nginx-vod-module/Manifest
 create mode 100644 www-nginx/nginx-vod-module/metadata.xml
 create mode 100644 www-nginx/nginx-vod-module/nginx-vod-module-1.18.0.1.25.ebuild

diff --git a/www-nginx/nginx-vod-module/Manifest b/www-nginx/nginx-vod-module/Manifest
new file mode 100644
index 00000000000..3e56021f4a4
--- /dev/null
+++ b/www-nginx/nginx-vod-module/Manifest
@@ -0,0 +1,2 @@
+DIST nginx-1.18.0.tar.gz 1039530 BLAKE2B a8962a6af96acb043ff0c3dc4ad5192083773c449950aff53b01f6f7c46a2a540eb061a43432acccd753fa71067b1451d75f440ba5526575b78608be9d40a50b SHA512 8c21eeb62ab6e32e436932500f700bd2fb99fd2d29e43c08a5bfed4714c189c29c7141db551fcd5d2437303b7439f71758f7407dfd3e801e704e45e7daa78ddb
+DIST nginx-vod-module-1.25.tar.gz 446830 BLAKE2B c1bf218c83ccee76fa4e6414b209585931a271577a8aa7b71ba9634ad82193ed9bbd06dd3cf780f085edde604f0e08e56d40b9e0658f5bd307735a1848b20d5a SHA512 11a97ffa28d6078aa57ad1821421928f6e2a05235a2f384cd2b498e7998f1025edc1ee163a900937ee251b49bd9381813e71248e67d537531b91a998b1610c56
diff --git a/www-nginx/nginx-vod-module/metadata.xml b/www-nginx/nginx-vod-module/metadata.xml
new file mode 100644
index 00000000000..fc0ed57d848
--- /dev/null
+++ b/www-nginx/nginx-vod-module/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+    <maintainer type="person">
+        <email>jonas.licht@gmail.com</email>
+        <name>Jonas Licht</name>
+    </maintainer>
+    <maintainer type="project">
+        <email>proxy-maint@gentoo.org</email>
+        <name>Proxy Maintainers</name>
+    </maintainer>
+</pkgmetadata>
diff --git a/www-nginx/nginx-vod-module/nginx-vod-module-1.18.0.1.25.ebuild b/www-nginx/nginx-vod-module/nginx-vod-module-1.18.0.1.25.ebuild
new file mode 100644
index 00000000000..b551d5ec9d0
--- /dev/null
+++ b/www-nginx/nginx-vod-module/nginx-vod-module-1.18.0.1.25.ebuild
@@ -0,0 +1,21 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit nginx-module
+
+DESCRIPTION="NGINX-based MP4 Repackager"
+HOMEPAGE="https://github.com/kaltura/nginx-vod-module"
+SRC_URI+=" https://github.com/kaltura/nginx-vod-module/archive/${MODULE_PV}.tar.gz -> ${PN}-${MODULE_PV}.tar.gz"
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="
+	dev-libs/libxml2
+	media-video/ffmpeg
+	sys-libs/zlib
+"
+RDEPEND="${DEPEND}"
-- 
2.26.2



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

* Re: [gentoo-dev] [PATCH v2 0/3] Version 2
  2021-02-28 17:36 ` [gentoo-dev] [PATCH v2 0/3] Version 2 jonas.licht
                     ` (2 preceding siblings ...)
  2021-02-28 17:36   ` [gentoo-dev] [PATCH v2 3/3] www-nginx/nginx-vod-module: add new package jonas.licht
@ 2021-12-13 21:12   ` Jonas Licht
  2021-12-15 18:02     ` Joonas Niilola
  3 siblings, 1 reply; 11+ messages in thread
From: Jonas Licht @ 2021-12-13 21:12 UTC (permalink / raw)
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 1136 bytes --]

So nearly ten months have now gone by.
Is there any thing I can do to push this changes to get merged?

Best regards,
Jonas

Am 28.02.21 um 18:36 schrieb jonas.licht@fem.tu-ilmenau.de:
> From: Jonas Licht <jonas.licht@fem.tu-ilmenau.de>
>
> Please see version two.
>
> Jonas Licht (3):
>   profiles/categories: add www-nginx
>   Add nginx-module.eclass
>   www-nginx/nginx-vod-module: add new package
>
>  eclass/nginx-module.eclass                    | 72 +++++++++++++++++++
>  profiles/categories                           |  1 +
>  www-nginx/metadata.xml                        |  7 ++
>  www-nginx/nginx-vod-module/Manifest           |  2 +
>  www-nginx/nginx-vod-module/metadata.xml       | 12 ++++
>  .../nginx-vod-module-1.18.0.1.25.ebuild       | 21 ++++++
>  6 files changed, 115 insertions(+)
>  create mode 100644 eclass/nginx-module.eclass
>  create mode 100644 www-nginx/metadata.xml
>  create mode 100644 www-nginx/nginx-vod-module/Manifest
>  create mode 100644 www-nginx/nginx-vod-module/metadata.xml
>  create mode 100644 www-nginx/nginx-vod-module/nginx-vod-module-1.18.0.1.25.ebuild
>


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

* Re: [gentoo-dev] [PATCH v2 0/3] Version 2
  2021-12-13 21:12   ` [gentoo-dev] [PATCH v2 0/3] Version 2 Jonas Licht
@ 2021-12-15 18:02     ` Joonas Niilola
  0 siblings, 0 replies; 11+ messages in thread
From: Joonas Niilola @ 2021-12-15 18:02 UTC (permalink / raw)
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 850 bytes --]

On 13.12.2021 23.12, Jonas Licht wrote:
> So nearly ten months have now gone by.
> Is there any thing I can do to push this changes to get merged?
> 
> Best regards,
> Jonas

Unfortunately I don't think anyone other than the current nginx
maintainer is brave enough to get involved. For an outsider there's a
lot of reading, understanding and _testing_ to do.

Haven't checked the related bugs as to an explanation why it hasn't been
merged yet, but since I use nginx personally I might be interested in
landing this support. The concept at least looks awesome on paper.
(Still, realistically I can probably "get to this" in January 2022).

Meanwhile, maybe you could update the eclass to support EAPI-8? :)

https://github.com/gentoo/gentoo/pull/16053 here's the PR if someone
wants to comment, minor enhances etc.

-- juippis

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 618 bytes --]

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

end of thread, other threads:[~2021-12-15 18:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-14 16:20 [gentoo-dev] [PATCH 0/3] [RFC] www-nginx/ category and nginx-module.eclass jonas.licht
2021-02-14 16:20 ` [gentoo-dev] [PATCH 1/3] profiles/categories: add www-nginx jonas.licht
2021-02-14 16:20 ` [gentoo-dev] [PATCH 2/3] Add nginx-module.eclass jonas.licht
2021-02-14 17:56   ` Michał Górny
2021-02-14 16:20 ` [gentoo-dev] [PATCH 3/3] www-nginx/nginx-vod-module: add new package jonas.licht
2021-02-28 17:36 ` [gentoo-dev] [PATCH v2 0/3] Version 2 jonas.licht
2021-02-28 17:36   ` [gentoo-dev] [PATCH v2 1/3] profiles/categories: add www-nginx jonas.licht
2021-02-28 17:36   ` [gentoo-dev] [PATCH v2 2/3] Add nginx-module.eclass jonas.licht
2021-02-28 17:36   ` [gentoo-dev] [PATCH v2 3/3] www-nginx/nginx-vod-module: add new package jonas.licht
2021-12-13 21:12   ` [gentoo-dev] [PATCH v2 0/3] Version 2 Jonas Licht
2021-12-15 18:02     ` Joonas Niilola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox