diff options
Diffstat (limited to 'filesystems/squashfs-tools')
-rw-r--r-- | filesystems/squashfs-tools/Makefile | 66 | ||||
-rw-r--r-- | filesystems/squashfs-tools/distinfo | 5 | ||||
-rw-r--r-- | filesystems/squashfs-tools/files/patch-Makefile | 75 | ||||
-rw-r--r-- | filesystems/squashfs-tools/files/patch-action.c | 17 | ||||
-rw-r--r-- | filesystems/squashfs-tools/files/patch-pseudo.c | 13 | ||||
-rw-r--r-- | filesystems/squashfs-tools/pkg-descr | 8 |
6 files changed, 184 insertions, 0 deletions
diff --git a/filesystems/squashfs-tools/Makefile b/filesystems/squashfs-tools/Makefile new file mode 100644 index 000000000000..d7a8a1105688 --- /dev/null +++ b/filesystems/squashfs-tools/Makefile @@ -0,0 +1,66 @@ +PORTNAME= squashfs-tools +PORTVERSION= 4.6.1 +PORTREVISION= 1 +CATEGORIES= filesystems sysutils +MASTER_SITES= SF/squashfs/squashfs/squashfs${PORTVERSION} +DISTFILES= squashfs${PORTVERSION}${EXTRACT_SUFX} + +MAINTAINER= danfe@FreeBSD.org +COMMENT= Set of tools to manipulate squashfs images +WWW= https://squashfs.sourceforge.net/ + +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/../COPYING + +BUILD_DEPENDS= gsed:textproc/gsed help2man:misc/help2man + +USES= alias cpe gmake + +MAKE_ARGS= INSTALL_MANPAGES_DIR=${PREFIX}/share/man/man1 + +BINARY_ALIAS= sed=gsed + +PLIST_FILES= bin/mksquashfs bin/sqfscat bin/sqfstar bin/unsquashfs \ + share/man/man1/mksquashfs.1.gz share/man/man1/sqfscat.1.gz \ + share/man/man1/sqfstar.1.gz share/man/man1/unsquashfs.1.gz + +OPTIONS_DEFINE= DOCS LZ4 LZMA LZO XZ ZSTD +OPTIONS_DEFAULT= LZ4 LZMA LZO XZ ZSTD +LZMA_DESC= LZMA1 compression support (obsolete) +XZ_DESC= XZ (LZMA2) compression support + +WRKSRC= ${WRKDIR}/${DISTNAME}/squashfs-tools + +CPE_PRODUCT= squashfs +CPE_VENDOR= squashfs_project + +PORTDOCS= ACKNOWLEDGEMENTS ACTIONS-README CHANGES \ + README-${PORTVERSION} TECHNICAL-INFO USAGE-* \ + pseudo-file.example + +LZ4_LIB_DEPENDS= liblz4.so:archivers/liblz4 +LZ4_MAKE_ARGS= LZ4_SUPPORT=1 + +LZMA_MASTER_SITES= SF/sevenzip/LZMA%20SDK/:lzma +LZMA_DISTFILES= lzma922.tar.bz2:lzma +LZMA_MAKE_ARGS= LZMA_SUPPORT=1 LZMA_DIR=${WRKDIR} EXTRA_CFLAGS=-D_7ZIP_ST + +LZO_LIB_DEPENDS= liblzo2.so:archivers/lzo2 +LZO_MAKE_ARGS= LZO_SUPPORT=1 LZO_LIBDIR=-L${LOCALBASE}/lib + +XZ_MAKE_ARGS= XZ_SUPPORT=1 + +ZSTD_LIB_DEPENDS= libzstd.so:archivers/zstd +ZSTD_MAKE_ARGS= ZSTD_SUPPORT=1 + +post-patch: + @${REINPLACE_CMD} -e '/^#include "squashfs_fs\.h"/ { x; \ + s,^,typedef struct __sFILE FILE;,; G; }' \ + ${WRKSRC}/lzma_wrapper.c + +post-install: + @${LN} -f ${WRKSRC:H}/examples/pseudo-file.example ${WRKSRC:H} + @${MKDIR} ${STAGEDIR}${DOCSDIR} + ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC:H}/|} ${STAGEDIR}${DOCSDIR} + +.include <bsd.port.mk> diff --git a/filesystems/squashfs-tools/distinfo b/filesystems/squashfs-tools/distinfo new file mode 100644 index 000000000000..4747eff52625 --- /dev/null +++ b/filesystems/squashfs-tools/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1679779447 +SHA256 (squashfs4.6.1.tar.gz) = 94201754b36121a9f022a190c75f718441df15402df32c2b520ca331a107511c +SIZE (squashfs4.6.1.tar.gz) = 286848 +SHA256 (lzma922.tar.bz2) = 9aade84f229fb25f7aef39d8866b375fe6d35a9e18098d7cd86a99e294902944 +SIZE (lzma922.tar.bz2) = 546148 diff --git a/filesystems/squashfs-tools/files/patch-Makefile b/filesystems/squashfs-tools/files/patch-Makefile new file mode 100644 index 000000000000..cb729b5d2dc4 --- /dev/null +++ b/filesystems/squashfs-tools/files/patch-Makefile @@ -0,0 +1,75 @@ +--- Makefile.orig 2022-03-17 19:32:02 UTC ++++ Makefile +@@ -101,7 +101,7 @@ COMP_DEFAULT = gzip + # If your C library or build/target environment doesn't support XATTRs then + # comment out the next line to build Mksquashfs and Unsquashfs without XATTR + # support +-XATTR_SUPPORT = 1 ++# XATTR_SUPPORT = 1 + + # Select whether you wish xattrs to be stored by Mksquashfs and extracted + # by Unsquashfs by default. If selected users can disable xattr support by +@@ -109,7 +109,7 @@ XATTR_SUPPORT = 1 + # + # If unselected, Mksquashfs/Unsquashfs won't store and extract xattrs by + # default. Users can enable xattrs by using the -xattrs option. +-XATTR_DEFAULT = 1 ++# XATTR_DEFAULT = 1 + + + ############################################### +@@ -177,7 +177,7 @@ UNSQUASHFS_OBJS = unsquashfs.o unsquash-1.o unsquash-2 + + CFLAGS ?= -O2 + CFLAGS += $(EXTRA_CFLAGS) $(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 \ +- -D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOMP_DEFAULT=\"$(COMP_DEFAULT)\" \ ++ -D_LARGEFILE_SOURCE -DFNM_EXTMATCH=0 -D_GNU_SOURCE -DCOMP_DEFAULT=\"$(COMP_DEFAULT)\" \ + -Wall + + LIBS = -lpthread -lm +@@ -217,6 +217,7 @@ endif + + ifeq ($(LZO_SUPPORT),1) + CFLAGS += -DLZO_SUPPORT ++INCLUDEDIR += -I$(LOCALBASE)/include + MKSQUASHFS_OBJS += lzo_wrapper.o + UNSQUASHFS_OBJS += lzo_wrapper.o + LIBS += -llzo2 +@@ -225,17 +226,19 @@ endif + + ifeq ($(LZ4_SUPPORT),1) + CFLAGS += -DLZ4_SUPPORT ++INCLUDEDIR += -I$(LOCALBASE)/include + MKSQUASHFS_OBJS += lz4_wrapper.o + UNSQUASHFS_OBJS += lz4_wrapper.o +-LIBS += -llz4 ++LIBS += -L$(LOCALBASE)/lib -llz4 + COMPRESSORS += lz4 + endif + + ifeq ($(ZSTD_SUPPORT),1) + CFLAGS += -DZSTD_SUPPORT ++INCLUDEDIR += -I$(LOCALBASE)/include + MKSQUASHFS_OBJS += zstd_wrapper.o + UNSQUASHFS_OBJS += zstd_wrapper.o +-LIBS += -lzstd ++LIBS += -L$(LOCALBASE)/lib -lzstd + COMPRESSORS += zstd + endif + +@@ -417,9 +420,9 @@ clean: + + .PHONY: install + install: mksquashfs unsquashfs +- mkdir -p $(INSTALL_DIR) +- cp mksquashfs $(INSTALL_DIR) +- cp unsquashfs $(INSTALL_DIR) +- ln -fs unsquashfs $(INSTALL_DIR)/sqfscat +- ln -fs mksquashfs $(INSTALL_DIR)/sqfstar +- ../generate-manpages/install-manpages.sh $(shell pwd)/.. "$(INSTALL_MANPAGES_DIR)" "$(USE_PREBUILT_MANPAGES)" ++ mkdir -p $(DESTDIR)$(PREFIX)/bin ++ $(BSD_INSTALL_PROGRAM) mksquashfs $(DESTDIR)$(PREFIX)/bin ++ $(BSD_INSTALL_PROGRAM) unsquashfs $(DESTDIR)$(PREFIX)/bin ++ ln -fs unsquashfs $(DESTDIR)$(INSTALL_DIR)/sqfscat ++ ln -fs mksquashfs $(DESTDIR)$(INSTALL_DIR)/sqfstar ++ ../generate-manpages/install-manpages.sh $(shell pwd)/.. "$(DESTDIR)$(INSTALL_MANPAGES_DIR)" "$(USE_PREBUILT_MANPAGES)" diff --git a/filesystems/squashfs-tools/files/patch-action.c b/filesystems/squashfs-tools/files/patch-action.c new file mode 100644 index 000000000000..2c07b6980c84 --- /dev/null +++ b/filesystems/squashfs-tools/files/patch-action.c @@ -0,0 +1,17 @@ +Hack for lack of strdupa() in BSD libc + +--- action.c.orig 2014-05-10 04:54:13 UTC ++++ action.c +@@ -44,6 +44,12 @@ + #include "action.h" + #include "error.h" + ++#ifndef strdupa ++#include <string.h> // required for str*() ++#include <stdlib.h> // required for alloca ++#define strdupa(foo) (strncpy( alloca( strlen(foo) + 1 ), foo, strlen( foo ) + 1 )) ++#endif ++ + /* + * code to parse actions + */ diff --git a/filesystems/squashfs-tools/files/patch-pseudo.c b/filesystems/squashfs-tools/files/patch-pseudo.c new file mode 100644 index 000000000000..3639ca3e0c1a --- /dev/null +++ b/filesystems/squashfs-tools/files/patch-pseudo.c @@ -0,0 +1,13 @@ +--- pseudo.c.orig 2014-05-10 04:54:13 UTC ++++ pseudo.c +@@ -34,6 +34,10 @@ + #include <sys/wait.h> + #include <ctype.h> + ++#ifdef __FreeBSD__ ++#include <sys/stat.h> ++#endif ++ + #include "pseudo.h" + #include "error.h" + #include "progressbar.h" diff --git a/filesystems/squashfs-tools/pkg-descr b/filesystems/squashfs-tools/pkg-descr new file mode 100644 index 000000000000..af37d38d07e0 --- /dev/null +++ b/filesystems/squashfs-tools/pkg-descr @@ -0,0 +1,8 @@ +Squashfs is a compressed read-only filesystem for Linux. Squashfs is +intended for general read-only filesystem use, for archival use (i.e. +in cases where a .tar.gz file may be used), and in constrained block +device/memory systems (e.g. embedded systems) where low overhead is +needed. The filesystem is currently stable, and has been tested on +PowerPC, i586, Sparc and ARM architectures. + +squashfs-tools are the set of tools to manipulate squashfs images. |