* sync rsync with main arch

This commit is contained in:
Alexander Baldeck 2020-01-14 17:17:03 +01:00
parent 77279d3aa4
commit 84b13cf238
7 changed files with 91 additions and 11 deletions

View File

@ -2,22 +2,23 @@
pkgname=rsync
pkgver=3.1.3
pkgrel=1
pkgrel=2
pkgdesc="A file transfer program to keep remote files in sync"
arch=('x86_64' 'powerpc64le')
arch=(x86_64 powerpc64le)
url="https://rsync.samba.org/"
license=('GPL3')
depends=('perl' 'popt' 'acl')
backup=('etc/rsyncd.conf' 'etc/xinetd.d/rsync')
install=rsync.install
validpgpkeys=('0048C8B026D4C96F0E589C2F6C859FB14B96A8C5') # Wayne Davison <wayned@users.sourceforge.net>
source=("https://rsync.samba.org/ftp/rsync/src/$pkgname-$pkgver.tar.gz"
source=("https://rsync.samba.org/ftp/rsync/src/$pkgname-$pkgver.tar.gz"{,.asc}
'rsyncd.conf'
'rsync.xinetd'
'rsyncd.service'
'rsyncd.socket'
'rsyncd@.service')
sha256sums=('55cc554efec5fdaad70de921cd5a5eeb6c29a95524c715f3bbf849235b0800c0'
'SKIP'
'733ccb571721433c3a6262c58b658253ca6553bec79c2bdd0011810bb4f2156b'
'da0ec9ce07bf2edafbc8e44020da29a58038b00c3048a22de57017c56318a767'
'6ad010a1f85f5637bdd0972403c032ca30d71608a36943c71c34ba1c5b463cd6'
@ -32,23 +33,30 @@ build() {
./configure --prefix=/usr \
--with-included-popt=no \
--with-included-zlib=yes \
--disable-debug \
--build=$CHOST
--disable-debug --build=${CHOST}
make
}
check() {
cd "$srcdir/$pkgname-$pkgver"
# rsync fails with xattr on btrfs...
if [ "$(stat --file-system --printf=%T .)" = "btrfs" ]; then
echo "Test is known to fail on btrfs..." >&2
exit 1
fi
make test
}
package() {
cd "$srcdir/$pkgname-$pkgver"
make DESTDIR="$pkgdir" install
install -Dm644 ../rsyncd.conf "$pkgdir/etc/rsyncd.conf"
install -Dm644 ../rsync.xinetd "$pkgdir/etc/xinetd.d/rsync"
install -Dm644 ../rsyncd.service "$pkgdir/usr/lib/systemd/system/rsyncd.service"
install -m644 ../rsyncd.socket "$pkgdir/usr/lib/systemd/system/rsyncd.socket"
install -m644 ../rsyncd@.service "$pkgdir/usr/lib/systemd/system/rsyncd@.service"
install -Dm755 support/rrsync "$pkgdir/usr/lib/rsync/rrsync"
install -Dm0644 ../rsyncd.conf "$pkgdir/etc/rsyncd.conf"
install -Dm0644 ../rsync.xinetd "$pkgdir/etc/xinetd.d/rsync"
install -Dm0644 ../rsyncd.service "$pkgdir/usr/lib/systemd/system/rsyncd.service"
install -m0644 ../rsyncd.socket "$pkgdir/usr/lib/systemd/system/rsyncd.socket"
install -m0644 ../rsyncd@.service "$pkgdir/usr/lib/systemd/system/rsyncd@.service"
install -Dm0755 support/rrsync "$pkgdir/usr/lib/rsync/rrsync"
}

14
rsync/rsync.install Normal file
View File

@ -0,0 +1,14 @@
#!/bin/sh
post_upgrade() {
# return if old package version greater 3.1.2-5...
(( $(vercmp "$2" '3.1.2-5') > 0 )) && return
# return if neither service nor socket is enabled...
systemctl -q is-enabled rsyncd.service rsyncd.socket || return 0
echo ' > For security reasons the rsyncd service protects the system by making'
echo ' > paths /boot, /etc and /usr read-only. If you need write access use'
echo ' > rsync via ssh or see the wiki for instructions to override:'
echo ' > https://wiki.archlinux.org/index.php/Rsync#rsync_daemon'
}

11
rsync/rsync.xinetd Normal file
View File

@ -0,0 +1,11 @@
service rsync
{
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_success += HOST DURATION
log_on_failure += HOST
disable = yes
}

10
rsync/rsyncd.conf Normal file
View File

@ -0,0 +1,10 @@
uid = nobody
gid = nobody
use chroot = no
max connections = 4
syslog facility = local5
pid file = /run/rsyncd.pid
[ftp]
path = /srv/ftp
comment = ftp area

14
rsync/rsyncd.service Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=A file transfer program to keep remote files in sync
After=network.target
[Service]
ExecStart=/usr/bin/rsync --daemon --no-detach
RestartSec=1
ProtectSystem=full
ProtectHome=off
PrivateDevices=on
NoNewPrivileges=on
[Install]
WantedBy=multi-user.target

10
rsync/rsyncd.socket Normal file
View File

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

13
rsync/rsyncd@.service Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=A file transfer program to keep remote files in sync
After=network.target
[Service]
ExecStart=-/usr/bin/rsync --daemon
StandardInput=socket
StandardOutput=inherit
StandardError=journal
ProtectSystem=full
ProtectHome=off
PrivateDevices=on
NoNewPrivileges=on