aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authortmpfile <tmpfile@users.noreply.github.com>2017-10-19 09:41:34 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2017-10-19 10:57:30 +0200
commit1e9f85a679aacd7ad1764ad2b2da399c87442abe (patch)
treea2831051d1c591778e7e141cf3115c231517600e /testing
parent9a70ab145f58801346c2da33559be0aea3bfdbe9 (diff)
downloadaports-1e9f85a679aacd7ad1764ad2b2da399c87442abe.tar.bz2
aports-1e9f85a679aacd7ad1764ad2b2da399c87442abe.tar.xz
testing/fuse3: new aport
https://github.com/alpinelinux/aports/pull/1902
Diffstat (limited to 'testing')
-rw-r--r--testing/fuse3/APKBUILD57
-rw-r--r--testing/fuse3/fix-realpath.patch28
-rw-r--r--testing/fuse3/fuse.initd35
3 files changed, 120 insertions, 0 deletions
diff --git a/testing/fuse3/APKBUILD b/testing/fuse3/APKBUILD
new file mode 100644
index 0000000000..4ffd2c2825
--- /dev/null
+++ b/testing/fuse3/APKBUILD
@@ -0,0 +1,57 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=fuse
+pkgver=3.1.0
+pkgrel=0
+pkgdesc="The reference implementation of the Linux FUSE (Filesystem in Userspace) interface"
+url="https://github.com/libfuse/libfuse/"
+arch="all"
+license="GPL2"
+makedepends="gettext-dev linux-headers"
+subpackages="$pkgname-dev $pkgname-doc"
+source="https://github.com/libfuse/libfuse/releases/download/fuse-$pkgver/fuse-$pkgver.tar.gz
+ fix-realpath.patch
+ fuse.initd"
+options="suid"
+
+builddir="$srcdir"/$pkgname-$pkgver
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --disable-static \
+ --enable-shared \
+ --disable-example \
+ --enable-lib \
+ --enable-util \
+ --bindir=/bin
+ make
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ rm -r "$pkgdir"/dev "$pkgdir"/usr/etc/init.d
+
+ install -Dm755 "$srcdir"/fuse.initd "$pkgdir"/etc/init.d/fuse
+ # create config
+ install -d "$pkgdir"/etc
+ cat >"$pkgdir"/etc/fuse.conf << _EOF_
+# Set the maximum number of FUSE mounts allowed to non-root users.
+# The default is 1000.
+#
+#mount_max = 1000
+
+# Allow non-root users to specify the 'allow_other' or 'allow_root'
+# mount options.
+#
+#user_allow_other
+_EOF_
+
+}
+
+sha512sums="e6278aef67162439b736af28528edb0f39a4513f584e5949a269cc3bc07a14436e6f0b69dbe8002db6f60de9139c452568b5a091baa49119a7f61422b7aec84c fuse-3.1.0.tar.gz
+1a9e1d1e8a7b0778ffde328e4322c73b5d57ec98d52767c846d755cce861ab27989823a75b6c5f994432ddb77fa351dfa4a8f948c9467c5f7d5f471e4608358b fix-realpath.patch
+7f6a503ef23cfa8b809c544375c2d83ad56525269b48ad1a7dff0ce36f4bf2f2a3fafed9dc70a71ff6281b261db5f01829e16c06f041921a5d8c8d715a04a8c1 fuse.initd"
diff --git a/testing/fuse3/fix-realpath.patch b/testing/fuse3/fix-realpath.patch
new file mode 100644
index 0000000000..375bedc961
--- /dev/null
+++ b/testing/fuse3/fix-realpath.patch
@@ -0,0 +1,28 @@
+--- fuse-3.1.0.orig/util/fusermount.c
++++ fuse-3.1.0/util/fusermount.c
+@@ -1200,19 +1200,16 @@
+
+ origmnt = argv[optind];
+
+- drop_privs();
+ mnt = fuse_mnt_resolve_path(progname, origmnt);
+- if (mnt != NULL) {
+- res = chdir("/");
+- if (res == -1) {
+- fprintf(stderr, "%s: failed to chdir to '/'\n", progname);
+- goto err_out;
+- }
+- }
+- restore_privs();
+ if (mnt == NULL)
+ exit(1);
+
++ res = chdir("/");
++ if (res == -1) {
++ fprintf(stderr, "%s: failed to chdir to '/'\n", progname);
++ exit(1);
++ }
++
+ umask(033);
+ if (unmount)
+ goto do_unmount;
diff --git a/testing/fuse3/fuse.initd b/testing/fuse3/fuse.initd
new file mode 100644
index 0000000000..6c99929c22
--- /dev/null
+++ b/testing/fuse3/fuse.initd
@@ -0,0 +1,35 @@
+#!/sbin/openrc-run
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+MOUNTPOINT=/sys/fs/fuse/connections
+
+depend() {
+ need localmount
+}
+
+start() {
+
+ ebegin "Starting fuse"
+ if ! grep -qw fuse /proc/filesystems; then
+ modprobe fuse >/dev/null 2>&1 || eerror $? "Error loading fuse module"
+ fi
+ if grep -qw fusectl /proc/filesystems && \
+ ! grep -qw $MOUNTPOINT /proc/mounts; then
+ mount -t fusectl none $MOUNTPOINT >/dev/null 2>&1 || \
+ eerror $? "Error mounting control filesystem"
+ fi
+ eend ${?}
+
+}
+
+stop() {
+
+ ebegin "Stopping fuse"
+ if grep -qw $MOUNTPOINT /proc/mounts; then
+ umount $MOUNTPOINT >/dev/null 2>&1 || \
+ eerror $? "Error unmounting control filesystem"
+ fi
+ eend ${?}
+
+}