summaryrefslogtreecommitdiff
path: root/hfsplusutils
diff options
context:
space:
mode:
authorDanny Rawlins <monster.romster@gmail.com>2019-09-03 23:29:00 +1000
committerDanny Rawlins <monster.romster@gmail.com>2019-09-03 23:29:00 +1000
commit35677d46d2c4b23ecfc9afcab71db43918242b9b (patch)
treeac4008e11d57d5016f99fc8a267e5c7fb1dc871d /hfsplusutils
parentb3c6c702f46af2bdb56e4bb955c700fababc6503 (diff)
downloadcontrib-35677d46d2c4b23ecfc9afcab71db43918242b9b.tar.gz
contrib-35677d46d2c4b23ecfc9afcab71db43918242b9b.tar.xz
hfsplusutils: initial import
Diffstat (limited to 'hfsplusutils')
-rw-r--r--hfsplusutils/.footprint26
-rw-r--r--hfsplusutils/.signature11
-rw-r--r--hfsplusutils/Pkgfile46
-rw-r--r--hfsplusutils/hfsplusutils-1.0.4-cflags.patch23
-rw-r--r--hfsplusutils/hfsplusutils-1.0.4-errno.patch13
-rw-r--r--hfsplusutils/hfsplusutils-1.0.4-gcc4.patch132
-rw-r--r--hfsplusutils/hfsplusutils-1.0.4-glob.patch12
-rw-r--r--hfsplusutils/hfsplusutils-1.0.4-stdlib.patch22
-rw-r--r--hfsplusutils/hfsplusutils-1.0.4-string.patch33
9 files changed, 318 insertions, 0 deletions
diff --git a/hfsplusutils/.footprint b/hfsplusutils/.footprint
new file mode 100644
index 000000000..149094446
--- /dev/null
+++ b/hfsplusutils/.footprint
@@ -0,0 +1,26 @@
+drwxr-xr-x root/root usr/
+drwxr-xr-x root/root usr/bin/
+lrwxrwxrwx root/root usr/bin/fsck.hfsplus -> hpfsck
+-rwxr-xr-x root/root usr/bin/hpcd
+-rwxr-xr-x root/root usr/bin/hpcopy
+-rwxr-xr-x root/root usr/bin/hpfsck
+-rwxr-xr-x root/root usr/bin/hpls
+-rwxr-xr-x root/root usr/bin/hpmkdir
+-rwxr-xr-x root/root usr/bin/hpmount
+-rwxr-xr-x root/root usr/bin/hppwd
+-rwxr-xr-x root/root usr/bin/hprm
+-rwxr-xr-x root/root usr/bin/hpumount
+drwxr-xr-x root/root usr/share/
+drwxr-xr-x root/root usr/share/man/
+drwxr-xr-x root/root usr/share/man/man1/
+lrwxrwxrwx root/root usr/share/man/man1/fsck.hfsplus.1.gz -> hfsp.1.gz
+-rw-rw-r-- root/root usr/share/man/man1/hfsp.1.gz
+lrwxrwxrwx root/root usr/share/man/man1/hpcd.1.gz -> hfsp.1.gz
+lrwxrwxrwx root/root usr/share/man/man1/hpcopy.1.gz -> hfsp.1.gz
+lrwxrwxrwx root/root usr/share/man/man1/hpfsck.1.gz -> hfsp.1.gz
+lrwxrwxrwx root/root usr/share/man/man1/hpls.1.gz -> hfsp.1.gz
+lrwxrwxrwx root/root usr/share/man/man1/hpmkdir.1.gz -> hfsp.1.gz
+lrwxrwxrwx root/root usr/share/man/man1/hpmount.1.gz -> hfsp.1.gz
+lrwxrwxrwx root/root usr/share/man/man1/hppwd.1.gz -> hfsp.1.gz
+lrwxrwxrwx root/root usr/share/man/man1/hprm.1.gz -> hfsp.1.gz
+lrwxrwxrwx root/root usr/share/man/man1/hpumount.1.gz -> hfsp.1.gz
diff --git a/hfsplusutils/.signature b/hfsplusutils/.signature
new file mode 100644
index 000000000..adb8c59e7
--- /dev/null
+++ b/hfsplusutils/.signature
@@ -0,0 +1,11 @@
+untrusted comment: verify with /etc/ports/contrib.pub
+RWSagIOpLGJF39dWqEEKI+YTT+Jy0yHnjR3T9l/9GkHllndK1+Q2uZbupcyuRXnQnR+U8OZEcx5/2yHFPyu3OPwgzOcrDLdHpQ0=
+SHA256 (Pkgfile) = a7d5bcf05c6f12d30ac3284ca665d2c1850cda5ea8673773a2eccf04edba2166
+SHA256 (.footprint) = 88ec1f95a5745559087c81243bec1451ff26328f24234e1b50dad9e9c59c5d74
+SHA256 (hfsplus_1.0.4.src.tar.bz2) = 032b1c663b1400f3ea1c2ec1a03adebd6e57e51fd38e997befdd223448a10c6d
+SHA256 (hfsplusutils-1.0.4-cflags.patch) = 9433ca3555cd4a64058feffbd09834c560eac9fa873397ac32194059f7f6324c
+SHA256 (hfsplusutils-1.0.4-errno.patch) = 2be73a0bc6234998497571c30985f804c084191578de416da59ee652d3728f46
+SHA256 (hfsplusutils-1.0.4-gcc4.patch) = f7ddb18849d6856204e7db6f7bfe010ec8683fd63f1e08db2ae0f52f42c5f108
+SHA256 (hfsplusutils-1.0.4-glob.patch) = bb845d54979a7eccf46f00d88b0e426b350bcaa39af0c46e945d2b1e632a36ab
+SHA256 (hfsplusutils-1.0.4-stdlib.patch) = 8ed4d468541735011dbff28b20f0783c00156544317126d178574244a3ca1191
+SHA256 (hfsplusutils-1.0.4-string.patch) = cf2649c3c29c6610feb42b2c12fd5aac71f4877d5af37d329f45eba685679bfe
diff --git a/hfsplusutils/Pkgfile b/hfsplusutils/Pkgfile
new file mode 100644
index 000000000..9c4ccb3d6
--- /dev/null
+++ b/hfsplusutils/Pkgfile
@@ -0,0 +1,46 @@
+# Description: HFS+ Filesystem Access Utilities (a PPC filesystem)
+# URL: http://penguinppc.org/historical/hfsplus/
+# Maintainer: Danny Rawlins, crux at romster dot me
+
+name=hfsplusutils
+version=1.0.4
+release=1
+source=(https://crux.ster.zone/downloads/$name/hfsplus_$version.src.tar.bz2
+ hfsplusutils-1.0.4-cflags.patch
+ hfsplusutils-1.0.4-errno.patch
+ hfsplusutils-1.0.4-gcc4.patch
+ hfsplusutils-1.0.4-glob.patch
+ hfsplusutils-1.0.4-stdlib.patch
+ hfsplusutils-1.0.4-string.patch)
+
+build() {
+ cd hfsplus-$version
+
+ patch -p1 -i $SRC/hfsplusutils-1.0.4-glob.patch
+ patch -p1 -i $SRC/hfsplusutils-1.0.4-errno.patch
+ patch -p1 -i $SRC/hfsplusutils-1.0.4-gcc4.patch
+ patch -p1 -i $SRC/hfsplusutils-1.0.4-string.patch
+ patch -p1 -i $SRC/hfsplusutils-1.0.4-stdlib.patch
+ patch -p1 -i $SRC/hfsplusutils-1.0.4-cflags.patch
+
+ sed -i -e 's/^CFLAGS\s/AM_CFLAGS /' {libhfsp/src,src}/Makefile.am
+
+ mv configure.{in,ac}
+ autoreconf -i
+
+ CFLAGS+=' -fgnu89-inline'
+ ./configure \
+ --prefix=/usr \
+ --disable-shared \
+ --disable-dependency-tracking \
+ CFLAGS="$CFLAGS"
+
+ make
+ make DESTDIR=$PKG SUBDIRS=src install
+
+ ln -sf hpfsck $PKG/usr/bin/fsck.hfsplus
+ install -D -m 0664 doc/man/hfsp.man $PKG/usr/share/man/man1/hfsp.1
+ for a in hpcd hpcopy hpfsck hpls hpmkdir hpmount hppwd hprm hpumount fsck.hfsplus ; do
+ ln -sf hfsp.1 $PKG/usr/share/man/man1/$a.1
+ done
+}
diff --git a/hfsplusutils/hfsplusutils-1.0.4-cflags.patch b/hfsplusutils/hfsplusutils-1.0.4-cflags.patch
new file mode 100644
index 000000000..2006c7d71
--- /dev/null
+++ b/hfsplusutils/hfsplusutils-1.0.4-cflags.patch
@@ -0,0 +1,23 @@
+don't clobber the user's settings that configure already put together for us
+
+--- a/libhfsp/src/Makefile.am
++++ b/libhfsp/src/Makefile.am
+@@ -27,7 +27,5 @@
+ blockiter.c btree.c btreecheck.c fscheck.c hfstime.c libhfsp.c os.c unicode.c \
+ record.c volume.c partitions.c
+
+-CFLAGS = -O2 -Wall
+-
+ # I need to clean up these headers first before i can distribute them ...
+ # include_HEADERS = apple.h hfs.h hfsp.h libhfsp.h
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -8,8 +8,6 @@
+
+ INCLUDES = -I../libhfsp/src
+
+-CFLAGS = -O2 -Wall
+-
+ bin_PROGRAMS = hpmount hpumount hpls hpcd hpcopy hppwd hpfsck hprm hpmkdir
+
+ hpmount_SOURCES = hpmount.c hpcache.c hfsputil.c glob.c dstring.c dlist.c
diff --git a/hfsplusutils/hfsplusutils-1.0.4-errno.patch b/hfsplusutils/hfsplusutils-1.0.4-errno.patch
new file mode 100644
index 000000000..f15e56cc1
--- /dev/null
+++ b/hfsplusutils/hfsplusutils-1.0.4-errno.patch
@@ -0,0 +1,13 @@
+--- a/src/hpmkdir.c
++++ b/src/hpmkdir.c
+@@ -46,8 +46,9 @@
+ # include <string.h>
+ # include <time.h>
+ # include <ctype.h>
+-# include <errno.h>
+ */
++# include <errno.h>
++
+ # include <stdio.h>
+ # include <stdlib.h>
+
diff --git a/hfsplusutils/hfsplusutils-1.0.4-gcc4.patch b/hfsplusutils/hfsplusutils-1.0.4-gcc4.patch
new file mode 100644
index 000000000..6f633454d
--- /dev/null
+++ b/hfsplusutils/hfsplusutils-1.0.4-gcc4.patch
@@ -0,0 +1,132 @@
+--- a/libhfsp/src/btree.c
++++ b/libhfsp/src/btree.c
+@@ -393,7 +393,7 @@ static int btree_init(btree* bt, volume*
+ {
+ p = volume_readfromfork(vol, nodebuf, fork, 0, bt->blkpernode,
+ HFSP_EXTENT_DATA, bt->cnid);
+- ((char*) p) += HEADER_RESERVEDOFFSET; // skip header
++ p += HEADER_RESERVEDOFFSET; // skip header
+ }
+
+ bt->alloc_bits = malloc(alloc_size);
+--- a/libhfsp/src/swab.h
++++ b/libhfsp/src/swab.h
+@@ -36,28 +36,28 @@
+
+ #define bswabU16(val) bswap_16(val)
+
+-#define bswabU16_inc(ptr) bswap_16(*((UInt16*) (ptr))++)
+-#define bswabU32_inc(ptr) bswap_32(*((UInt32*) (ptr))++)
+-#define bswabU64_inc(ptr) bswap_64(*((UInt64*) (ptr))++)
+-
+-#define bstoreU16_inc(ptr, val) (*((UInt16*) (ptr))++) = bswap_16(val)
+-#define bstoreU32_inc(ptr, val) (*((UInt32*) (ptr))++) = bswap_32(val)
+-#define bstoreU64_inc(ptr, val) (*((UInt64*) (ptr))++) = bswap_64(val)
++#define bswabU16_inc(ptr) bswap_16(*(*((UInt16**) (void *)(&ptr)))++)
++#define bswabU32_inc(ptr) bswap_32(*(*((UInt32**) (void *)(&ptr)))++)
++#define bswabU64_inc(ptr) bswap_64(*(*((UInt64**) (void *)(&ptr)))++)
++
++#define bstoreU16_inc(ptr, val) (*(*((UInt16**) (void *)(&ptr)))++) = bswap_16(val)
++#define bstoreU32_inc(ptr, val) (*(*((UInt32**) (void *)(&ptr)))++) = bswap_32(val)
++#define bstoreU64_inc(ptr, val) (*(*((UInt64**) (void *)(&ptr)))++) = bswap_64(val)
+
+ #else // BYTE_ORDER == BIG_ENDIAN
+
+ #define bswabU16(val) val
+
+-#define bswabU16_inc(ptr) (*((UInt16*) (ptr))++)
+-#define bswabU32_inc(ptr) (*((UInt32*) (ptr))++)
+-#define bswabU64_inc(ptr) (*((UInt64*) (ptr))++)
+-
+-#define bstoreU16_inc(ptr, val) (*((UInt16*) (ptr))++) = val
+-#define bstoreU32_inc(ptr, val) (*((UInt32*) (ptr))++) = val
+-#define bstoreU64_inc(ptr, val) (*((UInt64*) (ptr))++) = val
++#define bswabU16_inc(ptr) (*(*((UInt16**) (void *)(&ptr)))++)
++#define bswabU32_inc(ptr) (*(*((UInt32**) (void *)(&ptr)))++)
++#define bswabU64_inc(ptr) (*(*((UInt64**) (void *)(&ptr)))++)
++
++#define bstoreU16_inc(ptr, val) (*(*((UInt16**) (void *)(&ptr)))++) = val
++#define bstoreU32_inc(ptr, val) (*(*((UInt32**) (void *)(&ptr)))++) = val
++#define bstoreU64_inc(ptr, val) (*(*((UInt64**) (void *)(&ptr)))++) = val
+
+ #endif
+
+ /* for the sake of compleetness and readability */
+-#define bswabU8_inc(ptr) (*((UInt8*) (ptr))++)
+-#define bstoreU8_inc(ptr,val) (*((UInt8*) (ptr))++) = val
++#define bswabU8_inc(ptr) (*(*((UInt8**) (void *)(&ptr)))++)
++#define bstoreU8_inc(ptr,val) (*(*((UInt8**) (void *)(&ptr)))++) = val
+--- a/libhfsp/src/btreecheck.c
++++ b/libhfsp/src/btreecheck.c
+@@ -264,7 +264,7 @@ static int fscheck_btree_init(btree* bt,
+ {
+ p = volume_readfromfork(vol, nodebuf, fork, 0, bt->blkpernode,
+ HFSP_EXTENT_DATA, bt->cnid);
+- ((char*) p) += HEADER_RESERVEDOFFSET; // skip header
++ p += HEADER_RESERVEDOFFSET; // skip header
+ }
+
+ bt->alloc_bits = malloc(alloc_size);
+--- a/libhfsp/src/fscheck.c
++++ b/libhfsp/src/fscheck.c
+@@ -230,7 +230,7 @@ static int fscheck_volume_readbuf(volume
+ vh->write_count = bswabU32_inc(p);
+ vh->encodings_bmp = bswabU64_inc(p);
+ memcpy(vh->finder_info, p, 32);
+- ((char*) p) += 32; // So finderinfo must be swapped later, ***
++ p += 32; // So finderinfo must be swapped later, ***
+ p = volume_readfork(p, &vh->alloc_file );
+ p = volume_readfork(p, &vh->ext_file );
+ p = volume_readfork(p, &vh->cat_file );
+@@ -277,12 +277,12 @@ static int fscheck_read_wrapper(volume *
+ printf("Volume is wrapped in HFS volume "
+ " (use hfsck to check this)\n");
+
+- ((char*) p) += 0x12; /* skip unneded HFS vol fields */
++ p += 0x12; /* skip unneded HFS vol fields */
+ drAlBlkSiz = bswabU32_inc(p); /* offset 0x14 */
+- ((char*) p) += 0x4; /* skip unneded HFS vol fields */
++ p += 0x4; /* skip unneded HFS vol fields */
+ drAlBlSt = bswabU16_inc(p); /* offset 0x1C */
+
+- ((char*) p) += 0x5E; /* skip unneded HFS vol fields */
++ p += 0x5E; /* skip unneded HFS vol fields */
+ signature = bswabU16_inc(p); /* offset 0x7C, drEmbedSigWord */
+ if (signature != HFSP_VOLHEAD_SIG)
+ HFSP_ERROR(-1, "This looks like a normal HFS volume");
+--- a/libhfsp/src/volume.c
++++ b/libhfsp/src/volume.c
+@@ -345,7 +345,7 @@ static int volume_readbuf(hfsp_vh* vh, v
+ vh->write_count = bswabU32_inc(p);
+ vh->encodings_bmp = bswabU64_inc(p);
+ memcpy(vh->finder_info, p, 32);
+- ((char*) p) += 32; // finderinfo is not used by now
++ p += 32; // finderinfo is not used by now
+ p = volume_readfork(p, &vh->alloc_file );
+ p = volume_readfork(p, &vh->ext_file );
+ p = volume_readfork(p, &vh->cat_file );
+@@ -381,7 +381,7 @@ static int volume_writebuf(hfsp_vh* vh,
+ bstoreU32_inc(p, vh->write_count );
+ bstoreU64_inc(p, vh->encodings_bmp );
+ memcpy(p, vh->finder_info, 32);
+- ((char*) p) += 32; // finderinfo is not used by now
++ p += 32; // finderinfo is not used by now
+ p = volume_writefork(p, &vh->alloc_file );
+ p = volume_writefork(p, &vh->ext_file );
+ p = volume_writefork(p, &vh->cat_file );
+@@ -417,12 +417,12 @@ static int volume_read_wrapper(volume *
+
+ UInt16 embeds, embedl; /* Start/lenght of embedded area in blocks */
+
+- ((char*) p) += 0x12; /* skip unneeded HFS vol fields */
++ p += 0x12; /* skip unneeded HFS vol fields */
+ drAlBlkSiz = bswabU32_inc(p); /* offset 0x14 */
+- ((char*) p) += 0x4; /* skip unneeded HFS vol fields */
++ p += 0x4; /* skip unneeded HFS vol fields */
+ drAlBlSt = bswabU16_inc(p); /* offset 0x1C */
+
+- ((char*) p) += 0x5E; /* skip unneeded HFS vol fields */
++ p += 0x5E; /* skip unneeded HFS vol fields */
+ signature = bswabU16_inc(p); /* offset 0x7C, drEmbedSigWord */
+ if (signature != HFSP_VOLHEAD_SIG)
+ HFSP_ERROR(-1, "This looks like a normal HFS volume");
diff --git a/hfsplusutils/hfsplusutils-1.0.4-glob.patch b/hfsplusutils/hfsplusutils-1.0.4-glob.patch
new file mode 100644
index 000000000..776d69ed8
--- /dev/null
+++ b/hfsplusutils/hfsplusutils-1.0.4-glob.patch
@@ -0,0 +1,12 @@
+--- a/src/glob.c
++++ b/src/glob.c
+@@ -48,7 +48,7 @@
+
+ switch (*pat)
+ {
+- case NULL: // pattern at end
++ case '\0': // pattern at end
+ return (!*str); // String at end ?
+
+ case '*': // match all
+
diff --git a/hfsplusutils/hfsplusutils-1.0.4-stdlib.patch b/hfsplusutils/hfsplusutils-1.0.4-stdlib.patch
new file mode 100644
index 000000000..211a50225
--- /dev/null
+++ b/hfsplusutils/hfsplusutils-1.0.4-stdlib.patch
@@ -0,0 +1,22 @@
+needed for exit() prototype
+
+--- a/libhfsp/src/os.c
++++ b/libhfsp/src/os.c
+@@ -46,6 +46,7 @@ int fstat(int, struct stat *);
+ # endif
+
+ # include <stdio.h>
++# include <stdlib.h>
+
+
+ # include <errno.h>
+--- a/libhfsp/src/record.c
++++ b/libhfsp/src/record.c
+@@ -32,6 +32,7 @@
+ #include <errno.h>
+ #include <stdio.h>
+ #include <string.h>
++#include <stdlib.h>
+
+ #include "libhfsp.h"
+ #include "hfstime.h"
diff --git a/hfsplusutils/hfsplusutils-1.0.4-string.patch b/hfsplusutils/hfsplusutils-1.0.4-string.patch
new file mode 100644
index 000000000..37abcbd31
--- /dev/null
+++ b/hfsplusutils/hfsplusutils-1.0.4-string.patch
@@ -0,0 +1,33 @@
+needed for mem* funcs
+
+--- a/libhfsp/src/unicode.c
++++ b/libhfsp/src/unicode.c
+@@ -16,7 +16,7 @@
+ #include <stdlib.h>
+ #include <endian.h>
+ #include <byteswap.h>
+-#include <linux/string.h>
++#include <string.h>
+
+ #define __USE_GNU
+ /* need wcsrtomb */
+--- a/libhfsp/src/partitions.c
++++ b/libhfsp/src/partitions.c
+@@ -31,6 +31,7 @@
+ #include "os.h"
+ #include "libhfsp.h"
+
++#include <string.h>
+ #include <stdlib.h>
+
+ /*
+--- a/libhfsp/src/record.c
++++ b/libhfsp/src/record.c
+@@ -32,6 +32,7 @@
+
+ #include <errno.h>
+ #include <stdio.h>
++#include <string.h>
+
+ #include "libhfsp.h"
+ #include "hfstime.h"

Generated by cgit