Sat Jul 9 15:27:12 2011 UTC ()
Import new "fuse-ext2" package:
Fuse-ext2 is a multi OS FUSE module to mount ext2 and ext3 file system
devices and/or images with read write support.

Please note that this file-system only works under NetBSD if the
"librefuse" library on your system contains this bug fix:
- http://mail-index.netbsd.org/source-changes/2011/07/09/msg024410.html
- http://releng.netbsd.org/cgi-bin/req-5.cgi?show=1648

Status:

Vendor Tag:	TNF
Release Tags:	pkgsrc-base


(tron)
diff -r0 -r1.1.1.1 pkgsrc/filesystems/fuse-ext2/Makefile
diff -r0 -r1.1.1.1 pkgsrc/filesystems/fuse-ext2/PLIST
diff -r0 -r1.1.1.1 pkgsrc/filesystems/fuse-ext2/distinfo
diff -r0 -r1.1.1.1 pkgsrc/filesystems/fuse-ext2/DESCR
diff -r0 -r1.1.1.1 pkgsrc/filesystems/fuse-ext2/patches/patch-aa
diff -r0 -r1.1.1.1 pkgsrc/filesystems/fuse-ext2/patches/patch-ab
diff -r0 -r1.1.1.1 pkgsrc/filesystems/fuse-ext2/patches/patch-ac
diff -r0 -r1.1.1.1 pkgsrc/filesystems/fuse-ext2/patches/patch-ad
diff -r0 -r1.1.1.1 pkgsrc/filesystems/fuse-ext2/patches/patch-ae
diff -r0 -r1.1.1.1 pkgsrc/filesystems/fuse-ext2/patches/patch-af
diff -r0 -r1.1.1.1 pkgsrc/filesystems/fuse-ext2/patches/patch-ag

File Added: pkgsrc/filesystems/fuse-ext2/Makefile
# $NetBSD: Makefile,v 1.1.1.1 2011/07/09 15:27:11 tron Exp $

DISTNAME=	fuse-ext2-0.0.7
CATEGORIES=	filesystems
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=fuse-ext2/fuse-ext2/${DISTNAME}/}

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://alperakcan.org/projects/fuse-ext2/
COMMENT=	FUSE file-system to mount ext2 and ext3 file system
LICENSE=	gnu-gpl-v2

ONLY_FOR_PLATFORM=	Linux-*-* NetBSD-*-*

PKG_DESTDIR_SUPPORT=	user-destdir

GNU_CONFIGURE=	yes
USE_LIBTOOL=	yes
USE_TOOLS+=	autoheader automake autoreconf gmake pkg-config
USE_LANGUAGES=	c c++

pre-configure:
	cd ${WRKSRC} && autoreconf --verbose --install --force

.include "../../mk/fuse.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/filesystems/fuse-ext2/PLIST
@comment $NetBSD: PLIST,v 1.1.1.1 2011/07/09 15:27:11 tron Exp $
bin/fuse-ext2
bin/fuse-ext2.e2label
bin/fuse-ext2.mke2fs
bin/fuse-ext2.probe
lib/pkgconfig/fuse-ext2.pc
man/man1/fuse-ext2.1

File Added: pkgsrc/filesystems/fuse-ext2/distinfo
$NetBSD: distinfo,v 1.1.1.1 2011/07/09 15:27:11 tron Exp $

SHA1 (fuse-ext2-0.0.7.tar.gz) = cdfef525838d2de07a4da6d60b65efce5a1cffa0
RMD160 (fuse-ext2-0.0.7.tar.gz) = 29cb85f033b65fba4d82d14de907dd4458173c2b
Size (fuse-ext2-0.0.7.tar.gz) = 570156 bytes
SHA1 (patch-aa) = e8dc764411ea62f2c714df71bee7ea06a84c337b
SHA1 (patch-ab) = 830bc968c55b13125700a6fbeff9808610d065f0
SHA1 (patch-ac) = 253561f1e6a67b5d66d7409af3bf26477ad57b2c
SHA1 (patch-ad) = 9aa1100f461b2afa72239a5a8f31311e18b77e7e
SHA1 (patch-ae) = eddbe86f5f9541a62cbd9614e7d847f4a25fc6f5
SHA1 (patch-af) = ced88c0a278c4924ee9fb6585271093742f0eb09
SHA1 (patch-ag) = 93c6b2f3d0be517a3bfb4e5aaf198fbf782ab10c

