diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-03 01:00:58 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-03 01:00:58 +0200 |
commit | 64a2d6243471cee6a4151768f8ef4ca556ba2402 (patch) | |
tree | d097604a14347806e08ff6529cb4687f139b175b /community | |
parent | 8f9e0dc8f2e3b2ed519e3c41335f50d32240a751 (diff) | |
download | aports-64a2d6243471cee6a4151768f8ef4ca556ba2402.tar.bz2 aports-64a2d6243471cee6a4151768f8ef4ca556ba2402.tar.xz |
community/clsync: move from testing
Diffstat (limited to 'community')
-rw-r--r-- | community/clsync/APKBUILD | 55 | ||||
-rw-r--r-- | community/clsync/musl-fix.patch | 32 | ||||
-rw-r--r-- | community/clsync/pthread_setname_np.patch | 13 |
3 files changed, 100 insertions, 0 deletions
diff --git a/community/clsync/APKBUILD b/community/clsync/APKBUILD new file mode 100644 index 0000000000..0cfa0f3521 --- /dev/null +++ b/community/clsync/APKBUILD @@ -0,0 +1,55 @@ +# Contributor: Jakub Jirutka <jakub@jirutka.cz> +# Maintainer: Jakub Jirutka <jakub@jirutka.cz> +pkgname=clsync +pkgver=0.4.2 +pkgrel=0 +pkgdesc="File live sync daemon based on inotify" +url="https://github.com/xaionaro/clsync" +arch="x86 x86_64" +license="GPLv3+" +depends="" +depends_dev="glib-dev fts-dev libcap-dev libexecinfo-dev linux-headers musl-dev" +makedepends="$depends_dev autoconf automake file libtool" +subpackages="$pkgname-doc $pkgname-dev" +source="$pkgname-$pkgver.tar.gz::https://github.com/xaionaro/$pkgname/archive/v$pkgver.tar.gz + musl-fix.patch + pthread_setname_np.patch" +builddir="$srcdir/$pkgname-$pkgver" +options="!check" # upstream does not provide tests + +prepare() { + default_prepare + + cd "$builddir" + autoreconf -i +} + +build() { + cd "$builddir" + + ./configure \ + CFLAGS="$CFLAGS -lfts -lexecinfo" \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var \ + --enable-capabilities \ + --enable-seccomp \ + --disable-debug + make +} + +package() { + cd "$builddir" + + make DESTDIR="$pkgdir" install + + # https://github.com/xaionaro/clsync/issues/150 + rm "$pkgdir"/usr/bin/gencompilerflags +} + +sha512sums="d14a2efc4bf58d9d5c7a3fe5634cacdd182cd7cd814b0e9ebd99024a7282b056d1f7ceeec6903666391c3572d599a18e205af818b098ed7768d5c0e0f4cd1200 clsync-0.4.2.tar.gz +98e81408911731f6e203368094ea0e9eda312648eef8c5beec98b13c6ee43bccee59f0777805bea4d26cbe4e964d2ff95fe863be5be7750b50358d213f106542 musl-fix.patch +da65cfb7182fa1509c77d7da43132c1f8b4911acb819d90aaab88c78d35167c85c0f23259bb78983fdab8217c43ba93b6b21267ab96c7fdf4723878a800fe414 pthread_setname_np.patch" diff --git a/community/clsync/musl-fix.patch b/community/clsync/musl-fix.patch new file mode 100644 index 0000000000..a0dc31e9f2 --- /dev/null +++ b/community/clsync/musl-fix.patch @@ -0,0 +1,32 @@ +musl declares lstat64 only for GNU compatibility using macro +`#define lstat64 lstat`. Local variable lstat in mon_gio overrides +global function lstat from sys/stat.h. + +Upstream issue: https://github.com/xaionaro/clsync/issues/150 +--- a/mon_gio.c ++++ b/mon_gio.c +@@ -305,18 +305,18 @@ + count = 0; + while (gio_wait(ctx_p, indexes_p, &tv)) { + event_t *ev = event_pop(); +- stat64_t lstat, *lstat_p; ++ stat64_t _lstat, *lstat_p; + mode_t st_mode; + size_t st_size; +- if ((ev->objtype_new == EOT_DOESNTEXIST) || (ctx_p->flags[CANCEL_SYSCALLS]&CSC_MON_STAT) || lstat64(ev->path, &lstat)) { +- debug(2, "Cannot lstat64(\"%s\", lstat). Seems, that the object had been deleted (%i) or option \"--cancel-syscalls mon_stat\" (%i) is set.", ev->path, ev->objtype_new == EOT_DOESNTEXIST, ctx_p->flags[CANCEL_SYSCALLS]&CSC_MON_STAT); ++ if ((ev->objtype_new == EOT_DOESNTEXIST) || (ctx_p->flags[CANCEL_SYSCALLS]&CSC_MON_STAT) || lstat64(ev->path, &_lstat)) { ++ debug(2, "Cannot lstat64(\"%s\", _lstat). Seems, that the object had been deleted (%i) or option \"--cancel-syscalls mon_stat\" (%i) is set.", ev->path, ev->objtype_new == EOT_DOESNTEXIST, ctx_p->flags[CANCEL_SYSCALLS]&CSC_MON_STAT); + st_mode = (ev->objtype_event == EOT_DIR ? S_IFDIR : S_IFREG); + st_size = 0; + lstat_p = NULL; + } else { +- st_mode = lstat.st_mode; +- st_size = lstat.st_size; +- lstat_p = &lstat; ++ st_mode = _lstat.st_mode; ++ st_size = _lstat.st_size; ++ lstat_p = &_lstat; + } + + if (sync_prequeue_loadmark(1, ctx_p, indexes_p, NULL, ev->path, lstat_p, ev->objtype_old, ev->objtype_new, ev->event_id, ev->handle_id, st_mode, st_size, &path_full, &path_full_len, NULL)) { diff --git a/community/clsync/pthread_setname_np.patch b/community/clsync/pthread_setname_np.patch new file mode 100644 index 0000000000..aab4dd4ef8 --- /dev/null +++ b/community/clsync/pthread_setname_np.patch @@ -0,0 +1,13 @@ +pthread_setname_np is a glibc extension not defined in POSIX +and is not supported by musl libc. +--- a/privileged.c ++++ b/privileged.c +@@ -920,7 +920,7 @@ + # endif + } else { + register_blockthread(); +- pthread_setname_np(pthread_self(), "clsync-helper"); ++ //pthread_setname_np(pthread_self(), "clsync-helper"); + } + cap_drop(ctx_p, ctx_p->caps); + |