[packages/3proxy] - rel 2 - use cmake instead of weird hacks - install systemd service
baggins
baggins at pld-linux.org
Thu May 14 23:29:02 CEST 2026
commit 64ba36911c235e636c4fa26620a9fcfe9e14f7cd
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Fri May 15 01:28:13 2026 +0200
- rel 2
- use cmake instead of weird hacks
- install systemd service
3proxy-no-strip-install.patch | 13 -----------
3proxy.spec | 50 ++++++++++++++++++++++---------------------
2 files changed, 26 insertions(+), 37 deletions(-)
---
diff --git a/3proxy.spec b/3proxy.spec
index ca8856a..ae54a43 100644
--- a/3proxy.spec
+++ b/3proxy.spec
@@ -5,15 +5,18 @@ Summary: 3APA3A 3proxy tiny proxy server
Summary(pl.UTF-8): Mały serwer proxy 3APA3A 3proxy
Name: 3proxy
Version: 0.9.6
-Release: 1
+Release: 2
License: BSD or Apache v2.0 or LGPL v2.1+
Group: Networking/Daemons
#Source0Download: https://github.com/z3APA3A/3proxy/releases/
Source0: https://github.com/z3APA3A/3proxy/archive/%{version}/%{name}-%{version}.tar.gz
# Source0-md5: de5acece4cbfc711dd15f76a00d01e74
URL: https://3proxy.ru/?l=EN
+BuildRequires: cmake
+BuildRequires: rpmbuild(macros) >= 2.011
+Requires(post,preun,postun): systemd-units >= 1:250.1
+Requires: systemd-units >= 1:250.1
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-Patch0: %{name}-no-strip-install.patch
%description
3APA3A 3proxy tiny proxy server.
@@ -23,44 +26,39 @@ Mały serwer proxy 3APA3A 3proxy.
%prep
%setup -q
-%patch -P0 -p1
+
+%{__sed} -i -e '0,/^#!.*3proxy/{/^#!.*3proxy/d}' scripts/*.cfg*
%build
-%{__make} -f Makefile.Linux \
- CC="%{__cc}" \
- CFLAGS="%{rpmcflags} %{rpmcppflags} -fno-strict-aliasing -pthread -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL -c" \
- LN="%{__cc}" \
- DCFLAGS="-fPIC" \
- LDFLAGS="%{rpmldflags} %{rpmcflags} -pthread"
+mkdir -p build
+cd build
+%cmake ..
+%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-%{__make} -f Makefile.Linux install \
- DESTDIR=$RPM_BUILD_ROOT \
- prefix=%{_prefix} \
- ETCDIR=$RPM_BUILD_ROOT%{_sysconfdir}/3proxy
+%{__make} -C build install \
+ DESTDIR=$RPM_BUILD_ROOT
# fix page
%{__mv} $RPM_BUILD_ROOT%{_mandir}/man{3,5}
%{__mv} $RPM_BUILD_ROOT%{_mandir}/man5/3proxy.cfg.{3,5}
-# allow modifications
-chmod -R u+w $RPM_BUILD_ROOT
-
-# cleanup unpackaged
-rm -rf $RPM_BUILD_ROOT/usr/local
-rm -rf $RPM_BUILD_ROOT/var/log
-rm -rf $RPM_BUILD_ROOT/var/run
-rm -rf $RPM_BUILD_ROOT/etc/init.d
-rm -rf $RPM_BUILD_ROOT/usr/lib/systemd
-rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/3proxy/conf
-
touch $RPM_BUILD_ROOT%{_sysconfdir}/3proxy/{bandlimiters,counters,passwd}
%clean
rm -rf $RPM_BUILD_ROOT
+%post
+%systemd_post 3proxy.service
+
+%preun
+%systemd_preun 3proxy.service
+
+%postun
+%systemd_postun_with_restart 3proxy.service
+
%files
%defattr(644,root,root,755)
%doc README authors copying doc/html
@@ -71,11 +69,15 @@ rm -rf $RPM_BUILD_ROOT
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/3proxy/counters
# FIXME: 3proxy specific user?
%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/3proxy/passwd
+%{systemdunitdir}/3proxy.service
+%{systemdtmpfilesdir}/3proxy.conf
+%attr(755,root,root) %{_bindir}/add3proxyuser.sh
%attr(755,root,root) %{_bindir}/3proxy
%attr(755,root,root) %{_bindir}/ftppr
%attr(755,root,root) %{_bindir}/mycrypt
%attr(755,root,root) %{_bindir}/pop3p
%attr(755,root,root) %{_bindir}/proxy
+%attr(755,root,root) %{_bindir}/smtpp
%attr(755,root,root) %{_bindir}/socks
%attr(755,root,root) %{_bindir}/tcppm
%attr(755,root,root) %{_bindir}/tlspr
diff --git a/3proxy-no-strip-install.patch b/3proxy-no-strip-install.patch
deleted file mode 100644
index a8a68e3..0000000
--- a/3proxy-no-strip-install.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- 3proxy-0.9.6/Makefile.Linux.orig 2026-04-11 00:00:00.000000000 +0000
-+++ 3proxy-0.9.6/Makefile.Linux 2026-04-11 00:00:00.000000000 +0000
-@@ -97,8 +97,8 @@
-
- install-bin:
- $(INSTALL_BIN) -d $(BINDIR)
-- $(INSTALL_BIN) -s $(INSTALL_OBJS) $(BINDIR)
-- $(INSTALL_BIN) -s bin/*.ld.so $(CHROOTDIR)/libexec
-+ $(INSTALL_BIN) $(INSTALL_OBJS) $(BINDIR)
-+ $(INSTALL_BIN) bin/*.ld.so $(CHROOTDIR)/libexec
-
- install-etc-dir:
- $(INSTALL_BIN) -d $(ETCDIR)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/3proxy.git/commitdiff/64ba36911c235e636c4fa26620a9fcfe9e14f7cd
More information about the pld-cvs-commit
mailing list