diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2010-03-07 18:18:34 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2010-03-07 18:18:34 +0000 |
commit | df061f167da20abc6ce37cee027c7dc642ef400c (patch) | |
tree | 51f4a23ef389df8f7ebcec16280cc1ac7b107c65 /app-arch | |
parent | building shared libs now, keyworded for *-linux, tested by me (diff) | |
download | gentoo-2-df061f167da20abc6ce37cee027c7dc642ef400c.tar.gz gentoo-2-df061f167da20abc6ce37cee027c7dc642ef400c.tar.bz2 gentoo-2-df061f167da20abc6ce37cee027c7dc642ef400c.zip |
Version bump, add a patch to fix handling of OpenSSL checks.
(Portage version: 2.2_rc65/cvs/Linux x86_64)
Diffstat (limited to 'app-arch')
-rw-r--r-- | app-arch/libarchive/ChangeLog | 12 | ||||
-rw-r--r-- | app-arch/libarchive/files/libarchive-2.6.0-nolibs.patch | 38 | ||||
-rw-r--r-- | app-arch/libarchive/files/libarchive-2.6.1-headers.patch | 20 | ||||
-rw-r--r-- | app-arch/libarchive/files/libarchive-2.7.0-fortified-sources.patch | 27 | ||||
-rw-r--r-- | app-arch/libarchive/files/libarchive-2.7.0-pipe.patch | 113 | ||||
-rw-r--r-- | app-arch/libarchive/files/libarchive-2.8.1+openssl.patch | 66 | ||||
-rw-r--r-- | app-arch/libarchive/libarchive-2.8.1.ebuild | 92 |
7 files changed, 169 insertions, 199 deletions
diff --git a/app-arch/libarchive/ChangeLog b/app-arch/libarchive/ChangeLog index 784fd6c5b599..478048b9d8a9 100644 --- a/app-arch/libarchive/ChangeLog +++ b/app-arch/libarchive/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for app-arch/libarchive # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-arch/libarchive/ChangeLog,v 1.77 2010/02/09 14:28:12 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-arch/libarchive/ChangeLog,v 1.78 2010/03/07 18:18:32 flameeyes Exp $ + +*libarchive-2.8.1 (07 Mar 2010) + + 07 Mar 2010; Diego E. Pettenò <flameeyes@gentoo.org> + -files/libarchive-2.6.0-nolibs.patch, + -files/libarchive-2.6.1-headers.patch, + -files/libarchive-2.7.0-fortified-sources.patch, + -files/libarchive-2.7.0-pipe.patch, +libarchive-2.8.1.ebuild, + +files/libarchive-2.8.1+openssl.patch: + Version bump, add a patch to fix handling of OpenSSL checks. *libarchive-2.8.0 (09 Feb 2010) diff --git a/app-arch/libarchive/files/libarchive-2.6.0-nolibs.patch b/app-arch/libarchive/files/libarchive-2.6.0-nolibs.patch deleted file mode 100644 index 28d2fbc3710e..000000000000 --- a/app-arch/libarchive/files/libarchive-2.6.0-nolibs.patch +++ /dev/null @@ -1,38 +0,0 @@ -Patch from bug #253284 thanks to Lifong Sun - -diff -urN a/cpio/cpio.c b/cpio/cpio.c ---- a/cpio/cpio.c 2008-12-29 04:08:16.000000000 +0800 -+++ b/cpio/cpio.c 2009-01-01 22:23:06.000000000 +0800 -@@ -321,7 +321,15 @@ - "Common Options:\n" - " -v Verbose\n" - "Create: %p -o [options] < [list of files] > [archive]\n" -+#ifdef HAVE_BZLIB_H -+#ifdef HAVE_ZLIB_H - " -z, -y Compress archive with gzip/bzip2\n" -+#else -+ " -y Compress archive with bzip2\n" -+#endif -+#elif defined HAVE_ZLIB_H -+ " -z Compress archive with gzip\n" -+#endif - " --format {odc|newc|ustar} Select archive format\n" - "List: %p -it < [archive]\n" - "Extract: %p -i [options] < [archive]\n"; -@@ -387,12 +395,16 @@ - if (cpio->archive == NULL) - cpio_errc(1, 0, "Failed to allocate archive object"); - switch (cpio->compress) { -+#ifdef HAVE_BZLIB_H - case 'j': case 'y': - archive_write_set_compression_bzip2(cpio->archive); - break; -+#endif -+#ifdef HAVE_ZLIB_H - case 'z': - archive_write_set_compression_gzip(cpio->archive); - break; -+#endif - case 'Z': - archive_write_set_compression_compress(cpio->archive); - break; diff --git a/app-arch/libarchive/files/libarchive-2.6.1-headers.patch b/app-arch/libarchive/files/libarchive-2.6.1-headers.patch deleted file mode 100644 index 059df5fc4ff9..000000000000 --- a/app-arch/libarchive/files/libarchive-2.6.1-headers.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/.libs/bsdcpio b/.libs/bsdcpio -index 765bdfa..0cfa0f2 100755 -Binary files a/.libs/bsdcpio and b/.libs/bsdcpio differ -diff --git a/cpio/bsdcpio-cpio.o b/cpio/bsdcpio-cpio.o -index 691d75e..c17a703 100644 -Binary files a/cpio/bsdcpio-cpio.o and b/cpio/bsdcpio-cpio.o differ -diff --git a/cpio/cpio.c b/cpio/cpio.c -index 50bc997..1484582 100644 ---- a/cpio/cpio.c -+++ b/cpio/cpio.c -@@ -60,6 +60,9 @@ __FBSDID("$FreeBSD: src/usr.bin/cpio/cpio.c,v 1.15 2008/12/06 07:30:40 kientzle - #ifdef HAVE_UNISTD_H - #include <unistd.h> - #endif -+#ifdef HAVE_SYS_TIME_H -+#include <sys/time.h> -+#endif - - #include "cpio.h" - #include "matching.h" diff --git a/app-arch/libarchive/files/libarchive-2.7.0-fortified-sources.patch b/app-arch/libarchive/files/libarchive-2.7.0-fortified-sources.patch deleted file mode 100644 index 34c7b844905f..000000000000 --- a/app-arch/libarchive/files/libarchive-2.7.0-fortified-sources.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 8f08a4f3c67746fce484f0666e1828988ef72303 Mon Sep 17 00:00:00 2001 -From: =?utf-8?q?Diego=20Elio=20'Flameeyes'=20Petten=C3=B2?= <flameeyes@gmail.com> -Date: Fri, 17 Apr 2009 00:47:02 +0200 -Subject: [PATCH 2/2] Make sure to use the mode parameter of open(2). - -With _FORTIFY_SOURCE=2 on recent glibc versions, using open(2) with O_CREAT -and no mode parameter causes a build failure. Avoid this. ---- - libarchive/test/test_write_disk_failures.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/libarchive/test/test_write_disk_failures.c b/libarchive/test/test_write_disk_failures.c -index c0e1f8f..c9dc824 100644 ---- a/libarchive/test/test_write_disk_failures.c -+++ b/libarchive/test/test_write_disk_failures.c -@@ -48,7 +48,7 @@ DEFINE_TEST(test_write_disk_failures) - assertEqualInt(0, mkdir("dir", 0555)); - - /* Can we? */ -- fd = open("dir/testfile", O_WRONLY | O_CREAT); -+ fd = open("dir/testfile", O_WRONLY | O_CREAT, 0777); - if (fd >= 0) { - /* Apparently, we can, so the test below won't work. */ - close(fd); --- -1.6.2.3 - diff --git a/app-arch/libarchive/files/libarchive-2.7.0-pipe.patch b/app-arch/libarchive/files/libarchive-2.7.0-pipe.patch deleted file mode 100644 index 3b872b5ae534..000000000000 --- a/app-arch/libarchive/files/libarchive-2.7.0-pipe.patch +++ /dev/null @@ -1,113 +0,0 @@ ---- head/lib/libarchive/archive_read_open_filename.c 2009/05/07 21:51:13 191903 -+++ head/lib/libarchive/archive_read_open_filename.c 2009/05/07 23:01:03 191904 -@@ -85,19 +85,31 @@ - int fd; - -- if (filename == NULL || filename[0] == '\0') -- return (archive_read_open_fd(a, 0, block_size)); -- -- fd = open(filename, O_RDONLY | O_BINARY); -- if (fd < 0) { -- archive_set_error(a, errno, "Failed to open '%s'", filename); -- return (ARCHIVE_FATAL); -+ if (filename == NULL || filename[0] == '\0') { -+ /* We used to invoke archive_read_open_fd(a,0,block_size) -+ * here, but that doesn't (and shouldn't) handle the -+ * end-of-file flush when reading stdout from a pipe. -+ * Basically, read_open_fd() is intended for folks who -+ * are willing to handle such details themselves. This -+ * API is intended to be a little smarter for folks who -+ * want easy handling of the common case. -+ */ -+ filename = ""; /* Normalize NULL to "" */ -+ fd = 0; -+ } else { -+ fd = open(filename, O_RDONLY | O_BINARY); -+ if (fd < 0) { -+ archive_set_error(a, errno, -+ "Failed to open '%s'", filename); -+ return (ARCHIVE_FATAL); -+ } - } - if (fstat(fd, &st) != 0) { - archive_set_error(a, errno, "Can't stat '%s'", filename); - return (ARCHIVE_FATAL); - } - -- mine = (struct read_file_data *)malloc(sizeof(*mine) + strlen(filename)); -+ mine = (struct read_file_data *)calloc(1, -+ sizeof(*mine) + strlen(filename)); - b = malloc(block_size); - if (mine == NULL || b == NULL) { - archive_set_error(a, ENOMEM, "No memory"); -@@ -117,15 +129,20 @@ - if (S_ISREG(st.st_mode)) { - archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino); - /* -- * Skip is a performance optimization for anything -- * that supports lseek(). Generally, that only -- * includes regular files and possibly raw disk -- * devices, but there's no good portable way to detect -- * raw disks. -+ * Enabling skip here is a performance optimization -+ * for anything that supports lseek(). On FreeBSD -+ * (and probably many other systems), only regular -+ * files and raw disk devices support lseek() (on -+ * other input types, lseek() returns success but -+ * doesn't actually change the file pointer, which -+ * just completely screws up the position-tracking -+ * logic). In addition, I've yet to find a portable -+ * way to determine if a device is a raw disk device. -+ * So I don't see a way to do much better than to only -+ * enable this optimization for regular files. - */ - mine->can_skip = 1; -- } else -- mine->can_skip = 0; -+ } - return (archive_read_open2(a, mine, - NULL, file_read, file_skip, file_close)); - } -@@ -139,8 +156,11 @@ - *buff = mine->buffer; - bytes_read = read(mine->fd, mine->buffer, mine->block_size); - if (bytes_read < 0) { -- archive_set_error(a, errno, "Error reading '%s'", -- mine->filename); -+ if (mine->filename[0] == '\0') -+ archive_set_error(a, errno, "Error reading stdin"); -+ else -+ archive_set_error(a, errno, "Error reading '%s'", -+ mine->filename); - } - return (bytes_read); - } -@@ -190,8 +210,15 @@ - * likely caused by a programmer error (too large request) - * or a corrupted archive file. - */ -- archive_set_error(a, errno, "Error seeking in '%s'", -- mine->filename); -+ if (mine->filename[0] == '\0') -+ /* -+ * Should never get here, since lseek() on stdin ought -+ * to return an ESPIPE error. -+ */ -+ archive_set_error(a, errno, "Error seeking in stdin"); -+ else -+ archive_set_error(a, errno, "Error seeking in '%s'", -+ mine->filename); - return (-1); - } - return (new_offset - old_offset); -@@ -225,7 +252,9 @@ - mine->block_size); - } while (bytesRead > 0); - } -- close(mine->fd); -+ /* If a named file was opened, then it needs to be closed. */ -+ if (mine->filename[0] != '\0') -+ close(mine->fd); - } - free(mine->buffer); - free(mine); diff --git a/app-arch/libarchive/files/libarchive-2.8.1+openssl.patch b/app-arch/libarchive/files/libarchive-2.8.1+openssl.patch new file mode 100644 index 000000000000..895fcbcd564a --- /dev/null +++ b/app-arch/libarchive/files/libarchive-2.8.1+openssl.patch @@ -0,0 +1,66 @@ +commit 18311d1be81d93350a406b641d501e3ced5a2662 +Author: joerg.sonnenberger <joerg.sonnenberger@2e22974a-a639-11dd-bc7a-dd6b2ed99ab5> +Date: Sun Feb 21 14:23:09 2010 +0000 + + Improve detection of SHA2 functions in OpenSSL to deal with ancient + versions like in Mac OS X and FreeBSD 6.x. Fixes #65 and should fix #55. + + + git-svn-id: http://libarchive.googlecode.com/svn/trunk@1940 2e22974a-a639-11dd-bc7a-dd6b2ed99ab5 + +diff --git a/configure.ac b/configure.ac +index 45960ad..921ed87 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -281,30 +281,34 @@ if test "x$with_openssl" != "xno"; then + AC_CHECK_HEADERS([openssl/sha.h]) + AC_SEARCH_LIBS([SHA1_Init], [crypto]) + fi +- if test "$ac_cv_func_SHA256Init" != "yes" || +- test "$ac_cv_func_SHA384Init" != "yes" || +- test "$ac_cv_func_SHA512Init" != "yes"; then +- if test "$ac_cv_func_SHA256_Init" != "yes" || +- test "$ac_cv_func_SHA384_Init" != "yes" || +- test "$ac_cv_func_SHA512_Init" != "yes"; then +- AC_CHECK_HEADERS([openssl/sha.h]) +- # TODO: Does AC_SEARCH_LIBS support more than one function at once? +- # This appears to always fail. +- AC_SEARCH_LIBS([SHA256_Init SHA384_Init SHA512_Init], [crypto]) +- +- # TODO: Actually test for these. Previously our C code did not +- # test for these at all and just assumed availability. Now that +- # the C code tests these macros we preserve previous behavior +- # for the autotools build by hard-coding availability. +- if test "$ac_cv_header_openssl_sha_h" = "yes"; then ++ ++ AC_CHECK_HEADERS([openssl/sha.h]) ++ if test "$ac_cv_func_SHA256Init" != "yes" && ++ test "$ac_cv_func_SHA256_Init" != "yes"; then ++ AC_SEARCH_LIBS([SHA256_Init], [crypto]) ++ if test "$ac_cv_func_SHA256_Init" = "yes" && ++ test "$ac_cv_header_openssl_sha_h" = "yes"; then + AC_DEFINE(HAVE_OPENSSL_SHA256_INIT, 1, + [Define to 1 if your openssl has the `SHA256_Init' function.]) ++ fi ++ fi ++ if test "$ac_cv_func_SHA384Init" != "yes" && ++ test "$ac_cv_func_SHA384_Init" != "yes"; then ++ AC_SEARCH_LIBS([SHA384_Init], [crypto]) ++ if test "$ac_cv_func_SHA384_Init" = "yes" && ++ test "$ac_cv_header_openssl_sha_h" = "yes"; then + AC_DEFINE(HAVE_OPENSSL_SHA384_INIT, 1, + [Define to 1 if your openssl has the `SHA384_Init' function.]) ++ fi ++ fi ++ if test "$ac_cv_func_SHA512Init" != "yes" && ++ test "$ac_cv_func_SHA512_Init" != "yes"; then ++ AC_SEARCH_LIBS([SHA512_Init], [crypto]) ++ if test "$ac_cv_func_SHA512_Init" = "yes" && ++ test "$ac_cv_header_openssl_sha_h" = "yes"; then + AC_DEFINE(HAVE_OPENSSL_SHA512_INIT, 1, + [Define to 1 if your openssl has the `SHA512_Init' function.]) + fi +- fi + fi + fi + diff --git a/app-arch/libarchive/libarchive-2.8.1.ebuild b/app-arch/libarchive/libarchive-2.8.1.ebuild new file mode 100644 index 000000000000..15550e007302 --- /dev/null +++ b/app-arch/libarchive/libarchive-2.8.1.ebuild @@ -0,0 +1,92 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-arch/libarchive/libarchive-2.8.1.ebuild,v 1.1 2010/03/07 18:18:32 flameeyes Exp $ + +EAPI="2" + +inherit eutils libtool toolchain-funcs flag-o-matic autotools + +DESCRIPTION="BSD tar command" +HOMEPAGE="http://people.freebsd.org/~kientzle/libarchive" +SRC_URI="http://${PN}.googlecode.com/files/${P}.tar.gz + http://people.freebsd.org/~kientzle/libarchive/src/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" +IUSE="static static-libs acl xattr kernel_linux +bzip2 +lzma +zlib" + +COMPRESS_LIBS_DEPEND="lzma? ( app-arch/xz-utils ) + bzip2? ( app-arch/bzip2 ) + zlib? ( sys-libs/zlib )" + +RDEPEND="!dev-libs/libarchive + dev-libs/openssl + acl? ( virtual/acl ) + xattr? ( kernel_linux? ( sys-apps/attr ) ) + !static? ( ${COMPRESS_LIBS_DEPEND} )" +DEPEND="${RDEPEND} + ${COMPRESS_LIBS_DEPEND} + kernel_linux? ( sys-fs/e2fsprogs + virtual/os-headers )" + +src_prepare() { + epatch "${FILESDIR}/${P}+openssl.patch" + eautoreconf + elibtoolize + epunt_cxx +} + +src_configure() { + local myconf + + if ! use static ; then + myconf="--enable-bsdtar=shared --enable-bsdcpio=shared" + fi + + # force static libs for static binaries + if use static && ! use static-libs; then + myconf="${myconf} --enable-static" + fi + + # Check for need of this in 2.7.1 and later, on 2.7.0, -Werror was + # added to the final release, but since it's done in the + # Makefile.am we can just work it around this way. + append-flags -Wno-error + + # We disable lzmadec because we support the newer liblzma from xz-utils + # and not liblzmadec with this version. + econf --bindir=/bin \ + --enable-bsdtar --enable-bsdcpio \ + $(use_enable acl) $(use_enable xattr) \ + $(use_with zlib) \ + $(use_with bzip2 bz2lib) $(use_with lzma) \ + $(use_enable static-libs static) \ + --without-lzmadec \ + ${myconf} \ + --disable-dependency-tracking || die "econf failed." +} + +src_test() { + # Replace the default src_test so that it builds tests in parallel + emake check || die "tests failed" +} + +src_install() { + emake DESTDIR="${D}" install || die "emake install failed." + + # remove useless .a and .la files (only for non static compilation) + use static-libs || find "${D}" \( -name '*.a' -or -name '*.la' \) -delete + + # Create tar symlink for FreeBSD + if [[ ${CHOST} == *-freebsd* ]]; then + dosym bsdtar /bin/tar + dosym bsdtar.1 /usr/share/man/man1/tar.1 + # We may wish to switch to symlink bsdcpio to cpio too one day + fi + + dodoc NEWS README + dodir /$(get_libdir) + mv "${D}"/usr/$(get_libdir)/*.so* "${D}"/$(get_libdir) + gen_usr_ldscript libarchive.so +} |