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
This commit is contained in:
OBS User mrdocs 2017-06-14 19:46:07 +00:00 committed by Git OBS Bridge
parent 57d2c9f8e5
commit e3b5845c6e
7 changed files with 59 additions and 120 deletions

View File

@ -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 Wed Jan 6 10:26:26 UTC 2016 - hsk@imb-jena.de

View File

@ -1,7 +1,7 @@
# #
# spec file for package rsync # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # 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 Name: rsync
Version: 3.1.2 Version: 3.1.2
Release: 0 Release: 0
@ -28,20 +23,19 @@ Summary: Versatile tool for fast incremental file transfer
License: GPL-3.0+ License: GPL-3.0+
Group: Productivity/Networking/Other Group: Productivity/Networking/Other
Url: http://rsync.samba.org/ Url: http://rsync.samba.org/
Source: http://rsync.samba.org/ftp/rsync/src/rsync-%{version}.tar.gz 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 Source1: http://rsync.samba.org/ftp/rsync/src/rsync-patches-%{version}.tar.gz
Source2: logrotate.rsync Source2: logrotate.rsync
Source3: rsync.xinetd Source3: rsyncd.socket
Source4: rsyncd.rc Source4: rsyncd.rc
Source5: rsyncd.conf Source5: rsyncd.conf
Source6: rsyncd.secrets Source6: rsyncd.secrets
Source7: rsync-server.firewall Source7: rsync-server.firewall
Source8: rsyncd.service Source8: rsyncd.service
Source9: rsyncd@.service
Source10: http://rsync.samba.org/ftp/rsync/src/rsync-%{version}.tar.gz.asc 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 Source11: http://rsync.samba.org/ftp/rsync/src/rsync-patches-%{version}.tar.gz.asc
Source12: %{name}.keyring Source12: %{name}.keyring
Patch3: system-zlib.diff
Patch5: rsync-no-libattr.patch Patch5: rsync-no-libattr.patch
#PATCH-FIX-SUSE boo#922710 slp #PATCH-FIX-SUSE boo#922710 slp
Patch6: rsync-add_back_use_slp_directive.patch Patch6: rsync-add_back_use_slp_directive.patch
@ -50,22 +44,13 @@ BuildRequires: automake
BuildRequires: libacl-devel BuildRequires: libacl-devel
BuildRequires: openslp-devel BuildRequires: openslp-devel
BuildRequires: popt-devel BuildRequires: popt-devel
BuildRequires: systemd-rpm-macros
BuildRequires: zlib-devel BuildRequires: zlib-devel
Requires(post): grep
PreReq: %fillup_prereq Requires(post): sed
PreReq: grep
PreReq: sed
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1010
Recommends: logrotate Recommends: logrotate
%endif BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1140
BuildRequires: systemd
%{?systemd_requires} %{?systemd_requires}
%define has_systemd 1
%else
PreReq: %insserv_prereq
%endif
%description %description
Rsync is a fast and extraordinarily versatile file copying tool. It can copy 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. for backups and mirroring and as an improved copy command for everyday use.
%prep %prep
%setup -q -b 1 -n %{name}-%{version} %setup -q -b 1
%if %with_system_zlib
rm -f zlib/*.h rm -f zlib/*.h
%patch3
%endif
patch -p1 < patches/acls.diff patch -p1 < patches/acls.diff
patch -p1 < patches/xattrs.diff patch -p1 < patches/xattrs.diff
patch -p1 < patches/slp.diff patch -p1 < patches/slp.diff
@ -90,20 +72,23 @@ patch -p1 < patches/slp.diff
# fate#312479 # fate#312479
patch -p1 < patches/time-limit.diff patch -p1 < patches/time-limit.diff
%patch5 -p1 %patch5 -p1
%build %build
autoreconf -fiv autoreconf -fiv
export CFLAGS="%optflags -fPIC -DPIC -fPIE" export CFLAGS="%{optflags} -fPIC -DPIC -fPIE"
export LDFLAGS="-Wl,-z,relro,-z,now -pie" export LDFLAGS="-Wl,-z,relro,-z,now -pie"
%configure \ %configure \
--with-included-popt=no \
--with-included-zlib=no \
--disable-debug \ --disable-debug \
--enable-slp \ --enable-slp \
--enable-acl-support \ --enable-acl-support \
--enable-xattr-support --enable-xattr-support
make reconfigure make %{?_smp_mflags} reconfigure
make %{?_smp_mflags} make %{?_smp_mflags}
%install %install
make install DESTDIR="%buildroot" %make_install
rm -f %{buildroot}%{_sbindir}/rsyncd rm -f %{buildroot}%{_sbindir}/rsyncd
install -d %{buildroot}%{_sysconfdir}/logrotate.d install -d %{buildroot}%{_sysconfdir}/logrotate.d
install -d %{buildroot}%{_sysconfdir}/init.d install -d %{buildroot}%{_sysconfdir}/init.d
@ -112,67 +97,42 @@ install -d %{buildroot}%{_prefix}/sbin
ln -sf ../bin/rsync %{buildroot}%{_sbindir}/rsyncd ln -sf ../bin/rsync %{buildroot}%{_sbindir}/rsyncd
install -m 755 support/rsyncstats %{buildroot}%{_prefix}/bin install -m 755 support/rsyncstats %{buildroot}%{_prefix}/bin
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/rsync 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 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/rsyncd.conf
install -m 600 %{SOURCE6} %{buildroot}%{_sysconfdir}/rsyncd.secrets install -m 600 %{SOURCE6} %{buildroot}%{_sysconfdir}/rsyncd.secrets
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services mkdir -p %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services
install -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/rsync-server install -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/rsync-server
%if 0%{?has_systemd} install -D -m 0644 %{SOURCE9} %{buildroot}%{_unitdir}/rsyncd@.service
install -D -m 0644 %SOURCE8 %{buildroot}%{_unitdir}/rsyncd.service install -D -m 0644 %{SOURCE8} %{buildroot}%{_unitdir}/rsyncd.service
ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rcrsyncd install -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/rsyncd.socket
%else ln -sf service %{buildroot}%{_sbindir}/rcrsyncd
install -m 755 %{SOURCE4} %{buildroot}%{_initddir}/rsyncd
ln -sf ../../etc/init.d/rsyncd %{buildroot}%{_sbindir}/rcrsyncd
%endif
%pre %pre
%if 0%{?has_systemd}
%service_add_pre rsyncd.service %service_add_pre rsyncd.service
%endif
%preun %preun
%if 0%{?has_systemd}
%service_del_preun rsyncd.service %service_del_preun rsyncd.service
%else
%stop_on_removal rsyncd
%endif
%post %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 %service_add_post rsyncd.service
%else
%fillup_and_insserv rsyncd
%endif
%postun %postun
%if 0%{?has_systemd}
%service_del_postun rsyncd.service %service_del_postun rsyncd.service
%else
%restart_on_update rsyncd
%insserv_cleanup
%endif
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%if 0%{?has_systemd} %{_unitdir}/rsyncd@.service
%{_unitdir}/rsyncd.service %{_unitdir}/rsyncd.service
%else %{_unitdir}/rsyncd.socket
%config %{_sysconfdir}/init.d/rsyncd
%endif
%config(noreplace) %{_sysconfdir}/rsyncd.conf %config(noreplace) %{_sysconfdir}/rsyncd.conf
%config(noreplace) %{_sysconfdir}/rsyncd.secrets %config(noreplace) %{_sysconfdir}/rsyncd.secrets
%config(noreplace) %{_sysconfdir}/logrotate.d/rsync %config(noreplace) %{_sysconfdir}/logrotate.d/rsync
%config(noreplace) %{_sysconfdir}/xinetd.d/rsync
%{_sbindir}/rcrsyncd %{_sbindir}/rcrsyncd
%{_sbindir}/rsyncd %{_sbindir}/rsyncd
%{_bindir}/rsyncstats %{_bindir}/rsyncstats
%{_bindir}/rsync %{_bindir}/rsync
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/* %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/*
%doc %{_mandir}/man1/rsync.1.gz %{_mandir}/man1/rsync.1%{ext_man}
%doc %{_mandir}/man5/rsyncd.conf.5.gz %{_mandir}/man5/rsyncd.conf.5%{ext_man}
%doc COPYING NEWS README tech_report.tex %doc COPYING NEWS README tech_report.tex
%changelog %changelog

View File

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

View File

@ -1,6 +1,7 @@
[Unit] [Unit]
Description=Start the rsync server daemon Description=Start the rsync server daemon
After=network.target After=network.target
ConditionPathExists=/etc/rsyncd.conf
[Service] [Service]
ExecStart=/usr/sbin/rsyncd --daemon --no-detach ExecStart=/usr/sbin/rsyncd --daemon --no-detach
@ -9,4 +10,4 @@ CPUSchedulingPolicy=batch
PrivateTmp=true PrivateTmp=true
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

10
rsyncd.socket Normal file
View File

@ -0,0 +1,10 @@
[Unit]
Description=Rsync Server Socket
Conflicts=rsyncd.service
[Socket]
ListenStream=873
Accept=yes
[Install]
WantedBy=sockets.target

11
rsyncd@.service Normal file
View File

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

View File

@ -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 <zlib.h>
#include <time.h>
extern int eol_nulls;
--- options.c
+++ options.c
@@ -22,7 +22,7 @@
#include "rsync.h"
#include "ifuncs.h"
#include <popt.h>
-#include "zlib/zlib.h"
+#include <zlib.h>
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 <zlib.h>
extern int do_compression;
extern int module_id;