PSARC 2012/358 pixz
authorJohn Beck <John.Beck@Oracle.COM>
Wed, 29 May 2013 08:07:31 -0700
changeset 1318 e26b2e3ea279
parent 1317 f0a3bc9954c8
child 1319 e0ba15fa5e97
PSARC 2012/358 pixz 15824343 SUNBT7205960 introduce pixz
components/pixz/Makefile
components/pixz/files/pixz.1
components/pixz/pixz.p5m
components/pixz/resolve.deps
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pixz/Makefile	Wed May 29 08:07:31 2013 -0700
@@ -0,0 +1,65 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+#
+include ../../make-rules/shared-macros.mk
+
+COMPONENT_NAME=		pixz
+COMPONENT_VERSION=	1.0
+COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
+COMPONENT_PROJECT_URL=	http://github.com/vasi/pixz/
+COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
+COMPONENT_ARCHIVE_HASH=	\
+    sha256:912c60de88f7eca2e1c6fe13eec5371f723018dca933796c47cd50bf6a349fc9
+COMPONENT_ARCHIVE_URL=	$(COMPONENT_PROJECT_URL)archive/$(COMPONENT_ARCHIVE)
+COMPONENT_BUGDB=	utility/pixz
+
+include ../../make-rules/prep.mk
+include ../../make-rules/justmake.mk
+include ../../make-rules/ips.mk
+
+PKG_PROTO_DIRS += $(BUILD_DIR_64)
+PKG_PROTO_DIRS += $(COMPONENT_DIR)/files
+
+# Userland default includes -mt which links with libthread which we don't need.
+studio_MT =
+
+# pixz's Makefile hard-codes some gcc-only flags in MYCFLAGS and MYLDFLAGS,
+# then appends CFLAGS & LDFLAGS to each.  Here we include their preset values
+# minus the gcc-only parts, so we can build with Studio.
+COMPONENT_BUILD_ARGS += CC="$(CC)"
+COMPONENT_BUILD_ARGS += MYCFLAGS='$(patsubst %,-I%/include,$(LIBPREFIX)) $(OPT)'
+COMPONENT_BUILD_ARGS += MYLDFLAGS='$(patsubst %,-L%/lib,$(LIBPREFIX)) $(OPT)'
+COMPONENT_BUILD_ARGS += CFLAGS="$(CFLAGS)"
+COMPONENT_BUILD_ARGS += LDFLAGS="$(CC_BITS)"
+
+ASLR_MODE = $(ASLR_ENABLE)
+
+# common targets
+build:		$(BUILD_64)
+
+install:	$(BUILD_64)
+
+test:		$(NO_TESTS)
+
+BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
+
+include ../../make-rules/depend.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pixz/files/pixz.1	Wed May 29 08:07:31 2013 -0700
@@ -0,0 +1,139 @@
+'\" te
+.TH pixz 1
+.SH NAME
+pixz \- parallel, indexing version of XZ
+
+.SH SYNOPSIS
+.LP
+.nf
+\fB/usr/bin/pixz\fR input output.pxz
+.fi
+
+.LP
+.nf
+\fB/usr/bin/pixz\fR -d input.pxz output
+.fi
+
+.LP
+.nf
+\fB/usr/bin/pixz\fR -l input.tpxz
+.fi
+
+.LP
+.nf
+\fB/usr/bin/pixz\fR -x /path/to/file < input.tpxz
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The existing XZ Utils ( http://tukaani.org/xz/ ) provide great compression
+in the .xz file format, but they have two significant problems:
+.sp
+.LP
+.RS +4
+.TP
+.ie t \(bu
+.el o
+They are single-threaded, while most users nowadays have multi-core computers.
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The .xz files they produce are just one big block of compressed data, rather than a collection of smaller blocks. This makes random access to the original data impossible.
+.RE
+.sp
+.LP
+With pixz, both these problems are solved.
+
+.SH EXAMPLES
+.sp
+.LP
+Specifying input and output:
+.sp
+.ne 2
+.mk
+.na
+$ pixz < foo.tar > foo.tpxz
+.LP
+
+.sp .6
+.RS 4n
+Same as 'pixz foo.tar foo.tpxz'
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+$ pixz -i foo.tar -o foo.tpxz
+.LP
+
+.sp .6
+.RS 4n
+Ditto. These both work for -x, -d and -l too, eg:
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+$ pixz -x -i foo.tpxz -o foo.tar file1 file2 ...
+.LP
+
+.sp .6
+.RS 4n
+# Extract the files from foo.tpxz into foo.tar
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+$ pixz foo.tar
+.LP
+
+.sp .6
+.RS 4n
+Compress it to foo.tpxz, removing the original
+.RE
+
+.sp
+.ne 2
+.mk
+.na
+$ pixz -d foo.tpxz
+.LP
+
+.sp .6
+.RS 4n
+Extract it to foo.tar, removing the original
+.RE
+
+.SH OPTIONS
+.TP
+.B -1
+Faster, worse compression.
+.TP
+.B -9
+Better, slower compression.
+.TP
+.B -p <number>
+Cap the number of threads at <number>.
+.TP
+.B -t
+Compress but don't treat it as a tarball (don't index it).
+.TP
+.B -d
+Decompress, don't check that contents match index.
+.TP
+.B -l
+List the xz blocks instead of files.
+
+.SH WARNING
+Running pixz without the -t flag will cause it to treat the input
+as a tarball, as long as it looks vaguely tarball-like. This means if the
+file starts with at least 1024 zero bytes, pixz will assume it's empty, and
+truncate the output! If your input files aren't tarballs, run with -t or
+face possible data-loss.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pixz/pixz.p5m	Wed May 29 08:07:31 2013 -0700
@@ -0,0 +1,43 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+#
+
+<transform file path=usr.*/man/.+ -> default mangler.man.stability Uncommitted>
+set name=pkg.fmri \
+    value=pkg:/compress/pixz@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.summary value="parallel indexing version of XZ"
+set name=pkg.description \
+    value="pixz compresses and decompresses files using multiple processors. If the input looks like a tar(1) archive, it also creates an index of all the files in the archive. This allows the extraction of only a small segment of the tarball, without needing to decompress the entire archive."
+set name=com.oracle.info.description value="parallel indexing version of XZ"
+set name=com.oracle.info.tpno value=11623
+set name=info.classification \
+    value="org.opensolaris.category.2008:Applications/System Utilities"
+set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
+set name=info.upstream value="Dave Vasilevsky <[email protected]>"
+set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
+set name=org.opensolaris.arc-caseid value=PSARC/2012/358
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+file pixz path=usr/bin/pixz
+file pixz.1 path=usr/share/man/man1/pixz.1
+license LICENSE license=BSD-like
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/pixz/resolve.deps	Wed May 29 08:07:31 2013 -0700
@@ -0,0 +1,3 @@
+compress/xz
+library/libarchive
+system/library