diff --git a/www-servers/nginx-unit/files/init/nginx-unit.confd b/www-servers/nginx-unit/files/init/nginx-unit.confd index 8681ef06..9deb07a3 100644 --- a/www-servers/nginx-unit/files/init/nginx-unit.confd +++ b/www-servers/nginx-unit/files/init/nginx-unit.confd @@ -1,7 +1,2 @@ #UNITD_OPTIONS="--tmp /tmp --log /var/log/unitd.log --control unix:/run/nginx-unit.sock" #UNITD_OPTIONS="--tmp /tmp --log /var/log/unitd.log --control localhost:99" - -# If you're using systemd, please, avoid writing here any openrc-related stuff and functions. -# Only variables are supported (as it used as EnvironmentFile). -# And, actually, only UNITD_OPTIONS is used ATM. - diff --git a/www-servers/nginx-unit/files/init/nginx-unit.service b/www-servers/nginx-unit/files/init/nginx-unit.service index fd5fdbca..81dbaa4c 100644 --- a/www-servers/nginx-unit/files/init/nginx-unit.service +++ b/www-servers/nginx-unit/files/init/nginx-unit.service @@ -6,8 +6,7 @@ After=network-online.target [Service] Type=forking PIDFile=/run/nginx-unit.pid -EnvironmentFile=-/etc/conf.d/nginx-unit -ExecStart=/usr/sbin/unitd $UNITD_OPTIONS +ExecStart=/usr/sbin/unitd [Install] WantedBy=multi-user.target diff --git a/www-servers/nginx-unit/files/init/nginx-unit.service.conf b/www-servers/nginx-unit/files/init/nginx-unit.service.conf new file mode 100644 index 00000000..e5636090 --- /dev/null +++ b/www-servers/nginx-unit/files/init/nginx-unit.service.conf @@ -0,0 +1,3 @@ +# [Service] +# ExecStart=/usr/sbin/unitd --tmp /tmp --log /var/log/unitd.log --control unix:/run/nginx-unit.sock +# ExecStart=/usr/sbin/unitd --tmp /tmp --log /var/log/unitd.log --control localhost:99 diff --git a/www-servers/nginx-unit/nginx-unit-1.31.1-r10.ebuild b/www-servers/nginx-unit/nginx-unit-1.31.1-r10.ebuild index e50692ec..2c5ec589 100644 --- a/www-servers/nginx-unit/nginx-unit-1.31.1-r10.ebuild +++ b/www-servers/nginx-unit/nginx-unit-1.31.1-r10.ebuild @@ -7,13 +7,13 @@ PYTHON_COMPAT=( python3_{8..12} pypy3 ) PYTHON_REQ_USE="threads(+)" RUBY_OPTIONAL="yes" -USE_RUBY="ruby30 ruby31 ruby32" +USE_RUBY="ruby31 ruby32" PHP_EXT_INI="no" PHP_EXT_NAME="dummy" PHP_EXT_OPTIONAL_USE="unit_modules_php" PHP_EXT_NEEDED_USE="embed" -USE_PHP="php7-4 php8-0 php8-1 php8-2" +USE_PHP="php8-1 php8-2" inherit systemd php-ext-source-r3 python-r1 ruby-ng toolchain-funcs flag-o-matic patches # golang-base @@ -67,6 +67,9 @@ DEPEND=" # unit_modules_java? ( # virtual/jre:* # ) +# unit_modules_wasm? ( +# dev-util/wasmer +# ) RDEPEND="${DEPEND}" S="${WORKDIR}/${MY_P}" @@ -91,10 +94,15 @@ src_unpack() { src_prepare() { sed -r \ -e 's@-Werror@@g' \ - -i auto/cc/test + -i auto/cc/test || die sed -i '/^CFLAGS/d' auto/make || die + sed \ + -e '/NXT_LOGDIR/d' \ + -e '/NXT_RUNSTATEDIR/d' \ + -i auto/make || die "Failed to monkeypatch QA issues with installation" + patches_src_prepare tc-export_build_env } @@ -109,13 +117,22 @@ _unit_java_configure() { # That's why I decided to manually set system-vm, but still # give user a way to specify exact the vm they want. } -_unit_go_configure() { - # ./configure go --go-path="$(get_golibdir_gopath)" # deprecated golang-base eclass - my_econf go --go-path="${EPREFIX}/usr/lib/go" # multislot? -} -_unit_nodejs_configure() { - my_econf nodejs --node-gyp="/usr/$(get_libdir)/node_modules/npm/bin/node-gyp-bin/node-gyp" -} +# _unit_go_configure() { +# # Actually, it is used as external, so all the configuration made on app (and go) side +# # ./configure go --go-path="$(get_golibdir_gopath)" # deprecated golang-base eclass +# my_econf go --go-path="${EPREFIX}/usr/lib/go" # multislot? +# } +#_unit_nodejs_configure() { +# # Actually, it is used as external, so all the configuration made on app (and nodejs) side +# # my_econf nodejs --node-gyp="/usr/$(get_libdir)/node_modules/npm/bin/node-gyp-bin/node-gyp" +#} +#_unit_wasm_configure() { +# # there is only wasmer on gentoo repo ATM. Default wasmtime is only on 3party overlay +# my_econf wasm \ +# --runtime="wasmer" \ +# --include=... \ +# --lib-path=... \ +#} _unit_perl_configure() { my_econf perl } @@ -144,20 +161,29 @@ _unit_ruby_configure() { src_configure() { append-cflags $(test-flags-CC -fPIC) + local opt=( + --prefix="/usr" + --modulesdir="/usr/$(get_libdir)/${PN}" + --libdir="/usr/$(get_libdir)" + --localstatedir="/var" + --runstatedir="/run/${PN}" + --statedir="/var/lib/${PN}" + --logdir="/var/log" + --tmpdir="/tmp" + --pid="/run/${PN}.pid" + --log="/var/log/${PN}.log" + $(usex ipv6 '' "--no-ipv6") + $(usex unix-sockets "--control=unix:/run/${PN}.sock" "--no-unix-sockets") + $(usex ssl "--openssl" "") + $(usex debug "--debug" "") + # --njs + ) my_econf \ + ${opt[@]} \ --cc="$(tc-getCC)" \ --cc-opt="${CFLAGS}" \ --ld-opt="${LDFLAGS}" \ - --prefix="/usr" \ - --modules="$(get_libdir)/${PN}" \ - --state="/var/lib/${PN}" \ - --tmp="/tmp" \ - --pid="/run/${PN}.pid" \ - --log="/var/log/${PN}.log" \ - $(usex ipv6 '' "--no-ipv6") \ - $(usex unix-sockets "--control=unix:/run/${PN}.sock" "--no-unix-sockets") \ - $(usex ssl "--openssl" "") \ - $(usex debug "--debug" "") + || die "Core configuration failed!" for mod in $UNIT_MODULES; do use "unit_modules_${mod}" && "_unit_${mod}_configure" @@ -174,6 +200,7 @@ src_install() { diropts -m 0770 keepdir /var/lib/"${PN}" systemd_dounit "${FILESDIR}"/init/"${PN}".service + systemd_install_dropin "${PN}".service "${FILESDIR}"/init/"${PN}".service.conf newconfd "${FILESDIR}"/init/"${PN}".confd "${PN}" newinitd "${FILESDIR}"/init/"${PN}".initd "${PN}" } diff --git a/www-servers/nginx-unit/nginx-unit-9999.ebuild b/www-servers/nginx-unit/nginx-unit-9999.ebuild index e50692ec..2c5ec589 100644 --- a/www-servers/nginx-unit/nginx-unit-9999.ebuild +++ b/www-servers/nginx-unit/nginx-unit-9999.ebuild @@ -7,13 +7,13 @@ PYTHON_COMPAT=( python3_{8..12} pypy3 ) PYTHON_REQ_USE="threads(+)" RUBY_OPTIONAL="yes" -USE_RUBY="ruby30 ruby31 ruby32" +USE_RUBY="ruby31 ruby32" PHP_EXT_INI="no" PHP_EXT_NAME="dummy" PHP_EXT_OPTIONAL_USE="unit_modules_php" PHP_EXT_NEEDED_USE="embed" -USE_PHP="php7-4 php8-0 php8-1 php8-2" +USE_PHP="php8-1 php8-2" inherit systemd php-ext-source-r3 python-r1 ruby-ng toolchain-funcs flag-o-matic patches # golang-base @@ -67,6 +67,9 @@ DEPEND=" # unit_modules_java? ( # virtual/jre:* # ) +# unit_modules_wasm? ( +# dev-util/wasmer +# ) RDEPEND="${DEPEND}" S="${WORKDIR}/${MY_P}" @@ -91,10 +94,15 @@ src_unpack() { src_prepare() { sed -r \ -e 's@-Werror@@g' \ - -i auto/cc/test + -i auto/cc/test || die sed -i '/^CFLAGS/d' auto/make || die + sed \ + -e '/NXT_LOGDIR/d' \ + -e '/NXT_RUNSTATEDIR/d' \ + -i auto/make || die "Failed to monkeypatch QA issues with installation" + patches_src_prepare tc-export_build_env } @@ -109,13 +117,22 @@ _unit_java_configure() { # That's why I decided to manually set system-vm, but still # give user a way to specify exact the vm they want. } -_unit_go_configure() { - # ./configure go --go-path="$(get_golibdir_gopath)" # deprecated golang-base eclass - my_econf go --go-path="${EPREFIX}/usr/lib/go" # multislot? -} -_unit_nodejs_configure() { - my_econf nodejs --node-gyp="/usr/$(get_libdir)/node_modules/npm/bin/node-gyp-bin/node-gyp" -} +# _unit_go_configure() { +# # Actually, it is used as external, so all the configuration made on app (and go) side +# # ./configure go --go-path="$(get_golibdir_gopath)" # deprecated golang-base eclass +# my_econf go --go-path="${EPREFIX}/usr/lib/go" # multislot? +# } +#_unit_nodejs_configure() { +# # Actually, it is used as external, so all the configuration made on app (and nodejs) side +# # my_econf nodejs --node-gyp="/usr/$(get_libdir)/node_modules/npm/bin/node-gyp-bin/node-gyp" +#} +#_unit_wasm_configure() { +# # there is only wasmer on gentoo repo ATM. Default wasmtime is only on 3party overlay +# my_econf wasm \ +# --runtime="wasmer" \ +# --include=... \ +# --lib-path=... \ +#} _unit_perl_configure() { my_econf perl } @@ -144,20 +161,29 @@ _unit_ruby_configure() { src_configure() { append-cflags $(test-flags-CC -fPIC) + local opt=( + --prefix="/usr" + --modulesdir="/usr/$(get_libdir)/${PN}" + --libdir="/usr/$(get_libdir)" + --localstatedir="/var" + --runstatedir="/run/${PN}" + --statedir="/var/lib/${PN}" + --logdir="/var/log" + --tmpdir="/tmp" + --pid="/run/${PN}.pid" + --log="/var/log/${PN}.log" + $(usex ipv6 '' "--no-ipv6") + $(usex unix-sockets "--control=unix:/run/${PN}.sock" "--no-unix-sockets") + $(usex ssl "--openssl" "") + $(usex debug "--debug" "") + # --njs + ) my_econf \ + ${opt[@]} \ --cc="$(tc-getCC)" \ --cc-opt="${CFLAGS}" \ --ld-opt="${LDFLAGS}" \ - --prefix="/usr" \ - --modules="$(get_libdir)/${PN}" \ - --state="/var/lib/${PN}" \ - --tmp="/tmp" \ - --pid="/run/${PN}.pid" \ - --log="/var/log/${PN}.log" \ - $(usex ipv6 '' "--no-ipv6") \ - $(usex unix-sockets "--control=unix:/run/${PN}.sock" "--no-unix-sockets") \ - $(usex ssl "--openssl" "") \ - $(usex debug "--debug" "") + || die "Core configuration failed!" for mod in $UNIT_MODULES; do use "unit_modules_${mod}" && "_unit_${mod}_configure" @@ -174,6 +200,7 @@ src_install() { diropts -m 0770 keepdir /var/lib/"${PN}" systemd_dounit "${FILESDIR}"/init/"${PN}".service + systemd_install_dropin "${PN}".service "${FILESDIR}"/init/"${PN}".service.conf newconfd "${FILESDIR}"/init/"${PN}".confd "${PN}" newinitd "${FILESDIR}"/init/"${PN}".initd "${PN}" }