diff options
author | scole <scole@pkgsrc.org> | 2016-09-09 15:40:17 +0000 |
---|---|---|
committer | scole <scole@pkgsrc.org> | 2016-09-09 15:40:17 +0000 |
commit | f276fa9431738e7db8cf62e11c63964f5d7cbe84 (patch) | |
tree | 9f237a25e8261c3b0e1fa9190be3a143fc67093e /filesystems | |
parent | fe83706daa1ef193ef338d422af928904145f176 (diff) | |
download | pkgsrc-f276fa9431738e7db8cf62e11c63964f5d7cbe84.tar.gz |
PR pkg/51058
Add filesystem/squashfs 4.3
Squashfs is a highly compressed read-only filesystem for Linux.
It uses either gzip/xz/lzo/lz4 compression to compress both files, inodes
and directories. Inodes in the system are very small and all blocks are
packed to minimise data overhead. Block sizes greater than 4K are supported
up to a maximum of 1Mbytes (default block size 128K).
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.
This package contains tools to manipulate squashfs archive files.
Diffstat (limited to 'filesystems')
-rw-r--r-- | filesystems/Makefile | 3 | ||||
-rw-r--r-- | filesystems/squashfs/DESCR | 12 | ||||
-rw-r--r-- | filesystems/squashfs/Makefile | 48 | ||||
-rw-r--r-- | filesystems/squashfs/PLIST | 22 | ||||
-rw-r--r-- | filesystems/squashfs/distinfo | 11 | ||||
-rw-r--r-- | filesystems/squashfs/options.mk | 43 | ||||
-rw-r--r-- | filesystems/squashfs/patches/patch-Makefile | 42 | ||||
-rw-r--r-- | filesystems/squashfs/patches/patch-action.c | 37 | ||||
-rw-r--r-- | filesystems/squashfs/patches/patch-fnm__extmatch.h | 15 | ||||
-rw-r--r-- | filesystems/squashfs/patches/patch-mksquashfs.c | 13 | ||||
-rw-r--r-- | filesystems/squashfs/patches/patch-unsquashfs.c | 32 |
11 files changed, 277 insertions, 1 deletions
diff --git a/filesystems/Makefile b/filesystems/Makefile index dc53758190a..4e093e52af6 100644 --- a/filesystems/Makefile +++ b/filesystems/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.40 2016/03/01 11:30:43 jmmv Exp $ +# $NetBSD: Makefile,v 1.41 2016/09/09 15:40:17 scole Exp $ # COMMENT= File systems, and file system related packages @@ -43,6 +43,7 @@ SUBDIR+= p5-Path-Tiny SUBDIR+= perfuse SUBDIR+= py-filesystem SUBDIR+= py-fuse-bindings +SUBDIR+= squashfs SUBDIR+= tahoe-lafs SUBDIR+= u9fs diff --git a/filesystems/squashfs/DESCR b/filesystems/squashfs/DESCR new file mode 100644 index 00000000000..a7e9184ef28 --- /dev/null +++ b/filesystems/squashfs/DESCR @@ -0,0 +1,12 @@ +Squashfs is a highly compressed read-only filesystem for Linux. +It uses either gzip/xz/lzo/lz4 compression to compress both files, inodes +and directories. Inodes in the system are very small and all blocks are +packed to minimise data overhead. Block sizes greater than 4K are supported +up to a maximum of 1Mbytes (default block size 128K). + +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. + +This package contains tools to manipulate squashfs archive files. diff --git a/filesystems/squashfs/Makefile b/filesystems/squashfs/Makefile new file mode 100644 index 00000000000..346f27578dd --- /dev/null +++ b/filesystems/squashfs/Makefile @@ -0,0 +1,48 @@ +# $NetBSD: Makefile,v 1.1 2016/09/09 15:40:17 scole Exp $ + +DISTNAME= squashfs${VERSION} +PKGNAME= squashfs-${VERSION} +VERSION= 4.3 +CATEGORIES= filesystems +MASTER_SITES= http://downloads.sourceforge.net/project/squashfs/squashfs/${DISTNAME}/ + +MAINTAINER= pkgsrc-users@NetBSD.org +HOMEPAGE= http://squashfs.sourceforge.net/ +COMMENT= Tools for squashfs archives +LICENSE= gnu-gpl-v2 + +.include "../../mk/bsd.prefs.mk" +.include "options.mk" + +USE_LANGUAGES= c + +USE_TOOLS+= gmake + +INSTALLATION_DIRS= bin \ + share/doc/${PKGNAME} \ + share/doc/${PKGNAME}/OLD-READMEs \ + share/examples/${PKGNAME} + +SQUASH_DIR= ${WRKDIR}/${DISTNAME} +WRKSRC= ${SQUASH_DIR}/squashfs-tools +SQUASH_PKG_DOC= ${DESTDIR}${PREFIX}/share/doc/${PKGNAME} + +do-build: + cd ${WRKSRC} && env EXTRA_LDFLAGS="${COMPILER_RPATH_FLAG}${PREFIX}/lib" \ + ${GMAKE} ${BUILD_MAKE_FLAGS} + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/mksquashfs ${DESTDIR}${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/unsquashfs ${DESTDIR}${PREFIX}/bin + ${INSTALL_DATA} ${SQUASH_DIR}/ACKNOWLEDGEMENTS ${SQUASH_PKG_DOC} + ${INSTALL_DATA} ${SQUASH_DIR}/CHANGES ${SQUASH_PKG_DOC} + ${INSTALL_DATA} ${SQUASH_DIR}/COPYING ${SQUASH_PKG_DOC} + ${INSTALL_DATA} ${SQUASH_DIR}/DONATIONS ${SQUASH_PKG_DOC} + ${INSTALL_DATA} ${SQUASH_DIR}/INSTALL ${SQUASH_PKG_DOC} + ${INSTALL_DATA} ${SQUASH_DIR}/PERFORMANCE.README ${SQUASH_PKG_DOC} + ${INSTALL_DATA} ${SQUASH_DIR}/README ${SQUASH_PKG_DOC} + ${INSTALL_DATA} ${SQUASH_DIR}/README-4.3 ${SQUASH_PKG_DOC} + ${INSTALL_DATA} ${SQUASH_DIR}/OLD-READMEs/* ${SQUASH_PKG_DOC}/OLD-READMEs/ + ${INSTALL_DATA} ${SQUASH_DIR}/pseudo-file.example ${DESTDIR}${PREFIX}/share/examples/${PKGNAME}/ + +.include "../../mk/bsd.pkg.mk" diff --git a/filesystems/squashfs/PLIST b/filesystems/squashfs/PLIST new file mode 100644 index 00000000000..94b93f5ba45 --- /dev/null +++ b/filesystems/squashfs/PLIST @@ -0,0 +1,22 @@ +@comment $NetBSD: PLIST,v 1.1 2016/09/09 15:40:17 scole Exp $ +bin/mksquashfs +bin/unsquashfs +share/doc/${PKGNAME}/ACKNOWLEDGEMENTS +share/doc/${PKGNAME}/CHANGES +share/doc/${PKGNAME}/COPYING +share/doc/${PKGNAME}/DONATIONS +share/doc/${PKGNAME}/INSTALL +share/doc/${PKGNAME}/PERFORMANCE.README +share/doc/${PKGNAME}/README +share/doc/${PKGNAME}/README-4.3 +share/doc/${PKGNAME}/OLD-READMEs/README-2.0 +share/doc/${PKGNAME}/OLD-READMEs/README-2.1 +share/doc/${PKGNAME}/OLD-READMEs/README-3.0 +share/doc/${PKGNAME}/OLD-READMEs/README-3.1 +share/doc/${PKGNAME}/OLD-READMEs/README-3.2 +share/doc/${PKGNAME}/OLD-READMEs/README-3.3 +share/doc/${PKGNAME}/OLD-READMEs/README-4.0 +share/doc/${PKGNAME}/OLD-READMEs/README-4.1 +share/doc/${PKGNAME}/OLD-READMEs/README-4.2 +share/doc/${PKGNAME}/OLD-READMEs/README-AMD64 +share/examples/${PKGNAME}/pseudo-file.example diff --git a/filesystems/squashfs/distinfo b/filesystems/squashfs/distinfo new file mode 100644 index 00000000000..f31ccd81216 --- /dev/null +++ b/filesystems/squashfs/distinfo @@ -0,0 +1,11 @@ +$NetBSD: distinfo,v 1.1 2016/09/09 15:40:17 scole Exp $ + +SHA1 (squashfs4.3.tar.gz) = a615979db9cee82e4a934a1455577f597d290b41 +RMD160 (squashfs4.3.tar.gz) = fc91627c0757205c4a0fbe2037913cec1cefb1fd +SHA512 (squashfs4.3.tar.gz) = 854ed7acc99920f24ecf11e0da807e5a2a162eeda55db971aba63a03f0da2c13b20ec0564a906c4b0e415bd8258b273a10208c7abc0704f2ceea773aa6148a79 +Size (squashfs4.3.tar.gz) = 182550 bytes +SHA1 (patch-Makefile) = ec62b7beb0a741f48a2392900e6655b7bfbdb438 +SHA1 (patch-action.c) = d0fc02e79f93a125f20992362214b359460bdce2 +SHA1 (patch-fnm__extmatch.h) = 167c9b473c78f3e10d7536791d63e42c39794e4a +SHA1 (patch-mksquashfs.c) = 8e91a84b4bfd0de4aef79d9165ff41f17e5b8c41 +SHA1 (patch-unsquashfs.c) = 1e02204097129fdd0309124d2a664c2e081db2f0 diff --git a/filesystems/squashfs/options.mk b/filesystems/squashfs/options.mk new file mode 100644 index 00000000000..64e9ff28c1c --- /dev/null +++ b/filesystems/squashfs/options.mk @@ -0,0 +1,43 @@ +# $NetBSD: options.mk,v 1.1 2016/09/09 15:40:17 scole Exp $ + +PKG_OPTIONS_VAR= PKG_OPTIONS.squashfs +PKG_SUPPORTED_OPTIONS= zlib lz4 lzo xz xattr +PKG_SUGGESTED_OPTIONS= zlib lzo xz + +.include "../../mk/bsd.options.mk" + +# XXX any other OS support xattr? +.if ${OPSYS} == "Linux" +PKG_SUGGESTED_OPTIONS+= xattr +.endif + +.if empty(PKG_OPTIONS:Mzlib) && \ + empty(PKG_OPTIONS:Mlz4) && \ + empty(PKG_OPTIONS:Mlzo) && \ + empty(PKG_OPTIONS:Mxz) +PKG_FAIL_REASON= "need at least one compression algorithm selected" +.endif + +.if !empty(PKG_OPTIONS:Mzlib) +.include "../../devel/zlib/buildlink3.mk" +BUILD_MAKE_FLAGS+= GZIP_SUPPORT=1 +.endif + +.if !empty(PKG_OPTIONS:Mlz4) +.include "../../archivers/lz4/buildlink3.mk" +BUILD_MAKE_FLAGS+= LZ4_SUPPORT=1 +.endif + +.if !empty(PKG_OPTIONS:Mlzo) +.include "../../archivers/lzo/buildlink3.mk" +BUILD_MAKE_FLAGS+= LZO_SUPPORT=1 +.endif + +.if !empty(PKG_OPTIONS:Mxz) +.include "../../archivers/xz/buildlink3.mk" +BUILD_MAKE_FLAGS+= XZ_SUPPORT=1 +.endif + +.if !empty(PKG_OPTIONS:Mxattr) +BUILD_MAKE_FLAGS+= XATTR_SUPPORT=1 +.endif diff --git a/filesystems/squashfs/patches/patch-Makefile b/filesystems/squashfs/patches/patch-Makefile new file mode 100644 index 00000000000..cc097dd1335 --- /dev/null +++ b/filesystems/squashfs/patches/patch-Makefile @@ -0,0 +1,42 @@ +$NetBSD: patch-Makefile,v 1.1 2016/09/09 15:40:17 scole Exp $ +Add fnm_extmatch.h dependency + +--- Makefile.orig 2014-05-11 18:56:00.000000000 +0000 ++++ Makefile +@@ -15,7 +15,7 @@ + # Obviously, you must select at least one of the available gzip, lzma, lzo + # compression types. + # +-GZIP_SUPPORT = 1 ++#GZIP_SUPPORT = 1 + + ########### Building XZ support ############# + # +@@ -229,7 +229,8 @@ mksquashfs: $(MKSQUASHFS_OBJS) + + mksquashfs.o: Makefile mksquashfs.c squashfs_fs.h squashfs_swap.h mksquashfs.h \ + sort.h pseudo.h compressor.h xattr.h action.h error.h progressbar.h \ +- info.h caches-queues-lists.h read_fs.h restore.h process_fragments.h ++ info.h caches-queues-lists.h read_fs.h restore.h process_fragments.h \ ++ fnm_extmatch.h + + read_fs.o: read_fs.c squashfs_fs.h squashfs_swap.h compressor.h xattr.h \ + error.h mksquashfs.h +@@ -247,7 +248,7 @@ xattr.o: xattr.c squashfs_fs.h squashfs_ + + read_xattrs.o: read_xattrs.c squashfs_fs.h squashfs_swap.h xattr.h error.h + +-action.o: action.c squashfs_fs.h mksquashfs.h action.h error.h ++action.o: action.c squashfs_fs.h mksquashfs.h action.h error.h fnm_extmatch.h + + progressbar.o: progressbar.c error.h + +@@ -279,7 +280,7 @@ unsquashfs: $(UNSQUASHFS_OBJS) + $(CC) $(LDFLAGS) $(EXTRA_LDFLAGS) $(UNSQUASHFS_OBJS) $(LIBS) -o $@ + + unsquashfs.o: unsquashfs.h unsquashfs.c squashfs_fs.h squashfs_swap.h \ +- squashfs_compat.h xattr.h read_fs.h compressor.h ++ squashfs_compat.h xattr.h read_fs.h compressor.h fnm_extmatch.h + + unsquash-1.o: unsquashfs.h unsquash-1.c squashfs_fs.h squashfs_compat.h + diff --git a/filesystems/squashfs/patches/patch-action.c b/filesystems/squashfs/patches/patch-action.c new file mode 100644 index 00000000000..50f080671e3 --- /dev/null +++ b/filesystems/squashfs/patches/patch-action.c @@ -0,0 +1,37 @@ +$NetBSD: patch-action.c,v 1.1 2016/09/09 15:40:17 scole Exp $ +Do not use alloca and strdupa which some platforms may not have + +--- action.c.orig 2014-05-10 04:54:13.000000000 +0000 ++++ action.c +@@ -43,6 +43,7 @@ + #include "mksquashfs.h" + #include "action.h" + #include "error.h" ++#include "fnm_extmatch.h" + + /* + * code to parse actions +@@ -1953,9 +1954,22 @@ static char *get_start(char *s, int n) + + static int subpathname_fn(struct atom *atom, struct action_data *action_data) + { +- return fnmatch(atom->argv[0], get_start(strdupa(action_data->subpath), ++ /* XXX some platforms might not have alloca, strdupa */ ++ int ret_val; ++ char *copy_str; ++ ++ if ((copy_str = strdup(action_data->subpath)) == NULL) { ++ fprintf(stderr, "Out of mem\n"); ++ exit(1); ++ } ++ ++ ret_val = fnmatch(atom->argv[0],get_start(copy_str, + count_components(atom->argv[0])), + FNM_PATHNAME|FNM_PERIOD|FNM_EXTMATCH) == 0; ++ ++ free(copy_str); ++ ++ return ret_val; + } + + TEST_VAR_FN(filesize, ACTION_REG, action_data->buf->st_size) diff --git a/filesystems/squashfs/patches/patch-fnm__extmatch.h b/filesystems/squashfs/patches/patch-fnm__extmatch.h new file mode 100644 index 00000000000..92b37935fb0 --- /dev/null +++ b/filesystems/squashfs/patches/patch-fnm__extmatch.h @@ -0,0 +1,15 @@ +$NetBSD: patch-fnm__extmatch.h,v 1.1 2016/09/09 15:40:17 scole Exp $ +Define FNM_EXTMATCH if not already defined + +--- fnm_extmatch.h.orig 2016-09-09 14:49:14.000000000 +0000 ++++ fnm_extmatch.h +@@ -0,0 +1,9 @@ ++/* ++ * this is defined in external/gpl[23]/gnulib various fnmatch_.h ++ * with _GNU_SOURCE or various _POSIX_C_SOURCE but not ++ * pksrgc/pkgtools/libnbcompat pkg/include/nbcompat/fnmatch.h or ++ * usr/include/fnmatch.h, what is best way to fix? ++ */ ++#ifndef FNM_EXTMATCH ++# define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */ ++#endif diff --git a/filesystems/squashfs/patches/patch-mksquashfs.c b/filesystems/squashfs/patches/patch-mksquashfs.c new file mode 100644 index 00000000000..f7381184501 --- /dev/null +++ b/filesystems/squashfs/patches/patch-mksquashfs.c @@ -0,0 +1,13 @@ +$NetBSD: patch-mksquashfs.c,v 1.1 2016/09/09 15:40:17 scole Exp $ +Include fnm_extmatch.h + +--- mksquashfs.c.orig 2014-05-12 22:18:20.000000000 +0000 ++++ mksquashfs.c +@@ -76,6 +76,7 @@ + #include "read_fs.h" + #include "restore.h" + #include "process_fragments.h" ++#include "fnm_extmatch.h" + + int delete = FALSE; + int fd; diff --git a/filesystems/squashfs/patches/patch-unsquashfs.c b/filesystems/squashfs/patches/patch-unsquashfs.c new file mode 100644 index 00000000000..0823a127af1 --- /dev/null +++ b/filesystems/squashfs/patches/patch-unsquashfs.c @@ -0,0 +1,32 @@ +$NetBSD: patch-unsquashfs.c,v 1.1 2016/09/09 15:40:17 scole Exp $ +Some workarounds for not using autoconf and include fnm_extmatch.h + +--- unsquashfs.c.orig 2014-05-12 22:18:35.000000000 +0000 ++++ unsquashfs.c +@@ -31,13 +31,25 @@ + #include "unsquashfs_info.h" + #include "stdarg.h" + +-#include <sys/sysinfo.h> ++/* XXX need autoconf */ ++#if ( defined(__linux__) ) ++ #include <sys/sysinfo.h> ++#endif ++ ++/* XXX need autoconf HAVE_SYS_SYSCTL_H */ ++#if ( defined(__NetBSD__) || defined(__DragonFly__) || defined(__APPLE__) || \ ++ defined(__FreeBSD__) || defined(__OpenBSD__) ) ++ #include <sys/sysctl.h> ++#endif ++ + #include <sys/types.h> + #include <sys/time.h> + #include <sys/resource.h> + #include <limits.h> + #include <ctype.h> + ++#include "fnm_extmatch.h" ++ + struct cache *fragment_cache, *data_cache; + struct queue *to_reader, *to_inflate, *to_writer, *from_writer; + pthread_t *thread, *inflator_thread; |