## ## rsync.spec -- OpenPKG RPM Package Specification ## Copyright (c) 2000-2022 OpenPKG Project ## ## 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.2.3 Release: 20200809 # package options %option with_iconv no %option with_xxhash no %option with_openssl no %option with_zstd no %option with_lz4 no # list of sources Source0: http://rsync.samba.org/ftp/rsync/rsync-%{version}.tar.gz Source1: rsync.conf Source2: rc.rsync Patch0: rsync.patch # build information BuildPreReq: OpenPKG, openpkg >= 20160101 PreReq: OpenPKG, openpkg >= 20160101 BuildPreReq: zlib PreReq: zlib %if "%{with_iconv}" == "yes" BuildPreReq: libiconv PreReq: libiconv %endif %if "%{with_xxhash}" == "yes" BuildPreReq: xxhash PreReq: xxhash %endif %if "%{with_openssl}" == "yes" BuildPreReq: openssl PreReq: openssl %endif %if "%{with_zstd}" == "yes" BuildPreReq: zstd PreReq: zstd %endif %if "%{with_lz4}" == "yes" BuildPreReq: lz4 PreReq: lz4 %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 %patch -p0 %build # configure vendor sources 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 \ %if "%{with_iconv}" == "yes" --enable-iconv \ %else --disable-iconv \ %endif %if "%{with_openssl}" == "yes" --enable-openssl \ %else --disable-openssl \ %endif %if "%{with_xxhash}" == "yes" --enable-xxhash \ %else --disable-xxhash \ %endif %if "%{with_zstd}" == "yes" --enable-zstd \ %else --disable-zstd \ %endif %if "%{with_lz4}" == "yes" --enable-lz4 \ %else --disable-lz4 \ %endif --disable-debug \ --disable-locale \ --disable-simd \ --disable-md2man \ --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