Subject: [alpine-aports] [PATCH] main/rsync: fixes in apkbuild, simplify init-script

From: Valery Kartel <[email-masked]>
Date: Fri, 3 Feb 2017 12:32:22 +0200

---
 main/rsync/APKBUILD     | 31 +++++++++++++------------------
 main/rsync/rsyncd.initd | 24 ++++++++----------------
 2 files changed, 21 insertions(+), 34 deletions(-)

diff --git a/main/rsync/APKBUILD b/main/rsync/APKBUILD
index 7fd3a556d2..8000c105fa 100644
--- a/main/rsync/APKBUILD
+++ b/main/rsync/APKBUILD
@@ -1,9 +1,9 @@
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=rsync
 pkgver=3.1.2
-pkgrel=2
+pkgrel=3
 pkgdesc="A file transfer program to keep remote files in sync"
-url="http://samba.anu.edu.au/rsync/"
+url="https://rsync.samba.org/"
 arch="all"
 license="GPL3"
 depends=
@@ -15,16 +15,10 @@ source="https://download.samba.org/pub/$pkgname/$pkgname-$pkgver.tar.gz
 	rsyncd.conf
 	rsyncd.logrotate
 	"
-
-_builddir="$srcdir/$pkgname-$pkgver"
-prepare() {
-	cd "$_builddir"
-	./prepare-source || return 1
-	update_config_sub || return 1
-}
+builddir="$srcdir/$pkgname-$pkgver"
 
 build() {
-	cd "$_builddir"
+	cd "$builddir"
 	# Force IPv6 enabled, upstream bug https://bugzilla.samba.org/show_bug.cgi?id=10715
 	CFLAGS="$CFLAGS -DINET6" \
 	./configure \
@@ -39,26 +33,27 @@ build() {
 }
 
 package() {
-	cd "$srcdir/$pkgname-$pkgver"
+	cd "$builddir"
 	make DESTDIR="$pkgdir" install || return 1
-	install -D -m 755 ../rsyncd.initd ${pkgdir}/etc/init.d/rsyncd
-	install -D -m 644 ../rsyncd.conf ${pkgdir}/etc/rsyncd.conf 
-	install -D -m 644 ../rsyncd.confd ${pkgdir}/etc/conf.d/rsyncd
-	install -D -m 644 ../rsyncd.logrotate ${pkgdir}/etc/logrotate.d/rsyncd
+
+	install -D -m 755 "$srcdir"/rsyncd.initd "$pkgdir"/etc/init.d/rsyncd
+	install -D -m 644 "$srcdir"/rsyncd.conf "$pkgdir"/etc/rsyncd.conf
+	install -D -m 644 "$srcdir"/rsyncd.confd "$pkgdir"/etc/conf.d/rsyncd
+	install -D -m 644 "$srcdir"/rsyncd.logrotate "$pkgdir"/etc/logrotate.d/rsyncd
 }
 
 md5sums="0f758d7e000c0f7f7d3792610fad70cb  rsync-3.1.2.tar.gz
-cd237feca33f6a120fee76499652a460  rsyncd.initd
+ac58e89a700282c54b291c91d4570015  rsyncd.initd
 e5e62e8cef29e09c22e8ba8152ec1751  rsyncd.confd
 a99211a14af1766ba849035241cd5bb2  rsyncd.conf
 169cafc6907a4c3787bb0462e9d6a5c2  rsyncd.logrotate"
 sha256sums="ecfa62a7fa3c4c18b9eccd8c16eaddee4bd308a76ea50b5c02a5840f09c0a1c2  rsync-3.1.2.tar.gz
-c70ba2400123b75c869e6e3eb25108ba21d748cc3008889112cec627515fa1de  rsyncd.initd
+67bff207b7a2e924337b3cb0158ce7c1e63fd70fb51729c3d406846983081d5c  rsyncd.initd
 de758791b16b89a648c01867af7f51bc9bd44e40cbe868e439b753ff5d9572e5  rsyncd.confd
 2c00ca760c26bd7d6e1d8306d48eb9b27d876516c354f6d37c458871d5ac012f  rsyncd.conf
 eb54100686a253d4d14c9c67fcc20f92d88c0616692bffea899c6a8f8f980c7c  rsyncd.logrotate"
 sha512sums="4c55fd69f436ead0cb5a0b7c6fdfef9bb28ddb9c63534eb619e756b118d5b08cfc5e696498650932c86e865b37e06633da947e6720ca0c27ed5c034313ae208b  rsync-3.1.2.tar.gz
-27f99ee64b99bb57fe3da55fc93fefc33326175fdcad01a3d93dea3aa61daaf21cd9b1063be572fa8abc5d2d444f2e64f0f6f64241176ae53bf61f9e4cb0dca9  rsyncd.initd
+082d687f8facfbe5c61c49edb78b1c3f7c27ddc86a1d86f98393e3f6b4db7fca892ab3e2802ce07fdff297d4b41781a119ec4a21520d852487b19fb56aea709c  rsyncd.initd
 8ea9a2f1fea508fa132313fa16513eac84a9ed3ce75741c42769b56bbcd3f1bd2eb8bfdfe40a6c7f619e4281e8fc8d95d1bd84096d0b64aaacf606cd614ae5b3  rsyncd.confd
 5bcd339bac70d7c2efc2a028852efb9a4a78d8b7b114979763d29d0b378afceb753954c31cca5dfb05dadd88479e5c875626e297ba31a57ee3da5ecad29dbd6d  rsyncd.conf
 b8d6c0bb467a5c963317dc55478d2c10874564cd264d943d4a42037e2fce134fe001fabc92af5c6b5775e84dc310b1c8da147afaa61c99e5663c36580d8651a5  rsyncd.logrotate"
diff --git a/main/rsync/rsyncd.initd b/main/rsync/rsyncd.initd
index 04570064de..5b6405c413 100644
--- a/main/rsync/rsyncd.initd
+++ b/main/rsync/rsyncd.initd
@@ -1,24 +1,16 @@
 #!/sbin/openrc-run
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/rsync/files/rsyncd.init.d,v 1.5 2007/02/23 11:33:59 uberlord Exp $
+
+cfgfile="/etc/rsyncd.conf"
+pidfile="$(grep "^pid file" $cfgfile | cut -d= -f2)"
+command="/usr/bin/rsync"
+command_args="--daemon $command_args $RSYNC_OPTS"
+required_files="$cfgfile"
 
 depend() {
 	use net
 	after firewall
 }
 
-start() {
-	ebegin "Starting rsyncd"
-	start-stop-daemon --start --exec /usr/bin/rsync \
-	    --pidfile /var/run/rsyncd.pid \
-	    -- --daemon ${RSYNC_OPTS}
-	eend $?
-}
-
-stop() {
-	ebegin "Stopping rsyncd"
-	start-stop-daemon --stop --exec /usr/bin/rsync \
-	    --pidfile /var/run/rsyncd.pid
-	eend $?
+start_pre() {
+	checkpath --directory "${pidfile%/*}"
 }
-- 
2.11.0

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---