commit:     20d962742de92d136470b6a3dd2c4e6727ffa2ff
Author:     Petr Vaněk <arkamar <AT> atlas <DOT> cz>
AuthorDate: Tue Mar 21 14:02:28 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Mar 22 01:19:09 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20d96274

net-proxy/3proxy: add 0.9.4

- EAPI bump
- update HOMEPAGE and SRC_URI
- update gentoo patch
- add fix for clang-16 [1,2]
- remove src_compile phase, CC is now exported in src_prepare, LN is
  not needed anymore as it is set to $(CC) by default.

[1] https://github.com/3proxy/3proxy/issues/895
[2] https://github.com/3proxy/3proxy/pull/907

Closes: https://bugs.gentoo.org/881015
Signed-off-by: Petr Vaněk <arkamar <AT> atlas.cz>
Closes: https://github.com/gentoo/gentoo/pull/30287
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-proxy/3proxy/3proxy-0.9.4.ebuild               | 47 ++++++++++++++++++
 net-proxy/3proxy/Manifest                          |  1 +
 .../files/3proxy-0.9.4-function-pointer-fix.patch  | 58 ++++++++++++++++++++++
 net-proxy/3proxy/files/3proxy-0.9.4-gentoo.patch   | 38 ++++++++++++++
 4 files changed, 144 insertions(+)

diff --git a/net-proxy/3proxy/3proxy-0.9.4.ebuild 
b/net-proxy/3proxy/3proxy-0.9.4.ebuild
new file mode 100644
index 000000000000..80444d214f60
--- /dev/null
+++ b/net-proxy/3proxy/3proxy-0.9.4.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="A really tiny cross-platform proxy servers set"
+HOMEPAGE="
+       https://3proxy.ru/
+       https://github.com/3proxy/3proxy/
+"
+SRC_URI="https://github.com/3proxy/3proxy/archive/${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ppc ~sparc ~x86"
+
+PATCHES=(
+       "${FILESDIR}/${P}-gentoo.patch"
+       "${FILESDIR}/${P}-function-pointer-fix.patch"
+)
+
+DOCS=( README cfg )
+HTML_DOCS=( doc/html/. )
+
+src_prepare() {
+       default
+       tc-export CC
+       cp Makefile.Linux Makefile || die
+}
+
+src_install() {
+       local x
+
+       pushd bin >/dev/null || die
+       dolib.so *.so
+       dobin 3proxy
+       for x in ftppr mycrypt pop3p proxy smtpp socks tcppm udppm; do
+               newbin ${x} ${PN}-${x}
+               [[ -f "${S}"/man/${x}.8 ]] && newman "${S}"/man/${x}.8 
${PN}-${x}.8
+       done
+       popd >/dev/null
+
+       doman man/3proxy*.[38]
+
+       einstalldocs
+}

diff --git a/net-proxy/3proxy/Manifest b/net-proxy/3proxy/Manifest
index 16b6fe43d8d4..dde3c28222fe 100644
--- a/net-proxy/3proxy/Manifest
+++ b/net-proxy/3proxy/Manifest
@@ -1 +1,2 @@
 DIST 3proxy-0.9.0.tar.gz 607014 BLAKE2B 
dae9004ea1474080fbbd4a3ff3a2690f8a6afb2ab2c045dbdaa25adf10ff2c58501d46a5a99b24db526b153ce00d281851ec08499d908709c5801c27aa7b0ca8
 SHA512 
7429389bf70c38d57e7a6f34e649a04aaad4f81555b7ef131cae026123ff7877d3f1aef8d10f84b9fc2c58e9ad5ab3d55e4af7326dbce14c05f3cd9973fafd83
+DIST 3proxy-0.9.4.tar.gz 610340 BLAKE2B 
7b98cc26fc943fcf15a6518a7adb79ccc79d8250b359f97318e9a48b4bb2643a88ee5fed49216d4ee71b436d0a21231e148f616c78b1dfab8b0b720a4223ccfd
 SHA512 
d3316f6ee1217e580ce593a7bfd9d76672487a89862f247373b0acf3ea207887c758168e33b25db9fc974063deab0826c20d455cab2536d03eee49d8bddda6b5

