commit:     e72c074236cec61dfd428cad46b7d931a5b63695
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Mar  7 11:22:28 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar  7 11:24:08 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e72c0742

www-misc/fcgiwrap: add 1.1.0_p20150419

* Take a snapshot given there's been no release since 2013
* Pull in some patches from pending PRs
* Switch systemd sed to a patch

Signed-off-by: Sam James <sam <AT> gentoo.org>

 www-misc/fcgiwrap/Manifest                         |  1 +
 www-misc/fcgiwrap/fcgiwrap-1.1.0_p20150419.ebuild  | 64 ++++++++++++++++++++++
 www-misc/fcgiwrap/files/fcgiwrap-1.1.0-kill.patch  | 25 +++++++++
 .../fcgiwrap/files/fcgiwrap-1.1.0-systemd.patch    | 25 +++++++++
 .../files/fcgiwrap-1.1.0-uninit-ipv6.patch         | 34 ++++++++++++
 5 files changed, 149 insertions(+)

diff --git a/www-misc/fcgiwrap/Manifest b/www-misc/fcgiwrap/Manifest
index c1143d8241d4..a64ce154ee8e 100644
--- a/www-misc/fcgiwrap/Manifest
+++ b/www-misc/fcgiwrap/Manifest
@@ -1 +1,2 @@
 DIST fcgiwrap-1.1.0.tar.gz 9924 BLAKE2B 
a96a87bfd1e4845be3a5018e5574edd40a800926ac531a041fae07f6810da509eecf97a19b2debe0ea318f2968f30184f4f6c1c02495777492d32826a0f759a1
 SHA512 
b8d35762d1d3c94a67602290b0092f0c38cffbbcd3dbc16597abf8b92172909b04450c238de2e430e841a17dd47fdd48d6a001f77539966980ef1af61e447ddc
+DIST fcgiwrap-1.1.0_p20150419.gh.tar.gz 10833 BLAKE2B 
3820d2aee99a225656c9b3621f5ccf936b4909e74331a6332925bfbda38e8795339d943768aff4c967381bd52f349f445bcce335e3f94f7fb67ed15e5844a9ad
 SHA512 
87613dcaf617107bb179e5f1c50878f6378fcfcc53237a262881cc8e18a7d8c011215f1642d6d00797f322e08118ff9ed4a1da9fa5d09006f3ffbe20547e4f08

diff --git a/www-misc/fcgiwrap/fcgiwrap-1.1.0_p20150419.ebuild 
b/www-misc/fcgiwrap/fcgiwrap-1.1.0_p20150419.ebuild
new file mode 100644
index 000000000000..d7ecbe02f3e4
--- /dev/null
+++ b/www-misc/fcgiwrap/fcgiwrap-1.1.0_p20150419.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools systemd toolchain-funcs
+
+DESCRIPTION="Simple FastCGI wrapper for CGI scripts (CGI support for nginx)"
+HOMEPAGE="https://github.com/gnosek/fcgiwrap";
+if [[ ${PV} == *_p* ]] ; then
+       FCGIWRAP_COMMIT="99c942c90063c73734e56bacaa65f947772d9186"
+       
SRC_URI="https://github.com/gnosek/fcgiwrap/archive/${FCGIWRAP_COMMIT}.tar.gz 
-> ${P}.gh.tar.gz"
+       S="${WORKDIR}"/${PN}-${FCGIWRAP_COMMIT}
+else
+       # https://github.com/gnosek/fcgiwrap/issues/31
+       SRC_URI="https://github.com/gnosek/${PN}/archive/refs/tags/${PV}.tar.gz 
-> ${P}.tar.gz"
+fi
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="systemd"
+
+RDEPEND="
+       dev-libs/fcgi
+       systemd? ( sys-apps/systemd:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+DOCS=( README.rst )
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.1.0-kill.patch
+       "${FILESDIR}"/${PN}-1.1.0-systemd.patch
+       "${FILESDIR}"/${PN}-1.1.0-uninit-ipv6.patch
+)
+
+src_prepare() {
+       default
+
+       sed -e "s/-Werror//" \
+               -i configure.ac || die "sed failed"
+       sed -e '/man8dir = $(DESTDIR)/s/@prefix@//' \
+               -i Makefile.in || die "sed failed"
+
+       tc-export CC
+
+       # Fix systemd units for Gentoo
+       sed -i -e '/User/d' systemd/fcgiwrap.service || die
+       sed -i -e '/Group/d' systemd/fcgiwrap.service || die
+
+       eautoreconf
+}
+
+src_configure() {
+       econf \
+               $(use_with systemd) \
+               --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+}
+
+pkg_postinst() {
+       einfo "You may want to install www-servers/spawn-fcgi to use with 
fcgiwrap."
+}

