You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
172 lines
5.6 KiB
172 lines
5.6 KiB
## |
|
## rsync.spec -- OpenPKG RPM Package Specification |
|
## Copyright (c) 2000-2020 OpenPKG Project <http://openpkg.org/> |
|
## |
|
## Permission to use, copy, modify, and distribute this software for |
|
## any purpose with or without fee is hereby granted, provided that |
|
## the above copyright notice and this permission notice appear in all |
|
## copies. |
|
## |
|
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
|
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
|
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
|
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
|
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
|
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
|
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
## SUCH DAMAGE. |
|
## |
|
|
|
# package information |
|
Name: rsync |
|
Summary: Remote Filesystem Synchronization |
|
URL: http://rsync.samba.org/ |
|
Vendor: Andrew Tridgell & Paul Mackerras |
|
Packager: OpenPKG Project |
|
Distribution: OpenPKG Community |
|
Class: CORE |
|
Group: Filesystem |
|
License: GPL |
|
Version: 3.1.3 |
|
Release: 20180129 |
|
|
|
# package options |
|
%option with_iconv no |
|
%option with_fileflags no |
|
%option with_atimes no |
|
%option with_acls no |
|
|
|
# list of sources |
|
Source0: http://rsync.samba.org/ftp/rsync/rsync-%{version}.tar.gz |
|
Source1: http://rsync.samba.org/ftp/rsync/rsync-patches-%{version}.tar.gz |
|
Source2: rsync.conf |
|
Source3: rc.rsync |
|
Patch0: rsync.patch |
|
|
|
# build information |
|
BuildPreReq: OpenPKG, openpkg >= 20160101 |
|
PreReq: OpenPKG, openpkg >= 20160101 |
|
BuildPreReq: zlib |
|
%if "%{with_fileflags}" == "yes" || "%{with_atimes}" == "yes" || "%{with_acls}" == "yes" |
|
BuildPreReq: autoconf |
|
%endif |
|
%if "%{with_iconv}" == "yes" |
|
BuildPreReq: libiconv |
|
PreReq: libiconv |
|
%endif |
|
|
|
%description |
|
Rsync is a replacement for rcp(1) that has many more features. |
|
Rsync uses the "rsync algorithm" which provides a very fast method |
|
for bringing remote files into sync. It does this by sending just |
|
the differences in the files across the link, without requiring |
|
that both sets of files are present at one of the ends of the link |
|
beforehand. At first glance this may seem impossible because the |
|
calculation of differences between two files normally requires local |
|
access to both files. |
|
|
|
%track |
|
prog rsync = { |
|
version = %{version} |
|
url = http://rsync.samba.org/ftp/rsync/ |
|
regex = rsync-(\d+\.\d+\.\d+)\.tar\.gz |
|
} |
|
|
|
%prep |
|
# unpack vendor sources |
|
%setup -q |
|
%setup -q -T -D -b 1 |
|
%patch -p0 |
|
%if "%{with_fileflags}" == "yes" |
|
%{l_patch} -p1 -b <patches/fileflags.diff |
|
%endif |
|
%if "%{with_atimes}" == "yes" |
|
%{l_patch} -p1 -b <patches/atimes.diff |
|
%endif |
|
%if "%{with_acls}" == "yes" |
|
%{l_patch} -p1 -b <patches/acls.diff |
|
%endif |
|
|
|
%build |
|
# configure vendor sources |
|
%if "%{with_fileflags}" == "yes" || "%{with_atimes}" == "yes" || "%{with_acls}" == "yes" |
|
./prepare-source build |
|
%endif |
|
CC="%{l_cc}" \ |
|
CFLAGS="%{l_cflags -O} %{l_cppflags}" \ |
|
CPPFLAGS="%{l_cppflags}" \ |
|
LDFLAGS="%{l_ldflags}" \ |
|
GREP="grep" \ |
|
./configure \ |
|
--prefix=%{l_prefix} \ |
|
--mandir=%{l_prefix}/man \ |
|
--with-rsync-path="rsync" \ |
|
--with-rsyncd-conf=%{l_prefix}/etc/rsync/rsync.conf \ |
|
--disable-debug \ |
|
--disable-locale \ |
|
%if "%{with_iconv}" == "yes" |
|
--enable-iconv \ |
|
%else |
|
--disable-iconv \ |
|
%endif |
|
--with-included-zlib=no \ |
|
--with-included-popt \ |
|
--with-rsh="ssh" |
|
|
|
# build vendor sources |
|
%{l_make} %{l_mflags -O} PERL="%{l_miniperl}" |
|
|
|
%install |
|
# perform vendor installation |
|
%{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
|
|
|
# post-adjust vendor installation |
|
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
|
mv $RPM_BUILD_ROOT%{l_prefix}/man/man5/rsyncd.conf.5 \ |
|
$RPM_BUILD_ROOT%{l_prefix}/man/man5/rsync.conf.5 |
|
|
|
# provide default (deamon) configuration |
|
%{l_shtool} mkdir -f -p -m 755 \ |
|
$RPM_BUILD_ROOT%{l_prefix}/etc/rsync |
|
%{l_shtool} install -c -m 644 %{l_value -s -a} \ |
|
-e 's;@version@;%{version};g' \ |
|
%{SOURCE rsync.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/rsync/ |
|
%{l_shtool} install -c -m 644 /dev/null \ |
|
$RPM_BUILD_ROOT%{l_prefix}/etc/rsync/rsync.passwd |
|
%{l_shtool} mkdir -f -p -m 755 \ |
|
$RPM_BUILD_ROOT%{l_prefix}/var/rsync |
|
|
|
# provide run-command script |
|
%{l_shtool} mkdir -f -p -m 755 \ |
|
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d |
|
%{l_shtool} install -c -m 755 %{l_value -s -a} \ |
|
%{SOURCE rc.rsync} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
|
|
|
# determine binary package files |
|
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
|
%{l_files_std} \ |
|
'%config %{l_prefix}/etc/rsync/rsync.*' \ |
|
'%config %attr(600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/rsync/rsync.passwd' |
|
|
|
%files -f files |
|
|
|
%clean |
|
|
|
%post |
|
# after upgrade, restart service |
|
[ $1 -eq 2 ] || exit 0 |
|
eval `%{l_rc} rsync status 2>/dev/null` |
|
[ ".$rsync_active" = .yes ] && %{l_rc} rsync restart |
|
exit 0 |
|
|
|
%preun |
|
# before erase, stop service and remove log files |
|
[ $1 -eq 0 ] || exit 0 |
|
%{l_rc} rsync stop 2>/dev/null |
|
rm -f $RPM_INSTALL_PREFIX/var/rsync/rsync.log* >/dev/null 2>&1 || true |
|
exit 0 |
|
|
|
|