diff options
author | 2025-04-04 18:25:35 +0000 | |
---|---|---|
committer | 2025-04-29 20:28:21 +0100 | |
commit | f58b6eb230c72471121def40ce3206405d969237 (patch) | |
tree | 82ec674565d323fa532bdeb627c6a7308a5421cc /net-proxy | |
parent | dev-cpp/opentelemetry-cpp: bump to v1.20.0 (diff) | |
download | gentoo-f58b6eb230c72471121def40ce3206405d969237.tar.gz gentoo-f58b6eb230c72471121def40ce3206405d969237.tar.bz2 gentoo-f58b6eb230c72471121def40ce3206405d969237.zip |
net-proxy/3proxy: add 0.9.5
update HOMEPAGE (.ru -> .org)
add user/group
patches rebased
add confdir / initscript / unit.service
Signed-off-by: Nicolas PARLANT <[email protected]>
Part-of: https://github.com/gentoo/gentoo/pull/41457
Signed-off-by: Sam James <[email protected]>
Diffstat (limited to 'net-proxy')
-rw-r--r-- | net-proxy/3proxy/3proxy-0.9.5.ebuild | 62 | ||||
-rw-r--r-- | net-proxy/3proxy/Manifest | 1 | ||||
-rw-r--r-- | net-proxy/3proxy/files/3proxy-0.9.5-function-pointer-fix.patch | 49 | ||||
-rw-r--r-- | net-proxy/3proxy/files/3proxy-0.9.5-gentoo.patch | 51 | ||||
-rw-r--r-- | net-proxy/3proxy/files/3proxy.initd | 15 |
5 files changed, 178 insertions, 0 deletions
diff --git a/net-proxy/3proxy/3proxy-0.9.5.ebuild b/net-proxy/3proxy/3proxy-0.9.5.ebuild new file mode 100644 index 000000000000..93dca89544ec --- /dev/null +++ b/net-proxy/3proxy/3proxy-0.9.5.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit systemd toolchain-funcs + +DESCRIPTION="Really tiny cross-platform proxy servers set" +HOMEPAGE=" + https://3proxy.org/ + 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" + +RDEPEND=" + acct-group/3proxy + acct-user/3proxy +" + +PATCHES=( + "${FILESDIR}/${PN}-0.9.5-gentoo.patch" + "${FILESDIR}/${PN}-0.9.5-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 || die + dolib.so *.so + dobin 3proxy + for x in $(find -type f -executable ! -name '*.so' ! -name 3proxy -printf '%f\n'); do + newbin ${x} ${PN}-${x} + [[ -f "${S}"/man/${x}.8 ]] && newman "${S}"/man/${x}.8 ${PN}-${x}.8 + done + popd || die + + diropts -m 0700 -o 3proxy -g 3proxy + dodir /etc/3proxy + + insinto /etc/3proxy + insopts -m 0600 -o 3proxy -g 3proxy + doins cfg/3proxy.cfg.sample cfg/counters.sample + + newinitd "${FILESDIR}"/3proxy.initd 3proxy + systemd_dounit scripts/3proxy.service + + doman man/3proxy*.[38] + + einstalldocs +} diff --git a/net-proxy/3proxy/Manifest b/net-proxy/3proxy/Manifest index 45d5f8ce6708..c9b6c2c7e518 100644 --- a/net-proxy/3proxy/Manifest +++ b/net-proxy/3proxy/Manifest @@ -1 +1,2 @@ DIST 3proxy-0.9.4.tar.gz 610340 BLAKE2B 7b98cc26fc943fcf15a6518a7adb79ccc79d8250b359f97318e9a48b4bb2643a88ee5fed49216d4ee71b436d0a21231e148f616c78b1dfab8b0b720a4223ccfd SHA512 d3316f6ee1217e580ce593a7bfd9d76672487a89862f247373b0acf3ea207887c758168e33b25db9fc974063deab0826c20d455cab2536d03eee49d8bddda6b5 +DIST 3proxy-0.9.5.tar.gz 620563 BLAKE2B acf1bf60fca9150e0a486939d49773864b87d34663245bfbd24bdb34d4030d2bdb6623706a7586579810c517fcccfeaf3295737daa97c6c65750ff3ae48710bf SHA512 b668db6438da19ee2479228af744b9b3b9ff2c7e6d97aaf3b20737b165ab2baf656ac9ea92b6f1e169c428784c7d9e3e7eeb7c3effb1c0b77e5038319b6d2bcd diff --git a/net-proxy/3proxy/files/3proxy-0.9.5-function-pointer-fix.patch b/net-proxy/3proxy/files/3proxy-0.9.5-function-pointer-fix.patch new file mode 100644 index 000000000000..665e19793b1d --- /dev/null +++ b/net-proxy/3proxy/files/3proxy-0.9.5-function-pointer-fix.patch @@ -0,0 +1,49 @@ +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 ec25eb6..7a64a08 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 a2f5ba7..0db681b 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 +@@ -434,7 +435,7 @@ struct sockfuncs { + int (WINAPI *_getsockname)(void* state, SOCKET s, struct sockaddr * name, int * namelen); + int (WINAPI *_getsockopt)(void* state, SOCKET s, int level, int optname, char * optval, int * optlen); + int (WINAPI *_setsockopt)(void* state, SOCKET s, int level, int optname, const char *optval, int optlen); +- int (WINAPI *_poll)(void* state, struct pollfd *fds, unsigned int nfds, int timeout); ++ int (WINAPI *_poll)(void* state, struct pollfd *fds, nfds_t nfds, int timeout); + int (WINAPI *_send)(void* state, SOCKET s, const char *msg, int len, int flags); + int (WINAPI *_sendto)(void* state, SOCKET s, const char *msg, int len, int flags, const struct sockaddr *to, int tolen); + int (WINAPI *_recv)(void* state, SOCKET s, char *buf, int len, int flags); diff --git a/net-proxy/3proxy/files/3proxy-0.9.5-gentoo.patch b/net-proxy/3proxy/files/3proxy-0.9.5-gentoo.patch new file mode 100644 index 000000000000..1daf65c95b5b --- /dev/null +++ b/net-proxy/3proxy/files/3proxy-0.9.5-gentoo.patch @@ -0,0 +1,51 @@ +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 = -fPIC -O2 -fno-strict-aliasing -pthread ++LDFLAGS += -fPIC -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 +diff --git a/scripts/3proxy.service b/scripts/3proxy.service +index cdb3af2..6e71d4d 100644 +--- a/scripts/3proxy.service ++++ b/scripts/3proxy.service +@@ -5,7 +5,7 @@ After=network.target + + [Service] + Environment=CONFIGFILE=/etc/3proxy/3proxy.cfg +-ExecStart=/bin/3proxy ${CONFIGFILE} ++ExecStart=/usr/bin/3proxy ${CONFIGFILE} + ExecReload=/bin/kill -SIGUSR1 $MAINPID + KillMode=process + Restart=on-failure diff --git a/net-proxy/3proxy/files/3proxy.initd b/net-proxy/3proxy/files/3proxy.initd new file mode 100644 index 000000000000..68c1038b0cfb --- /dev/null +++ b/net-proxy/3proxy/files/3proxy.initd @@ -0,0 +1,15 @@ +#!/sbin/openrc-run +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +name="3proxy daemon" +description="A really tiny cross-platform proxy servers set" +command=/usr/bin/3proxy +command_args="/etc/3proxy/3proxy.cfg" +command_user="3proxy:3proxy" +command_background=yes +pidfile="/run/3proxy.pid" + +depend() { +use dns +} |