summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authoragc <agc@pkgsrc.org>2004-10-05 12:39:38 +0000
committeragc <agc@pkgsrc.org>2004-10-05 12:39:38 +0000
commitf6726d0a8f52b2baeea839bb1018af4b98d494b1 (patch)
tree9e05cdc5cb99325ca1dbfda4bd49a8375c0b131b /sysutils
parent8b72d7e7ca610adf509c9fb5cd36b6b048cc8a9f (diff)
downloadpkgsrc-f6726d0a8f52b2baeea839bb1018af4b98d494b1.tar.gz
Initial import of ntfsprogs-1.9.4 into the packages collection.
The Linux-NTFS project (http://linux-ntfs.sf.net/) aims to bring full support for the NTFS filesystem to the Linux operating system. The ntfsprogs package currently consists of a static library and utilities such as mkntfs, ntfscat, ntfsls, ntfsresize, and ntfsundelete (for a full list of included utilities see man 8 ntfsprogs after installation). Provided in PR 27119 by Darrin B. Jewell, modified by myself to remove dylib files from PLIST, add NetBSD statvfs compatibility, and quieten a warning in one of the patches. Darrin's patches perform the following changes: . provide for redirection of error output without having an lvalue stderr . support for NetBSD disklabels . fix for ntfs_attr_pread to avoid reading a partial block . workaround for darwin sys/mount.h namespace pollution This package is currently configured with the gnome-vfs module disabled.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/ntfsprogs/DESCR5
-rw-r--r--sysutils/ntfsprogs/Makefile21
-rw-r--r--sysutils/ntfsprogs/PLIST51
-rw-r--r--sysutils/ntfsprogs/distinfo11
-rw-r--r--sysutils/ntfsprogs/patches/patch-aa13
-rw-r--r--sysutils/ntfsprogs/patches/patch-ab21
-rw-r--r--sysutils/ntfsprogs/patches/patch-ac43
-rw-r--r--sysutils/ntfsprogs/patches/patch-ad97
-rw-r--r--sysutils/ntfsprogs/patches/patch-ae39
-rw-r--r--sysutils/ntfsprogs/patches/patch-af89
-rw-r--r--sysutils/ntfsprogs/patches/patch-ag18
11 files changed, 408 insertions, 0 deletions
diff --git a/sysutils/ntfsprogs/DESCR b/sysutils/ntfsprogs/DESCR
new file mode 100644
index 00000000000..4548aa23791
--- /dev/null
+++ b/sysutils/ntfsprogs/DESCR
@@ -0,0 +1,5 @@
+The Linux-NTFS project (http://linux-ntfs.sf.net/) aims to bring full support
+for the NTFS filesystem to the Linux operating system. The ntfsprogs package
+currently consists of a static library and utilities such as mkntfs, ntfscat,
+ntfsls, ntfsresize, and ntfsundelete (for a full list of included utilities
+see man 8 ntfsprogs after installation).
diff --git a/sysutils/ntfsprogs/Makefile b/sysutils/ntfsprogs/Makefile
new file mode 100644
index 00000000000..4591e10a39f
--- /dev/null
+++ b/sysutils/ntfsprogs/Makefile
@@ -0,0 +1,21 @@
+# $NetBSD: Makefile,v 1.1.1.1 2004/10/05 12:39:38 agc Exp $
+#
+
+DISTNAME= ntfsprogs-1.9.4
+CATEGORIES= sysutils
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=linux-ntfs/}
+
+MAINTAINER= tech-pkg@NetBSD.org
+HOMEPAGE= http://linux-ntfs.sourceforge.net/
+COMMENT= Linux-NTFS project utilities for the Windows NT Filesystem (ntfs)
+
+GNU_CONFIGURE= yes
+USE_LIBTOOL= yes
+
+CONFIGURE_ARGS+=--enable-debug
+
+# XXX support for this should be possibly integrated with other
+# gnome pkgsrc and this could be a configurable option
+CONFIGURE_ARGS+=--disable-gnome-vfs
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/ntfsprogs/PLIST b/sysutils/ntfsprogs/PLIST
new file mode 100644
index 00000000000..2198b827c7f
--- /dev/null
+++ b/sysutils/ntfsprogs/PLIST
@@ -0,0 +1,51 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2004/10/05 12:39:38 agc Exp $
+bin/ntfscat
+bin/ntfscluster
+bin/ntfsfix
+bin/ntfsinfo
+bin/ntfsls
+include/ntfs/attrib.h
+include/ntfs/attrlist.h
+include/ntfs/bitmap.h
+include/ntfs/bootsect.h
+include/ntfs/compat.h
+include/ntfs/compress.h
+include/ntfs/debug.h
+include/ntfs/device.h
+include/ntfs/device_io.h
+include/ntfs/dir.h
+include/ntfs/endians.h
+include/ntfs/gnome-vfs-method.h
+include/ntfs/gnome-vfs-module.h
+include/ntfs/inode.h
+include/ntfs/layout.h
+include/ntfs/lcnalloc.h
+include/ntfs/list.h
+include/ntfs/logfile.h
+include/ntfs/mft.h
+include/ntfs/mst.h
+include/ntfs/runlist.h
+include/ntfs/security.h
+include/ntfs/support.h
+include/ntfs/types.h
+include/ntfs/unistr.h
+include/ntfs/volume.h
+lib/libntfs.la
+man/man8/libntfs-gnomevfs.8
+man/man8/mkntfs.8
+man/man8/ntfscat.8
+man/man8/ntfsclone.8
+man/man8/ntfscluster.8
+man/man8/ntfsfix.8
+man/man8/ntfsinfo.8
+man/man8/ntfslabel.8
+man/man8/ntfsls.8
+man/man8/ntfsprogs.8
+man/man8/ntfsresize.8
+man/man8/ntfsundelete.8
+sbin/mkntfs
+sbin/ntfsclone
+sbin/ntfslabel
+sbin/ntfsresize
+sbin/ntfsundelete
+@dirrm include/ntfs
diff --git a/sysutils/ntfsprogs/distinfo b/sysutils/ntfsprogs/distinfo
new file mode 100644
index 00000000000..91a5ff34120
--- /dev/null
+++ b/sysutils/ntfsprogs/distinfo
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.1.1.1 2004/10/05 12:39:38 agc Exp $
+
+SHA1 (ntfsprogs-1.9.4.tar.gz) = 1250e161f2ee7182bf6e473d4589b5139e3fda8a
+Size (ntfsprogs-1.9.4.tar.gz) = 701154 bytes
+SHA1 (patch-aa) = 1e63d62190b3d2ca78d96c9ba2398232c656a5dc
+SHA1 (patch-ab) = 6d571d962e702d776792c84a81bdaf8e7b8357e4
+SHA1 (patch-ac) = 3ebaa59a289c4085cfec2e27b7e94ce95ff9e74d
+SHA1 (patch-ad) = 576f8505b95965e0c49ec7e63516b49edd5f5679
+SHA1 (patch-ae) = 7bfacd98899ddb63cf73132a7e070186452bd46b
+SHA1 (patch-af) = f892b293fd235aec9ed4340a7ceb21620b2cbe5c
+SHA1 (patch-ag) = 79883013e1ee78c7d8901601badbe9f1857dab65
diff --git a/sysutils/ntfsprogs/patches/patch-aa b/sysutils/ntfsprogs/patches/patch-aa
new file mode 100644
index 00000000000..7db0a6ef4cf
--- /dev/null
+++ b/sysutils/ntfsprogs/patches/patch-aa
@@ -0,0 +1,13 @@
+$NetBSD: patch-aa,v 1.1.1.1 2004/10/05 12:39:38 agc Exp $
+
+--- include/ntfs/debug.h.orig Sat Sep 4 06:16:32 2004
++++ include/ntfs/debug.h
+@@ -53,6 +53,8 @@ extern void __Dputs(const char *s);
+ extern void __Dperror(const char *s);
+ #define Dperror(s) __Dperror(s)
+
++extern FILE *ntfs_err_out;
++
+ extern void ntfs_debug_runlist_dump(const struct _runlist_element *rl);
+
+ #else /* if !DEBUG */
diff --git a/sysutils/ntfsprogs/patches/patch-ab b/sysutils/ntfsprogs/patches/patch-ab
new file mode 100644
index 00000000000..e7721c65682
--- /dev/null
+++ b/sysutils/ntfsprogs/patches/patch-ab
@@ -0,0 +1,21 @@
+$NetBSD: patch-ab,v 1.1.1.1 2004/10/05 12:39:38 agc Exp $
+
+--- include/ntfs/types.h.orig Sat Sep 4 06:16:32 2004
++++ include/ntfs/types.h
+@@ -59,6 +59,16 @@ typedef s64 LCN;
+ */
+ typedef s64 LSN;
+
++/* XXX For some reason, including sys/mount.h on osx defines TRUE and FALSE
++ * so clear them here.
++ */
++#ifdef FALSE
++#undef FALSE
++#endif
++#ifdef TRUE
++#undef TRUE
++#endif
++
+ /*
+ * Cygwin has a collusion between our BOOL and <windef.h>'s
+ * As long as this file will be included after <windows.h> were fine.
diff --git a/sysutils/ntfsprogs/patches/patch-ac b/sysutils/ntfsprogs/patches/patch-ac
new file mode 100644
index 00000000000..cd1e187ec79
--- /dev/null
+++ b/sysutils/ntfsprogs/patches/patch-ac
@@ -0,0 +1,43 @@
+$NetBSD: patch-ac,v 1.1.1.1 2004/10/05 12:39:38 agc Exp $
+
+--- libntfs/attrib.c.orig Sat Sep 4 06:16:32 2004
++++ libntfs/attrib.c
+@@ -709,7 +709,7 @@ map_rl:
+ */
+ s64 ntfs_attr_pread(ntfs_attr *na, const s64 pos, s64 count, void *b)
+ {
+- s64 br, to_read, ofs, total, total2;
++ s64 br, to_read, ofs, total, total2, origcount;
+ ntfs_volume *vol;
+ runlist_element *rl;
+
+@@ -737,6 +737,7 @@ s64 ntfs_attr_pread(ntfs_attr *na, const
+ }
+ if (!count)
+ return 0;
++ origcount = count;
+ /* Truncate reads beyond end of attribute. */
+ if (pos + count > na->data_size) {
+ if (pos >= na->data_size)
+@@ -818,7 +819,7 @@ res_err_out:
+ continue;
+ }
+ /* It is a real lcn, read it into @dst. */
+- to_read = min(count, (rl->length << vol->cluster_size_bits) -
++ to_read = min(origcount, (rl->length << vol->cluster_size_bits) -
+ ofs);
+ retry:
+ Dprintf("%s(): Reading 0x%llx bytes from vcn 0x%llx, lcn 0x%llx, "
+@@ -826,6 +827,12 @@ retry:
+ rl->vcn, rl->lcn, ofs);
+ br = ntfs_pread(vol->dev, (rl->lcn << vol->cluster_size_bits) +
+ ofs, to_read, b);
++ /* Zero any overage that we may have read */
++ if (br > count) {
++ memset(b + count, 0, br - count);
++ total += count;
++ return total + total2;
++ }
+ /* If everything ok, update progress counters and continue. */
+ if (br > 0) {
+ total += br;
diff --git a/sysutils/ntfsprogs/patches/patch-ad b/sysutils/ntfsprogs/patches/patch-ad
new file mode 100644
index 00000000000..1ecbc1e6abb
--- /dev/null
+++ b/sysutils/ntfsprogs/patches/patch-ad
@@ -0,0 +1,97 @@
+$NetBSD: patch-ad,v 1.1.1.1 2004/10/05 12:39:38 agc Exp $
+
+--- libntfs/debug.c.orig Sat Sep 4 06:16:32 2004
++++ libntfs/debug.c
+@@ -25,18 +25,20 @@
+ #include "attrib.h"
+ #include "debug.h"
+
++FILE *ntfs_err_out = stderr;
++
+ /**
+- * Sprintf - silencable output to stderr
+- * @silent: if 0 string is output to stderr
++ * Sprintf - silencable output to ntfs_err_out
++ * @silent: if 0 string is output to ntfs_err_out
+ * @fmt: printf style format string
+ * @...: optional arguments for the printf style format string
+ *
+- * If @silent is 0, output the string @fmt to stderr.
++ * If @silent is 0, output the string @fmt to ntfs_err_out.
+ *
+ * This is basically a replacement for:
+ *
+ * if (!silent)
+- * fprintf(stderr, fmt, ...);
++ * fprintf(ntfs_err_out, fmt, ...);
+ *
+ * It is more convenient to use Sprintf instead of the above code and perhaps
+ * more importantly, Sprintf makes it much easier to turn it into a "do
+@@ -48,41 +50,61 @@
+ int eo;
+ va_list ap;
+
+- if (silent)
++ if (silent || !ntfs_err_out)
+ return;
+ eo = errno;
+ va_start(ap, fmt);
+- vfprintf(stderr, fmt, ap);
++ vfprintf(ntfs_err_out, fmt, ap);
+ va_end(ap);
++ fflush(ntfs_err_out);
+ errno = eo;
+ }
+
+ #ifdef DEBUG
+
+-/* Debug output to stderr. To get it run ./configure --enable-debug. */
++#ifdef HAVE_STRING_H
++#include <string.h>
++#endif
++
++/* Debug output to ntfs_err_out. To get it run ./configure --enable-debug. */
+
+ void __Dprintf(const char *fmt, ...)
+ {
+ int eo = errno;
+ va_list ap;
+
++ if (!ntfs_err_out)
++ return;
+ va_start(ap, fmt);
+- vfprintf(stderr, fmt, ap);
++ vfprintf(ntfs_err_out, fmt, ap);
+ va_end(ap);
++ fflush(ntfs_err_out);
+ errno = eo;
+ }
+
+ void __Dputs(const char *s)
+ {
+ int eo = errno;
+- fprintf(stderr, "%s\n", s);
++
++ if (!ntfs_err_out)
++ return;
++ fprintf(ntfs_err_out, "%s\n", s);
++ fflush(ntfs_err_out);
+ errno = eo;
+ }
+
+ void __Dperror(const char *s)
+ {
+ int eo = errno;
+- perror(s);
++
++ if (!ntfs_err_out)
++ return;
++ if (s && s[0]) {
++ fprintf(ntfs_err_out, "%s: %s\n", s, strerror(eo));
++ } else {
++ fprintf(ntfs_err_out, "%s\n", strerror(eo));
++ }
++ fflush(ntfs_err_out);
+ errno = eo;
+ }
+
diff --git a/sysutils/ntfsprogs/patches/patch-ae b/sysutils/ntfsprogs/patches/patch-ae
new file mode 100644
index 00000000000..47431e9a17e
--- /dev/null
+++ b/sysutils/ntfsprogs/patches/patch-ae
@@ -0,0 +1,39 @@
+$NetBSD: patch-ae,v 1.1.1.1 2004/10/05 12:39:38 agc Exp $
+
+--- libntfs/device.c.orig Sat Sep 4 06:16:32 2004
++++ libntfs/device.c
+@@ -52,6 +52,10 @@
+ #define HDIO_GETGEO 0x0301 /* Get device geometry. */
+ #endif
+
++#if defined(__NetBSD__)
++#include <sys/disklabel.h> /* XXX autoconf this ? */
++#endif
++
+ /**
+ * ntfs_device_alloc - allocate an ntfs device structure and pre-initialize it
+ * name: name of the device (must be present)
+@@ -498,6 +502,23 @@ s64 ntfs_device_size_get(struct ntfs_dev
+ (unsigned long)this_floppy.size,
+ (unsigned long)this_floppy.size);
+ return (s64)this_floppy.size * 512 / block_size;
++ }
++ }
++#endif
++#ifdef DIOCGPART
++ {
++ struct stat st;
++ if (dev->d_ops->stat(dev, &st) >= 0) {
++ struct disklabel disklabel;
++ int secsize;
++ s64 psize;
++ if (dev->d_ops->ioctl(dev, DIOCGDINFO, &disklabel) >= 0) {
++ secsize = disklabel.d_secsize;
++ psize = disklabel.d_partitions[DISKPART(st.st_rdev)].p_size;
++ Dprintf("DIOCGPART nr %d byte blocks = %lld (0x%llx)\n",
++ secsize, psize, psize);
++ return psize * secsize / block_size;
++ }
+ }
+ }
+ #endif
diff --git a/sysutils/ntfsprogs/patches/patch-af b/sysutils/ntfsprogs/patches/patch-af
new file mode 100644
index 00000000000..a03f4a008f1
--- /dev/null
+++ b/sysutils/ntfsprogs/patches/patch-af
@@ -0,0 +1,89 @@
+$NetBSD: patch-af,v 1.1.1.1 2004/10/05 12:39:38 agc Exp $
+
+--- ntfsprogs/ntfsclone.c.orig Sat Sep 4 06:16:32 2004
++++ ntfsprogs/ntfsclone.c
+@@ -30,6 +30,17 @@
+ #include <errno.h>
+ #include <getopt.h>
+
++#ifdef __NetBSD__
++# include <sys/param.h>
++ /* NetBSD versions later than 2.0D have statvfs(2) instead of statfs(2) */
++# if __NetBSD_Version__ >= 200040000
++# include <sys/statvfs.h>
++# define F_TYPE f_fsid
++# else
++# define F_TYPE f_type
++# endif
++#endif
++
+ #include "debug.h"
+ #include "types.h"
+ #include "support.h"
+@@ -66,7 +77,11 @@
+ int restore_image;
+ char *output;
+ char *volume;
++#if defined(__NetBSD__) && (__NetBSD_Version__ >= 200040000)
++ struct statvfs stfs;
++#else
+ struct statfs stfs;
++#endif
+ } opt;
+
+ struct bitmap {
+@@ -338,16 +353,13 @@
+ }
+
+ msg_out = stdout;
+-
+- /* FIXME: this is a workaround for loosing debug info if stdout != stderr
+- and for the uncontrollable verbose messages in libntfs. Ughhh. */
+ if (opt.std_out)
+ msg_out = stderr;
+- else if (opt.debug)
+- stderr = stdout;
+- else
+- if (!(stderr = fopen("/dev/null", "rw")))
+- perr_exit("Couldn't open /dev/null");
++
++#ifdef DEBUG
++ if (!opt.debug)
++ ntfs_err_out = NULL;
++#endif
+ }
+
+ static void progress_init(struct progress_bar *p, u64 start, u64 stop, int res)
+@@ -462,7 +474,7 @@
+ if (write_all(&fd_out, buff, csize) == -1) {
+ int err = errno;
+ perr_printf("Write failed");
+- if (err == EIO && opt.stfs.f_type == 0x517b)
++ if (err == EIO && opt.stfs.F_TYPE == 0x517b)
+ Printf("Apparently you tried to clone to a remote "
+ "Windows computer but they don't\nhave "
+ "efficient sparse file handling by default. "
+@@ -1152,12 +1164,12 @@
+ if (fstatfs(fd_out, &opt.stfs) == -1)
+ Printf("WARNING: Couldn't get filesystem type: "
+ "%s\n", strerror(errno));
+- else if (opt.stfs.f_type == 0x52654973)
++ else if (opt.stfs.F_TYPE == 0x52654973)
+ Printf("WARNING: You're using ReiserFS, it has very poor "
+ "performance creating\nlarge sparse files. The next "
+ "operation might take a very long time!\n"
+ "Creating sparse output file ...\n");
+- else if (opt.stfs.f_type == 0x517b)
++ else if (opt.stfs.F_TYPE == 0x517b)
+ Printf("WARNING: You're using SMBFS and if the remote share "
+ "isn't Samba but a Windows\ncomputer then the clone "
+ "operation will be very inefficient and may fail!\n");
+@@ -1168,7 +1180,7 @@
+ if (err == E2BIG) {
+ Printf("Your system or the destination filesystem "
+ "doesn't support large files.\n");
+- if (opt.stfs.f_type == 0x517b) {
++ if (opt.stfs.F_TYPE == 0x517b) {
+ Printf("SMBFS needs minimum Linux kernel "
+ "version 2.4.25 and\n the 'lfs' option"
+ "\nfor smbmount to have large "
diff --git a/sysutils/ntfsprogs/patches/patch-ag b/sysutils/ntfsprogs/patches/patch-ag
new file mode 100644
index 00000000000..b4352f6e1b6
--- /dev/null
+++ b/sysutils/ntfsprogs/patches/patch-ag
@@ -0,0 +1,18 @@
+$NetBSD: patch-ag,v 1.1.1.1 2004/10/05 12:39:38 agc Exp $
+
+--- ntfsprogs/ntfsresize.c.orig Sat Sep 4 06:16:32 2004
++++ ntfsprogs/ntfsresize.c
+@@ -483,12 +483,9 @@ static int parse_options(int argc, char
+ }
+ }
+
+- stderr = stdout;
+-
+ #ifdef DEBUG
+ if (!opt.debug)
+- if (!(stderr = fopen("/dev/null", "rw")))
+- perr_exit("Couldn't open /dev/null");
++ ntfs_err_out = NULL;
+ #endif
+
+ if (ver)