From e3b5845c6e650c8a485753add801bd4161ded9ce5bb1f52bad52ea8d2421ba4d Mon Sep 17 00:00:00 2001 From: OBS User mrdocs Date: Wed, 14 Jun 2017 19:46:07 +0000 Subject: [PATCH] Accepting request 503686 from home:scarabeus_iv:branches:network - We no longer need to inject the pid in post as we do not use the iniscript relying on it - Add socket activation service instead of the xinetd service - Verify in services the configuration to run actually exist - Drop sle11 support as it does not autoreconf anymore - Drop patch system-zlib.diff that was never applied - Switch to system popt and zlib: * This should not cause issues now because upstream states the underlying issue why we used the bundled one was fixed by using more safeguarded error detection OBS-URL: https://build.opensuse.org/request/show/503686 OBS-URL: https://build.opensuse.org/package/show/network/rsync?expand=0&rev=52 --- rsync.changes | 14 ++++++++ rsync.spec | 84 +++++++++++++----------------------------------- rsync.xinetd | 12 ------- rsyncd.service | 3 +- rsyncd.socket | 10 ++++++ rsyncd@.service | 11 +++++++ system-zlib.diff | 45 -------------------------- 7 files changed, 59 insertions(+), 120 deletions(-) delete mode 100644 rsync.xinetd create mode 100644 rsyncd.socket create mode 100644 rsyncd@.service delete mode 100644 system-zlib.diff diff --git a/rsync.changes b/rsync.changes index 4f45507..88f645b 100644 --- a/rsync.changes +++ b/rsync.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Wed Jun 14 12:21:21 UTC 2017 - tchvatal@suse.com + +- We no longer need to inject the pid in post as we do not use + the iniscript relying on it +- Add socket activation service instead of the xinetd service +- Verify in services the configuration to run actually exist +- Drop sle11 support as it does not autoreconf anymore +- Drop patch system-zlib.diff that was never applied +- Switch to system popt and zlib: + * This should not cause issues now because upstream states the + underlying issue why we used the bundled one was fixed by + using more safeguarded error detection + ------------------------------------------------------------------- Wed Jan 6 10:26:26 UTC 2016 - hsk@imb-jena.de diff --git a/rsync.spec b/rsync.spec index 223a4ca..9b6c8fa 100644 --- a/rsync.spec +++ b/rsync.spec @@ -1,7 +1,7 @@ # # spec file for package rsync # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,11 +16,6 @@ # -%define with_system_zlib 0 -%if 0%{?suse_version} < 1120 -%define _initddir %{_sysconfdir}/init.d -%endif - Name: rsync Version: 3.1.2 Release: 0 @@ -28,20 +23,19 @@ Summary: Versatile tool for fast incremental file transfer License: GPL-3.0+ Group: Productivity/Networking/Other Url: http://rsync.samba.org/ - Source: http://rsync.samba.org/ftp/rsync/src/rsync-%{version}.tar.gz Source1: http://rsync.samba.org/ftp/rsync/src/rsync-patches-%{version}.tar.gz Source2: logrotate.rsync -Source3: rsync.xinetd +Source3: rsyncd.socket Source4: rsyncd.rc Source5: rsyncd.conf Source6: rsyncd.secrets Source7: rsync-server.firewall Source8: rsyncd.service +Source9: rsyncd@.service Source10: http://rsync.samba.org/ftp/rsync/src/rsync-%{version}.tar.gz.asc Source11: http://rsync.samba.org/ftp/rsync/src/rsync-patches-%{version}.tar.gz.asc Source12: %{name}.keyring -Patch3: system-zlib.diff Patch5: rsync-no-libattr.patch #PATCH-FIX-SUSE boo#922710 slp Patch6: rsync-add_back_use_slp_directive.patch @@ -50,22 +44,13 @@ BuildRequires: automake BuildRequires: libacl-devel BuildRequires: openslp-devel BuildRequires: popt-devel +BuildRequires: systemd-rpm-macros BuildRequires: zlib-devel - -PreReq: %fillup_prereq -PreReq: grep -PreReq: sed -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if 0%{?suse_version} > 1010 +Requires(post): grep +Requires(post): sed Recommends: logrotate -%endif -%if 0%{?suse_version} > 1140 -BuildRequires: systemd +BuildRoot: %{_tmppath}/%{name}-%{version}-build %{?systemd_requires} -%define has_systemd 1 -%else -PreReq: %insserv_prereq -%endif %description Rsync is a fast and extraordinarily versatile file copying tool. It can copy @@ -78,11 +63,8 @@ source files and the existing files in the destination. Rsync is widely used for backups and mirroring and as an improved copy command for everyday use. %prep -%setup -q -b 1 -n %{name}-%{version} -%if %with_system_zlib +%setup -q -b 1 rm -f zlib/*.h -%patch3 -%endif patch -p1 < patches/acls.diff patch -p1 < patches/xattrs.diff patch -p1 < patches/slp.diff @@ -90,20 +72,23 @@ patch -p1 < patches/slp.diff # fate#312479 patch -p1 < patches/time-limit.diff %patch5 -p1 + %build autoreconf -fiv -export CFLAGS="%optflags -fPIC -DPIC -fPIE" +export CFLAGS="%{optflags} -fPIC -DPIC -fPIE" export LDFLAGS="-Wl,-z,relro,-z,now -pie" %configure \ + --with-included-popt=no \ + --with-included-zlib=no \ --disable-debug \ --enable-slp \ --enable-acl-support \ --enable-xattr-support -make reconfigure +make %{?_smp_mflags} reconfigure make %{?_smp_mflags} %install -make install DESTDIR="%buildroot" +%make_install rm -f %{buildroot}%{_sbindir}/rsyncd install -d %{buildroot}%{_sysconfdir}/logrotate.d install -d %{buildroot}%{_sysconfdir}/init.d @@ -112,67 +97,42 @@ install -d %{buildroot}%{_prefix}/sbin ln -sf ../bin/rsync %{buildroot}%{_sbindir}/rsyncd install -m 755 support/rsyncstats %{buildroot}%{_prefix}/bin install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/rsync -install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/xinetd.d/rsync install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/rsyncd.conf install -m 600 %{SOURCE6} %{buildroot}%{_sysconfdir}/rsyncd.secrets mkdir -p %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services install -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/rsync-server -%if 0%{?has_systemd} -install -D -m 0644 %SOURCE8 %{buildroot}%{_unitdir}/rsyncd.service -ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rcrsyncd -%else -install -m 755 %{SOURCE4} %{buildroot}%{_initddir}/rsyncd -ln -sf ../../etc/init.d/rsyncd %{buildroot}%{_sbindir}/rcrsyncd -%endif +install -D -m 0644 %{SOURCE9} %{buildroot}%{_unitdir}/rsyncd@.service +install -D -m 0644 %{SOURCE8} %{buildroot}%{_unitdir}/rsyncd.service +install -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/rsyncd.socket +ln -sf service %{buildroot}%{_sbindir}/rcrsyncd %pre -%if 0%{?has_systemd} %service_add_pre rsyncd.service -%endif %preun -%if 0%{?has_systemd} %service_del_preun rsyncd.service -%else -%stop_on_removal rsyncd -%endif %post -if ! grep -q "^pid file" /etc/rsyncd.conf ; then - sed -i -e "/^log file/{;p;s@\(.*\)@pid file = /var/run/rsyncd.pid@;}" /etc/rsyncd.conf -fi -%if 0%{?has_systemd} %service_add_post rsyncd.service -%else -%fillup_and_insserv rsyncd -%endif %postun -%if 0%{?has_systemd} %service_del_postun rsyncd.service -%else -%restart_on_update rsyncd -%insserv_cleanup -%endif %files %defattr(-,root,root) -%if 0%{?has_systemd} +%{_unitdir}/rsyncd@.service %{_unitdir}/rsyncd.service -%else -%config %{_sysconfdir}/init.d/rsyncd -%endif +%{_unitdir}/rsyncd.socket %config(noreplace) %{_sysconfdir}/rsyncd.conf %config(noreplace) %{_sysconfdir}/rsyncd.secrets %config(noreplace) %{_sysconfdir}/logrotate.d/rsync -%config(noreplace) %{_sysconfdir}/xinetd.d/rsync %{_sbindir}/rcrsyncd %{_sbindir}/rsyncd %{_bindir}/rsyncstats %{_bindir}/rsync %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/* -%doc %{_mandir}/man1/rsync.1.gz -%doc %{_mandir}/man5/rsyncd.conf.5.gz +%{_mandir}/man1/rsync.1%{ext_man} +%{_mandir}/man5/rsyncd.conf.5%{ext_man} %doc COPYING NEWS README tech_report.tex %changelog diff --git a/rsync.xinetd b/rsync.xinetd deleted file mode 100644 index deb581c..0000000 --- a/rsync.xinetd +++ /dev/null @@ -1,12 +0,0 @@ -# default: off -# description: rsync file transfer daemon -service rsync -{ - socket_type = stream - protocol = tcp - wait = no - user = root - server = /usr/sbin/rsyncd - server_args = --daemon - disable = yes -} diff --git a/rsyncd.service b/rsyncd.service index 3e0d56a..89ebbd8 100644 --- a/rsyncd.service +++ b/rsyncd.service @@ -1,6 +1,7 @@ [Unit] Description=Start the rsync server daemon After=network.target +ConditionPathExists=/etc/rsyncd.conf [Service] ExecStart=/usr/sbin/rsyncd --daemon --no-detach @@ -9,4 +10,4 @@ CPUSchedulingPolicy=batch PrivateTmp=true [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target diff --git a/rsyncd.socket b/rsyncd.socket new file mode 100644 index 0000000..31b00a4 --- /dev/null +++ b/rsyncd.socket @@ -0,0 +1,10 @@ +[Unit] +Description=Rsync Server Socket +Conflicts=rsyncd.service + +[Socket] +ListenStream=873 +Accept=yes + +[Install] +WantedBy=sockets.target diff --git a/rsyncd@.service b/rsyncd@.service new file mode 100644 index 0000000..710ecd9 --- /dev/null +++ b/rsyncd@.service @@ -0,0 +1,11 @@ +[Unit] +Description=Start the rsync server daemon +After=network.target +ConditionPathExists=/etc/rsyncd.conf + +[Service] +ExecStart=/usr/sbin/rsyncd --daemon --no-detach +IOSchedulingClass=idle +CPUSchedulingPolicy=batch +PrivateTmp=true +StandardInput=socket diff --git a/system-zlib.diff b/system-zlib.diff deleted file mode 100644 index 7e72cb7..0000000 --- a/system-zlib.diff +++ /dev/null @@ -1,45 +0,0 @@ ---- Makefile.in -+++ Makefile.in -@@ -40,7 +40,8 @@ - DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o - popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \ - popt/popthelp.o popt/poptparse.o --OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@ -+OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) @BUILD_POPT@ -+LIBS += -lz - - TLS_OBJ = tls.o syscall.o lib/compat.o lib/snprintf.o lib/permstring.o lib/sysxattrs.o @BUILD_POPT@ - ---- batch.c -+++ batch.c -@@ -20,7 +20,7 @@ - */ - - #include "rsync.h" --#include "zlib/zlib.h" -+#include - #include - - extern int eol_nulls; ---- options.c -+++ options.c -@@ -22,7 +22,7 @@ - #include "rsync.h" - #include "ifuncs.h" - #include --#include "zlib/zlib.h" -+#include - - extern int module_id; - extern int sanitize_paths; ---- token.c -+++ token.c -@@ -21,7 +21,7 @@ - - #include "rsync.h" - #include "ifuncs.h" --#include "zlib/zlib.h" -+#include - - extern int do_compression; - extern int module_id;