summaryrefslogtreecommitdiff
path: root/core/rsync/MAKEPKG
diff options
context:
space:
mode:
Diffstat (limited to 'core/rsync/MAKEPKG')
-rw-r--r--core/rsync/MAKEPKG97
1 files changed, 97 insertions, 0 deletions
diff --git a/core/rsync/MAKEPKG b/core/rsync/MAKEPKG
new file mode 100644
index 0000000..51e94e3
--- /dev/null
+++ b/core/rsync/MAKEPKG
@@ -0,0 +1,97 @@
+#!/bin/mkpkg
+# description: Fast incremental file transfer
+# url: https://rsync.samba.org
+
+name=rsync
+version=3.5.1
+release=2
+depends=(zlib libressl xxhash zstd lz4)
+groups=(rsyncd:user:rsyncd:/nonexistent:700:873:873)
+services=(rsyncd)
+permissions=(
+ /etc/rsyncd.conf:root:root:644
+)
+source=(https://www.samba.org/ftp/rsync/src/$name-$version.tar.gz)
+
+sha256sums=(
+ "c55f9c9dc10fb8bec397b399a0fdded53cc9a2d8e30891bb0d63724d25c37bef"
+)
+
+build() {
+ cd $name-$version
+
+ ./configure \
+ --prefix=/ \
+ --bindir=/bin \
+ --libdir=/lib \
+ --mandir=/usr/share/man \
+ --sysconfdir=/etc \
+ --disable-debug \
+ --disable-idn \
+ --with-included-popt \
+ --with-included-zlib=no \
+ --enable-ipv6 \
+ --enable-xxhash \
+ --enable-zstd \
+ --enable-lz4
+
+ make
+ make DESTDIR=$PKG install
+
+ # Minimal daemon config - no modules exported by default
+ install -d $PKG/etc
+
+ printf '%s\n' \
+ '## rawnix rsyncd configuration' \
+ '## See rsyncd.conf(5) for options' \
+ '' \
+ 'uid = rsyncd' \
+ 'gid = rsyncd' \
+ 'use chroot = yes' \
+ 'read only = yes' \
+ 'list = no' \
+ 'reverse lookup = no' \
+ 'max connections = 8' \
+ 'timeout = 300' \
+ 'transfer logging = no' \
+ '' \
+ '# Example module:' \
+ '# [pub]' \
+ '# path = /srv/rsync/pub' \
+ '# comment = public files' \
+ '# hosts allow = 192.168.0.0/16' \
+ '# auth users = backup' \
+ '# secrets file = /etc/rsyncd.secrets' \
+ > $PKG/etc/rsyncd.conf
+}
+
+post_build() {
+ # runit service
+ install -d $PKG/etc/sv/rsyncd/log
+
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'exec 2>&1' \
+ '' \
+ 'exec /bin/rsync --daemon --no-detach --config=/etc/rsyncd.conf --log-file=/dev/stdout' \
+ > $PKG/etc/sv/rsyncd/run
+
+ printf '%s\n' \
+ '#!/bin/sh' \
+ 'mkdir -p /var/log/rsyncd' \
+ 'exec svlogd -tt /var/log/rsyncd' \
+ > $PKG/etc/sv/rsyncd/log/run
+
+ chmod 755 $PKG/etc/sv/rsyncd/run
+ chmod 755 $PKG/etc/sv/rsyncd/log/run
+
+ # Service disabled by default - must explicitly: rm /etc/sv/rsyncd/down
+ touch $PKG/etc/sv/rsyncd/down
+}
+
+signify() {
+ untrusted comment: public key
+ RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3
+}
+
+# vim: filetype=sh