diff --git a/www-misc/fcgiwrap/files/fcgiwrap-1.1.0-kill.patch 
b/www-misc/fcgiwrap/files/fcgiwrap-1.1.0-kill.patch
new file mode 100644
index 000000000000..aa627cfa764c
--- /dev/null
+++ b/www-misc/fcgiwrap/files/fcgiwrap-1.1.0-kill.patch
@@ -0,0 +1,25 @@
+https://github.com/gnosek/fcgiwrap/pull/44
+
+From dc0c3b14f0d7bb014a9a4c6c17eb55a123496365 Mon Sep 17 00:00:00 2001
+From: "D.pz" <[email protected]>
+Date: Mon, 28 Aug 2017 23:54:08 +0800
+Subject: [PATCH] 1.fix: kill() parameter sequence wrong
+
+---
+ fcgiwrap.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fcgiwrap.c b/fcgiwrap.c
+index b44d8aa..bfd9a90 100644
+--- a/fcgiwrap.c
++++ b/fcgiwrap.c
+@@ -205,7 +205,7 @@ static void fcgi_finish(struct fcgi_context *fc, const 
char* msg)
+       if (fc->fd_stderr >= 0) close(fc->fd_stderr);
+ 
+       if (fc->cgi_pid)
+-              kill(SIGTERM, fc->cgi_pid);
++              kill(fc->cgi_pid, SIGTERM);
+ }
+ 
+ static const char * fcgi_pass_fd(struct fcgi_context *fc, int *fdp, FCGI_FILE 
*ffp, char *buf, size_t bufsize)
+

diff --git a/www-misc/fcgiwrap/files/fcgiwrap-1.1.0-systemd.patch 
b/www-misc/fcgiwrap/files/fcgiwrap-1.1.0-systemd.patch
new file mode 100644
index 000000000000..e943a4e89fda
--- /dev/null
+++ b/www-misc/fcgiwrap/files/fcgiwrap-1.1.0-systemd.patch
@@ -0,0 +1,25 @@
+https://github.com/gnosek/fcgiwrap/pull/39
+
+From 5e9be0eacceaad4eb11b0f49a0cffb70b18b4af3 Mon Sep 17 00:00:00 2001
+From: Juan Orti Alcaine <[email protected]>
+Date: Fri, 11 Nov 2016 22:40:23 +0100
+Subject: [PATCH] libsystemd-daemon has been renamed to libsystemd
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index bb3674e..2b02ef4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -28,7 +28,7 @@ AC_ARG_WITH([systemd],
+   [], [with_systemd=check])
+ have_systemd=no
+ if test "x$with_systemd" != "xno"; then
+-  PKG_CHECK_MODULES(systemd, [libsystemd-daemon],
++  PKG_CHECK_MODULES(systemd, [libsystemd],
+     [AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd is available])
+     have_systemd=yes],
+   have_systemd=no)
+

diff --git a/www-misc/fcgiwrap/files/fcgiwrap-1.1.0-uninit-ipv6.patch 
b/www-misc/fcgiwrap/files/fcgiwrap-1.1.0-uninit-ipv6.patch
new file mode 100644
index 000000000000..3fbd939e36a7
--- /dev/null
+++ b/www-misc/fcgiwrap/files/fcgiwrap-1.1.0-uninit-ipv6.patch
@@ -0,0 +1,34 @@
+https://github.com/gnosek/fcgiwrap/pull/51
+
+From 0b04283bc0f33c8b9e7ec23e2e7fd779da5bda09 Mon Sep 17 00:00:00 2001
+From: Rodrigo Osorio <[email protected]>
+Date: Sat, 28 Mar 2020 18:17:11 +0100
+Subject: [PATCH] Zero-out the sockaddr struct before using it
+
+The sockaddr union struct must be zero-out
+before usage at least for IPv6.
+
+IEEE Std 1003.1, 2004 Edition says:
+---
+The sockaddr_in6 structure shall be set to zero by an
+application prior to using it, since implementations
+are free to have additional, implementation-defined
+fields in sockaddr_in6.
+---
+ fcgiwrap.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/fcgiwrap.c b/fcgiwrap.c
+index b44d8aa..2e0f44f 100644
+--- a/fcgiwrap.c
++++ b/fcgiwrap.c
+@@ -726,6 +726,8 @@ static int setup_socket(char *url) {
+               struct sockaddr_in6 sa_in6;
+       } sa;
+ 
++    memset(&sa, 0, sizeof(sa));
++
+       if (!strncmp(p, "unix:", sizeof("unix:") - 1)) {
+               p += sizeof("unix:") - 1;
+ 
+

Reply via email to