File Added: pkgsrc/filesystems/fuse-ext2/DESCR
Fuse-ext2 is a multi OS FUSE module to mount ext2 and ext3 file system devices
and/or images with read write support.

File Added: pkgsrc/filesystems/fuse-ext2/patches/Attic/patch-aa
$NetBSD: patch-aa,v 1.1.1.1 2011/07/09 15:27:11 tron Exp $

Add NetBSD support.

--- configure.ac.orig	2009-12-24 12:38:06.000000000 +0000
+++ configure.ac	2011-07-09 13:54:03.000000000 +0100
@@ -15,6 +15,7 @@
 case $target_os in
      *linux*)	arch=linux;;
      *darwin*)	arch=darwin;;
+     *netbsd*)	arch=netbsd;;
      *)			arch=unknown;;
 esac
 
@@ -137,7 +138,7 @@
 ])
 
 # Checks for libraries
-AC_CHECK_LIB([fuse], [fuse_main], [FUSE_LIBS="-lfuse"], [AC_MSG_ERROR([Can't find libfuse, please install it])])
+AC_CHECK_LIB([fuse], [fuse_exit], [FUSE_LIBS="-lfuse"], [AC_MSG_ERROR([Can't find libfuse, please install it])])
 
 AC_MSG_CHECKING([if FUSE on this system is too new for us])
 AC_EGREP_CPP([fuse_version_yes], [
@@ -193,6 +194,7 @@
 
 AM_CONDITIONAL(LINUX, test "$arch" = linux)
 AM_CONDITIONAL(DARWIN, test "$arch" = darwin)
+AM_CONDITIONAL(NETBSD, test "$arch" = netbsd)
 
 AC_CONFIG_FILES([
 	fuse-ext2.pc

File Added: pkgsrc/filesystems/fuse-ext2/patches/Attic/patch-ab
$NetBSD: patch-ab,v 1.1.1.1 2011/07/09 15:27:11 tron Exp $

Add NetBSD support to autotools files.

--- fuse-ext2/Makefile.am.orig	2009-11-09 16:31:37.000000000 +0000
+++ fuse-ext2/Makefile.am	2011-07-09 14:17:19.000000000 +0100
@@ -39,6 +39,17 @@
 	-lfuse \
 	-lext2fs
 endif
+if NETBSD
+fuse_ext2_probe_CFLAGS = \
+	-Wall \
+	-DHAVE_CONFIG_H \
+	-I$(top_srcdir)/e2fsprogs-1.41.9
+
+fuse_ext2_probe_LDADD =	\
+	../e2fsprogs-1.41.9/ext2fs/libext2fs.a \
+	../e2fsprogs-1.41.9/et/libcom_err.a \
+	-lrefuse
+endif
 
 fuse_ext2_SOURCES =	\
 	fuse-ext2.h \
@@ -183,6 +194,12 @@
 	-lfuse \
 	-lext2fs
 endif
+if NETBSD
+fuse_ext2_LDADD = \
+	../e2fsprogs-1.41.9/ext2fs/libext2fs.a	\
+	../e2fsprogs-1.41.9/et/libcom_err.a	\
+	-lrefuse
+endif
 
 install-data-hook:
 	cd "$(DESTDIR)/$(moddir)" && rm -f $(mod_LTLIBRARIES)

File Added: pkgsrc/filesystems/fuse-ext2/patches/Attic/patch-ac
$NetBSD: patch-ac,v 1.1.1.1 2011/07/09 15:27:11 tron Exp $

Fix build under NetBSD, based on "pkgsrc/sysutils/e2fsprogs/patches/patch-af".

--- e2fsprogs-1.41.9/ext2fs/ismounted.c.orig	2010-05-18 03:04:39.000000000 +0000
+++ e2fsprogs-1.41.9/ext2fs/ismounted.c
@@ -198,7 +198,11 @@ static errcode_t check_mntent(const char
 static errcode_t check_getmntinfo(const char *file, int *mount_flags,
 				  char *mtpt, int mtlen)
 {
-	struct statfs *mp;
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 299000900
+        struct statvfs *mp;
+#else
+        struct statfs *mp;
+#endif
         int    len, n;
         const  char   *s1;
 	char	*s2;

File Added: pkgsrc/filesystems/fuse-ext2/patches/Attic/patch-ad
$NetBSD: patch-ad,v 1.1.1.1 2011/07/09 15:27:11 tron Exp $

Avoid NULL pointer access with "librefuse" under NetBSD.

--- fuse-ext2/fuse-ext2.h.orig	2009-11-09 16:31:37.000000000 +0000
+++ fuse-ext2/fuse-ext2.h	2011-07-09 16:15:41.000000000 +0100
@@ -71,12 +71,17 @@
 {
 	struct fuse_context *mycontext=fuse_get_context();
 	struct extfs_data *e2data=mycontext->private_data;
+	ext2_filsys e2fs = e2data->e2fs;
+	if (e2fs == NULL) {
+		return NULL;
+	}
+
 	time_t now=time(NULL);
 	if ((now - e2data->last_flush) > FLUSH_BITMAPS_TIMEOUT) {
 		ext2fs_write_bitmaps(e2data->e2fs);
 		e2data->last_flush=now;
 	}
-	return (ext2_filsys) e2data->e2fs;
+	return e2fs;
 }
 
 #if ENABLE_DEBUG

File Added: pkgsrc/filesystems/fuse-ext2/patches/Attic/patch-ae
$NetBSD: patch-ae,v 1.1.1.1 2011/07/09 15:27:11 tron Exp $

Avoid NULL pointer access with "librefuse" under NetBSD.

--- fuse-ext2/op_getattr.c.orig	2009-10-19 20:19:42.000000000 +0100
+++ fuse-ext2/op_getattr.c	2011-07-09 16:12:35.000000000 +0100
@@ -27,6 +27,10 @@
 	struct ext2_vnode *vnode;
 	ext2_filsys e2fs = current_ext2fs();
 
+	if (e2fs == NULL) {
+		return -EIO;
+	}
+
 	debugf("enter");
 	debugf("path = %s", path);
 

File Added: pkgsrc/filesystems/fuse-ext2/patches/Attic/patch-af
$NetBSD: patch-af,v 1.1.1.1 2011/07/09 15:27:11 tron Exp $

Fix build under NetBSD.

--- fuse-ext2/fuse-ext2.c.orig	2009-11-09 15:28:02.000000000 +0000
+++ fuse-ext2/fuse-ext2.c	2011-07-09 12:52:23.000000000 +0100
@@ -78,6 +78,13 @@
 	return 0;
 }
 
+#ifdef __NetBSD__
+static int fuse_version (void)
+{
+	return FUSE_VERSION;
+}
+#endif
+
 static void usage (void)
 {
 	printf(usage_msg, PACKAGE, VERSION, fuse_version(), PACKAGE, HOME);

File Added: pkgsrc/filesystems/fuse-ext2/patches/Attic/patch-ag
$NetBSD: patch-ag,v 1.1.1.1 2011/07/09 15:27:11 tron Exp $

Fix build under NetBSD.

--- fuse-ext2/fuse-ext2.probe.c.orig	2009-11-03 13:50:57.000000000 +0000
+++ fuse-ext2/fuse-ext2.probe.c	2011-07-09 14:05:33.000000000 +0100
@@ -35,6 +35,13 @@
 "%s\n"
 "\n";
 
+#ifdef __NetBSD__
+static int fuse_version (void)
+{
+	return FUSE_VERSION;
+}
+#endif
+
 static void usage (void)
 {
 	printf(usage_msg, PACKAGE, VERSION, fuse_version(), PACKAGE, HOME);