summaryrefslogtreecommitdiff
path: root/filesystems/fuse
diff options
context:
space:
mode:
authormanu <manu>2010-08-25 08:02:21 +0000
committermanu <manu>2010-08-25 08:02:21 +0000
commit0f5ccc93a7bfefd1dd3d95801cc392fe33c83516 (patch)
treebad33accbf3aff760b7cb2377a3bc4c3ca58fd2e /filesystems/fuse
parent0d3486cad79465075fd87efe3fbfa7faf9f581e3 (diff)
downloadpkgsrc-0f5ccc93a7bfefd1dd3d95801cc392fe33c83516.tar.gz
Update FUSE to 2.8.4 and add NetBSD support through filesystems/perfuse
Changes since previous verion, from the NEWS file 2.8.x: - More scalable directory tree locking - Atomic open(O_TRUNC) support - Support big write requests on kernels 2.6.26 and newer - Out-of-tree fuse module removed - Better NFS exporting support - New ioctl and poll requests - New CUSE (Character Device in Userspace) interface - Allow umask processing in userspace - Added cache invalidation notifications - Bugfixes and small improvements 2.7.x: - Stacking support for the high level API - Add filename charset conversion module - Improved mounting 2.6.x! - Improved read characteristics (asynchronous reads) - Support for aborting filesystem connection - POSIX file locking support - Request interruption support - Building module for Linux kernels earlier than 2.6.9 not supported - Allow block device based filesystems to support swap files - Several bugs fixed, including a rare system hang on SMP
Diffstat (limited to 'filesystems/fuse')
-rw-r--r--filesystems/fuse/MESSAGE.Linux (renamed from filesystems/fuse/MESSAGE)4
-rw-r--r--filesystems/fuse/MESSAGE.NetBSD8
-rw-r--r--filesystems/fuse/Makefile16
-rw-r--r--filesystems/fuse/PLIST.Linux2
-rw-r--r--filesystems/fuse/PLIST.common (renamed from filesystems/fuse/PLIST)7
-rw-r--r--filesystems/fuse/distinfo21
-rw-r--r--filesystems/fuse/patches/patch-aa17
-rw-r--r--filesystems/fuse/patches/patch-ab71
-rw-r--r--filesystems/fuse/patches/patch-ac49
-rw-r--r--filesystems/fuse/patches/patch-ad27
-rw-r--r--filesystems/fuse/patches/patch-ae69
-rw-r--r--filesystems/fuse/patches/patch-af42
-rw-r--r--filesystems/fuse/patches/patch-ag23
-rw-r--r--filesystems/fuse/patches/patch-ai27
-rw-r--r--filesystems/fuse/patches/patch-ak25
-rw-r--r--filesystems/fuse/patches/patch-al59
-rw-r--r--filesystems/fuse/patches/patch-am18
-rw-r--r--filesystems/fuse/patches/patch-an16
18 files changed, 478 insertions, 23 deletions
diff --git a/filesystems/fuse/MESSAGE b/filesystems/fuse/MESSAGE.Linux
index 0dc8d4b4cd3..399f3f537a8 100644
--- a/filesystems/fuse/MESSAGE
+++ b/filesystems/fuse/MESSAGE.Linux
@@ -1,7 +1,7 @@
===========================================================================
-$NetBSD: MESSAGE,v 1.1.1.1 2007/02/20 23:48:30 xtraeme Exp $
+$NetBSD: MESSAGE.Linux,v 1.1 2010/08/25 08:02:21 manu Exp $
-You must create the device by typing:
+Linux users must create the device by typing:
$ mknod /dev/fuse -m 0666 c 10 229
===========================================================================
diff --git a/filesystems/fuse/MESSAGE.NetBSD b/filesystems/fuse/MESSAGE.NetBSD
new file mode 100644
index 00000000000..013c0a7e18f
--- /dev/null
+++ b/filesystems/fuse/MESSAGE.NetBSD
@@ -0,0 +1,8 @@
+===========================================================================
+$NetBSD: MESSAGE.NetBSD,v 1.1 2010/08/25 08:02:21 manu Exp $
+
+On NetBSD, there is no kernel FUSE support. perfused(8) must be
+started prior using FUSE filesystems. It will take care of creating
+a /dev/fuse socket.
+
+===========================================================================
diff --git a/filesystems/fuse/Makefile b/filesystems/fuse/Makefile
index 57bb40470af..f13cc584d44 100644
--- a/filesystems/fuse/Makefile
+++ b/filesystems/fuse/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.5 2010/07/06 10:17:12 jmmv Exp $
+# $NetBSD: Makefile,v 1.6 2010/08/25 08:02:21 manu Exp $
#
-DISTNAME= fuse-2.5.2
+DISTNAME= fuse-2.8.4
CATEGORIES= filesystems
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=fuse/}
@@ -14,15 +14,17 @@ PKG_DESTDIR_SUPPORT= user-destdir
GNU_CONFIGURE= yes
# FUSE the implementation only builds on Linux and FreeBSD.
-ONLY_FOR_PLATFORM= Linux-*-* FreeBSD-*-*
+ONLY_FOR_PLATFORM= Linux-*-* FreeBSD-*-* NetBSD-*-*
# On NetBSD 4.99 after 2007-02, /usr/lib/librefuse provides the FUSE
# interface expected by filesystem implementations and therefore this
-# implementation is not needed.
-# XXX Set NOT_FOR_PLATFORM with a helpful failure message, because
-# fuse not building is confusing for people who have been told that
-# fuse works on NetBSD.
+# implementation is not needed. This FUSE implementation can also be
+# used with the perfuse package on NetBSD.
USE_TOOLS+= gmake pkg-config
USE_LIBTOOL= yes
+.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} == "NetBSD"
+.include "../../filesystems/perfuse/buildlink3.mk"
+.endif
.include "../../mk/bsd.pkg.mk"
diff --git a/filesystems/fuse/PLIST.Linux b/filesystems/fuse/PLIST.Linux
new file mode 100644
index 00000000000..d44e5f503bf
--- /dev/null
+++ b/filesystems/fuse/PLIST.Linux
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST.Linux,v 1.1 2010/08/25 08:02:21 manu Exp $
+bin/fusermount
diff --git a/filesystems/fuse/PLIST b/filesystems/fuse/PLIST.common
index 4c45c3f551c..10d9a5893e3 100644
--- a/filesystems/fuse/PLIST
+++ b/filesystems/fuse/PLIST.common
@@ -1,11 +1,14 @@
-@comment $NetBSD: PLIST,v 1.2 2009/06/14 17:51:59 joerg Exp $
-bin/fusermount
+@comment $NetBSD: PLIST.common,v 1.1 2010/08/25 08:02:21 manu Exp $
include/fuse.h
include/fuse/fuse.h
include/fuse/fuse_common.h
+include/fuse/fuse_common_compat.h
include/fuse/fuse_compat.h
include/fuse/fuse_lowlevel.h
include/fuse/fuse_lowlevel_compat.h
include/fuse/fuse_opt.h
+include/fuse/cuse_lowlevel.h
+include/ulockmgr.h
lib/libfuse.la
+lib/libulockmgr.la
lib/pkgconfig/fuse.pc
diff --git a/filesystems/fuse/distinfo b/filesystems/fuse/distinfo
index dcae8b68968..da5783a182e 100644
--- a/filesystems/fuse/distinfo
+++ b/filesystems/fuse/distinfo
@@ -1,6 +1,17 @@
-$NetBSD: distinfo,v 1.1.1.1 2007/02/20 23:48:30 xtraeme Exp $
+$NetBSD: distinfo,v 1.2 2010/08/25 08:02:21 manu Exp $
-SHA1 (fuse-2.5.2.tar.gz) = b353237dc7964c7337a837470b1f7d5ebc71aa0e
-RMD160 (fuse-2.5.2.tar.gz) = 840f0f13d9d493b1c2969471cfb9414a5368780e
-Size (fuse-2.5.2.tar.gz) = 407845 bytes
-SHA1 (patch-aa) = 2bed299164f56d72623b79eb69b011bcf5f97fed
+SHA1 (fuse-2.8.4.tar.gz) = b1bc296c3e5b90b3658edb5d8d7aa0ee97c145d7
+RMD160 (fuse-2.8.4.tar.gz) = 75093d0ddf8c4b9fc2e4764bdf86c43c5937c297
+Size (fuse-2.8.4.tar.gz) = 500345 bytes
+SHA1 (patch-aa) = 651517ebbc440cb84a7b21c45b48aa717babc227
+SHA1 (patch-ab) = c53da5e8e9bd934ae9753b604c11d6a49b45731c
+SHA1 (patch-ac) = f31f83ca7cd7f75845f90d00b4c62f28935b93f3
+SHA1 (patch-ad) = e3e013137fbafca9a2944d23265e66553408b503
+SHA1 (patch-ae) = b275cd57b8f7c331fb730c27a8f1c901c11a9d01
+SHA1 (patch-af) = fdd24a2c94b31b4c3586e8ed56a78583e85f029d
+SHA1 (patch-ag) = e3fa9eac0a8e6de91f43c43cd904f12a1eb3621a
+SHA1 (patch-ai) = cc40e939f884c6c9b7b413021b9f18671507a2ab
+SHA1 (patch-ak) = 222faa9b6549063428c89e65dfcb77e002dc798e
+SHA1 (patch-al) = 358d734dbfa43e306bf0bb0a39b006be5822f1a3
+SHA1 (patch-am) = 2abd07b403896bff5aad6cd865cb473553851a22
+SHA1 (patch-an) = 3f119dae5f08996dd483a0fb4fa0365507be2070
diff --git a/filesystems/fuse/patches/patch-aa b/filesystems/fuse/patches/patch-aa
index 2b14f2efc46..4a0dcf951d3 100644
--- a/filesystems/fuse/patches/patch-aa
+++ b/filesystems/fuse/patches/patch-aa
@@ -1,13 +1,16 @@
-$NetBSD: patch-aa,v 1.1.1.1 2007/02/20 23:48:30 xtraeme Exp $
+$NetBSD: patch-aa,v 1.2 2010/08/25 08:02:21 manu Exp $
---- util/Makefile.in.orig 2006-02-11 00:41:46.000000000 +0100
-+++ util/Makefile.in 2006-02-11 01:01:48.000000000 +0100
-@@ -461,7 +461,7 @@
+mount.fuse is a script, not a binary
+--- util/Makefile.in.orig 2010-08-24 10:08:52.000000000 +0200
++++ util/Makefile.in 2010-08-24 10:08:59.000000000 +0200
+@@ -591,9 +591,9 @@
+ fi
install-exec-local:
$(mkdir_p) $(DESTDIR)$(MOUNT_FUSE_PATH)
- $(INSTALL_PROGRAM) $(srcdir)/mount.fuse $(DESTDIR)$(MOUNT_FUSE_PATH)/mount.fuse
+ $(INSTALL_SCRIPT) $(srcdir)/mount.fuse $(DESTDIR)$(MOUNT_FUSE_PATH)/mount.fuse
-
- install-data-local:
- $(mkdir_p) $(DESTDIR)$(UDEV_RULES_PATH)
+ $(mkdir_p) $(DESTDIR)$(INIT_D_PATH)
+ $(INSTALL_SCRIPT) $(srcdir)/init_script $(DESTDIR)$(INIT_D_PATH)/fuse
+ @if test -x /usr/sbin/update-rc.d; then \
+ echo "/usr/sbin/update-rc.d fuse start 34 S . start 41 0 6 . || true"; \
diff --git a/filesystems/fuse/patches/patch-ab b/filesystems/fuse/patches/patch-ab
new file mode 100644
index 00000000000..80ef1cf8d9a
--- /dev/null
+++ b/filesystems/fuse/patches/patch-ab
@@ -0,0 +1,71 @@
+$NetBSD: patch-ab,v 1.1 2010/08/25 08:02:21 manu Exp $
+
+NetBSD has the same build oddities af FreeBSD.
+--- ./lib/fuse.c.orig 2010-07-25 15:16:03.000000000 +0200
++++ ./lib/fuse.c 2010-08-07 03:25:21.000000000 +0200
+@@ -953,9 +953,9 @@
+ if (f->conf.intr)
+ fuse_do_prepare_interrupt(req, d);
+ }
+
+-#ifndef __FreeBSD__
++#if !defined(__FreeBSD__) && !defined(__NetBSD__)
+
+ static int fuse_compat_open(struct fuse_fs *fs, const char *path,
+ struct fuse_file_info *fi)
+ {
+@@ -1048,9 +1048,9 @@
+ }
+ return err;
+ }
+
+-#else /* __FreeBSD__ */
++#else /* __FreeBSD__ || __NetBSD__ */
+
+ static inline int fuse_compat_open(struct fuse_fs *fs, char *path,
+ struct fuse_file_info *fi)
+ {
+@@ -1074,9 +1074,9 @@
+ {
+ return fs->op.statfs(fs->compat == 25 ? "/" : path, buf);
+ }
+
+-#endif /* __FreeBSD__ */
++#endif /* __FreeBSD__ || __NetBSD__ */
+
+ int fuse_fs_getattr(struct fuse_fs *fs, const char *path, struct stat *buf)
+ {
+ fuse_get_context()->private_data = fs->user_data;
+@@ -3720,9 +3720,9 @@
+
+ if (!f->conf.ac_attr_timeout_set)
+ f->conf.ac_attr_timeout = f->conf.attr_timeout;
+
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ /*
+ * In FreeBSD, we always use these settings as inode numbers
+ * are needed to make getcwd(3) work.
+ */
+@@ -3896,9 +3896,9 @@
+ mod->next = fuse_modules;
+ fuse_modules = mod;
+ }
+
+-#ifndef __FreeBSD__
++#if !defined(__FreeBSD__) && !defined(__NetBSD__)
+
+ static struct fuse *fuse_new_common_compat(int fd, const char *opts,
+ const struct fuse_operations *op,
+ size_t op_size, int compat)
+@@ -3953,9 +3953,9 @@
+ FUSE_SYMVER(".symver fuse_set_getcontext_func,__fuse_set_getcontext_func@");
+ FUSE_SYMVER(".symver fuse_new_compat2,fuse_new@");
+ FUSE_SYMVER(".symver fuse_new_compat22,fuse_new@FUSE_2.2");
+
+-#endif /* __FreeBSD__ */
++#endif /* __FreeBSD__ || __NetBSD__ */
+
+ struct fuse *fuse_new_compat25(int fd, struct fuse_args *args,
+ const struct fuse_operations_compat25 *op,
+ size_t op_size)
diff --git a/filesystems/fuse/patches/patch-ac b/filesystems/fuse/patches/patch-ac
new file mode 100644
index 00000000000..ad31204480d
--- /dev/null
+++ b/filesystems/fuse/patches/patch-ac
@@ -0,0 +1,49 @@
+$NetBSD: patch-ac,v 1.1 2010/08/25 08:02:21 manu Exp $
+
+NetBSD has the same build oddities af FreeBSD. We also have this strange
+problem with fuse_req_ctx_compat24
+--- ./lib/fuse_lowlevel.c.orig 2010-07-25 15:18:20.000000000 +0200
++++ ./lib/fuse_lowlevel.c 2010-08-04 03:53:16.000000000 +0200
+@@ -1366,9 +1366,11 @@
+ const struct fuse_ctx *fuse_req_ctx_compat24(fuse_req_t req)
+ {
+ return fuse_req_ctx(req);
+ }
++#ifndef __NetBSD__
+ FUSE_SYMVER(".symver fuse_req_ctx_compat24,fuse_req_ctx@FUSE_2.4");
++#endif
+
+
+ void fuse_req_interrupt_func(fuse_req_t req, fuse_interrupt_func_t func,
+ void *data)
+@@ -1735,9 +1733,9 @@
+ return -ENOSYS;
+ }
+ #endif
+
+-#ifndef __FreeBSD__
++#if !defined(__FreeBSD__) && !defined(__NetBSD__)
+
+ static void fill_open_compat(struct fuse_open_out *arg,
+ const struct fuse_file_info_compat *f)
+ {
+@@ -1837,17 +1835,17 @@
+ FUSE_SYMVER(".symver fuse_reply_statfs_compat,fuse_reply_statfs@FUSE_2.4");
+ FUSE_SYMVER(".symver fuse_reply_open_compat,fuse_reply_open@FUSE_2.4");
+ FUSE_SYMVER(".symver fuse_lowlevel_new_compat,fuse_lowlevel_new@FUSE_2.4");
+
+-#else /* __FreeBSD__ */
++#else /* __FreeBSD__ || __NetBSD__ */
+
+ int fuse_sync_compat_args(struct fuse_args *args)
+ {
+ (void) args;
+ return 0;
+ }
+
+-#endif /* __FreeBSD__ */
++#endif /* __FreeBSD__ || __NetBSD__ */
+
+ struct fuse_session *fuse_lowlevel_new_compat25(struct fuse_args *args,
+ const struct fuse_lowlevel_ops_compat25 *op,
+ size_t op_size, void *userdata)
diff --git a/filesystems/fuse/patches/patch-ad b/filesystems/fuse/patches/patch-ad
new file mode 100644
index 00000000000..d510e5a19fa
--- /dev/null
+++ b/filesystems/fuse/patches/patch-ad
@@ -0,0 +1,27 @@
+$NetBSD: patch-ad,v 1.1 2010/08/25 08:02:21 manu Exp $
+
+NetBSD has the same build oddities af FreeBSD.
+--- ./lib/helper.c.orig 2010-07-25 15:25:28.000000000 +0200
++++ ./lib/helper.c 2010-07-29 18:05:33.000000000 +0200
+@@ -356,9 +356,9 @@
+ }
+
+ #include "fuse_compat.h"
+
+-#ifndef __FreeBSD__
++#if !defined(__FreeBSD__) && !defined(__NetBSD__)
+
+ struct fuse *fuse_setup_compat22(int argc, char *argv[],
+ const struct fuse_operations_compat22 *op,
+ size_t op_size, char **mountpoint,
+@@ -414,9 +414,9 @@
+ FUSE_SYMVER(".symver fuse_teardown,__fuse_teardown@");
+ FUSE_SYMVER(".symver fuse_main_compat2,fuse_main@");
+ FUSE_SYMVER(".symver fuse_main_real_compat22,fuse_main_real@FUSE_2.2");
+
+-#endif /* __FreeBSD__ */
++#endif /* __FreeBSD__ || __NetBSD__ */
+
+
+ struct fuse *fuse_setup_compat25(int argc, char *argv[],
+ const struct fuse_operations_compat25 *op,
diff --git a/filesystems/fuse/patches/patch-ae b/filesystems/fuse/patches/patch-ae
new file mode 100644
index 00000000000..2e761137ab5
--- /dev/null
+++ b/filesystems/fuse/patches/patch-ae
@@ -0,0 +1,69 @@
+$NetBSD: patch-ae,v 1.1 2010/08/25 08:02:21 manu Exp $
+
+NetBSD uses libperfuse(3). Also remap MNT_* flags to Linux MS_*, and
+unmount(2) to umount2(2)
+--- lib/mount.c.orig 2010-04-26 14:11:30.000000000 +0200
++++ lib/mount.c 2010-08-24 09:20:25.000000000 +0200
+@@ -16,16 +16,30 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <stddef.h>
++#include <string.h>
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <sys/poll.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
+ #include <sys/wait.h>
+ #include <sys/mount.h>
+
++#ifdef __NetBSD__
++#include <perfuse.h>
++
++#define MS_RDONLY MNT_RDONLY
++#define MS_NOSUID MNT_NOSUID
++#define MS_NODEV MNT_NODEV
++#define MS_NOEXEC MNT_NOEXEC
++#define MS_SYNCHRONOUS MNT_SYNCHRONOUS
++#define MS_NOATIME MNT_NOATIME
++
++#define umount2(mnt, flags) unmount(mnt, (flags == 2) ? MNT_FORCE : 0)
++#endif
++
+ #define FUSERMOUNT_PROG "fusermount"
+ #define FUSE_COMMFD_ENV "_FUSE_COMMFD"
+
+ #ifndef HAVE_FORK
+@@ -154,9 +168,11 @@
+ {"async", MS_SYNCHRONOUS, 0},
+ {"sync", MS_SYNCHRONOUS, 1},
+ {"atime", MS_NOATIME, 0},
+ {"noatime", MS_NOATIME, 1},
++#ifndef __NetBSD__
+ {"dirsync", MS_DIRSYNC, 1},
++#endif
+ {NULL, 0, 0}
+ };
+
+ static void set_mount_flag(const char *s, int *flags)
+@@ -483,8 +499,9 @@
+
+ goto out_close;
+ }
+
++#ifndef __NetBSD__
+ if (geteuid() == 0) {
+ char *newmnt = fuse_mnt_resolve_path("fuse", mnt);
+ res = -1;
+ if (!newmnt)
+@@ -495,8 +512,9 @@
+ free(newmnt);
+ if (res == -1)
+ goto out_umount;
+ }
++#endif /* __NetBSD__ */
+ free(type);
+ free(source);
+
+ return fd;
diff --git a/filesystems/fuse/patches/patch-af b/filesystems/fuse/patches/patch-af
new file mode 100644
index 00000000000..8dd53b5a16d
--- /dev/null
+++ b/filesystems/fuse/patches/patch-af
@@ -0,0 +1,42 @@
+$NetBSD: patch-af,v 1.1 2010/08/25 08:02:21 manu Exp $
+
+Do not check for inexistant /etc/mtab on NetBSD. Also remap umount2() to
+unmount(2).
+--- lib/mount_util.c.orig 2010-08-24 09:44:43.000000000 +0200
++++ lib/mount_util.c 2010-08-24 09:48:40.000000000 +0200
+@@ -10,18 +10,25 @@
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <signal.h>
+ #include <dirent.h>
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
++#ifndef __NetBSD__
+ #include <mntent.h>
++#endif
+ #include <sys/stat.h>
+ #include <sys/wait.h>
+ #include <sys/mount.h>
+ #include <sys/param.h>
+
++#ifdef __NetBSD__
++#define umount2(mnt, flags) unmount(mnt, (flags == 2) ? MNT_FORCE : 0)
++#define mtab_needs_update(mnt) 0
++#else
+ static int mtab_needs_update(const char *mnt)
+ {
+ int res;
+ struct stat stbuf;
+@@ -52,8 +59,9 @@
+ }
+
+ return 1;
+ }
++#endif /* __NetBSD__ */
+
+ static int add_mount_legacy(const char *progname, const char *fsname,
+ const char *mnt, const char *type, const char *opts)
+ {
diff --git a/filesystems/fuse/patches/patch-ag b/filesystems/fuse/patches/patch-ag
new file mode 100644
index 00000000000..40b7cf073a0
--- /dev/null
+++ b/filesystems/fuse/patches/patch-ag
@@ -0,0 +1,23 @@
+$NetBSD: patch-ag,v 1.1 2010/08/25 08:02:21 manu Exp $
+
+NetBSD has the same build oddities af FreeBSD.
+--- ./include/fuse_compat.h 2010-07-25 15:16:35.000000000 +0200
++++ ./include/fuse_compat.h.orig 2010-07-25 15:14:11.000000000 +0200
+@@ -64,9 +64,9 @@
+ int *multithreaded, int *fd);
+
+ void fuse_teardown_compat22(struct fuse *fuse, int fd, char *mountpoint);
+
+-#ifndef __FreeBSD__
++#if !defined(__FreeBSD__) && !defined(__NetBSD__)
+ #include <sys/statfs.h>
+
+ struct fuse_operations_compat22 {
+ int (*getattr) (const char *, struct stat *);
+@@ -197,5 +197,5 @@
+
+ void fuse_main_compat1(int argc, char *argv[],
+ const struct fuse_operations_compat1 *op);
+
+-#endif /* __FreeBSD__ */
++#endif /* __FreeBSD__ || __NetBSD__ */
diff --git a/filesystems/fuse/patches/patch-ai b/filesystems/fuse/patches/patch-ai
new file mode 100644
index 00000000000..d5e31c3ee63
--- /dev/null
+++ b/filesystems/fuse/patches/patch-ai
@@ -0,0 +1,27 @@
+$NetBSD: patch-ai,v 1.1 2010/08/25 08:02:21 manu Exp $
+
+NetBSD has the same build oddities af FreeBSD.
+--- ./include/fuse_lowlevel_compat.h.orig 2010-07-25 15:21:50.000000000 +0200
++++ ./include/fuse_lowlevel_compat.h 2010-07-25 15:22:20.000000000 +0200
+@@ -71,9 +71,9 @@
+
+ char *fuse_add_dirent(char *buf, const char *name, const struct stat *stbuf,
+ off_t off);
+
+-#ifndef __FreeBSD__
++#if !defined(__FreeBSD__) && !defined(__NetBSD__)
+
+ #include <sys/statfs.h>
+
+ struct fuse_lowlevel_ops_compat {
+@@ -138,9 +138,9 @@
+ struct fuse_session *fuse_lowlevel_new_compat(const char *opts,
+ const struct fuse_lowlevel_ops_compat *op,
+ size_t op_size, void *userdata);
+
+-#endif /* __FreeBSD__ */
++#endif /* __FreeBSD__ || __NetBSD__ */
+
+ struct fuse_chan_ops_compat24 {
+ int (*receive)(struct fuse_chan *ch, char *buf, size_t size);
+ int (*send)(struct fuse_chan *ch, const struct iovec iov[],
diff --git a/filesystems/fuse/patches/patch-ak b/filesystems/fuse/patches/patch-ak
new file mode 100644
index 00000000000..837f78738d8
--- /dev/null
+++ b/filesystems/fuse/patches/patch-ak
@@ -0,0 +1,25 @@
+$NetBSD: patch-ak,v 1.1 2010/08/25 08:02:21 manu Exp $
+
+Take care of NetBSD so that we can link with -lperfuse in makefile.
+--- configure.in.orig 2010-08-24 09:26:08.000000000 +0200
++++ configure.in 2010-08-24 09:27:01.000000000 +0200
+@@ -15,8 +15,9 @@
+ fi
+
+ case $target_os in
+ *linux*) arch=linux;;
++ *netbsd*) arch=netbsd;;
+ *bsd*) arch=bsd;;
+ *) arch=unknown;;
+ esac
+
+@@ -90,8 +91,9 @@
+
+ AC_SUBST(subdirs2)
+
+ AM_CONDITIONAL(LINUX, test "$arch" = linux)
++AM_CONDITIONAL(NETBSD, test "$arch" = netbsd)
+ AM_CONDITIONAL(BSD, test "$arch" = bsd)
+
+ AC_CONFIG_FILES([fuse.pc Makefile lib/Makefile util/Makefile example/Makefile include/Makefile])
+ AC_OUTPUT
diff --git a/filesystems/fuse/patches/patch-al b/filesystems/fuse/patches/patch-al
new file mode 100644
index 00000000000..e86157ebfdf
--- /dev/null
+++ b/filesystems/fuse/patches/patch-al
@@ -0,0 +1,59 @@
+$NetBSD: patch-al,v 1.1 2010/08/25 08:02:21 manu Exp $
+
+Take care of NetBSD so that we can link with -lperfuse in makefile.
+--- configure.orig 2010-08-24 09:28:13.000000000 +0200
++++ configure 2010-08-24 09:31:20.000000000 +0200
+@@ -788,8 +788,10 @@
+ LTLIBOBJS
+ LIBOBJS
+ BSD_FALSE
+ BSD_TRUE
++NETBSD_FALSE
++NETBSD_TRUE
+ LINUX_FALSE
+ LINUX_TRUE
+ subdirs2
+ INIT_D_PATH
+@@ -12082,8 +12084,9 @@
+ fi
+
+ case $target_os in
+ *linux*) arch=linux;;
++ *netbsd*) arch=netbsd;;
+ *bsd*) arch=bsd;;
+ *) arch=unknown;;
+ esac
+
+@@ -13671,8 +13674,16 @@
+ LINUX_TRUE='#'
+ LINUX_FALSE=
+ fi
+
++ if test "$arch" = netbsd; then
++ NETBSD_TRUE=
++ NETBSD_FALSE='#'
++else
++ NETBSD_TRUE='#'
++ NETBSD_FALSE=
++fi
++
+ if test "$arch" = bsd; then
+ BSD_TRUE=
+ BSD_FALSE='#'
+ else
+@@ -13822,8 +13833,15 @@
+ $as_echo "$as_me: error: conditional \"LINUX\" was never defined.
+ Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
++if test -z "${NETBSD_TRUE}" && test -z "${NETBSD_FALSE}"; then
++ { { $as_echo "$as_me:$LINENO: error: conditional \"NETBSD\" was never defined.
++Usually this means the macro was only invoked conditionally." >&5
++$as_echo "$as_me: error: conditional \"NETBSD\" was never defined.
++Usually this means the macro was only invoked conditionally." >&2;}
++ { (exit 1); exit 1; }; }
++fi
+ if test -z "${BSD_TRUE}" && test -z "${BSD_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"BSD\" was never defined.
+ Usually this means the macro was only invoked conditionally." >&5
+ $as_echo "$as_me: error: conditional \"BSD\" was never defined.
diff --git a/filesystems/fuse/patches/patch-am b/filesystems/fuse/patches/patch-am
new file mode 100644
index 00000000000..d5bd9da3d17
--- /dev/null
+++ b/filesystems/fuse/patches/patch-am
@@ -0,0 +1,18 @@
+$NetBSD: patch-am,v 1.1 2010/08/25 08:02:21 manu Exp $
+
+Link with -lperfuse on NetBSD
+--- lib/Makefile.am.orig 2010-08-24 09:32:59.000000000 +0200
++++ lib/Makefile.am 2010-08-24 09:33:09.000000000 +0200
+@@ -37,8 +37,12 @@
+
+ libfuse_la_LDFLAGS = @libfuse_libs@ -version-number 2:8:4 \
+ -Wl,--version-script,$(srcdir)/fuse_versionscript
+
++if NETBSD
++libfuse_la_LIBADD = -lperfuse -lpuffs
++endif
++
+ libulockmgr_la_SOURCES = ulockmgr.c
+ libulockmgr_la_LDFLAGS = -pthread -version-number 1:0:1
+
+ EXTRA_DIST = fuse_versionscript
diff --git a/filesystems/fuse/patches/patch-an b/filesystems/fuse/patches/patch-an
new file mode 100644
index 00000000000..c31f687e6cf
--- /dev/null
+++ b/filesystems/fuse/patches/patch-an
@@ -0,0 +1,16 @@
+$NetBSD: patch-an,v 1.1 2010/08/25 08:02:21 manu Exp $
+
+Link with -lperfuse on NetBSD
+--- lib/Makefile.in.orig 2010-08-24 09:33:40.000000000 +0200
++++ lib/Makefile.in 2010-08-24 09:35:20.000000000 +0200
+@@ -263,8 +263,10 @@
+
+ libfuse_la_LDFLAGS = @libfuse_libs@ -version-number 2:8:4 \
+ -Wl,--version-script,$(srcdir)/fuse_versionscript
+
++@NETBSD_TRUE@libfuse_la_LIBADD = -lperfuse -lpuffs
++
+ libulockmgr_la_SOURCES = ulockmgr.c
+ libulockmgr_la_LDFLAGS = -pthread -version-number 1:0:1
+ EXTRA_DIST = fuse_versionscript
+ all: all-am