diff --git a/net-proxy/3proxy/files/3proxy-0.9.4-function-pointer-fix.patch 
b/net-proxy/3proxy/files/3proxy-0.9.4-function-pointer-fix.patch
new file mode 100644
index 000000000000..9c51f90f1df1
--- /dev/null
+++ b/net-proxy/3proxy/files/3proxy-0.9.4-function-pointer-fix.patch
@@ -0,0 +1,58 @@
+Use poll with nfds_t type
+
+Fixes: https://github.com/3proxy/3proxy/issues/895
+Bug: https://bugs.gentoo.org/881015
+Upstream-PR: https://github.com/3proxy/3proxy/pull/907
+
+diff --git a/src/common.c b/src/common.c
+index e8106e2..27ad390 100644
+--- a/src/common.c
++++ b/src/common.c
+@@ -157,7 +157,7 @@ int
+  WINAPI
+ #endif
+ 
+-    mypoll(struct mypollfd *fds, unsigned int nfds, int timeout){
++    mypoll(struct mypollfd *fds, nfds_t nfds, int timeout){
+       fd_set readfd;
+       fd_set writefd;
+       fd_set oobfd;
+diff --git a/src/structures.h b/src/structures.h
+index 8d41374..ee778c2 100644
+--- a/src/structures.h
++++ b/src/structures.h
+@@ -69,6 +69,7 @@ int mutex_unlock(int *val);
+ #ifdef WITH_POLL
+ #include <poll.h>
+ #else
++typedef unsigned int nfds_t;
+ #ifdef WITH_WSAPOLL
+ 
+ #define poll(A,B,C) WSAPoll(A,B,C)
+@@ -84,7 +85,7 @@ int
+ #ifdef _WIN32
+   WINAPI
+ #endif
+-   mypoll(struct mypollfd *fds, unsigned int nfds, int timeout);
++   mypoll(struct mypollfd *fds, nfds_t nfds, int timeout);
+ #ifndef POLLIN
+ #define POLLIN 1
+ #endif
+@@ -701,7 +702,7 @@ struct sockfuncs {
+       int (WINAPI *_getsockname)(SOCKET s, struct sockaddr * name, int * 
namelen);
+       int (WINAPI *_getsockopt)(SOCKET s, int level, int optname, char * 
optval, int * optlen);
+       int (WINAPI *_setsockopt)(SOCKET s, int level, int optname, const char 
*optval, int optlen);
+-      int (WINAPI *_poll)(struct pollfd *fds, unsigned int nfds, int timeout);
++      int (WINAPI *_poll)(struct pollfd *fds, nfds_t nfds, int timeout);
+       int (WINAPI *_send)(SOCKET s, const char *msg, int len, int flags);
+       int  (WINAPI *_sendto)(SOCKET s, const char *msg, int len, int flags, 
const struct sockaddr *to, int tolen);
+       int  (WINAPI *_recv)(SOCKET s, char *buf, int len, int flags);
+@@ -718,7 +719,7 @@ struct sockfuncs {
+       int (*_getsockname)(SOCKET s, struct sockaddr * name, socklen_t * 
namelen);
+       int (*_getsockopt)(SOCKET s, int level, int optname, void * optval, 
socklen_t * optlen);
+       int (*_setsockopt)(int s, int level, int optname, const void *optval, 
socklen_t optlen);
+-      int (*_poll)(struct pollfd *fds, unsigned int nfds, int timeout);
++      int (*_poll)(struct pollfd *fds, nfds_t nfds, int timeout);
+       size_t (*_send)(SOCKET s, const void *msg, size_t len, int flags);
+       size_t (*_sendto)(SOCKET s, const void *msg, size_t len, int flags, 
const struct sockaddr *to, SASIZETYPE tolen);
+       size_t (*_recv)(SOCKET s, void *buf, size_t len, int flags);

diff --git a/net-proxy/3proxy/files/3proxy-0.9.4-gentoo.patch 
b/net-proxy/3proxy/files/3proxy-0.9.4-gentoo.patch
new file mode 100644
index 000000000000..57a9b479f1e3
--- /dev/null
+++ b/net-proxy/3proxy/files/3proxy-0.9.4-gentoo.patch
@@ -0,0 +1,38 @@
+diff --git a/Makefile.Linux b/Makefile.Linux
+index 4f3f2b3..f15f6ff 100644
+--- a/Makefile.Linux
++++ b/Makefile.Linux
+@@ -8,13 +8,13 @@
+ # library support. Add -DSAFESQL for poorely written ODBC library / drivers.
+ 
+ BUILDDIR = ../bin/
+-CC = gcc
++CC ?= gcc
+ 
+-CFLAGS = -g  -fPIC -O2 -fno-strict-aliasing -c -pthread -DWITHSPLICE 
-D_GNU_SOURCE -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DNOODBC 
-DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER
++CFLAGS += -fPIC -fno-strict-aliasing -c -pthread -DWITHSPLICE -D_GNU_SOURCE 
-DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DWITH_STD_MALLOC 
-DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER
+ COUT = -o 
+ LN = $(CC)
+ DCFLAGS = 
+-LDFLAGS = -fPIE -O2 -fno-strict-aliasing -pthread
++LDFLAGS += -fPIE -fno-strict-aliasing -pthread
+ DLFLAGS = -shared
+ DLSUFFICS = .ld.so
+ # -lpthreads may be reuqired on some platforms instead of -pthreads
+@@ -40,13 +40,13 @@ PLUGINS = StringsPlugin TrafficPlugin PCREPlugin 
TransparentPlugin
+ include Makefile.inc
+ 
+ allplugins:
+-      @list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var 
plugins/$$p; cd plugins/$$p ; make ;   cd ../.. ; done
++      @list='$(PLUGINS)'; for p in $$list; do cp Makefile Makefile.var 
plugins/$$p; cd plugins/$$p ; $(MAKE) ; cd ../.. ; done
+ 
+ DESTDIR               =
+ prefix                = 
+ exec_prefix   = $(prefix)
+-man_prefix    = /usr/share
+-chroot_prefix = /usr/local
++man_prefix    = $(prefix)/usr/share
++chroot_prefix = $(prefix)/usr/local
+ 
+ INSTALL               = /usr/bin/install
+ INSTALL_BIN   = $(INSTALL) -m 755

Reply via email to