pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[PATCH] fuse-ntfs-3g and libntfs



Hello,

The current pkgsrc version of filesystems/fuse-ntfs-3g/ does not
compile.

The problem is that some procedures used by the sources are not 
provided by librefuse.

The solution:

For mount.ntfs-3g(8), the problem is relatively light : fuse_version()
used -> replaced by the macro FUSE_VERSION. A fuse_set_signal_handlers()
(? How is the library taking care of these ?) is simply ignored.

An auxiliary program : lowntfs-3g(8) is using various low level routines
that are provided by libfuse-lite but not by librefuse. This program is
simply not compiled and hence not installed.

All the patches go in filesystems/libntfs. The two distinfo.diff and
patch-src_Makefile.in.diff are for filesystems/libntfs too.

The diff for PLIST is for filesystems/fuse-ntfs-3g (it works from
filesystems/libntfs/; so this is just to not install the lowntfs-3g
related bin and manpages).

Disclaimer: I'm not an automake/autoconf and al. on expert; neither a
pkgsrc expert. Since there is already a fuse -> refuse dance, I have
found a way to modify the autoconf/automake source templates that works
with what is made by the pkgsrc framework for the (NetBSD) refuse
substitution. I have found a way. Probably not _the_ way.

HTH
-- 
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                     http://www.kergis.com/
                     http://www.arts-po.fr/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C
--- src/Makefile.am.orig	2014-02-15 15:07:52.000000000 +0100
+++ src/Makefile.am	2015-06-19 22:49:38.000000000 +0200
@@ -16,7 +16,7 @@
 bin_PROGRAMS	 = ntfs-3g.probe \
 		ntfs-3g.usermap \
 		ntfs-3g.secaudit
-rootbin_PROGRAMS = ntfs-3g lowntfs-3g
+rootbin_PROGRAMS = ntfs-3g
 rootsbin_DATA 	 = #Create directory
 man_MANS	 = ntfs-3g.8 ntfs-3g.probe.8 \
 		ntfs-3g.usermap.8 \
@@ -70,12 +70,10 @@
 install-exec-local:	install-rootbinPROGRAMS
 	$(MKDIR_P) "$(DESTDIR)/sbin"
 	$(LN_S) -f "$(rootbindir)/ntfs-3g" "$(DESTDIR)/sbin/mount.ntfs-3g"
-	$(LN_S) -f "$(rootbindir)/lowntfs-3g" "$(DESTDIR)/sbin/mount.lowntfs-3g"
 endif
 
 install-data-local:	install-man8
 	$(LN_S) -f ntfs-3g.8 "$(DESTDIR)$(man8dir)/mount.ntfs-3g.8"
-	$(LN_S) -f ntfs-3g.8 "$(DESTDIR)$(man8dir)/mount.lowntfs-3g.8"
 
 uninstall-local:
 	$(RM) -f "$(DESTDIR)$(man8dir)/mount.ntfs-3g.8"
--- src/ntfs-3g_common.h	2015-06-19 21:40:28.000000000 +0200
+++ src/ntfs-3g_common.h	2015-06-19 21:44:19.000000000 +0200
@@ -25,6 +25,14 @@
 
 #include "inode.h"
 
+#ifdef NETBSD_LIBREFUSE
+/* NetBSD librefuse, as of version 2.6, has not these fonctions. They
+   are implemented in libfuse-lite for reference.
+ */
+#define fuse_version() FUSE_VERSION
+#define fuse_set_signal_handlers(session) 0
+#endif
+
 struct ntfs_options {
         char    *mnt_point;     /* Mount point */    
         char    *options;       /* Mount options */  
--- config.h.in	2015-06-19 21:36:43.000000000 +0200
+++ config.h.in	2015-06-19 21:37:44.000000000 +0200
@@ -380,6 +380,9 @@
 /* Define to 1 if this is a Windows OS */
 #undef WINDOWS
 
+/* Define to 1 if using NETBSD_LIBREFUSE. */
+#undef NETBSD_LIBREFUSE
+
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
    significant byte first (like Motorola and SPARC, unlike Intel). */
 #if defined AC_APPLE_UNIVERSAL_BUILD
--- configure.ac	2014-02-15 15:07:52.000000000 +0100
+++ configure.ac	2015-06-19 21:30:40.000000000 +0200
@@ -221,9 +221,18 @@
 			[with_fuse="internal"]
 		)
 		;;
