[gentoo-dev] [PATCH 3/3] www-nginx/nginx-vod-module: add new package

2021-02-14 Thread jonas . licht
From: Jonas Licht 

Bug: https://bugs.gentoo.org/648334
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Jonas Licht 
---
 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 000..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 000..fc0ed57d848
--- /dev/null
+++ b/www-nginx/nginx-vod-module/metadata.xml
@@ -0,0 +1,12 @@
+
+http://www.gentoo.org/dtd/metadata.dtd;>
+
+
+jonas.li...@gmail.com
+Jonas Licht
+
+
+proxy-ma...@gentoo.org
+Proxy Maintainers
+
+
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 000..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




[gentoo-dev] [PATCH 2/3] Add nginx-module.eclass

2021-02-14 Thread jonas . licht
From: Jonas Licht 

Signed-off-by: Jonas Licht 
---
 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 000..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 
+# @AUTHOR:
+# Jonas Licht 
+# @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




[gentoo-dev] [PATCH 1/3] profiles/categories: add www-nginx

2021-02-14 Thread jonas . licht
From: Jonas Licht 

Signed-off-by: Jonas Licht 
---
 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 000..340ce767d0e
--- /dev/null
+++ b/www-nginx/metadata.xml
@@ -0,0 +1,7 @@
+
+http://www.gentoo.org/dtd/metadata.dtd;>
+
+   
+   The www-nginx category contains modules for the Nginx Webserver.
+   
+
-- 
2.26.2




[gentoo-dev] Packages up for grabs: x11-misc/macopix

2021-02-14 Thread Jonas Stein

Dear all

the following packages are up for grabs after dropping
desktop-misc:

x11-misc/macopix
https://packages.gentoo.org/packages/x11-misc/macopix

Upstream moved the repository to
https://github.com/chimari/MaCoPiX

They will hopefully add tags too
https://github.com/chimari/MaCoPiX/issues/6

Please help with this package, it blocks
https://bugs.gentoo.org/768993

--
Best,
Jonas



Re: [gentoo-dev] [PATCH 2/3] Add nginx-module.eclass

2021-02-14 Thread Michał Górny
On Sun, 2021-02-14 at 17:20 +0100, jonas.li...@fem.tu-ilmenau.de wrote:
> From: Jonas Licht 
> 
> Signed-off-by: Jonas Licht 
> ---
>  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 000..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 
> +# @AUTHOR:
> +# Jonas Licht 
> +# @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





Re: [gentoo-dev] New project: binhost

2021-02-14 Thread Rich Freeman
On Sat, Feb 13, 2021 at 8:51 PM Zac Medico  wrote:
>
> > 2.  Generate a hash of the file contents - this can go in the filename
> > so that the file can co-exist with other files, and be located
> > assuming you have a full matching set of metadata.
>
> For FEATURES=binpkg-multi-instance we currently use an integer BUILD_ID
> ensure that file names are unique.
>
> > 3.  Start dropping attributes from the file based on a list of
> > priorities and generate additional hashes.  Create symlinked files to
> > the original file using these hashes (overwriting or not existing
> > symlinks based on policy).  This allows the binary package to be found
> > using either an exact set of attributes or a subset of higher-priority
> > attributes.  This is analogous to shared object symlinking.
> > 4.  The package manager will look for a binary package first using the
> > user's full config, and then by dropping optional elements of the
> > config (so maybe it does the search without CFLAGs, then without USE
> > flags).  Eventually it aborts based on user prefs (maybe the user only
> > wants an exact match, or is willing to accept alternate CFLAGs but not
> > USE flags, or maybe anything for the arch is selected> 5.  As always the 
> > final selected binary package still gets evaluated
> > like any other binary package to ensure it is usable.
> >
> > Such a system can identify whether a potentially usable file exists
> > using only filename, cutting down on fetching.  In the interests of
> > avoiding useless fetches we would only carry step 3 reasonably far -
> > packages would have to match based on architecture and any dynamic
> > linking requirements.  So we wouldn't generate hashes that didn't
> > include at least those minimums, and the package manager wouldn't
> > search for them.
> >
> > Obviously you could do more (if you have 5 combinations of use flags,
> > look for the set that matches most closely).  That couldn't be done
> > using hashes alone in an efficient way.  You could have a small
> > manifest file alongside the binary package that could be fetched
> > separately if the package manager wants to narrow things down and
> > fetch a few of those to narrow it down further.
>
> All of the above is oriented toward multi-profile binhosts, so we'll
> have to do a cost/benefit analysis to determine whether it's worth the
> effort to introduce the complexity that multi-profile binhosts add.

The hash label on the filenames was also considered around
multi-profiles.  I figured that if you're going to be building
variants of packages you'd want to parallelize and hashes work better
for that.  Plus at least in concept you could potentially identify and
fetch files by hash using info already in the local repo without
having to sync additional metadata from the binhost.  User-contributed
binaries would also work better in such a world though for obvious
security issues that might just take the form of local user-generated
repos (allowing users to supplement the upstream repo with local
builds for a cluster, without having to mirror/reporoduce the entire
upstream.

I do get that multi-profiles aren't entirely an essential feature, but
when you consider stuff like X11 support or stable/unstable it seems
like we're probably going to have to provide at least a few variants
on packages for this to be practical.  You could just put each profile
in a separate repo, but then anything that doesn't actually change
across profiles gets built multiple times.  The hash-based solution is
also a form of deduping.

But, hey, it is great to see anything like this being done at all.
Walking before running isn't a bad thing!

-- 
Rich