Created attachment 539370 [details] Initial ebuild submission Please find attached my initial submission of an ebuild for "NGINX Unit". The ebuild is designed for version 1.3, which has been released today (2018-07-13). I have been using this ebuild locally since the release of Unit 1.0. Quoting https://unit.nginx.org : NGINX Unit is a dynamic web and application server, designed to run applications in multiple languages. Unit is lightweight, polyglot, and dynamically configured via API. The design of the server allows reconfiguration of specific application parameters as needed by the engineering or operations. I suggest using "www-servers/nginx-unit" as the full name, matching the existing "www-servers/nginx" web server. -Ralph
Hello Ralph, glad you want to bring this into Gentoo :) A few notes: - drop src_compile() as it's the default anyway - in src_install() start with default and then just add keepdir (and then remove emake... because it's called within default) - only add python/perl/php support if one wants it (add IUSE and R/DEPENDs on dev-lang/php[embed] etc.). You can add a condition so that at least one has to be enabled if you wish. Optionally, adding ruby/go would be also nice but can be done later on of course. - please at least add an openrc init script
Created attachment 539438 [details] Ebuild with added init script and IUSE support Hi Tomáš, I made the improvements you mentioned. Hopefully I am doing it right, this is the first time I attempt to publish an ebuild.
Created attachment 539440 [details] Template for /etc/init.d/nginx-unit
Created attachment 539516 [details] Improved ebuild with REQUIRED_USE I added REQUIRED_USE to have users select at least one of 'perl', 'php' or 'python'. Also, the ebuild will now abort if configuring the support module for any specified USE flag fails. BTW, I plan to add support for Go, Ruby et al as well, but I have not yet needed these and hence don't have applications I could use for testing.
Created attachment 539652 [details] Ebuild with dependency slot fixes Latest version of ebuild includes fixes for dependency slots. I will also add manifest and metadata files.
Created attachment 539654 [details] Initial version of ebuild metadata
Created attachment 539656 [details] /etc/init.d/nginx-unit with fixed copyright
Thanks for the update, a few more comments: init.d: - does nginx-unit really "need net"? (please check https://bugs.gentoo.org/439092) - wouldn't it be better to run nginx-unit as a non-root user? metadata: - please also add proxy-maint - the perl/python/php flags are already listed in profiles/use.desc ebuild: - please leave a blank line after EAPI=6 - aren't any use flags of perl/php/python needed for their support (like php[embed])?
> does nginx-unit really "need net"? I'll check if Unit can do without. > wouldn't it be better to run nginx-unit as a non-root user? Only the main process runs as 'root'. Controller and router processes run as 'nobody', individual application processes as the user defined in Unit's application configuration section. Here's a typical output form one of my servers: # ps aux | grep unit root 4124 (...) 0:00 unit: main v1.3 [/usr/sbin/unitd] nobody 4174 (...) 0:00 unit: controller nobody 4175 (...) 0:00 unit: router nginx 4176 (...) 5:40 unit: "foo" application nginx 4187 (...) 5:39 unit: "bar" application I configured the 'foo' and 'bar' applications to run as 'nginx', because NGINX is acting as a proxy for these apps. This is done within Unit. > please also add proxy-maint Already did, at least in my Git repo at least. ;-) > the perl/python/php flags are already listed in profiles/use.desc Does that mean I can remove the flags from my metadata.xml? I thought they were required, in addition to IUSE. > please leave a blank line after EAPI=6 Repoman did not complain, but I can add a blank line of course. > aren't any use flags of perl/php/python needed for their support (like php[embed])? Perl and Python don't require particular flags as far as I could tell, but php[embed] might be required (apparently this flag is enabled via a profile here, so I guess I should try turning it off manually).
(In reply to Ralph Seichter from comment #9) > > please also add proxy-maint > Already did, at least in my Git repo at least. ;-) Just checked the attachment here :) > > the perl/python/php flags are already listed in profiles/use.desc > Does that mean I can remove the flags from my metadata.xml? I thought > they were required, in addition to IUSE. Since they are so common, they are defined globally so don't have to be repeated each time (for example check https://github.com/gentoo/gentoo/blob/master/app-editors/vim/metadata.xml plus the vim ebuild that has perl,python,ruby...) > > please leave a blank line after EAPI=6 > Repoman did not complain, but I can add a blank line of course. Nothing serious though, but it's like that in the other ebuilds.
I think you're doing fine Ralph with your first ebuild, but please note I cannot add your package to Gentoo as I'm not a developer. Probably it will be better to open a PR on github later on where other devs/proxy maint can comment and hopefully add your ebuild to the main tree.
Thank you for helping me with this, Tomáš. It makes the process easier for me. > Probably it will be better to open a PR on github later on No problem, I will do that. I should have figured out earlier that these days a GitHub PR is the preferred method. I've already invested quite some time reading the documentation about GH based contributions, and I don't expect much trouble.
GitHub pull request created. Please note that the PR contains *newer* versions of the attachments. I'm not quite sure if I should keep updating the attachments this bug report?
I don't think it's necessary to update on both places.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45c246558a1abfd8c5fdb2b51d00b33faf1a0d81 commit 45c246558a1abfd8c5fdb2b51d00b33faf1a0d81 Author: Ralph Seichter <github@seichter.de> AuthorDate: 2018-07-16 10:57:14 +0000 Commit: Tony Vroon <chainsaw@gentoo.org> CommitDate: 2018-07-17 17:14:24 +0000 www-servers/nginx-unit: New package, by Ralph Seichter. NGINX Unit is a dynamic web and application server, designed to run applications in multiple languages. Unit is lightweight, polyglot, and dynamically configured via API. The design of the server allows reconfiguration of specific application parameters as needed by the engineering or operations. (Source: http://unit.nginx.org/) Bug: https://bugs.gentoo.org/661074 Package-Manager: Portage-2.3.40, Repoman-2.3.9 Closes: https://github.com/gentoo/gentoo/pull/9249 Closes: https://bugs.gentoo.org/661074 www-servers/nginx-unit/Manifest | 1 + www-servers/nginx-unit/files/nginx-unit.initd | 14 ++++++++++ www-servers/nginx-unit/metadata.xml | 22 +++++++++++++++ www-servers/nginx-unit/nginx-unit-1.3.ebuild | 39 +++++++++++++++++++++++++++ 4 files changed, 76 insertions(+) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45c246558a1abfd8c5fdb2b51d00b33faf1a0d81 commit 45c246558a1abfd8c5fdb2b51d00b33faf1a0d81 Author: Ralph Seichter <github@seichter.de> AuthorDate: 2018-07-16 10:57:14 +0000 Commit: Tony Vroon <chainsaw@gentoo.org> CommitDate: 2018-07-17 17:14:24 +0000 www-servers/nginx-unit: New package, by Ralph Seichter. NGINX Unit is a dynamic web and application server, designed to run applications in multiple languages. Unit is lightweight, polyglot, and dynamically configured via API. The design of the server allows reconfiguration of specific application parameters as needed by the engineering or operations. (Source: http://unit.nginx.org/) Bug: https://bugs.gentoo.org/661074 Package-Manager: Portage-2.3.40, Repoman-2.3.9 Closes: https://github.com/gentoo/gentoo/pull/9249 Closes: https://bugs.gentoo.org/661074 www-servers/nginx-unit/Manifest | 1 + www-servers/nginx-unit/files/nginx-unit.initd | 14 ++++++++++ www-servers/nginx-unit/metadata.xml | 22 +++++++++++++++ www-servers/nginx-unit/nginx-unit-1.3.ebuild | 39 +++++++++++++++++++++++++++ 4 files changed, 76 insertions(+)
Thank you Ralph and happy proxy maintaining :)