-	darwin*|netbsd*|kfreebsd*-gnu)
+	darwin*|kfreebsd*-gnu)
 		with_fuse="external"
 		;;
+	netbsd*)
+		with_fuse="external"
+		NETBSD_LIBREFUSE="yes"
+		AC_DEFINE(
+			[NETBSD_LIBREFUSE],
+			[1],
+			[librefuse doesn't have some routines liker use_version()]
+		)
+		;;
 	freebsd*)
 		AC_MSG_ERROR([Please see FreeBSD support at http://www.freshports.org/sysutils/fusefs-ntfs])
 		;;
@@ -599,6 +608,7 @@
 AM_CONDITIONAL([FUSE_INTERNAL], [test "${with_fuse}" = "internal"])
 AM_CONDITIONAL([GENERATE_LDSCRIPT], [test "${enable_ldscript}" = "yes"])
 AM_CONDITIONAL([WINDOWS], [test "${WINDOWS}" = "yes"])
+AM_CONDITIONAL([NETBSD_LIBREFUSE], [test "${NETBSD_LIBREFUSE}" = "yes"])
 AM_CONDITIONAL([NTFS_DEVICE_DEFAULT_IO_OPS], [test "${enable_device_default_io_ops}" = "yes"])
 AM_CONDITIONAL([RUN_LDCONFIG], [test "${enable_ldconfig}" = "yes"])
 AM_CONDITIONAL([REALLYSTATIC], [test "${enable_really_static}" = "yes"])
--- configure	2015-06-19 21:24:49.000000000 +0200
+++ configure	2015-06-19 21:29:58.000000000 +0200
@@ -763,6 +763,8 @@
 RUN_LDCONFIG_TRUE
 NTFS_DEVICE_DEFAULT_IO_OPS_FALSE
 NTFS_DEVICE_DEFAULT_IO_OPS_TRUE
+NETBSD_LIBREFUSE_FALSE
+NETBSD_LIBREFUSE_TRUE
 WINDOWS_FALSE
 WINDOWS_TRUE
 GENERATE_LDSCRIPT_FALSE
@@ -11890,9 +11892,16 @@
 fi
 
 		;;
-	darwin*|netbsd*|kfreebsd*-gnu)
+	darwin*|kfreebsd*-gnu)
 		with_fuse="external"
 		;;
+	netbsd*)
+		with_fuse="external"
+		NETBSD_LIBREFUSE="yes"
+
+$as_echo "#define NETBSD_LIBREFUSE 1" >>confdefs.h
+
+		;;
 	freebsd*)
 		as_fn_error $? "Please see FreeBSD support at http://www.freshports.org/sysutils/fusefs-ntfs"; "$LINENO" 5
 		;;
@@ -14020,6 +14029,14 @@
   WINDOWS_FALSE=
 fi
 
+ if test "${NETBSD_LIBREFUSE}" = "yes"; then
+  NETBSD_LIBREFUSE_TRUE=
+  NETBSD_LIBREFUSE_FALSE='#'
+else
+  NETBSD_LIBREFUSE_TRUE='#'
+  NETBSD_LIBREFUSE_FALSE=
+fi
+
  if test "${enable_device_default_io_ops}" = "yes"; then
   NTFS_DEVICE_DEFAULT_IO_OPS_TRUE=
   NTFS_DEVICE_DEFAULT_IO_OPS_FALSE='#'
@@ -14238,6 +14255,10 @@
   as_fn_error $? "conditional \"WINDOWS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${NETBSD_LIBREFUSE_TRUE}" && test -z "${NETBSD_LIBREFUSE_FALSE}"; then
+  as_fn_error $? "conditional \"NETBSD_LIBREFUSE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${NTFS_DEVICE_DEFAULT_IO_OPS_TRUE}" && test -z "${NTFS_DEVICE_DEFAULT_IO_OPS_FALSE}"; then
   as_fn_error $? "conditional \"NTFS_DEVICE_DEFAULT_IO_OPS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
