Name rsync
Description A fast and versatile file copying tool for remote and local files
Version 3.4.1-2
Package Base rsync
Homepage https://rsync.samba.org/
Maintainers ['Christian Hesse <mail@eworm.de>', 'T.J. Townsend <blakkheim@archlinux.org>', 'Tobias Powalowski <tpowa@archlinux.org>']
Contributors []
Distro-repo https://gitlab.archlinux.org/archlinux/packaging/packages/rsync
Sources ['git+https://github.com/RsyncProject/rsync.git#tag=v3.4.1?signed', 'rsyncd.conf']
Dependencies ['acl', 'libacl.so', 'libxxhash.so', 'lz4', 'openssl', 'popt', 'xxhash', 'zlib', 'zstd']
Optional-Dependencies ['python']
Build-Dependencies ['git', 'python-commonmark']
Provides []
Builddate 02-02-2025 11:41:25
Architecture x86_64
Distro-Version
Licenses ['GPL-3.0-or-later']
Hash 01f63964388bb7ab132d82fe3115b0b536d6d5dafa4c1173aa216a5c73d5b270
# Maintainer: Christian Hesse <mail@eworm.de>
# Maintainer: T.J. Townsend <blakkheim@archlinux.org>

pkgname=rsync
pkgver=3.4.1
pkgrel=2
pkgdesc='A fast and versatile file copying tool for remote and local files'
arch=('x86_64')
url='https://rsync.samba.org/'
license=('GPL-3.0-or-later')
depends=('acl' 'libacl.so' 'lz4' 'openssl' 'popt' 'xxhash' 'libxxhash.so'
         'zlib' 'zstd')
optdepends=('python: for rrsync')
makedepends=('git' 'python-commonmark')
backup=('etc/rsyncd.conf')
validpgpkeys=('0048C8B026D4C96F0E589C2F6C859FB14B96A8C5'  # Wayne Davison <wayned@users.sourceforge.net>
              '9FEF112DCE19A0DC7E882CB81BB24997A8535F6F') # Andrew Tridgell <andrew@tridgell.net
source=("git+https://github.com/RsyncProject/rsync.git#tag=v${pkgver}?signed"
        'rsyncd.conf')
sha256sums=('97ac2998444ad0611ea47103e294682fc39c7518a33af3ef3e44fdb1ed282021'
            '733ccb571721433c3a6262c58b658253ca6553bec79c2bdd0011810bb4f2156b')

_backports=(
  # bool is a keyword in C23
  'a4b926dcdce96b0f2cc0dc7744e95747b233500a'
)

_reverts=(
)

prepare() {
  cd ${pkgname}

  local _c
  for _c in "${_backports[@]}"; do
    if [[ $_c == *..* ]]; then
      git log --oneline --reverse "${_c}"
    else
      git log --oneline -1 "${_c}"
    fi
    git cherry-pick -n -m1 "${_c}"
  done
  for _c in "${_reverts[@]}"; do
    git log --oneline -1 "${_c}"
    git revert -n "${_c}"
  done

  # For historic reasons we install the systemd unit as `rsyncd.*`, instead of
  # just `rsync.*`. Let's make it conflict as expected with these names.
  sed -i '/^Conflicts=/s|rsync.service|rsyncd.service|' packaging/systemd/rsync.socket
}

build() {
  cd ${pkgname}

  ./configure \
    --prefix=/usr \
    --enable-ipv6 \
    --disable-debug \
    --with-rrsync \
    --with-included-popt=no \
    --with-included-zlib=no
  make
}

check() {
  cd ${pkgname}

  # check for IPv6 support
  # https://gitlab.archlinux.org/archlinux/packaging/packages/rsync/-/commit/8936e33b245da170e7b5488b4ca35727ac9c4b68
  if rsync -V | grep -q 'no IPv6'; then
    echo 'Built without IPv6 support!' >&2
    exit 1
  fi

  make test
}

package() {
  cd ${pkgname}

  make DESTDIR="$pkgdir" install
  # install support scripts to doc
  for i in support/*; do
    install -Dm0644 "$i" "$pkgdir/usr/share/doc/rsync/$i"
  done
  install -Dm0644 "tech_report.tex" "$pkgdir/usr/share/doc/rsync/tech_report.tex"
  install -Dm0644 ../rsyncd.conf "$pkgdir/etc/rsyncd.conf"
  install -Dm0644 packaging/systemd/rsync.service "$pkgdir/usr/lib/systemd/system/rsyncd.service"
  install -Dm0644 packaging/systemd/rsync.socket "$pkgdir/usr/lib/systemd/system/rsyncd.socket"
  install -Dm0644 packaging/systemd/rsync@.service "$pkgdir/usr/lib/systemd/system/rsyncd@.service"
}