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@atlas.cz>
Closes: https://github.com/gentoo/gentoo/pull/30287
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Petr Vaněk 2023-03-21 15:02:28 +01:00 committed by Sam James
parent ff19b5ca65
commit 20d962742d
No known key found for this signature in database
GPG Key ID: 738409F520DF9190
4 changed files with 144 additions and 0 deletions

View File

@ -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
}

View File

@ -1 +1,2 @@
DIST 3proxy-0.9.0.tar.gz 607014 BLAKE2B dae9004ea1474080fbbd4a3ff3a2690f8a6afb2ab2c045dbdaa25adf10ff2c58501d46a5a99b24db526b153ce00d281851ec08499d908709c5801c27aa7b0ca8 SHA512 7429389bf70c38d57e7a6f34e649a04aaad4f81555b7ef131cae026123ff7877d3f1aef8d10f84b9fc2c58e9ad5ab3d55e4af7326dbce14c05f3cd9973fafd83 DIST 3proxy-0.9.0.tar.gz 607014 BLAKE2B dae9004ea1474080fbbd4a3ff3a2690f8a6afb2ab2c045dbdaa25adf10ff2c58501d46a5a99b24db526b153ce00d281851ec08499d908709c5801c27aa7b0ca8 SHA512 7429389bf70c38d57e7a6f34e649a04aaad4f81555b7ef131cae026123ff7877d3f1aef8d10f84b9fc2c58e9ad5ab3d55e4af7326dbce14c05f3cd9973fafd83
DIST 3proxy-0.9.4.tar.gz 610340 BLAKE2B 7b98cc26fc943fcf15a6518a7adb79ccc79d8250b359f97318e9a48b4bb2643a88ee5fed49216d4ee71b436d0a21231e148f616c78b1dfab8b0b720a4223ccfd SHA512 d3316f6ee1217e580ce593a7bfd9d76672487a89862f247373b0acf3ea207887c758168e33b25db9fc974063deab0826c20d455cab2536d03eee49d8bddda6b5

View File

@ -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);

View File

@ -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