aboutsummaryrefslogtreecommitdiff
path: root/sysutils/cloop-utils
diff options
context:
space:
mode:
authorMax Khon <fjoe@FreeBSD.org>2004-01-25 12:56:50 +0000
committerMax Khon <fjoe@FreeBSD.org>2004-01-25 12:56:50 +0000
commitbdb407082f1dd6e7fd3370553d2d31c679a51f97 (patch)
tree1dc094739ad90d248cc171b7cf6d6ebe3d676fc9 /sysutils/cloop-utils
parent1411fb6abcc748e24c625aa6dd5069237136943d (diff)
downloadports-bdb407082f1dd6e7fd3370553d2d31c679a51f97.tar.gz
ports-bdb407082f1dd6e7fd3370553d2d31c679a51f97.zip
Notes
Diffstat (limited to 'sysutils/cloop-utils')
-rw-r--r--sysutils/cloop-utils/Makefile28
-rw-r--r--sysutils/cloop-utils/distinfo1
-rw-r--r--sysutils/cloop-utils/files/patch-Makefile16
-rw-r--r--sysutils/cloop-utils/files/patch-create_compressed_fs.c57
-rw-r--r--sysutils/cloop-utils/files/patch-extract_compressed_fs.c33
-rw-r--r--sysutils/cloop-utils/pkg-descr4
-rw-r--r--sysutils/cloop-utils/pkg-plist2
7 files changed, 141 insertions, 0 deletions
diff --git a/sysutils/cloop-utils/Makefile b/sysutils/cloop-utils/Makefile
new file mode 100644
index 000000000000..8174e4d5cc75
--- /dev/null
+++ b/sysutils/cloop-utils/Makefile
@@ -0,0 +1,28 @@
+# New ports collection makefile for: cloop-utils
+# Date created: 19 Jan 2004
+# Whom: Max Khon <fjoe@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= cloop-utils
+PORTVERSION= 2.00
+CATEGORIES= sysutils
+MASTER_SITES= http://developer.linuxtag.net/knoppix/sources/
+DISTNAME= cloop_${PORTVERSION}-1
+
+MAINTAINER= fjoe@freebsd.org
+COMMENT= Compressed loop FS utils
+
+WRKSRC= ${WRKDIR}/cloop-${PORTVERSION}
+USE_GMAKE= yes
+MAKE_ENV= APPSONLY=yes
+PORTDOCS= README
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/create_compressed_fs ${PREFIX}/bin
+ ${INSTALL_PROGRAM} ${WRKSRC}/extract_compressed_fs ${PREFIX}/bin
+ ${MKDIR} ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
+
+.include <bsd.port.mk>
diff --git a/sysutils/cloop-utils/distinfo b/sysutils/cloop-utils/distinfo
new file mode 100644
index 000000000000..4362357e1b80
--- /dev/null
+++ b/sysutils/cloop-utils/distinfo
@@ -0,0 +1 @@
+MD5 (cloop_2.00-1.tar.gz) = a18f5d97bae863b823c42cf6722ef769
diff --git a/sysutils/cloop-utils/files/patch-Makefile b/sysutils/cloop-utils/files/patch-Makefile
new file mode 100644
index 000000000000..153f237ebbbb
--- /dev/null
+++ b/sysutils/cloop-utils/files/patch-Makefile
@@ -0,0 +1,16 @@
+--- Makefile.orig Thu Jan 15 10:34:31 2004
++++ Makefile Thu Jan 15 10:34:31 2004
+@@ -23,8 +23,12 @@
+ endif
+
+ KERNOBJ:=compressed_loop.o
++ALL_TARGETS = create_compressed_fs extract_compressed_fs
++ifndef APPSONLY
++ALL_TARGETS += cloop.o
++endif
+
+-all: cloop.o create_compressed_fs extract_compressed_fs
++all: $(ALL_TARGETS)
+
+ cloop.o: compressed_loop.o
+ $(LD) -r -o $@ $^
diff --git a/sysutils/cloop-utils/files/patch-create_compressed_fs.c b/sysutils/cloop-utils/files/patch-create_compressed_fs.c
new file mode 100644
index 000000000000..d974375dc72f
--- /dev/null
+++ b/sysutils/cloop-utils/files/patch-create_compressed_fs.c
@@ -0,0 +1,57 @@
+--- create_compressed_fs.c.orig Sun Oct 26 05:15:22 2003
++++ create_compressed_fs.c Tue Jan 20 03:37:34 2004
+@@ -18,7 +18,30 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/stat.h>
++#if defined(__FreeBSD__)
++#include <sys/endian.h>
++#include <netinet/in.h>
++typedef uint64_t loff_t;
++#ifndef htobe64
++static __inline __uint64_t
++__bswap64(__uint64_t _x)
++{
++
++ return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) |
++ ((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) |
++ ((_x << 24) & ((__uint64_t)0xff << 40)) |
++ ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56)));
++}
++#if BYTE_ORDER == LITTLE_ENDIAN
++#define htobe64(x) __bswap64(x)
++#else
++#define htobe64(x)
++#endif
++#endif
++#define __cpu_to_be64 htobe64
++#else
+ #include <asm/byteorder.h>
++#endif
+ #include <fcntl.h>
+ #include <zlib.h>
+ #include "compressed_loop.h"
+@@ -195,6 +218,23 @@
+ cbp=cbp->next;
+ free(compressed_blocks); compressed_blocks=cbp;
+ }
++#if defined(__FreeBSD__)
++ /*
++ * FreeBSD requires padding to 512 byte boundary
++ */
++ bytes_so_far = lseek(STDOUT_FILENO, 0, SEEK_END);
++ if (bytes_so_far % 512)
++ {
++ static char padding[512];
++ off_t len = 512 - bytes_so_far % 512;
++
++ if (write(STDOUT_FILENO, padding, len) != len)
++ {
++ perror("writing padding block");
++ return 1;
++ }
++ }
++#endif
+ fprintf(stderr,"Done.\n");
+ return 0;
+ }
diff --git a/sysutils/cloop-utils/files/patch-extract_compressed_fs.c b/sysutils/cloop-utils/files/patch-extract_compressed_fs.c
new file mode 100644
index 000000000000..551ab3ac1290
--- /dev/null
+++ b/sysutils/cloop-utils/files/patch-extract_compressed_fs.c
@@ -0,0 +1,33 @@
+--- extract_compressed_fs.c.orig Sun Oct 26 04:57:09 2003
++++ extract_compressed_fs.c Mon Jan 19 05:28:47 2004
+@@ -8,7 +8,30 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <zlib.h>
++#if defined(__FreeBSD__)
++#include <sys/endian.h>
++#include <netinet/in.h>
++typedef uint64_t loff_t;
++#ifndef be64toh
++static __inline __uint64_t
++__bswap64(__uint64_t _x)
++{
++
++ return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) |
++ ((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) |
++ ((_x << 24) & ((__uint64_t)0xff << 40)) |
++ ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56)));
++}
++#if BYTE_ORDER == LITTLE_ENDIAN
++#define be64toh(x) __bswap64(x)
++#else
++#define be64toh(x)
++#endif
++#endif
++#define __be64_to_cpu be64toh
++#else
+ #include <asm/byteorder.h>
++#endif
+ #include "compressed_loop.h"
+
+ struct compressed_block
diff --git a/sysutils/cloop-utils/pkg-descr b/sysutils/cloop-utils/pkg-descr
new file mode 100644
index 000000000000..c747b18a0eb8
--- /dev/null
+++ b/sysutils/cloop-utils/pkg-descr
@@ -0,0 +1,4 @@
+Tools for creating and extracting read-only compressed filesystem images
+in cloop V2.0 format.
+
+WWW: http://developer.linuxtag.net/knoppix/sources/
diff --git a/sysutils/cloop-utils/pkg-plist b/sysutils/cloop-utils/pkg-plist
new file mode 100644
index 000000000000..ecc556caea0b
--- /dev/null
+++ b/sysutils/cloop-utils/pkg-plist
@@ -0,0 +1,2 @@
+bin/create_compressed_fs
+bin/extract_compressed_fs