summaryrefslogtreecommitdiff
path: root/app-arch/bzip2
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-arch/bzip2
reinit the tree, so we can have metadata
Diffstat (limited to 'app-arch/bzip2')
-rw-r--r--app-arch/bzip2/Manifest14
-rw-r--r--app-arch/bzip2/bzip2-1.0.6-r8.ebuild114
-rw-r--r--app-arch/bzip2/files/bzip2-1.0.3-no-test.patch9
-rw-r--r--app-arch/bzip2/files/bzip2-1.0.4-POSIX-shell.patch21
-rw-r--r--app-arch/bzip2/files/bzip2-1.0.4-makefile-CFLAGS.patch25
-rw-r--r--app-arch/bzip2/files/bzip2-1.0.4-man-links.patch12
-rw-r--r--app-arch/bzip2/files/bzip2-1.0.6-CVE-2016-3189.patch18
-rw-r--r--app-arch/bzip2/files/bzip2-1.0.6-mingw.patch27
-rw-r--r--app-arch/bzip2/files/bzip2-1.0.6-out-of-tree-build.patch79
-rw-r--r--app-arch/bzip2/files/bzip2-1.0.6-progress.patch163
-rw-r--r--app-arch/bzip2/files/bzip2-1.0.6-saneso.patch13
-rw-r--r--app-arch/bzip2/metadata.xml11
12 files changed, 506 insertions, 0 deletions
diff --git a/app-arch/bzip2/Manifest b/app-arch/bzip2/Manifest
new file mode 100644
index 000000000000..8e12bdc7f07d
--- /dev/null
+++ b/app-arch/bzip2/Manifest
@@ -0,0 +1,14 @@
+AUX bzip2-1.0.3-no-test.patch 161 SHA256 806dcb0f9f46a2b0b3ef04212405708198a25e281617e27a44c565948c159a49 SHA512 a07f04189bce8a53980f324769cc8eb79eed9e42cbed223b74f566802e61eacb45e677c122266689a654d4fc946cba4a2171c72be87f98e4996c6cde5cb0c462 WHIRLPOOL bf32302ea76029ca01c07e70024460ab8cde0c4db84ebad1b0fe66717f465f515b96c70fe67fb7d0f48233e3bd883f77dc83c489e8a0418c982ff416e66c1c11
+AUX bzip2-1.0.4-POSIX-shell.patch 672 SHA256 34bc42c1d6c980e0970a517c9602b904efb2f676ec191e80fcbcd185ccb6b1fe SHA512 7fc5e34ac2fccb7e096bafa6dd934fb72375c17e0cfa3e0549648ecc82ec44521eb8f8ac3ce49a4064ee67fa9319da9e52db86a971443956f71d11c056289d19 WHIRLPOOL 42d9a3b0ac26fc59ee74fa5fb1b7f74a6c4cebab13100ed1165e6d8d40bddfc58425b0a3018f6e6216789fad498e25419199c020df24197a8ca5730ccb2d8e36
+AUX bzip2-1.0.4-makefile-CFLAGS.patch 569 SHA256 853621ae207f0115210e06f738d4e79861110712823419707875116cb45b105e SHA512 5ad3ecad8b577737386f0e5fc6f9adfd72334598b6dc76755cab6e38611b048c5c6b97462cbca48237a95802e1e2ac0de34b03d579d737edda8eea3e6a31346e WHIRLPOOL f4906ca56ce15b6ea18fccbc745c18858458ac2ecf6d2f1cb57de710ce5888d567dfed1dc34048cf1909d3d9f66a7c3b356bec0ee02674924669e7d717e2e6e2
+AUX bzip2-1.0.4-man-links.patch 422 SHA256 03e6ba8a87a8abcf6bb02c0e44186e4b20b8dc871ac2d4921cfc3c9ea616e971 SHA512 7c650620dc11522c4d8bd17a55da18ab3f8556cf83452459e86bceecf33a5de39b8e05e23eb11c4c8dffa79cc8d23d54741ccc8bc715dea2e108f5f3c8dde20c WHIRLPOOL 33a67aec4d7f668f401e920a9c97d9715535bbe774d0fb4b0baa12f023215081904995a22dc8eaa5708c7e1b736738164055c9e77d188650ad61fe99abcaf8d1
+AUX bzip2-1.0.6-CVE-2016-3189.patch 619 SHA256 2ad8ead7e43cb584ea5c1df737394a8ca56ea3cac504756361e507dc5a263325 SHA512 ec8ec21ff795f4caafc7dab727280836894058a7c85e2a094033d71d4b0cdced108a371f15d423f49248707e3eb95303eeb40cb50c96cd136fe7cbf038e628a8 WHIRLPOOL 66d25f99b071ebe97b8ca012a8c40b5895da6a793254bcebc0058afdabac009d65a4f2d4bc42f45bf74695908bbb65e7e53a8070f623b61f6ad521f0d8d8c924
+AUX bzip2-1.0.6-mingw.patch 556 SHA256 8da568f1d7daac4ac6b9d7946dd3b807e062b5a1710a2548029cc4f158e8d717 SHA512 e28442acc456c996eb6bc1866cd3814a9aea9c8a4ac2767a59bd03273ee95e34efdb4d00a17c64242a3395056b38c7083ec6f4c986e91d02f5348af1af2a35c8 WHIRLPOOL 66cbedef7eef3b4890a56dd0aad28529960c2e205fc7809ded96dd7ece17cdd3f18d92eeca25e009f2ca3689f9ad2d2bf81238562078d4147d87124107ac41af
+AUX bzip2-1.0.6-out-of-tree-build.patch 2121 SHA256 2dd4db48de0a3b1a927725640ad4f56e90d68c33ea3cea9ff0dab7bdb8f7ccc1 SHA512 f4a85c8b9ba0fe0ffadcb058550bb948e84c51f4c213957ffeb1072258efb1caa957c496ce0a0fb4d4b5f7dfdf062995a819487b9475389cfb25583fa061143e WHIRLPOOL 18491f4d99ef866154379112d4c0b840bf6960a116cb03c338aa132cb5440f8cfec8a0933460794902e11b2c0cc13edd99aefc424d3d0f91e4b30d221230ff56
+AUX bzip2-1.0.6-progress.patch 5756 SHA256 f93e6b50082a8e880ee8436c7ec6a65a8f01e9282436af77f95bb259b1c7f7f7 SHA512 c3f5959027346a471182fbcac72fe3b755d9327557ac31fd8d36746c643afd418f5a59bf434493109af4536b90e69220e985a25eb3ce7e3d05029583a9d0bcdc WHIRLPOOL 830dab52ec0efd50a0266863dec0180e40db7ef519cd5c02991bc12fb978bb5df5d0329ede896aff02fc2abbfa09c4380949c8f5eb48a9ccbb562675fa5d2003
+AUX bzip2-1.0.6-saneso.patch 439 SHA256 8345a9fcfce28a459a12126748ac27480a384e80974c31d9fae752d818ea05d9 SHA512 4f5d499227e3381e87c43b4afa48b5cd1f796142805dee19bf7f9f3a8547ca5baaf0b1d1f42079a61b63e3c279650292cca119e7d177ad04425c93e23f1bbd88 WHIRLPOOL 35d83bd455116a1121c87675bf0ceda0e37ac48a76a1379d0455e39026b1445c3d90493923ee1c4c49f3cc388c8344b8a4379d6c44e01564d658ebd22c3a5a10
+DIST bzip2-1.0.6.tar.gz 782025 SHA256 a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd SHA512 00ace5438cfa0c577e5f578d8a808613187eff5217c35164ffe044fbafdfec9e98f4192c02a7d67e01e5a5ccced630583ad1003c37697219b0f147343a3fdd12 WHIRLPOOL 8e92c24f77c3711f5103a26d6fefbe61fe49a7d1e46879d259d46347c606ca956b7228ab011aa88007db771f86a500d4954057c7f9c70bd8380ca6c9430bd81e
+EBUILD bzip2-1.0.6-r8.ebuild 3028 SHA256 a63ec5bf15ea68ed8e1d344960013efd8ceaca9ad99735f97dcd4f0d0c92b739 SHA512 ac44c1e7919af1e855f191260e520133d275c07139c9bea74bbc289e2bd818584a4f2132826b9b99829ad199f6b10278e764e0e62d76c5eb791672ec9eff2ea8 WHIRLPOOL 70df293a937d6b3738ae9c5e14685c365cfe3ce59a51cfaac20363750594d2bb8632c15cf5a0ab797c906564149af8f1001b1a01bb994d9dc4aba3828cb36a9a
+MISC ChangeLog 4457 SHA256 bf4140b18998985ad2ba1549e40a5b8459264e460849e99c0646bd6bb6c3d8b7 SHA512 df831d1a011429a033ad40f71ba909ee12a6eb6222b4862c75bda2fee714bd7a8cfbe8577fa212a6382e032c15753bbdc1b7858c1bfa6787082a3f790a72830b WHIRLPOOL abe5cf62a84af9b533bbf3a9e51d4937604edc955326f78072db8176fda9f99d754e08e0a0525bf46e966d33c5dd9fb6e8ed7db025ab5f29988c5be11566d794
+MISC ChangeLog-2015 18677 SHA256 b21e44cabf4e85755a407d69b76a5887bb6634f4ff1597f93d7c6cf67c92f7d6 SHA512 c32fbab48cf636d137ada557532fd70d62fc907be097001f4d4e86bde2e765654bf3aae56d4fb97d6a8e98a1501abc58e665291666d655b926ff5ca4a09a6efc WHIRLPOOL 5a4e135b0a86975c193d7984869e7d7d5b57ffa56ed4895f7557541945b8b60cbec65ea1482b3bfc4f96727cc3b3dccf0b74f00c78244a74cdf2c43d550daf2d
+MISC metadata.xml 332 SHA256 6167ecfa860cfcb3d79a8191ca49affd1b7bbbe399fa9857865a5268861a504a SHA512 1a7f730b73728875e428e7b123cd8e7773e8ea88a02d6891727775b50196854c608ae541846063a258874a83aab38800dc697b37196fe1c75162abe21b8f92d0 WHIRLPOOL ea4e55d4bc5f7518feef174952bee5e77c59f7eaf79e1b27b74e57ec042a121b477e15ca4f0669c5688b377e31010a7d2c6fccd59e5e2f060621a5beaf4d7674
diff --git a/app-arch/bzip2/bzip2-1.0.6-r8.ebuild b/app-arch/bzip2/bzip2-1.0.6-r8.ebuild
new file mode 100644
index 000000000000..5b555febf72c
--- /dev/null
+++ b/app-arch/bzip2/bzip2-1.0.6-r8.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# XXX: atm, libbz2.a is always PIC :(, so it is always built quickly
+# (since we're building shared libs) ...
+
+EAPI=5
+
+inherit eutils toolchain-funcs multilib multilib-minimal
+
+DESCRIPTION="A high-quality data compressor used extensively by Gentoo Linux"
+HOMEPAGE="http://www.bzip.org/"
+SRC_URI="http://www.bzip.org/${PV}/${P}.tar.gz"
+
+LICENSE="BZIP2"
+SLOT="0/1" # subslot = SONAME
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="static static-libs"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.0.4-makefile-CFLAGS.patch
+ "${FILESDIR}"/${PN}-1.0.6-saneso.patch
+ "${FILESDIR}"/${PN}-1.0.4-man-links.patch #172986
+ "${FILESDIR}"/${PN}-1.0.6-progress.patch
+ "${FILESDIR}"/${PN}-1.0.3-no-test.patch
+ "${FILESDIR}"/${PN}-1.0.4-POSIX-shell.patch #193365
+ "${FILESDIR}"/${PN}-1.0.6-mingw.patch #393573
+ "${FILESDIR}"/${PN}-1.0.6-out-of-tree-build.patch
+ "${FILESDIR}"/${PN}-1.0.6-CVE-2016-3189.patch #620466
+)
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+
+ # - Use right man path
+ # - Generate symlinks instead of hardlinks
+ # - pass custom variables to control libdir
+ sed -i \
+ -e 's:\$(PREFIX)/man:\$(PREFIX)/share/man:g' \
+ -e 's:ln -s -f $(PREFIX)/bin/:ln -s -f :' \
+ -e 's:$(PREFIX)/lib:$(PREFIX)/$(LIBDIR):g' \
+ Makefile || die
+}
+
+bemake() {
+ emake \
+ VPATH="${S}" \
+ CC="$(tc-getCC)" \
+ AR="$(tc-getAR)" \
+ RANLIB="$(tc-getRANLIB)" \
+ "$@"
+}
+
+multilib_src_compile() {
+ bemake -f "${S}"/Makefile-libbz2_so all
+ # Make sure we link against the shared lib #504648
+ ln -sf libbz2.so.${PV} libbz2.so
+ bemake -f "${S}"/Makefile all LDFLAGS="${LDFLAGS} $(usex static -static '')"
+}
+
+multilib_src_install() {
+ into /usr
+
+ # Install the shared lib manually. We install:
+ # .x.x.x - standard shared lib behavior
+ # .x.x - SONAME some distros use #338321
+ # .x - SONAME Gentoo uses
+ dolib.so libbz2.so.${PV}
+ local v
+ for v in libbz2.so{,.{${PV%%.*},${PV%.*}}} ; do
+ dosym libbz2.so.${PV} /usr/$(get_libdir)/${v}
+ done
+ use static-libs && dolib.a libbz2.a
+
+ if multilib_is_native_abi ; then
+ gen_usr_ldscript -a bz2
+
+ dobin bzip2recover
+ into /
+ dobin bzip2
+ fi
+}
+
+multilib_src_install_all() {
+ # `make install` doesn't cope with out-of-tree builds, nor with
+ # installing just non-binaries, so handle things ourselves.
+ insinto /usr/include
+ doins bzlib.h
+ into /usr
+ dobin bz{diff,grep,more}
+ doman *.1
+
+ dosym bzdiff /usr/bin/bzcmp
+ dosym bzdiff.1 /usr/share/man/man1/bzcmp.1
+
+ dosym bzmore /usr/bin/bzless
+ dosym bzmore.1 /usr/share/man/man1/bzless.1
+
+ local x
+ for x in bunzip2 bzcat bzip2recover ; do
+ dosym bzip2.1 /usr/share/man/man1/${x}.1
+ done
+ for x in bz{e,f}grep ; do
+ dosym bzgrep /usr/bin/${x}
+ dosym bzgrep.1 /usr/share/man/man1/${x}.1
+ done
+
+ dodoc README* CHANGES manual.pdf
+ dohtml manual.html
+
+ # move "important" bzip2 binaries to /bin and use the shared libbz2.so
+ dosym bzip2 /bin/bzcat
+ dosym bzip2 /bin/bunzip2
+}
diff --git a/app-arch/bzip2/files/bzip2-1.0.3-no-test.patch b/app-arch/bzip2/files/bzip2-1.0.3-no-test.patch
new file mode 100644
index 000000000000..672c89dfbd20
--- /dev/null
+++ b/app-arch/bzip2/files/bzip2-1.0.3-no-test.patch
@@ -0,0 +1,9 @@
+--- Makefile
++++ Makefile
+@@ -23,5 +23,5 @@
+ bzlib.o
+
+-all: libbz2.a bzip2 bzip2recover test
++all: libbz2.a bzip2 bzip2recover
+
+ bzip2: libbz2.a bzip2.o
diff --git a/app-arch/bzip2/files/bzip2-1.0.4-POSIX-shell.patch b/app-arch/bzip2/files/bzip2-1.0.4-POSIX-shell.patch
new file mode 100644
index 000000000000..b31cc061db6f
--- /dev/null
+++ b/app-arch/bzip2/files/bzip2-1.0.4-POSIX-shell.patch
@@ -0,0 +1,21 @@
+bzgrep uses !/bin/sh but then uses the bashism ${var//} so replace those
+with calls to sed so POSIX shells work
+
+http://bugs.gentoo.org/193365
+
+--- bzgrep
++++ bzgrep
+@@ -63,10 +63,9 @@
+ bzip2 -cdfq "$i" | $grep $opt "$pat"
+ r=$?
+ else
+- j=${i//\\/\\\\}
+- j=${j//|/\\|}
+- j=${j//&/\\&}
+- j=`printf "%s" "$j" | tr '\n' ' '`
++ # the backslashes here are doubled up as we have to escape each one for the
++ # shell and then escape each one for the sed expression
++ j=`printf "%s" "${i}" | sed -e 's:\\\\:\\\\\\\\:g' -e 's:[|]:\\\\|:g' -e 's:[&]:\\\\&:g' | tr '\n' ' '`
+ bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
+ r=$?
+ fi
diff --git a/app-arch/bzip2/files/bzip2-1.0.4-makefile-CFLAGS.patch b/app-arch/bzip2/files/bzip2-1.0.4-makefile-CFLAGS.patch
new file mode 100644
index 000000000000..5a95ed68b2d0
--- /dev/null
+++ b/app-arch/bzip2/files/bzip2-1.0.4-makefile-CFLAGS.patch
@@ -0,0 +1,25 @@
+--- Makefile
++++ Makefile
+@@ -18,10 +18,9 @@
+ CC=gcc
+ AR=ar
+ RANLIB=ranlib
+-LDFLAGS=
+
+ BIGFILES=-D_FILE_OFFSET_BITS=64
+-CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
++CFLAGS+=-Wall -Winline $(BIGFILES) $(CPPFLAGS)
+
+ # Where you want it installed when you do 'make install'
+ PREFIX=/usr/local
+--- Makefile-libbz2_so
++++ Makefile-libbz2_so
+@@ -24,7 +24,7 @@
+ SHELL=/bin/sh
+ CC=gcc
+ BIGFILES=-D_FILE_OFFSET_BITS=64
+-CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES)
++CFLAGS+=-fpic -fPIC -Wall -Winline $(BIGFILES) $(CPPFLAGS)
+
+ OBJS= blocksort.o \
+ huffman.o \
diff --git a/app-arch/bzip2/files/bzip2-1.0.4-man-links.patch b/app-arch/bzip2/files/bzip2-1.0.4-man-links.patch
new file mode 100644
index 000000000000..308f5f9b3e89
--- /dev/null
+++ b/app-arch/bzip2/files/bzip2-1.0.4-man-links.patch
@@ -0,0 +1,12 @@
+http://bugs.gentoo.org/172986
+
+--- bzip2-1.0.4/Makefile
++++ bzip2-1.0.4/Makefile
+@@ -85,4 +85,7 @@
+ cp -f bzip2.1 $(PREFIX)/share/man/man1
+ chmod a+r $(PREFIX)/share/man/man1/bzip2.1
++ ln -s -f bzip2.1 $(PREFIX)/share/man/man1/bunzip2.1
++ ln -s -f bzip2.1 $(PREFIX)/share/man/man1/bzcat.1
++ ln -s -f bzip2.1 $(PREFIX)/share/man/man1/bzip2recover.1
+ cp -f bzlib.h $(PREFIX)/include
+ chmod a+r $(PREFIX)/include/bzlib.h
diff --git a/app-arch/bzip2/files/bzip2-1.0.6-CVE-2016-3189.patch b/app-arch/bzip2/files/bzip2-1.0.6-CVE-2016-3189.patch
new file mode 100644
index 000000000000..1d0c3a6dd34f
--- /dev/null
+++ b/app-arch/bzip2/files/bzip2-1.0.6-CVE-2016-3189.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Backport
+https://bugzilla.suse.com/attachment.cgi?id=681334
+
+CVE: CVE-2016-3189
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+Index: bzip2-1.0.6/bzip2recover.c
+===================================================================
+--- bzip2-1.0.6.orig/bzip2recover.c
++++ bzip2-1.0.6/bzip2recover.c
+@@ -457,6 +457,7 @@ Int32 main ( Int32 argc, Char** argv )
+ bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 );
+ bsPutUInt32 ( bsWr, blockCRC );
+ bsClose ( bsWr );
++ outFile = NULL;
+ }
+ if (wrBlock >= rbCtr) break;
+ wrBlock++;
diff --git a/app-arch/bzip2/files/bzip2-1.0.6-mingw.patch b/app-arch/bzip2/files/bzip2-1.0.6-mingw.patch
new file mode 100644
index 000000000000..51469ca4c96e
--- /dev/null
+++ b/app-arch/bzip2/files/bzip2-1.0.6-mingw.patch
@@ -0,0 +1,27 @@
+make it build for mingw targets
+
+https://bugs.gentoo.org/393573
+
+--- a/bzip2.c
++++ b/bzip2.c
+@@ -129,7 +129,7 @@
+ #if BZ_LCCWIN32
+ # include <io.h>
+ # include <fcntl.h>
+-# include <sys\stat.h>
++# include <sys/stat.h>
+
+ # define NORETURN /**/
+ # define PATH_SEP '\\'
+--- a/bzlib.h
++++ b/bzlib.h
+@@ -81,6 +81,9 @@ typedef
+ /* windows.h define small to char */
+ # undef small
+ # endif
++# ifndef WINAPI
++# define WINAPI
++# endif
+ # ifdef BZ_EXPORT
+ # define BZ_API(func) WINAPI func
+ # define BZ_EXTERN extern
diff --git a/app-arch/bzip2/files/bzip2-1.0.6-out-of-tree-build.patch b/app-arch/bzip2/files/bzip2-1.0.6-out-of-tree-build.patch
new file mode 100644
index 000000000000..806339ebb6b4
--- /dev/null
+++ b/app-arch/bzip2/files/bzip2-1.0.6-out-of-tree-build.patch
@@ -0,0 +1,79 @@
+--- a/Makefile
++++ b/Makefile
+@@ -53,7 +53,6 @@ libbz2.a: $(OBJS)
+
+ check: test
+ test: bzip2
+- @cat words1
+ ./bzip2 -1 < sample1.ref > sample1.rb2
+ ./bzip2 -2 < sample2.ref > sample2.rb2
+ ./bzip2 -3 < sample3.ref > sample3.rb2
+@@ -66,7 +65,6 @@ test: bzip2
+ cmp sample1.tst sample1.ref
+ cmp sample2.tst sample2.ref
+ cmp sample3.tst sample3.ref
+- @cat words3
+
+ install: bzip2 bzip2recover
+ if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
+@@ -115,25 +113,8 @@ clean:
+ sample1.rb2 sample2.rb2 sample3.rb2 \
+ sample1.tst sample2.tst sample3.tst
+
+-blocksort.o: blocksort.c
+- @cat words0
+- $(CC) $(CFLAGS) -c blocksort.c
+-huffman.o: huffman.c
+- $(CC) $(CFLAGS) -c huffman.c
+-crctable.o: crctable.c
+- $(CC) $(CFLAGS) -c crctable.c
+-randtable.o: randtable.c
+- $(CC) $(CFLAGS) -c randtable.c
+-compress.o: compress.c
+- $(CC) $(CFLAGS) -c compress.c
+-decompress.o: decompress.c
+- $(CC) $(CFLAGS) -c decompress.c
+-bzlib.o: bzlib.c
+- $(CC) $(CFLAGS) -c bzlib.c
+-bzip2.o: bzip2.c
+- $(CC) $(CFLAGS) -c bzip2.c
+-bzip2recover.o: bzip2recover.c
+- $(CC) $(CFLAGS) -c bzip2recover.c
++%.o: %.c
++ $(CC) $(CFLAGS) -c $<
+
+
+ distclean: clean
+--- a/Makefile-libbz2_so
++++ b/Makefile-libbz2_so
+@@ -36,9 +36,7 @@ OBJS= blocksort.o \
+
+ all: $(OBJS)
+ $(CC) $(LDFLAGS) -shared -Wl,-soname -Wl,libbz2.so.1 -o libbz2.so.1.0.6 $(OBJS)
+- $(CC) $(LDFLAGS) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
+- rm -f libbz2.so.1.0
+- ln -s libbz2.so.1.0.6 libbz2.so.1.0
++ ln -sf libbz2.so.1.0.6 libbz2.so.1.0
+
+ clean:
+ rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared
+@@ -43,17 +43,5 @@ all: $(OBJS)
+ clean:
+ rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared
+
+-blocksort.o: blocksort.c
+- $(CC) $(CFLAGS) -c blocksort.c
+-huffman.o: huffman.c
+- $(CC) $(CFLAGS) -c huffman.c
+-crctable.o: crctable.c
+- $(CC) $(CFLAGS) -c crctable.c
+-randtable.o: randtable.c
+- $(CC) $(CFLAGS) -c randtable.c
+-compress.o: compress.c
+- $(CC) $(CFLAGS) -c compress.c
+-decompress.o: decompress.c
+- $(CC) $(CFLAGS) -c decompress.c
+-bzlib.o: bzlib.c
+- $(CC) $(CFLAGS) -c bzlib.c
++%.o: %.c
++ $(CC) $(CFLAGS) -c $<
diff --git a/app-arch/bzip2/files/bzip2-1.0.6-progress.patch b/app-arch/bzip2/files/bzip2-1.0.6-progress.patch
new file mode 100644
index 000000000000..7691d63e27c8
--- /dev/null
+++ b/app-arch/bzip2/files/bzip2-1.0.6-progress.patch
@@ -0,0 +1,163 @@
+Ripped from Mandrake
+
+http://bugs.gentoo.org/82192
+
+--- bzip2-1.0.6/bzip2.1
++++ bzip2-1.0.6/bzip2.1
+@@ -235,6 +235,10 @@
+ Suppress non-essential warning messages. Messages pertaining to
+ I/O errors and other critical events will not be suppressed.
+ .TP
++.B \-p \-\-show\-progress
++Show percentage of input\-file done and while compressing show the percentage
++of the original file the new file is.
++.TP
+ .B \-v --verbose
+ Verbose mode -- show the compression ratio for each file processed.
+ Further \-v's increase the verbosity level, spewing out lots of
+--- bzip2-1.0.6/bzip2.c
++++ bzip2-1.0.6/bzip2.c
+@@ -145,6 +145,7 @@
+ #include <signal.h>
+ #include <math.h>
+ #include <errno.h>
++#include <time.h>
+ #include <ctype.h>
+ #include "bzlib.h"
+
+@@ -301,6 +302,7 @@
+ Char progNameReally[FILE_NAME_LEN];
+ FILE *outputHandleJustInCase;
+ Int32 workFactor;
++Char showProgress;
+
+ static void panic ( Char* ) NORETURN;
+ static void ioError ( void ) NORETURN;
+@@ -425,6 +427,12 @@
+ UInt32 nbytes_in_lo32, nbytes_in_hi32;
+ UInt32 nbytes_out_lo32, nbytes_out_hi32;
+ Int32 bzerr, bzerr_dummy, ret;
++ double fileSize = 0; /* initialized to make the compiler stop crying */
++ /* double because big files might otherwhise give
++ * overflows. not long long since not all compilers
++ * support that one
++ */
++ time_t startTime, currentTime;
+
+ SET_BINARY_MODE(stream);
+ SET_BINARY_MODE(zStream);
+@@ -432,12 +440,21 @@
+ if (ferror(stream)) goto errhandler_io;
+ if (ferror(zStream)) goto errhandler_io;
+
++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
++ (void)fseek(stream, 0, SEEK_END);
++ fileSize = ftello(stream);
++ rewind(stream);
++ if (verbosity >= 1)
++ fprintf(stderr, "Input-file size: %ld\n", (long)fileSize);
++ }
++
+ bzf = BZ2_bzWriteOpen ( &bzerr, zStream,
+ blockSize100k, verbosity, workFactor );
+ if (bzerr != BZ_OK) goto errhandler;
+
+ if (verbosity >= 2) fprintf ( stderr, "\n" );
+
++ time(&startTime);
+ while (True) {
+
+ if (myfeof(stream)) break;
+@@ -446,6 +463,22 @@
+ if (nIbuf > 0) BZ2_bzWrite ( &bzerr, bzf, (void*)ibuf, nIbuf );
+ if (bzerr != BZ_OK) goto errhandler;
+
++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
++ time(&currentTime);
++
++ if ((currentTime - startTime) > 1) { /* show progress every 2 seconds */
++ double curInPos = ftello(stream);
++ double curOutPos = ftello(zStream);
++
++ startTime = currentTime;
++
++ fprintf(stderr, "%.2f%% done", (curInPos * 100.0) / fileSize);
++ if (srcMode == SM_F2F)
++ fprintf(stderr, ", new size: %.2f%%", (curOutPos * 100.0) / curInPos);
++
++ fprintf(stderr, " \r");
++ }
++ }
+ }
+
+ BZ2_bzWriteClose64 ( &bzerr, bzf, 0,
+@@ -526,6 +559,8 @@
+ UChar unused[BZ_MAX_UNUSED];
+ Int32 nUnused;
+ UChar* unusedTmp;
++ double fileSize = 0; /* initialized to make the compiler stop crying */
++ time_t startTime, currentTime;
+
+ nUnused = 0;
+ streamNo = 0;
+@@ -533,9 +568,19 @@
+ SET_BINARY_MODE(stream);
+ SET_BINARY_MODE(zStream);
+
++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
++ off_t dummy = ftello(zStream);
++ (void)fseeko(zStream, 0, SEEK_END);
++ fileSize = ftello(zStream);
++ (void)fseeko(zStream, dummy, SEEK_SET);
++ if (verbosity >= 1)
++ fprintf(stderr, "Input-file size: %ld\n", (long)fileSize);
++ }
++
+ if (ferror(stream)) goto errhandler_io;
+ if (ferror(zStream)) goto errhandler_io;
+
++ time(&startTime);
+ while (True) {
+
+ bzf = BZ2_bzReadOpen (
+@@ -551,6 +596,16 @@
+ if ((bzerr == BZ_OK || bzerr == BZ_STREAM_END) && nread > 0)
+ fwrite ( obuf, sizeof(UChar), nread, stream );
+ if (ferror(stream)) goto errhandler_io;
++
++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
++ time(&currentTime);
++ if ((currentTime - startTime) >= 2) {
++ double curInPos = ftello(zStream);
++ startTime = currentTime;
++
++ fprintf(stderr, "%.2f%% done\r", (curInPos * 100.0) / fileSize);
++ }
++ }
+ }
+ if (bzerr != BZ_STREAM_END) goto errhandler;
+
+@@ -1872,6 +1927,7 @@
+ deleteOutputOnInterrupt = False;
+ exitValue = 0;
+ i = j = 0; /* avoid bogus warning from egcs-1.1.X */
++ showProgress = False;
+
+ /*-- Set up signal handlers for mem access errors --*/
+ signal (SIGSEGV, mySIGSEGVorSIGBUScatcher);
+@@ -1949,6 +2005,7 @@
+ case 'k': keepInputFiles = True; break;
+ case 's': smallMode = True; break;
+ case 'q': noisy = False; break;
++ case 'p': showProgress = True; break;
+ case '1': blockSize100k = 1; break;
+ case '2': blockSize100k = 2; break;
+ case '3': blockSize100k = 3; break;
+@@ -1985,6 +2042,7 @@
+ if (ISFLAG("--keep")) keepInputFiles = True; else
+ if (ISFLAG("--small")) smallMode = True; else
+ if (ISFLAG("--quiet")) noisy = False; else
++ if (ISFLAG("--show-progress")) showProgress = True; else
+ if (ISFLAG("--version")) license(); else
+ if (ISFLAG("--license")) license(); else
+ if (ISFLAG("--exponential")) workFactor = 1; else
diff --git a/app-arch/bzip2/files/bzip2-1.0.6-saneso.patch b/app-arch/bzip2/files/bzip2-1.0.6-saneso.patch
new file mode 100644
index 000000000000..9c4ddf05307b
--- /dev/null
+++ b/app-arch/bzip2/files/bzip2-1.0.6-saneso.patch
@@ -0,0 +1,13 @@
+--- Makefile-libbz2_so
++++ Makefile-libbz2_so
+@@ -35,8 +35,8 @@
+ bzlib.o
+
+ all: $(OBJS)
+- $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS)
+- $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
++ $(CC) $(LDFLAGS) -shared -Wl,-soname -Wl,libbz2.so.1 -o libbz2.so.1.0.6 $(OBJS)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6
+ rm -f libbz2.so.1.0
+ ln -s libbz2.so.1.0.6 libbz2.so.1.0
+
diff --git a/app-arch/bzip2/metadata.xml b/app-arch/bzip2/metadata.xml
new file mode 100644
index 000000000000..83d6d32d00a6
--- /dev/null
+++ b/app-arch/bzip2/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<upstream>
+ <remote-id type="cpe">cpe:/a:bzip:bzip2</remote-id>
+</upstream>
+</pkgmetadata>