PSARC 2012/356 libarchive s11-update
authorJohn Beck <John.Beck@Oracle.COM>
Mon, 17 Jun 2013 14:23:50 -0700
branchs11-update
changeset 2651 9b563675339e
parent 2649 79b6c91e7f81
child 2652 9202b60adab6
PSARC 2012/356 libarchive 15959922 add libarchive to Userland
components/libarchive/Makefile
components/libarchive/libarchive.license
components/libarchive/libarchive.p5m
components/libarchive/patches/archive_string.c.patch
components/libarchive/patches/archive_write_set_format_ar.c.patch
components/libarchive/patches/archive_write_set_format_pax.c.patch
components/libarchive/patches/archive_write_set_format_zip.c.patch
components/libarchive/patches/libarchive-archive_entry.3.patch
components/libarchive/patches/libarchive-archive_entry_acl.3.patch
components/libarchive/patches/libarchive-archive_entry_linkify.3.patch
components/libarchive/patches/libarchive-archive_entry_paths.3.patch
components/libarchive/patches/libarchive-archive_entry_perms.3.patch
components/libarchive/patches/libarchive-archive_entry_stat.3.patch
components/libarchive/patches/libarchive-archive_entry_time.3.patch
components/libarchive/patches/libarchive-archive_read.3.patch
components/libarchive/patches/libarchive-archive_read_disk.3.patch
components/libarchive/patches/libarchive-archive_read_set_options.3.patch
components/libarchive/patches/libarchive-archive_util.3.patch
components/libarchive/patches/libarchive-archive_write.3.patch
components/libarchive/patches/libarchive-archive_write_disk.3.patch
components/libarchive/patches/libarchive-archive_write_set_options.3.patch
components/libarchive/patches/libarchive-libarchive-formats.5.patch
components/libarchive/patches/libarchive-libarchive.3.patch
components/libarchive/resolve.deps
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/Makefile	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,64 @@
+#
+# 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=		libarchive
+COMPONENT_VERSION=	3.0.4
+COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
+COMPONENT_PROJECT_URL=	http://github.com/
+COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
+COMPONENT_ARCHIVE_HASH=	\
+    sha256:76e8d7c7b100ec4071e48c1b7d3f3ea1d22b39db3e45b7189f75b5ff4df90fac
+COMPONENT_ARCHIVE_URL=	\
+    $(COMPONENT_PROJECT_URL)downloads/libarchive/libarchive/$(COMPONENT_ARCHIVE)
+COMPONENT_BUGDB=	library/libarchive
+
+include ../../make-rules/prep.mk
+include ../../make-rules/configure.mk
+include ../../make-rules/ips.mk
+
+# Userland default includes -mt which links with libthread which we don't need.
+studio_MT =
+
+# libarchive's Makefile hard-codes some gcc-only flags in COMMON_CFLAGS, then
+# appends CFLAGS to that.  Reset the former here so we can build with Studio.
+COMPONENT_BUILD_ARGS +=	COMMON_CFLAGS=''
+COMPONENT_BUILD_ARGS +=	CFLAGS="$(CFLAGS)"
+COMPONENT_TEST_ARGS +=	COMMON_CFLAGS=''
+COMPONENT_TEST_ARGS +=	CFLAGS="$(CFLAGS)"
+
+# We need GNU awk for the following to work; hence the PATH tweak.
+COMPONENT_PREP_ACTION = \
+    (cd $(@D)/doc/man ; rm *.[135] ; env PATH=/usr/gnu/bin:$$PATH gmake all)
+PKG_PROTO_DIRS += $(COMPONENT_SRC)/doc/man
+
+# common targets
+build:		$(BUILD_32_and_64)
+
+install:	$(INSTALL_32_and_64)
+
+test:		$(TEST_32_and_64)
+
+BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
+
+include ../../make-rules/depend.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/libarchive.license	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,150 @@
+The libarchive distribution as a whole is Copyright by Tim Kientzle
+and is subject to the copyright notice reproduced at the bottom of
+this file.
+
+Each individual file in this distribution should have a clear
+copyright/licensing statement at the beginning of the file.  If any do
+not, please let me know and I will rectify it.  The following is
+intended to summarize the copyright status of the individual files;
+the actual statements in the files are controlling.
+
+* Except as listed below, all C sources (including .c and .h files)
+  and documentation files are subject to the copyright notice reproduced
+  at the bottom of this file.
+
+* The following source files are also subject in whole or in part to
+  a 3-clause UC Regents copyright; please read the individual source
+  files for details:
+   libarchive/archive_entry.c
+   libarchive/archive_read_support_filter_compress.c
+   libarchive/archive_write_set_filter_compress.c
+   libarchive/mtree.5
+   tar/matching.c
+
+* The following source files are in the public domain:
+   tar/getdate.c
+
+* The build files---including Makefiles, configure scripts,
+  and auxiliary scripts used as part of the compile process---have
+  widely varying licensing terms.  Please check individual files before
+  distributing them to see if those restrictions apply to you.
+
+I intend for all new source code to use the license below and hope over
+time to replace code with other licenses with new implementations that
+do use the license below.  The varying licensing of the build scripts
+seems to be an unavoidable mess.
+
+
+Copyright (c) 2003-2009 <author(s)>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer
+   in this position and unchanged.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This code borrows heavily from "compress" source code, which is
+ * protected by the following copyright.  (Clause 3 dropped by request
+ * of the Regents.)
+ */
+
+/*-
+ * Copyright (c) 1985, 1986, 1992, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Diomidis Spinellis and James A. Woods, derived from original
+ * work by Spencer Thomas and Joseph Orost.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+.\" Copyright (c) 1989, 1990, 1993
+.\"     The Regents of the University of California.  All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/libarchive.p5m	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,70 @@
+#
+# 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>
+# All man pages are pulled from $(COMPONENT_SRC)/doc/man and have a .3 suffix
+<transform file path=usr.*/man/man.+/(.+[.]3).*$ -> set action.hash %<\1> >
+set name=pkg.fmri \
+    value=pkg:/library/[email protected]$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.summary value="multi-format archive and compression library"
+set name=pkg.description \
+    value="The libarchive(3LIB) library provides a flexible interface for reading and writing archives in various formats such as tar(1) and cpio(1). libarchive also supports reading and writing archives compressed using various compression filters such as gzip(1) and bzip2(1). The library is inherently stream-oriented; readers serially iterate through the archive, writers serially add things to the archive."
+set name=com.oracle.info.description \
+    value="multi-format archive and compression library"
+set name=com.oracle.info.tpno value=11624
+set name=info.classification \
+    value=org.opensolaris.category.2008:System/Libraries
+set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
+set name=info.upstream value="Tim Kientzle <[email protected]>"
+set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
+set name=org.opensolaris.arc-caseid value=PSARC/2012/356
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+file path=usr/include/archive.h
+file path=usr/include/archive_entry.h
+link path=usr/lib/$(MACH64)/libarchive.so target=libarchive.so.12.0.4
+link path=usr/lib/$(MACH64)/libarchive.so.12 target=libarchive.so.12.0.4
+file path=usr/lib/$(MACH64)/libarchive.so.12.0.4
+file path=usr/lib/$(MACH64)/pkgconfig/libarchive.pc
+link path=usr/lib/libarchive.so target=libarchive.so.12
+link path=usr/lib/libarchive.so.12 target=libarchive.so.12.0.4
+file path=usr/lib/libarchive.so.12.0.4
+file path=usr/lib/pkgconfig/libarchive.pc
+file path=usr/share/man/man3archive/archive_entry.3archive
+file path=usr/share/man/man3archive/archive_entry_acl.3archive
+file path=usr/share/man/man3archive/archive_entry_linkify.3archive
+file path=usr/share/man/man3archive/archive_entry_paths.3archive
+file path=usr/share/man/man3archive/archive_entry_perms.3archive
+file path=usr/share/man/man3archive/archive_entry_stat.3archive
+file path=usr/share/man/man3archive/archive_entry_time.3archive
+file path=usr/share/man/man3archive/archive_read.3archive
+file path=usr/share/man/man3archive/archive_read_disk.3archive
+file path=usr/share/man/man3archive/archive_read_set_options.3archive
+file path=usr/share/man/man3archive/archive_util.3archive
+file path=usr/share/man/man3archive/archive_write.3archive
+file path=usr/share/man/man3archive/archive_write_disk.3archive
+file path=usr/share/man/man3archive/archive_write_set_options.3archive
+file path=usr/share/man/man3lib/libarchive.3lib
+file libarchive-formats.5 path=usr/share/man/man4/libarchive-formats.4
+license libarchive.license license=BSD-like
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/archive_string.c.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,17 @@
+This patch was fed back to the upstream community:
+http://code.google.com/p/libarchive/issues/detail?id=288
+Given the response "This issue has been already fixed in master branch."
+it should no longer be needed with the next release.
+
+--- libarchive/libarchive/archive_string.c.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_string.c	Tue Nov 27 18:10:35 2012
[email protected]@ -1120,8 +1120,8 @@
+ 	}
+ 	sc->to_charset = strdup(tc);
+ 	if (sc->to_charset == NULL) {
+-		free(sc);
+ 		free(sc->from_charset);
++		free(sc);
+ 		return (NULL);
+ 	}
+ 	archive_string_init(&sc->utftmp);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/archive_write_set_format_ar.c.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,16 @@
+This patch was fed back to the upstream community:
+http://code.google.com/p/libarchive/issues/detail?id=287
+Given the response "I just committed your patch.", it should
+no longer be needed with the next release.
+
+--- libarchive/libarchive/archive_write_set_format_ar.c.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_write_set_format_ar.c	Tue Nov 27 17:48:04 2012
[email protected]@ -165,7 +165,7 @@
+ 	 * Reject files with empty name.
+ 	 */
+ 	pathname = archive_entry_pathname(entry);
+-	if (*pathname == '\0') {
++	if (pathname == NULL || *pathname == '\0') {
+ 		archive_set_error(&a->archive, EINVAL,
+ 		    "Invalid filename");
+ 		return (ARCHIVE_WARN);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/archive_write_set_format_pax.c.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,27 @@
+A less complete version of this patch was fed back to the upstream community:
+http://code.google.com/p/libarchive/issues/detail?id=285
+This more complete patch was committed instead.  It should no longer be
+needed with the next release.
+
+--- libarchive/libarchive/archive_write_set_format_pax.c.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_write_set_format_pax.c	Sun Dec  2 04:03:38 2012
[email protected]@ -647,8 +647,10 @@ archive_write_pax_header(struct archive_write *a,
+		oname = archive_entry_pathname(entry_original);
+		name_length = strlen(oname);
+		name = malloc(name_length + 3);
+-		if (name == NULL) {
++		if (name == NULL || extra == NULL) {
+			/* XXX error message */
++			archive_entry_free(extra);
++			free(name);
+			return (ARCHIVE_FAILED);
+		}
+		strcpy(name, oname);
[email protected]@ -687,6 +689,7 @@ archive_write_pax_header(struct archive_write *a,
+
+		/* Recurse to write the special copyfile entry. */
+		r = archive_write_pax_header(a, extra);
++		archive_entry_free(extra);
+		if (r < ARCHIVE_WARN)
+			return (r);
+		if (r < ret)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/archive_write_set_format_zip.c.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,16 @@
+This patch was fed back to the upstream community:
+http://code.google.com/p/libarchive/issues/detail?id=286
+Given the response "I applied your patch to zip writer."
+it should no longer be needed with the next release.
+
+--- libarchive/libarchive/archive_write_set_format_zip.c.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_write_set_format_zip.c	Tue Nov 27 17:31:42 2012
[email protected]@ -842,6 +842,8 @@
+ 	type = archive_entry_filetype(entry);
+ 	path = archive_entry_pathname(entry);
+ 
++	if (path == NULL)
++		return (0);
+ 	if ((type == AE_IFDIR) & (path[strlen(path) - 1] != '/')) {
+ 		return strlen(path) + 1;
+ 	} else {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/libarchive-archive_entry.3.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,65 @@
+This patch is needed to convert BSD-style section numbers to Solaris-style
+section numbers.  It has not been fed back to the upstream community.  It
+may need to be tweaked slightly for future releases.
+
+--- libarchive/libarchive/archive_entry.3.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_entry.3	Fri Nov  9 12:39:50 2012
[email protected]@ -26,7 +26,7 @@
+ .\" $FreeBSD$
+ .\"
+ .Dd Feburary 2, 2012
+-.Dt ARCHIVE_ENTRY 3
++.Dt ARCHIVE_ENTRY 3ARCHIVE
+ .Os
+ .Sh NAME
+ .Nm archive_entry_clear ,
[email protected]@ -57,7 +57,7 @@
+ .Tn struct stat
+ plus associated pathname, textual group and user names, etc.
+ These objects are used by
+-.Xr libarchive 3
++.Xr libarchive 3LIB
+ to represent the metadata associated with a particular
+ entry in an archive.
+ .Ss Create and Destroy
[email protected]@ -84,17 +84,17 @@
+ .Ss Function groups
+ Due to high number of functions, the accessor functions can be found in
+ man pages grouped by the purpose.
+-.Bl -tag -width ".Xr archive_entry_perms 3"
+-.It Xr archive_entry_acl 3
++.Bl -tag -width ".Xr archive_entry_perms 3ARCHIVE"
++.It Xr archive_entry_acl 3ARCHIVE
+ Access Control List manipulation
+-.It Xr archive_entry_paths 3
++.It Xr archive_entry_paths 3ARCHIVE
+ Path name manipulation
+-.It Xr archive_entry_perms 3
++.It Xr archive_entry_perms 3ARCHIVE
+ User, group and mode manipulation
+-.It Xr archive_entry_stat 3
++.It Xr archive_entry_stat 3ARCHIVE
+ Functions not in the other groups and copying to/from
+ .Vt struct stat .
+-.It Xr archive_entry_time 3
++.It Xr archive_entry_time 3ARCHIVE
+ Time field manipulation
+ .El
+ .Pp
[email protected]@ -131,11 +131,11 @@
+ .\" .Sh RETURN VALUES
+ .\" .Sh ERRORS
+ .Sh SEE ALSO
+-.Xr archive 3 ,
+-.Xr archive_entry_acl 3 ,
+-.Xr archive_entry_paths 3 ,
+-.Xr archive_entry_perms 3 ,
+-.Xr archive_entry_time 3
++.Xr libarchive 3LIB ,
++.Xr archive_entry_acl 3ARCHIVE ,
++.Xr archive_entry_paths 3ARCHIVE ,
++.Xr archive_entry_perms 3ARCHIVE ,
++.Xr archive_entry_time 3ARCHIVE
+ .Sh HISTORY
+ The
+ .Nm libarchive
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/libarchive-archive_entry_acl.3.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,35 @@
+This patch is needed to convert BSD-style section numbers to Solaris-style
+section numbers.  It has not been fed back to the upstream community.  It
+may need to be tweaked slightly for future releases.
+
+--- libarchive/libarchive/archive_entry_acl.3.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_entry_acl.3	Fri Nov  9 12:39:06 2012
[email protected]@ -23,7 +23,7 @@
+ .\" SUCH DAMAGE.
+ .\"
+ .Dd February 2, 2012
+-.Dt ARCHIVE_ENTRY_ACL 3
++.Dt ARCHIVE_ENTRY_ACL 3ARCHIVE
+ .Os
+ .Sh NAME
+ .Nm archive_entry_acl_add_entry ,
[email protected]@ -173,7 +173,7 @@
+ .Fn archive_entry_acl_next_w .
+ The function returns either 0, if no non-extended ACLs are found.
+ In this case, the access permissions should be obtained by
+-.Xr archive_entry_mode 3
++.Xr archive_entry_mode 3ARCHIVE
+ or set using
+ .Xr chmod 2 .
+ Otherwise, the function returns the same value as
[email protected]@ -226,8 +226,8 @@
+ or
+ .Fn archive_entry_acl_text_w .
+ .Sh SEE ALSO
+-.Xr archive 3 ,
+-.Xr archive_entry 3
++.Xr libarchive 3LIB ,
++.Xr archive_entry 3ARCHIVE
+ .Sh BUGS
+ .Dv ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID
+ and
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/libarchive-archive_entry_linkify.3.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,34 @@
+This patch is needed to convert BSD-style section numbers to Solaris-style
+section numbers.  It has not been fed back to the upstream community.  It
+may need to be tweaked slightly for future releases.
+
+--- libarchive/libarchive/archive_entry_linkify.3.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_entry_linkify.3	Fri Nov  9 12:38:22 2012
[email protected]@ -23,7 +23,7 @@
+ .\" SUCH DAMAGE.
+ .\"
+ .Dd February 2, 2012
+-.Dt ARCHIVE_ENTRY_LINKIFY 3
++.Dt ARCHIVE_ENTRY_LINKIFY 3ARCHIVE
+ .Os
+ .Sh NAME
+ .Nm archive_entry_linkresolver ,
[email protected]@ -91,7 +91,7 @@
+ .Fn archive_entry_linkresolver_set_strategy
+ function selects the optimal hardlink strategy for the given format.
+ The format code can be obtained from
+-.Xr archive_format 3 .
++.Xr archive_format 3ARCHIVE .
+ The function can be called more than once, but it is recommended to
+ flush all deferred entries first.
+ .Pp
[email protected]@ -218,7 +218,7 @@
+ returns
+ .Dv NULL
+ on
+-.Xr malloc 3
++.Xr malloc 3C
+ failures.
+ .Sh SEE ALSO
+-.Xr archive_entry 3
++.Xr archive_entry 3ARCHIVE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/libarchive-archive_entry_paths.3.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,41 @@
+This patch is needed to convert BSD-style section numbers to Solaris-style
+section numbers.  It has not been fed back to the upstream community.  It
+may need to be tweaked slightly for future releases.
+
+--- libarchive/libarchive/archive_entry_paths.3.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_entry_paths.3	Fri Nov  9 12:37:42 2012
[email protected]@ -23,7 +23,7 @@
+ .\" SUCH DAMAGE.
+ .\"
+ .Dd February 2, 2012
+-.Dt ARCHIVE_ENTRY_PATHS 3
++.Dt ARCHIVE_ENTRY_PATHS 3ARCHIVE
+ .Os
+ .Sh NAME
+ .Nm archive_entry_hardlink ,
[email protected]@ -105,7 +105,7 @@
+ .Fn archive_entry_update_symlink_utf8 "struct archive_entry *a" "const char *path"
+ .Sh DESCRIPTION
+ Path names supported by
+-.Xr archive_entry 3 :
++.Xr archive_entry 3ARCHIVE :
+ .Bl -tag -width "sourcepath" -compact
+ .It hardlink
+ Destination of the hardlink.
[email protected]@ -118,7 +118,7 @@
+ Path in the archive
+ .It sourcepath
+ Path on the disk for use by
+-.Xr archive_read_disk 3 .
++.Xr archive_read_disk 3ARCHIVE .
+ .It symlink
+ Destination of the symbolic link.
+ .El
[email protected]@ -149,5 +149,5 @@
+ is an alias for 
+ .Fn archive_entry_copy_XXX .
+ .Sh SEE ALSO
+-.Xr archive 3 ,
+-.Xr archive_entry 3
++.Xr libarchive 3LIB ,
++.Xr archive_entry 3ARCHIVE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/libarchive-archive_entry_perms.3.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,46 @@
+This patch is needed to convert BSD-style section numbers to Solaris-style
+section numbers.  It has not been fed back to the upstream community.  It
+may need to be tweaked slightly for future releases.
+
+--- libarchive/libarchive/archive_entry_perms.3.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_entry_perms.3	Fri Nov  9 12:37:14 2012
[email protected]@ -24,7 +24,7 @@
+ .\" SUCH DAMAGE.
+ .\"
+ .Dd February 2, 2012
+-.Dt ARCHIVE_ENTRY_PERMS 3
++.Dt ARCHIVE_ENTRY_PERMS 3ARCHIVE
+ .Os
+ .Sh NAME
+ .Nm archive_entry_gid ,
[email protected]@ -170,9 +170,6 @@
+ In unusual circumstances, you can force a fully-specified set
+ of file flags by setting the bitmap of flags to clear to the complement
+ of the bitmap of flags to set.
+-(This differs from
+-.Xr fflagstostr 3 ,
+-which only includes names for set bits.)
+ Converting a bitmap to a textual string is a platform-specific
+ operation; bits that are not meaningful on the current platform
+ will be ignored.
[email protected]@ -190,15 +187,12 @@
+ Note that every name \(em including names that follow an unrecognized
+ name \(em will be evaluated, and the bitmaps will be set to reflect
+ every name that is recognized.
+-(In particular, this differs from
+-.Xr strtofflags 3 ,
+-which stops parsing at the first unrecognized name.)
+ .Sh SEE ALSO
+-.Xr archive 3 ,
+-.Xr archive_entry 3 ,
+-.Xr archive_entry_acl 3 ,
+-.Xr archive_read_disk 3 ,
+-.Xr archive_write_disk 3
++.Xr libarchive 3LIB ,
++.Xr archive_entry 3ARCHIVE ,
++.Xr archive_entry_acl 3ARCHIVE ,
++.Xr archive_read_disk 3ARCHIVE ,
++.Xr archive_write_disk 3ARCHIVE
+ .Sh BUGS
+ The platform types
+ .Vt uid_t
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/libarchive-archive_entry_stat.3.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,37 @@
+This patch is needed to convert BSD-style section numbers to Solaris-style
+section numbers.  It has not been fed back to the upstream community.  It
+may need to be tweaked slightly for future releases.
+
+--- libarchive/libarchive/archive_entry_stat.3.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_entry_stat.3	Fri Nov  9 12:41:56 2012
[email protected]@ -23,7 +23,7 @@
+ .\" SUCH DAMAGE.
+ .\"
+ .Dd February 2, 2012
+-.Dt ARCHIVE_ENTRY_STAT 3
++.Dt ARCHIVE_ENTRY_STAT 3ARCHIVE
+ .Os
+ .Sh NAME
+ .Nm archive_entry_stat ,
[email protected]@ -224,7 +224,7 @@
+ and
+ .Fn archive_entry_ino64
+ are used by
+-.Xr archive_entry_linkify 3
++.Xr archive_entry_linkify 3ARCHIVE
+ to find hardlinks.
+ The pair of device and inode is suppossed to identify hardlinked files.
+ .Pp
[email protected]@ -267,8 +267,8 @@
+ Some archive formats use the combined form, while other formats use
+ the split form.
+ .Sh SEE ALSO
+-.Xr archive 3 ,
+-.Xr archive_entry_acl 3 ,
+-.Xr archive_entry_perms 3 ,
+-.Xr archive_entry_time 3 ,
++.Xr libarchive 3LIB ,
++.Xr archive_entry_acl 3ARCHIVE ,
++.Xr archive_entry_perms 3ARCHIVE ,
++.Xr archive_entry_time 3ARCHIVE ,
+ .Xr stat 2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/libarchive-archive_entry_time.3.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,35 @@
+This patch is needed to convert BSD-style section numbers to Solaris-style
+section numbers.  It has not been fed back to the upstream community.  It
+may need to be tweaked slightly for future releases.
+
+--- libarchive/libarchive/archive_entry_time.3.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_entry_time.3	Fri Nov  9 12:36:07 2012
[email protected]@ -26,7 +26,7 @@
+ .\" $FreeBSD$
+ .\"
+ .Dd February 2, 2012
+-.Dt ARCHIVE_ENTRY_TIME 3
++.Dt ARCHIVE_ENTRY_TIME 3ARCHIVE
+ .Os
+ .Sh NAME
+ .Nm archive_entry_atime ,
[email protected]@ -100,7 +100,7 @@
+ Supported time fields are atime (access time), birthtime (creation time),
+ ctime (last time an inode property was changed) and mtime (modification time).
+ .Pp
+-.Xr libarchive 3
++.Xr libarchive 3LIB
+ provides a high-resolution interface.
+ The timestamps are truncated automatically depending on the archive format
+ (for archiving) or the filesystem capabilities (for restoring).
[email protected]@ -113,8 +113,8 @@
+ .Fn XXX_is_set .
+ Unset time fields have a second and nanosecond field of 0.
+ .Sh SEE ALSO
+-.Xr archive 3 ,
+-.Xr archive_entry 3
++.Xr libarchive 3LIB ,
++.Xr archive_entry 3ARCHIVE
+ .Sh HISTORY
+ The
+ .Nm libarchive
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/libarchive-archive_read.3.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,101 @@
+This patch is needed to convert BSD-style section numbers to Solaris-style
+section numbers.  It has not been fed back to the upstream community.  It
+may need to be tweaked slightly for future releases.
+
+--- libarchive/libarchive/archive_read.3.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_read.3	Fri Nov  9 12:42:17 2012
[email protected]@ -25,7 +25,7 @@
+ .\" $FreeBSD$
+ .\"
+ .Dd February 2, 2012
+-.Dt ARCHIVE_READ 3
++.Dt ARCHIVE_READ 3ARCHIVE
+ .Os
+ .Sh NAME
+ .Nm archive_read
[email protected]@ -44,7 +44,7 @@
+ .\"
+ .Ss Create archive object
+ See
+-.Xr archive_read_new 3 .
++.Xr archive_read_new 3ARCHIVE .
+ .Pp
+ To read an archive, you must first obtain an initialized
+ .Tn struct archive
[email protected]@ -53,9 +53,9 @@
+ .\"
+ .Ss Enable filters and formats
+ See
+-.Xr archive_read_filter 3
++.Xr archive_read_filter 3ARCHIVE
+ and
+-.Xr archive_read_format 3 .
++.Xr archive_read_format 3ARCHIVE .
+ .Pp
+ You can then modify this object for the desired operations with the
+ various
[email protected]@ -80,11 +80,11 @@
+ .\"
+ .Ss Set options
+ See
+-.Xr archive_read_set_options 3 .
++.Xr archive_read_set_options 3ARCHIVE .
+ .\"
+ .Ss Open archive
+ See
+-.Xr archive_read_open 3 .
++.Xr archive_read_open 3ARCHIVE .
+ .Pp
+ Once you have prepared the
+ .Tn struct archive
[email protected]@ -105,10 +105,10 @@
+ .\"
+ .Ss Consume archive
+ See
+-.Xr archive_read_header 3 ,
+-.Xr archive_read_data 3
++.Xr archive_read_header 3ARCHIVE ,
++.Xr archive_read_data 3ARCHIVE
+ and
+-.Xr archive_read_extract 3 .
++.Xr archive_read_extract 3ARCHIVE .
+ .Pp
+ Each archive entry consists of a header followed by a certain
+ amount of data.
[email protected]@ -146,7 +146,7 @@
+ .\"
+ .Ss Release resources
+ See
+-.Xr archive_read_free 3 .
++.Xr archive_read_free 3ARCHIVE .
+ .Pp
+ Once you have finished reading data from the archive, you
+ should call
[email protected]@ -217,17 +217,16 @@
+ .\" .Sh ERRORS
+ .Sh SEE ALSO
+ .Xr tar 1 ,
+-.Xr libarchive 3 ,
+-.Xr archive_read_new 3 ,
+-.Xr archive_read_data 3 ,
+-.Xr archive_read_extract 3 ,
+-.Xr archive_read_filter 3 ,
+-.Xr archive_read_format 3 ,
+-.Xr archive_read_header 3 ,
+-.Xr archive_read_open 3 ,
+-.Xr archive_read_set_options 3 ,
+-.Xr archive_util 3 ,
+-.Xr tar 5
++.Xr libarchive 3LIB ,
++.Xr archive_read_new 3ARCHIVE ,
++.Xr archive_read_data 3ARCHIVE ,
++.Xr archive_read_extract 3ARCHIVE ,
++.Xr archive_read_filter 3ARCHIVE ,
++.Xr archive_read_format 3ARCHIVE ,
++.Xr archive_read_header 3ARCHIVE ,
++.Xr archive_read_open 3ARCHIVE ,
++.Xr archive_read_set_options 3ARCHIVE ,
++.Xr archive_util 3ARCHIVE
+ .Sh HISTORY
+ The
+ .Nm libarchive
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/libarchive-archive_read_disk.3.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,93 @@
+This patch is needed to convert BSD-style section numbers to Solaris-style
+section numbers.  It has not been fed back to the upstream community.  It
+may need to be tweaked slightly for future releases.
+
+--- libarchive/libarchive/archive_read_disk.3.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_read_disk.3	Fri Nov  9 12:35:02 2012
[email protected]@ -25,7 +25,7 @@
+ .\" $FreeBSD$
+ .\"
+ .Dd February 2, 2012
+-.Dt ARCHIVE_READ_DISK 3
++.Dt ARCHIVE_READ_DISK 3ARCHIVE
+ .Os
+ .Sh NAME
+ .Nm archive_read_disk_new ,
[email protected]@ -138,16 +138,16 @@
+ This convenience function installs a standard set of user
+ and group name lookup functions.
+ These functions use
+-.Xr getpwuid 3
++.Xr getpwuid 3C
+ and
+-.Xr getgrgid 3
++.Xr getgrgid 3C
+ to convert ids to names, defaulting to NULL if the names cannot
+ be looked up.
+ These functions also implement a simple memory cache to reduce
+ the number of calls to
+-.Xr getpwuid 3
++.Xr getpwuid 3C
+ and
+-.Xr getgrgid 3 .
++.Xr getgrgid 3C .
+ .It Fn archive_read_disk_entry_from_file
+ Populates a
+ .Tn struct archive_entry
[email protected]@ -155,7 +155,7 @@
+ The
+ .Tn archive_entry
+ object must have already been created with
+-.Xr archive_entry_new 3
++.Xr archive_entry_new 3ARCHIVE
+ and at least one of the source path or path fields must already be set.
+ (If both are set, the source path will be used.)
+ .Pp
[email protected]@ -196,7 +196,7 @@
+ More information about the
+ .Va struct archive
+ object and the overall design of the library can be found in the
+-.Xr libarchive 3
++.Xr libarchive 3LIB
+ overview.
+ .Sh EXAMPLE
+ The following illustrates basic usage of the library by
[email protected]@ -263,12 +263,12 @@
+ functions.
+ .\"
+ .Sh SEE ALSO
+-.Xr archive_read 3 ,
+-.Xr archive_util 3 ,
+-.Xr archive_write 3 ,
+-.Xr archive_write_disk 3 ,
++.Xr archive_read 3ARCHIVE ,
++.Xr archive_util 3ARCHIVE ,
++.Xr archive_write 3ARCHIVE ,
++.Xr archive_write_disk 3ARCHIVE ,
+ .Xr tar 1 ,
+-.Xr libarchive 3
++.Xr libarchive 3LIB
+ .Sh HISTORY
+ The
+ .Nm libarchive
[email protected]@ -290,9 +290,9 @@
+ The
+ .Dq standard
+ user name and group name lookup functions are not the defaults because
+-.Xr getgrgid 3
++.Xr getgrgid 3C
+ and
+-.Xr getpwuid 3
++.Xr getpwuid 3C
+ are sometimes too large for particular applications.
+ The current design allows the application author to use a more
+ compact implementation when appropriate.
[email protected]@ -310,7 +310,7 @@
+ .Pp
+ This API should provide a set of methods for walking a directory tree.
+ That would make it a direct parallel of the
+-.Xr archive_read 3
++.Xr archive_read 3ARCHIVE
+ API.
+ When such methods are implemented, the
+ .Dq hybrid
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/libarchive-archive_read_set_options.3.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,25 @@
+This patch is needed to convert BSD-style section numbers to Solaris-style
+section numbers.  It has not been fed back to the upstream community.  It
+may need to be tweaked slightly for future releases.
+
+--- libarchive/libarchive/archive_read_set_options.3.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_read_set_options.3	Fri Nov  9 12:28:47 2012
[email protected]@ -25,7 +25,7 @@
+ .\" $FreeBSD$
+ .\"
+ .Dd February 2, 2012
+-.Dt ARCHIVE_READ_OPTIONS 3
++.Dt ARCHIVE_READ_OPTIONS 3ARCHIVE
+ .Os
+ .Sh NAME
+ .Nm archive_read_set_filter_option ,
[email protected]@ -204,6 +204,6 @@
+ .\"
+ .Sh SEE ALSO
+ .Xr tar 1 ,
+-.Xr libarchive 3 ,
+-.Xr archive_write_set_options 3 ,
+-.Xr archive_read 3
++.Xr libarchive 3LIB ,
++.Xr archive_write_set_options 3ARCHIVE ,
++.Xr archive_read 3ARCHIVE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/libarchive-archive_util.3.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,56 @@
+This patch is needed to convert BSD-style section numbers to Solaris-style
+section numbers.  It has not been fed back to the upstream community.  It
+may need to be tweaked slightly for future releases.
+
+--- libarchive/libarchive/archive_util.3.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_util.3	Fri Nov  9 12:34:22 2012
[email protected]@ -25,7 +25,7 @@
+ .\" $FreeBSD$
+ .\"
+ .Dd February 2, 2012
+-.Dt ARCHIVE_UTIL 3
++.Dt ARCHIVE_UTIL 3ARCHIVE
+ .Os
+ .Sh NAME
+ .Nm archive_clear_error ,
[email protected]@ -84,7 +84,7 @@
+ These functions provide access to various information about the
+ .Tn struct archive
+ object used in the
+-.Xr libarchive 3
++.Xr libarchive 3LIB
+ library.
+ .Bl -tag -compact -width indent
+ .It Fn archive_clear_error
[email protected]@ -112,13 +112,13 @@
+ obtained from passing the result of
+ .Fn archive_errno
+ to
+-.Xr strerror 3 .
++.Xr strerror 3C .
+ .It Fn archive_file_count
+ Returns a count of the number of files processed by this archive object.
+ The count is incremented by calls to
+-.Xr archive_write_header 3
++.Xr archive_write_header 3ARCHIVE
+ or
+-.Xr archive_read_next_header 3 .
++.Xr archive_read_next_header 3ARCHIVE .
+ .It Fn archive_filter_code
+ Returns a numeric code identifying the indicated filter.
+ See
[email protected]@ -207,10 +207,10 @@
+ not uniformly supported and should not be used.
+ .El
+ .Sh SEE ALSO
+-.Xr archive_read 3 ,
+-.Xr archive_write 3 ,
+-.Xr libarchive 3 ,
+-.Xr printf 3
++.Xr archive_read 3ARCHIVE ,
++.Xr archive_write 3ARCHIVE ,
++.Xr libarchive 3LIB ,
++.Xr printf 3C
+ .Sh HISTORY
+ The
+ .Nm libarchive
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/libarchive-archive_write.3.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,87 @@
+This patch is needed to convert BSD-style section numbers to Solaris-style
+section numbers.  It has not been fed back to the upstream community.  It
+may need to be tweaked slightly for future releases.
+
+--- libarchive/libarchive/archive_write.3.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_write.3	Fri Nov  9 12:24:57 2012
[email protected]@ -25,7 +25,7 @@
+ .\" $FreeBSD$
+ .\"
+ .Dd February 2, 2012
+-.Dt ARCHIVE_WRITE 3
++.Dt ARCHIVE_WRITE 3ARCHIVE
+ .Os
+ .Sh NAME
+ .Nm archive_write
[email protected]@ -44,7 +44,7 @@
+ .\"
+ .Ss Create archive object
+ See
+-.Xr archive_write_new 3 .
++.Xr archive_write_new 3ARCHIVE .
+ .Pp
+ To write an archive, you must first obtain an initialized
+ .Tn struct archive
[email protected]@ -53,10 +53,10 @@
+ .\"
+ .Ss Enable filters and formats, configure block size and padding
+ See
+-.Xr archive_write_filter 3 ,
+-.Xr archive_write_format 3
++.Xr archive_write_filter 3ARCHIVE ,
++.Xr archive_write_format 3ARCHIVE
+ and
+-.Xr archive_write_blocksize 3 .
++.Xr archive_write_blocksize 3ARCHIVE .
+ .Pp
+ You can then modify this object for the desired operations with the
+ various
[email protected]@ -71,11 +71,11 @@
+ .\"
+ .Ss Set options
+ See
+-.Xr archive_read_set_options 3 .
++.Xr archive_read_set_options 3ARCHIVE .
+ .\"
+ .Ss Open archive
+ See
+-.Xr archive_write_open 3 .
++.Xr archive_write_open 3ARCHIVE .
+ .Pp
+ Once you have prepared the
+ .Tn struct archive
[email protected]@ -92,9 +92,9 @@
+ .\"
+ .Ss Produce archive
+ See
+-.Xr archive_write_header 3
++.Xr archive_write_header 3ARCHIVE
+ and
+-.Xr archive_write_data 3 .
++.Xr archive_write_data 3ARCHIVE .
+ .Pp
+ Individual archive entries are written in a three-step
+ process:
[email protected]@ -112,7 +112,7 @@
+ .\"
+ .Ss Release resources
+ See
+-.Xr archive_write_free 3 .
++.Xr archive_write_free 3ARCHIVE .
+ .Pp
+ After all entries have been written, use the
+ .Fn archive_write_free
[email protected]@ -220,11 +220,8 @@
+ .Ed
+ .Sh SEE ALSO
+ .Xr tar 1 ,
+-.Xr libarchive 3 ,
+-.Xr archive_write_set_options 3 ,
+-.Xr cpio 5 ,
+-.Xr mtree 5 ,
+-.Xr tar 5
++.Xr libarchive 3LIB ,
++.Xr archive_write_set_options 3ARCHIVE
+ .Sh HISTORY
+ The
+ .Nm libarchive
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/libarchive-archive_write_disk.3.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,82 @@
+This patch is needed to convert BSD-style section numbers to Solaris-style
+section numbers.  It has not been fed back to the upstream community.  It
+may need to be tweaked slightly for future releases.
+
+--- libarchive/libarchive/archive_write_disk.3.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_write_disk.3	Fri Nov  9 12:33:36 2012
[email protected]@ -25,7 +25,7 @@
+ .\" $FreeBSD$
+ .\"
+ .Dd February 2, 2012
+-.Dt ARCHIVE_WRITE_DISK 3
++.Dt ARCHIVE_WRITE_DISK 3ARCHIVE
+ .Os
+ .Sh NAME
+ .Nm archive_write_disk_new ,
[email protected]@ -207,22 +207,22 @@
+ This convenience function installs a standard set of user
+ and group lookup functions.
+ These functions use
+-.Xr getpwnam 3
++.Xr getpwnam 3C
+ and
+-.Xr getgrnam 3
++.Xr getgrnam 3C
+ to convert names to ids, defaulting to the ids if the names cannot
+ be looked up.
+ These functions also implement a simple memory cache to reduce
+ the number of calls to
+-.Xr getpwnam 3
++.Xr getpwnam 3C
+ and
+-.Xr getgrnam 3 .
++.Xr getgrnam 3C .
+ .It Fn archive_write_header
+ Build and write a header using the data in the provided
+ .Tn struct archive_entry
+ structure.
+ See
+-.Xr archive_entry 3
++.Xr archive_entry 3ARCHIVE
+ for information on creating and populating
+ .Tn struct archive_entry
+ objects.
[email protected]@ -275,10 +275,10 @@
+ More information about the
+ .Va struct archive
+ object and the overall design of the library can be found in the
+-.Xr libarchive 3
++.Xr libarchive 3LIB
+ overview.
+ Many of these functions are also documented under
+-.Xr archive_write 3 .
++.Xr archive_write 3ARCHIVE .
+ .Sh RETURN VALUES
+ Most functions return
+ .Cm ARCHIVE_OK
[email protected]@ -311,10 +311,10 @@
+ functions.
+ .\"
+ .Sh SEE ALSO
+-.Xr archive_read 3 ,
+-.Xr archive_write 3 ,
++.Xr archive_read 3ARCHIVE ,
++.Xr archive_write 3ARCHIVE ,
+ .Xr tar 1 ,
+-.Xr libarchive 3
++.Xr libarchive 3LIB
+ .Sh HISTORY
+ The
+ .Nm libarchive
[email protected]@ -390,9 +390,9 @@
+ The
+ .Dq standard
+ user-id and group-id lookup functions are not the defaults because
+-.Xr getgrnam 3
++.Xr getgrnam 3C
+ and
+-.Xr getpwnam 3
++.Xr getpwnam 3C
+ are sometimes too large for particular applications.
+ The current design allows the application author to use a more
+ compact implementation when appropriate.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/libarchive-archive_write_set_options.3.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,28 @@
+This patch is needed to convert BSD-style section numbers to Solaris-style
+section numbers.  It has not been fed back to the upstream community.  It
+may need to be tweaked slightly for future releases.
+
+--- libarchive/libarchive/archive_write_set_options.3.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/archive_write_set_options.3	Fri Nov  9 12:25:27 2012
[email protected]@ -25,7 +25,7 @@
+ .\" $FreeBSD$
+ .\"
+ .Dd February 2, 2012
+-.Dt ARCHIVE_WRITE_OPTIONS 3
++.Dt ARCHIVE_WRITE_OPTIONS 3ARCHIVE
+ .Os
+ .Sh NAME
+ .Nm archive_write_set_filter_option ,
[email protected]@ -422,9 +422,9 @@
+ .\"
+ .Sh SEE ALSO
+ .Xr tar 1 ,
+-.Xr libarchive 3 ,
+-.Xr archive_read_set_options 3 ,
+-.Xr archive_write 3
++.Xr libarchive 3LIB ,
++.Xr archive_read_set_options 3ARCHIVE ,
++.Xr archive_write 3ARCHIVE
+ .Sh HISTORY
+ The
+ .Nm libarchive
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/libarchive-libarchive-formats.5.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,86 @@
+This patch is needed to convert BSD-style section numbers to Solaris-style
+section numbers.  It has not been fed back to the upstream community.  It
+may need to be tweaked slightly for future releases.
+
+--- libarchive/libarchive/libarchive-formats.5.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/libarchive-formats.5	Fri Nov  9 12:32:18 2012
[email protected]@ -25,7 +25,7 @@
+ .\" $FreeBSD$
+ .\"
+ .Dd March 18, 2012
+-.Dt LIBARCHIVE-FORMATS 5
++.Dt LIBARCHIVE-FORMATS 4
+ .Os
+ .Sh NAME
+ .Nm libarchive-formats
[email protected]@ -32,7 +32,7 @@
+ .Nd archive formats supported by the libarchive library
+ .Sh DESCRIPTION
+ The
+-.Xr libarchive 3
++.Xr libarchive 3LIB
+ library reads and writes a variety of streaming archive formats.
+ Generally speaking, all of these archive formats consist of a series of
+ .Dq entries .
[email protected]@ -49,7 +49,7 @@
+ functions to enable all supported formats.
+ .Ss Tar Formats
+ The
+-.Xr libarchive 3
++.Xr libarchive 3LIB
+ library can read most tar archives.
+ It can write POSIX-standard
+ .Dq ustar
[email protected]@ -69,7 +69,7 @@
+ .Bl -tag -width indent
+ .It Cm gnutar
+ The
+-.Xr libarchive 3
++.Xr libarchive 3LIB
+ library can read most GNU-format tar archives.
+ It currently supports the most popular GNU extensions, including
+ modern long filename and linkname support, as well as atime and ctime data.
[email protected]@ -79,12 +79,12 @@
+ formats.
+ .Pp
+ The
+-.Xr libarchive 3
++.Xr libarchive 3LIB
+ library can write GNU tar format, including long filename
+ and linkname support, as well as atime and ctime data.
+ .It Cm pax
+ The
+-.Xr libarchive 3
++.Xr libarchive 3LIB
+ library can read and write POSIX-compliant pax interchange format
+ archives.
+ Pax interchange format archives are an extension of the older ustar
[email protected]@ -371,9 +371,7 @@
+ This can cause problems for programs such as
+ GNU ld that do not support the BSD-style long filenames.
+ .Ss mtree
+-Libarchive can read and write files in
+-.Xr mtree 5
+-format.
++Libarchive can read and write files in mtree format.
+ This format is not a true archive format, but rather a textual description
+ of a file hierarchy in which each line specifies the name of a file and
+ provides specific metadata about that file.
[email protected]@ -384,7 +382,7 @@
+ .Tn archive_entry
+ object.
+ When writing, libarchive supports use of the
+-.Xr archive_write_set_options 3
++.Xr archive_write_set_options 3ARCHIVE
+ interface to specify which keywords should be included in the
+ output.
+ If libarchive was compiled with access to suitable
[email protected]@ -425,7 +423,4 @@
+ .Xr shar 1 ,
+ .Xr tar 1 ,
+ .Xr zip 1 ,
+-.Xr zlib 3 ,
+-.Xr cpio 5 ,
+-.Xr mtree 5 ,
+-.Xr tar 5
++.Xr zlib 3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/patches/libarchive-libarchive.3.patch	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,100 @@
+This patch is needed to convert BSD-style section numbers to Solaris-style
+section numbers.  It has not been fed back to the upstream community.  It
+may need to be tweaked slightly for future releases.
+
+--- libarchive/libarchive/libarchive.3.orig	Mon Mar 26 19:49:00 2012
++++ libarchive/libarchive/libarchive.3	Fri Nov  9 12:43:07 2012
[email protected]@ -25,7 +25,7 @@
+ .\" $FreeBSD$
+ .\"
+ .Dd March 18, 2012
+-.Dt LIBARCHIVE 3
++.Dt LIBARCHIVE 3LIB
+ .Os
+ .Sh NAME
+ .Nm libarchive
[email protected]@ -146,21 +146,21 @@
+ .\"
+ .Sh READING AN ARCHIVE
+ See
+-.Xr libarchive_read 3 .
++.Xr libarchive_read 3ARCHIVE .
+ .\"
+ .Sh WRITING AN ARCHIVE
+ See
+-.Xr libarchive_write 3 .
++.Xr libarchive_write 3ARCHIVE .
+ .\"
+ .Sh WRITING ENTRIES TO DISK
+ The
+-.Xr archive_write_disk 3
++.Xr archive_write_disk 3ARCHIVE
+ API allows you to write
+-.Xr archive_entry 3
++.Xr archive_entry 3ARCHIVE
+ objects to disk using the same API used by
+-.Xr archive_write 3 .
++.Xr archive_write 3ARCHIVE .
+ The
+-.Xr archive_write_disk 3
++.Xr archive_write_disk 3ARCHIVE
+ API is used internally by
+ .Fn archive_read_extract ;
+ using it directly can provide greater control over how entries
[email protected]@ -170,9 +170,9 @@
+ operations.
+ .Sh READING ENTRIES FROM DISK
+ The
+-.Xr archive_read_disk 3
++.Xr archive_read_disk 3ARCHIVE
+ supports for populating
+-.Xr archive_entry 3
++.Xr archive_entry 3ARCHIVE
+ objects from information in the filesystem.
+ This includes the information accessible from the
+ .Xr stat 2
[email protected]@ -179,12 +179,12 @@
+ system call as well as ACLs, extended attributes,
+ and other metadata.
+ The
+-.Xr archive_read_disk 3
++.Xr archive_read_disk 3ARCHIVE
+ API also supports iterating over directory trees,
+ which allows directories of files to be read using
+ an API compatible with
+ the
+-.Xr archive_read 3
++.Xr archive_read 3ARCHIVE
+ API.
+ .Sh DESCRIPTION
+ Detailed descriptions of each function are provided by the
[email protected]@ -199,7 +199,7 @@
+ structure contains a complete description of a single archive
+ entry.
+ It uses an opaque interface that is fully documented in
+-.Xr archive_entry 3 .
++.Xr archive_entry 3ARCHIVE .
+ .Pp
+ Users familiar with historic formats should be aware that the newer
+ variants have eliminated most restrictions on the length of textual fields.
[email protected]@ -247,15 +247,14 @@
+ functions can be used to obtain more information.
+ .Sh ENVIRONMENT
+ There are character set conversions within the
+-.Xr archive_entry 3
++.Xr archive_entry 3ARCHIVE
+ functions that are impacted by the currently-selected locale.
+ .Sh SEE ALSO
+ .Xr tar 1 ,
+-.Xr archive_entry 3 ,
+-.Xr archive_read 3 ,
+-.Xr archive_util 3 ,
+-.Xr archive_write 3 ,
+-.Xr tar 5
++.Xr archive_entry 3ARCHIVE ,
++.Xr archive_read 3ARCHIVE ,
++.Xr archive_util 3ARCHIVE ,
++.Xr archive_write 3ARCHIVE
+ .Sh HISTORY
+ The
+ .Nm libarchive
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libarchive/resolve.deps	Mon Jun 17 14:23:50 2013 -0700
@@ -0,0 +1,6 @@
+compress/bzip2
+compress/xz
+library/libxml2
+library/security/openssl
+library/zlib
+system/library