summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 20a49521f89a7eb797a27b7bf8443ab714d0d886 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# https://github.com/archlinux/svntogit-packages/tree/packages/rsync

_pkgname=rsync
pkgname="$_pkgname-reflink"
pkgver=3.2.7
pkgrel=3
pkgdesc='A fast and versatile file copying tool for remote and local files - with reflink support'
arch=('x86_64')
url='https://rsync.samba.org/'
license=('GPL3')
depends=(
  'acl'
  'libacl.so'
  'libxxhash.so'
  'popt'
  'xxhash'
  'zstd'
)
optdepends=(
  'python: for rrsync'
)
makedepends=('git' 'python-commonmark')
provides=("$_pkgname")
conflicts=(${provides[@]})
backup=(
  'etc/rsyncd.conf'
  'etc/xinetd.d/rsync'
)
source=(
  "$_pkgname"::"git+https://github.com/WayneD/rsync#tag=v${pkgver}"
  'https://github.com/WayneD/rsync-patches/raw/master/clone-dest.diff'
  'https://github.com/WayneD/rsync-patches/raw/master/detect-renamed.diff'
  'https://github.com/WayneD/rsync-patches/raw/master/detect-renamed-lax.diff'
  'rsyncd.conf'
)
sha256sums=(
  'SKIP'
  'SKIP'
  'SKIP'
  'SKIP'
  '733ccb571721433c3a6262c58b658253ca6553bec79c2bdd0011810bb4f2156b'
)

_backports=(
)

_reverts=(
)

prepare() {
  cd "$srcdir/$_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

  # patches
  patch -Np1 -F100 -i "$srcdir/clone-dest.diff"
  patch -Np1 -F100 -i "$srcdir/detect-renamed.diff"
  patch -Np1 -F100 -i "$srcdir/detect-renamed-lax.diff"
}

build() {
  cd "$srcdir/$_pkgname"

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

check() {
  cd "$srcdir/$_pkgname"
  make test
}

package() {
  cd "$srcdir/$_pkgname"

  make DESTDIR="$pkgdir" install
  install -Dm0644 ../rsyncd.conf "$pkgdir/etc/rsyncd.conf"
  install -Dm0644 packaging/lsb/rsync.xinetd "$pkgdir/etc/xinetd.d/rsync"
  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"
  install -Dm0755 support/rrsync "$pkgdir/usr/lib/rsync/rrsync"
}