Index: sysutils/fusefs-ntfs/Makefile =================================================================== --- sysutils/fusefs-ntfs/Makefile +++ sysutils/fusefs-ntfs/Makefile @@ -14,30 +14,56 @@ LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING -LIB_DEPENDS= libuuid.so:misc/e2fsprogs-libuuid +USES= autoreconf fuse pkgconfig iconv libtool tar:tgz +USE_LDCONFIG= yes +GNU_CONFIGURE= yes + +CONFIGURE_ARGS= --exec-prefix=${PREFIX} \ + --disable-mount-helper \ + --disable-mtab \ + --disable-ldconfig \ + --with-fuse=external \ + --with-pkgconfigdir=${PREFIX}/libdata/pkgconfig \ + CONFLICTS_BUILD= bonobo-1.* CONFLICTS_INSTALL= ntfsprogs-* -USES= fuse pkgconfig iconv libtool localbase:ldflags tar:tgz -USE_LDCONFIG= yes -GNU_CONFIGURE= yes -CONFIGURE_ARGS= --exec-prefix=${PREFIX} --disable-mount-helper \ - --disable-mtab --with-fuse=external --disable-ldconfig -CPPFLAGS+= -I${WRKSRC}/include/ntfs-3g/ +OPTIONS_DEFINE= CRYPTO DEBUG DOCS EXTRAS LOCK UUID +OPTIONS_DEFAULT= CRYPTO EXTRAS LOCK UUID +OPTIONS_SUB= yes -OPTIONS_DEFINE= LOCK UBLIO DOCS -OPTIONS_DEFAULT=LOCK UBLIO +CRYPTO_DESC= Enable crypto related code and utilities +EXTRAS_DESC= Install ntfsdecrypt, ntfsrecover, ntfssecaudit, ntfstruncate, ntfsusermap, ntfswipe LOCK_DESC= Lock the device when mounting (avoids access) -LOCK_CFLAGS= -DUSE_LOCK UBLIO_DESC= Enable user space cache for improved speed -UBLIO_EXTRA_PATCHES= ${FILESDIR}/extra-patch-ublio -UBLIO_LIB_DEPENDS= libublio.so:devel/libublio -UBLIO_CFLAGS= -DUSE_UBLIO +UUID_DESC= Generate DCE compliant UUIDs SUB_FILES= pkg-message DOCSDIR= ${PREFIX}/share/doc/ntfs-3g +CRYPTO_CONFIGURE_ENABLE= crypto +CRYPTO_LIB_DEPENDS= libgnutls.so:security/gnutls \ + libgcrypt.so:security/libgcrypt + +DEBUG_CONFIGURE_ENABLE= debug + +EXTRAS_CONFIGURE_ENABLE= extras +EXTRAS_IMPLIES= crypto +EXTRAS_LIB_DEPENDS+= libgpg-error.so:security/libgpg-error # ntsfsdecrypt + +LOCK_CFLAGS= -DUSE_LOCK + +UBLIO_EXTRA_PATCHES= ${FILESDIR}/extra-patch-ublio +UBLIO_LIB_DEPENDS= libublio.so:devel/libublio +UBLIO_CFLAGS= -DUSE_UBLIO + +UUID_CONFIGURE_ON= --with-uuid=${LOCALBASE} +UUID_CONFIGURE_OFF= --without-uuid +UUID_LIB_DEPENDS= libuuid.so:misc/e2fsprogs-libuuid + +INSTALL_TARGET= install-strip + post-patch: @${REINPLACE_CMD} -e 's|ENODATA|ENOATTR|' \ ${WRKSRC}/libntfs-3g/object_id.c \ @@ -45,9 +71,6 @@ ${WRKSRC}/libntfs-3g/security.c @${REINPLACE_CMD} -e 's|\($$(AM_CFLAGS)\) \(-I$$(top_srcdir)/include/ntfs-3g\)|\2 \1|; \ /install-exec-hook:/,/^$$/ s|^@.*||' ${WRKSRC}/libntfs-3g/Makefile.in - -post-install: - ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libntfs-3g.so post-install-DOCS-on: ${INSTALL_DATA} ${FILESDIR}/README.FreeBSD ${STAGEDIR}${DOCSDIR}/ Index: sysutils/fusefs-ntfs/files/README.FreeBSD =================================================================== --- sysutils/fusefs-ntfs/files/README.FreeBSD +++ sysutils/fusefs-ntfs/files/README.FreeBSD @@ -29,15 +29,21 @@ The port has a patch to align read/write operations to the media block size (required on FreeBSD). -The port has 2 options: LOCK (to prevent access to the device by external -programs than NTFS-3G once mounted, default on Linux), and UBLIO (use a user -space cache library, see devel/libublio, not required on Linux). +The port has 2 options: LOCK, which prevents access to the device by external +programs than NTFS-3G once mounted, the default on Linux, and UBLIO, which +enabled a user space cache library, see devel/libublio, not required on Linux. The reason for using UBLIO is that FreeBSD removed support for block devices, being them now character devices. The former ones had a cache, and NTFS-3G was optimized for it (Linux still uses them). The same happens on Mac OS X (based on FreeBSD 5). So using UBLIO both improves performance (~10 times faster), and reduces disk load. + +Note: The UBLIO port option has been removed from OPTIONS_DEFINE, as there +have been bug reports including data corruption when using it. However, the +bits to enable and patch NTFS-3g to use UBLIO have been left in place to enable +interested persons to test and potentially bring it back to a maintained and +stable state. To enable UBLIO, add UBLIO to the ports OPTIONS_DEFINE line. ============================================================================== 3. Mounting at startup with /etc/fstab Index: sysutils/fusefs-ntfs/files/patch-configure =================================================================== --- sysutils/fusefs-ntfs/files/patch-configure +++ /dev/null @@ -1,29 +0,0 @@ ---- configure.orig 2015-03-14 14:10:24 UTC -+++ configure -@@ -3256,7 +3256,7 @@ if test "${enable_mount_helper+set}" = s - else - - case "${target_os}" in -- linux*) enable_mount_helper="yes" ;; -+ linux*|freebsd*) enable_mount_helper="yes" ;; - *) enable_mount_helper="no" ;; - esac - -@@ -12871,7 +12871,7 @@ fi - with_fuse="external" - ;; - freebsd*) -- as_fn_error $? "Please see FreeBSD support at http://www.freshports.org/sysutils/fusefs-ntfs" "$LINENO" 5 -+ with_fuse="external" - ;; - *) - as_fn_error $? "ntfs-3g can be built for Linux, FreeBSD, Mac OS X, NetBSD, and Solaris only." "$LINENO" 5 -@@ -15014,7 +15014,7 @@ if test "x${DISTCHECK_HACK}" != "x"; the - fi - - # Settings --pkgconfigdir="\$(libdir)/pkgconfig" -+pkgconfigdir="\$(prefix)/libdata/pkgconfig" - ntfs3gincludedir="\$(includedir)/ntfs-3g" - # Executables should be installed to the root filesystem, otherwise - # automounting NTFS volumes can fail during boot if the driver binaries Index: sysutils/fusefs-ntfs/files/patch-configure.ac =================================================================== --- /dev/null +++ sysutils/fusefs-ntfs/files/patch-configure.ac @@ -0,0 +1,136 @@ +# 1) Enable --with-fuse configure argument for freebsd too +# 2) Respect user/system CFLAGS +# 3) Add --with-pkgconfigdir configure argument + +--- configure.ac.orig 2015-03-14 14:10:12 UTC ++++ configure.ac +@@ -1,4 +1,4 @@ +-# ++e# + # configure.ac - Source file to generate "./configure" to prepare package for + # compilation. + # +@@ -143,10 +143,12 @@ AC_ARG_ENABLE( + [enable_ntfsprogs="yes"] + ) + +-AC_ARG_ENABLE(crypto, +- AS_HELP_STRING(--enable-crypto,enable crypto related code and utilities +- (default=no)), , +- enable_crypto=no ++AC_ARG_ENABLE( ++ [crypto], ++ [AS_HELP_STRING([--enable-crypto],[enable crypto related code and utilities ++ (default=no)])], ++ , ++ [enable_crypto="no"] + ) + + AC_ARG_ENABLE( +@@ -221,7 +223,7 @@ esac + if test "x${enable_ntfs_3g}" = "xyes"; then + AC_MSG_CHECKING([fuse compatibility]) + case "${target_os}" in +- linux*|solaris*) ++ linux*|solaris*|freebsd*) + AC_ARG_WITH( + [fuse], + [AS_HELP_STRING([--with-fuse=],[Select FUSE library: internal or external @<:@default=internal@:>@])], +@@ -232,9 +234,6 @@ if test "x${enable_ntfs_3g}" = "xyes"; t + darwin*|netbsd*|kfreebsd*-gnu) + with_fuse="external" + ;; +- freebsd*) +- AC_MSG_ERROR([Please see FreeBSD support at http://www.freshports.org/sysutils/fusefs-ntfs]) +- ;; + *) + AC_MSG_ERROR([ntfs-3g can be built for Linux, FreeBSD, Mac OS X, NetBSD, and Solaris only.]) + ;; +@@ -326,14 +325,17 @@ fi + compile_crypto=false + if test "$enable_crypto" != "no"; then + have_libgcrypt=false +- AM_PATH_LIBGCRYPT(1.2.2, [ have_libgcrypt=true ], +- [ +- if test "$enable_crypto" = "yes"; then +- AC_MSG_ERROR([ntfsprogs crypto code requires the gcrypt library.]) +- else +- AC_MSG_WARN([ntfsprogs crypto code requires the gcrypt library.]) +- fi +- ]) ++ m4_ifdef([AM_PATH_LIBGCRYPT], ++ [AM_PATH_LIBGCRYPT(1.2.2, [ have_libgcrypt=true ], ++ [ ++ if test "$enable_crypto" = "yes"; then ++ AC_MSG_ERROR([ntfsprogs crypto code requires the gcrypt library.]) ++ else ++ AC_MSG_WARN([ntfsprogs crypto code requires the gcrypt library.]) ++ fi ++ ])], ++ [enable_crypto=no]) ++ + have_libgnutls=false + PKG_CHECK_MODULES(GNUTLS, gnutls >= 1.4.4, [ have_libgnutls=true ], + if test "$enable_crypto" = "yes"; then +@@ -380,6 +382,10 @@ AC_ARG_WITH(uuid, [ + ) + if test "x$extrapath" != "x"; then + if test "x$extrapath" != "xdefault"; then ++ OLD_CPPFLAGS="$CPPFLAGS" ++ OLD_LDFLAGS="$LDFLAGS" ++ CPPFLAGS="$CPPFLAGS -I$extrapath/include" ++ LDFLAGS="$LDFLAGS -L$extrapath/lib" + MKNTFS_CPPFLAGS="$MKNTFS_CPPFLAGS -I$extrapath/include" + MKNTFS_LIBS="$MKNTFS_LIBS -L$extrapath/lib" + fi +@@ -423,6 +429,8 @@ if test "x$extrapath" != "x"; then + if test "x$search_for_luuid" != "xno"; then + AC_MSG_WARN([ntfsprogs DCE compliant UUID generation code requires the uuid library.]) + fi ++CPPFLAGS="$OLD_CPPFLAGS" ++LDFLAGS="$OLD_LDFLAGS" + fi + + # Specify support for obtaining the correct BIOS legacy geometry needed for +@@ -536,20 +544,20 @@ AC_SYS_LARGEFILE + + if test "$GCC" = "yes" ; then + # We add -Wall to enable some compiler warnings. +- CFLAGS="${CFLAGS} -Wall" ++ CFLAGS="-Wall ${CFLAGS}" + fi + + if test "${enable_pedantic}" = "yes"; then + enable_warnings="yes" +- CFLAGS="${CFLAGS} -pedantic" ++ CFLAGS="-pedantic ${CFLAGS}" + fi + + if test "${enable_warnings}" = "yes"; then +- CFLAGS="${CFLAGS} -W -Wall -Waggregate-return -Wbad-function-cast -Wcast-align -Wcast-qual -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Winline -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wmultichar -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wformat -Wformat-security -Wuninitialized" ++ CFLAGS="-W -Wall -Waggregate-return -Wbad-function-cast -Wcast-align -Wcast-qual -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Winline -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wmultichar -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wformat -Wformat-security -Wuninitialized ${CFLAGS}" + fi + + if test "${enable_debug}" = "yes"; then +- CFLAGS="${CFLAGS} -ggdb3 -DDEBUG" ++ CFLAGS="-ggdb3 -DDEBUG ${CFLAGS}" + AC_DEFINE( + [ENABLE_DEBUG], + [1], +@@ -576,8 +584,15 @@ if test "x${DISTCHECK_HACK}" != "x"; the + fi + + # Settings +-pkgconfigdir="\$(libdir)/pkgconfig" ++ + ntfs3gincludedir="\$(includedir)/ntfs-3g" ++ ++# Set pkgconfigdir ++AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH], ++ [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]), ++ [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig']) ++AC_SUBST([pkgconfigdir]) ++ + # Executables should be installed to the root filesystem, otherwise + # automounting NTFS volumes can fail during boot if the driver binaries + # and their dependencies are on an unmounted partition. Use --exec-prefix Index: sysutils/fusefs-ntfs/pkg-plist =================================================================== --- sysutils/fusefs-ntfs/pkg-plist +++ sysutils/fusefs-ntfs/pkg-plist @@ -1,3 +1,9 @@ +%%EXTRAS%%bin/ntfsdecrypt +%%EXTRAS%%bin/ntfsrecover +%%EXTRAS%%bin/ntfssecaudit +%%EXTRAS%%bin/ntfstruncate +%%EXTRAS%%bin/ntfsusermap +%%EXTRAS%%bin/ntfswipe bin/lowntfs-3g bin/ntfs-3g bin/ntfs-3g.probe @@ -17,8 +23,8 @@ include/ntfs-3g/compat.h include/ntfs-3g/compress.h include/ntfs-3g/debug.h -include/ntfs-3g/device.h include/ntfs-3g/device_io.h +include/ntfs-3g/device.h include/ntfs-3g/dir.h include/ntfs-3g/ea.h include/ntfs-3g/efs.h @@ -54,8 +60,6 @@ man/man8/mkntfs.8.gz man/man8/ntfs-3g.8.gz man/man8/ntfs-3g.probe.8.gz -man/man8/ntfssecaudit.8.gz -man/man8/ntfsusermap.8.gz man/man8/ntfscat.8.gz man/man8/ntfsclone.8.gz man/man8/ntfscluster.8.gz @@ -70,14 +74,15 @@ man/man8/ntfsprogs.8.gz man/man8/ntfsrecover.8.gz man/man8/ntfsresize.8.gz +man/man8/ntfssecaudit.8.gz man/man8/ntfstruncate.8.gz man/man8/ntfsundelete.8.gz +man/man8/ntfsusermap.8.gz man/man8/ntfswipe.8.gz sbin/mkntfs sbin/ntfsclone sbin/ntfscp sbin/ntfslabel -sbin/ntfsrecover sbin/ntfsresize sbin/ntfsundelete %%PORTDOCS%%%%DOCSDIR%%/README