Index: PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/filesystems/fuse-ntfs-3g/PLIST,v
retrieving revision 1.4
diff -u -r1.4 PLIST
--- PLIST	19 May 2014 12:22:06 -0000	1.4
+++ PLIST	19 Jun 2015 21:12:33 -0000
@@ -1,14 +1,11 @@
 @comment $NetBSD: PLIST,v 1.4 2014/05/19 12:22:06 adam Exp $
-bin/lowntfs-3g
 bin/ntfs-3g
 bin/ntfs-3g.probe
 bin/ntfs-3g.secaudit
 bin/ntfs-3g.usermap
-man/man8/mount.lowntfs-3g.8
 man/man8/mount.ntfs-3g.8
 man/man8/ntfs-3g.8
 man/man8/ntfs-3g.probe.8
 man/man8/ntfs-3g.secaudit.8
 man/man8/ntfs-3g.usermap.8
-sbin/mount.lowntfs-3g
 sbin/mount.ntfs-3g
Index: patches/patch-src_Makefile.in
===================================================================
RCS file: /cvsroot/pkgsrc/filesystems/libntfs/patches/patch-src_Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 patch-src_Makefile.in
--- patches/patch-src_Makefile.in	19 May 2014 12:22:06 -0000	1.1
+++ patches/patch-src_Makefile.in	19 Jun 2015 21:10:48 -0000
@@ -1,11 +1,16 @@
-$NetBSD: patch-src_Makefile.in,v 1.1 2014/05/19 12:22:06 adam Exp $
-
-Link against already built and installed libntfs.
-Install binaries into PREFIX, not the root directory.
-
---- src/Makefile.in.orig	2014-02-15 14:08:01.000000000 +0000
-+++ src/Makefile.in
-@@ -68,8 +68,7 @@ lowntfs_3g_OBJECTS = $(am_lowntfs_3g_OBJ
+--- src/Makefile.in.orig	2014-02-15 15:08:01.000000000 +0100
++++ src/Makefile.in	2015-06-19 22:50:50.000000000 +0200
+@@ -39,8 +39,7 @@
+ @ENABLE_NTFS_3G_TRUE@bin_PROGRAMS = ntfs-3g.probe$(EXEEXT) \
+ @ENABLE_NTFS_3G_TRUE@	ntfs-3g.usermap$(EXEEXT) \
+ @ENABLE_NTFS_3G_TRUE@	ntfs-3g.secaudit$(EXEEXT)
+-@ENABLE_NTFS_3G_TRUE@rootbin_PROGRAMS = ntfs-3g$(EXEEXT) \
+-@ENABLE_NTFS_3G_TRUE@	lowntfs-3g$(EXEEXT)
++@ENABLE_NTFS_3G_TRUE@rootbin_PROGRAMS = ntfs-3g$(EXEEXT)
+ subdir = src
+ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ 	$(srcdir)/ntfs-3g.8.in $(srcdir)/ntfs-3g.probe.8.in \
+@@ -68,8 +67,7 @@
  am__DEPENDENCIES_1 =
  @FUSE_INTERNAL_FALSE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
  @FUSE_INTERNAL_TRUE@am__DEPENDENCIES_2 = $(top_builddir)/libfuse-lite/libfuse-lite.la
@@ -15,7 +20,7 @@
  lowntfs_3g_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
  	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(lowntfs_3g_CFLAGS) \
  	$(CFLAGS) $(lowntfs_3g_LDFLAGS) $(LDFLAGS) -o $@
-@@ -77,8 +76,7 @@ am__ntfs_3g_SOURCES_DIST = ntfs-3g.c ntf
+@@ -77,8 +75,7 @@
  @ENABLE_NTFS_3G_TRUE@am_ntfs_3g_OBJECTS = ntfs_3g-ntfs-3g.$(OBJEXT) \
  @ENABLE_NTFS_3G_TRUE@	ntfs_3g-ntfs-3g_common.$(OBJEXT)
  ntfs_3g_OBJECTS = $(am_ntfs_3g_OBJECTS)
@@ -25,7 +30,7 @@
  ntfs_3g_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
  	--mode=link $(CCLD) $(ntfs_3g_CFLAGS) $(CFLAGS) \
  	$(ntfs_3g_LDFLAGS) $(LDFLAGS) -o $@
-@@ -86,8 +84,7 @@ am__ntfs_3g_probe_SOURCES_DIST = ntfs-3g
+@@ -86,8 +83,7 @@
  @ENABLE_NTFS_3G_TRUE@am_ntfs_3g_probe_OBJECTS =  \
  @ENABLE_NTFS_3G_TRUE@	ntfs_3g_probe-ntfs-3g.probe.$(OBJEXT)
  ntfs_3g_probe_OBJECTS = $(am_ntfs_3g_probe_OBJECTS)
@@ -35,7 +40,7 @@
  ntfs_3g_probe_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
  	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(ntfs_3g_probe_CFLAGS) \
  	$(CFLAGS) $(ntfs_3g_probe_LDFLAGS) $(LDFLAGS) -o $@
-@@ -95,8 +92,7 @@ am__ntfs_3g_secaudit_SOURCES_DIST = seca
+@@ -95,8 +91,7 @@
  @ENABLE_NTFS_3G_TRUE@am_ntfs_3g_secaudit_OBJECTS =  \
  @ENABLE_NTFS_3G_TRUE@	ntfs_3g_secaudit-secaudit.$(OBJEXT)
  ntfs_3g_secaudit_OBJECTS = $(am_ntfs_3g_secaudit_OBJECTS)
@@ -45,7 +50,7 @@
  ntfs_3g_secaudit_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
  	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(ntfs_3g_secaudit_CFLAGS) \
  	$(CFLAGS) $(ntfs_3g_secaudit_LDFLAGS) $(LDFLAGS) -o $@
-@@ -104,8 +100,7 @@ am__ntfs_3g_usermap_SOURCES_DIST = userm
+@@ -104,8 +99,7 @@
  @ENABLE_NTFS_3G_TRUE@am_ntfs_3g_usermap_OBJECTS =  \
  @ENABLE_NTFS_3G_TRUE@	ntfs_3g_usermap-usermap.$(OBJEXT)
  ntfs_3g_usermap_OBJECTS = $(am_ntfs_3g_usermap_OBJECTS)
@@ -55,7 +60,7 @@
  ntfs_3g_usermap_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
  	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(ntfs_3g_usermap_CFLAGS) \
  	$(CFLAGS) $(ntfs_3g_usermap_LDFLAGS) $(LDFLAGS) -o $@
-@@ -287,9 +282,9 @@ pkgconfigdir = @pkgconfigdir@
+@@ -287,9 +281,9 @@
  prefix = @prefix@
  program_transform_name = @program_transform_name@
  psdir = @psdir@
@@ -68,7 +73,7 @@
  sbindir = @sbindir@
  sharedstatedir = @sharedstatedir@
  srcdir = @srcdir@
-@@ -313,7 +308,7 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefil
+@@ -313,7 +307,7 @@
  @ENABLE_NTFS_3G_TRUE@		ntfs-3g.usermap.8 \
  @ENABLE_NTFS_3G_TRUE@		ntfs-3g.secaudit.8
  
@@ -77,7 +82,7 @@
  @ENABLE_NTFS_3G_TRUE@@REALLYSTATIC_TRUE@ntfs_3g_LDFLAGS = $(AM_LDFLAGS) -all-static
  @ENABLE_NTFS_3G_TRUE@ntfs_3g_CFLAGS = \
  @ENABLE_NTFS_3G_TRUE@	$(AM_CFLAGS) 			\
-@@ -322,7 +317,7 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefil
+@@ -322,7 +316,7 @@
  @ENABLE_NTFS_3G_TRUE@	-I$(top_srcdir)/include/ntfs-3g
  
  @ENABLE_NTFS_3G_TRUE@ntfs_3g_SOURCES = ntfs-3g.c ntfs-3g_common.c
@@ -86,7 +91,7 @@
  @ENABLE_NTFS_3G_TRUE@@REALLYSTATIC_TRUE@lowntfs_3g_LDFLAGS = $(AM_LDFLAGS) -all-static
  @ENABLE_NTFS_3G_TRUE@lowntfs_3g_CFLAGS = \
  @ENABLE_NTFS_3G_TRUE@	$(AM_CFLAGS) 			\
-@@ -331,9 +326,9 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefil
+@@ -331,9 +325,9 @@
  @ENABLE_NTFS_3G_TRUE@	-I$(top_srcdir)/include/ntfs-3g
  
  @ENABLE_NTFS_3G_TRUE@lowntfs_3g_SOURCES = lowntfs-3g.c ntfs-3g_common.c
@@ -99,7 +104,7 @@
  @ENABLE_NTFS_3G_TRUE@@REALLYSTATIC_TRUE@ntfs_3g_probe_LDFLAGS = $(AM_LDFLAGS) -all-static
  @ENABLE_NTFS_3G_TRUE@@REALLYSTATIC_TRUE@ntfs_3g_usermap_LDFLAGS = $(AM_LDFLAGS) -all-static
  @ENABLE_NTFS_3G_TRUE@@REALLYSTATIC_TRUE@ntfs_3g_secaudit_LDFLAGS = $(AM_LDFLAGS) -all-static
-@@ -921,9 +916,9 @@ uninstall-man: uninstall-man8
+@@ -921,17 +915,14 @@
  @ENABLE_NTFS_3G_TRUE@@RUN_LDCONFIG_TRUE@	$(LDCONFIG)
  
  @ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@install-exec-local:	install-rootbinPROGRAMS
@@ -108,7 +113,14 @@
 -@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@	$(LN_S) -f "$(rootbindir)/lowntfs-3g" "$(DESTDIR)/sbin/mount.lowntfs-3g"
 +@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@	$(MKDIR_P) "$(DESTDIR)/$(sbindir)"
 +@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@	$(LN_S) -f "$(rootbindir)/ntfs-3g" "$(DESTDIR)/$(sbindir)/mount.ntfs-3g"
-+@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@	$(LN_S) -f "$(rootbindir)/lowntfs-3g" "$(DESTDIR)/$(sbindir)/mount.lowntfs-3g"
  
  @ENABLE_NTFS_3G_TRUE@install-data-local:	install-man8
  @ENABLE_NTFS_3G_TRUE@	$(LN_S) -f ntfs-3g.8 "$(DESTDIR)$(man8dir)/mount.ntfs-3g.8"
+-@ENABLE_NTFS_3G_TRUE@	$(LN_S) -f ntfs-3g.8 "$(DESTDIR)$(man8dir)/mount.lowntfs-3g.8"
+ 
+ @ENABLE_NTFS_3G_TRUE@uninstall-local:
+ @ENABLE_NTFS_3G_TRUE@	$(RM) -f "$(DESTDIR)$(man8dir)/mount.ntfs-3g.8"
+-@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@	$(RM) -f "$(DESTDIR)/sbin/mount.ntfs-3g" "$(DESTDIR)/sbin/mount.lowntfs-3g"
+ 
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/filesystems/libntfs/distinfo,v
retrieving revision 1.1
diff -u -r1.1 distinfo
--- distinfo	19 May 2014 12:22:06 -0000	1.1
+++ distinfo	19 Jun 2015 21:09:31 -0000
@@ -10,4 +10,9 @@
 SHA1 (patch-libntfs-3g_device.c) = 3ad49d69b03cdd500246f77d9f6e30ca3d2e2ec6
 SHA1 (patch-ntfsprogs_Makefile.in) = 9acd073006c54009cedeafc766c964e9b5f11468
 SHA1 (patch-ntfsprogs_ntfsclone.c) = 3306b501e94ce71a709f394516829a727aa743ad
-SHA1 (patch-src_Makefile.in) = 78d107a3ba0e9e0b39a4c5e4eaad2fd58bb9ade2
+SHA1 (patch-src_Makefile.in) = e133338c437a9dadb4495eaf3de18fc1bf776d14
+SHA1 (patch-configure.ac) = 332823e613f78663fbfeecac0b43f01228569a96
+SHA1 (patch-configure) = c0dcddef3f1a53d91d4e32881cde171bccd779b8
+SHA1 (patch-config.h.in) = a7ff598dea2312277aa2d9740fa08fbbbf81de29
+SHA1 (patch-src_ntfs-3g_common.h) = 28c977f45259762a98b51e7fcc9c5395ceeded6c
+SHA1 (patch-src_Makefile.am) = da06c5ee354d1f5b60fdabb1f17b8917b5a2b11f


Home | Main Index | Thread Index | Old Index