1 |
commit: a583c4ba35a3c3bd5903893d1d4b3f1544f58d2c |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jun 21 13:20:17 2017 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jun 21 13:21:26 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a583c4ba |
7 |
|
8 |
Revert "app-arch/unrar: Security cleanup (bug #622342)" |
9 |
|
10 |
This reverts commit f84896cce4b495bcf147fd493e815d5106f7aa76. |
11 |
|
12 |
app-arch/unrar/Manifest | 1 + |
13 |
app-arch/unrar/files/unrar-5.0.2-build.patch | 45 ++++++++++++++++ |
14 |
.../unrar/files/unrar-5.2.2-no-auto-clean.patch | 17 ++++++ |
15 |
app-arch/unrar/unrar-5.4.5.ebuild | 62 ++++++++++++++++++++++ |
16 |
4 files changed, 125 insertions(+) |
17 |
|
18 |
diff --git a/app-arch/unrar/Manifest b/app-arch/unrar/Manifest |
19 |
index b4fb96e475e..fb13df3fb15 100644 |
20 |
--- a/app-arch/unrar/Manifest |
21 |
+++ b/app-arch/unrar/Manifest |
22 |
@@ -1 +1,2 @@ |
23 |
DIST unrar-5.5.5.tar.gz 220377 SHA256 a4553839cb2f025d0d9c5633816a83a723e3938209f17620c8c15da06ed061ef SHA512 b0979641737e3ef18f6708cc19e335c312ac5c6e2a13206d5fed9a5564ac99042c45a842da95163e53c6415131a39a91e901aeb186016da2e3781164679a07ff WHIRLPOOL e22399e866fabeb6f0c1617ca6b8852cf1bd406c0e95e5480692fe33bed9a130dd678f93dde6401015928437b99949865a80b21774788fdb1c7a12e3175560f4 |
24 |
+DIST unrarsrc-5.4.5.tar.gz 226320 SHA256 e470c584332422893fb52e049f2cbd99e24dc6c6da971008b4e2ae4284f8796c SHA512 ba2abf11638b5ee026cb9e0c3576c94376a01ab3c5411b9bd0e8116d64879c81e76df16f98d850f0f0f5387dda046f38be64ddfb4fe57431cc4d97066d6e3c2f WHIRLPOOL c8e035ec183f41d8faf8345b49d2a4d20e21f9c6e27f14d7794389942df4954cd66ab4a5be2fdff6d369b514ae99d5d015f35a36143d686563b2a8efdfc77dce |
25 |
|
26 |
diff --git a/app-arch/unrar/files/unrar-5.0.2-build.patch b/app-arch/unrar/files/unrar-5.0.2-build.patch |
27 |
new file mode 100644 |
28 |
index 00000000000..61de7ee0689 |
29 |
--- /dev/null |
30 |
+++ b/app-arch/unrar/files/unrar-5.0.2-build.patch |
31 |
@@ -0,0 +1,45 @@ |
32 |
+do not let these targets depend on clean, otherwise it could run in |
33 |
+parallel with the object compile which runs into races |
34 |
+https://bugs.gentoo.org/461806 |
35 |
+ |
36 |
+While we're in here, fix up a few other things: |
37 |
+ - append -pthread to LDFLAGS instead of replacing them |
38 |
+ - do not bother with `rm` in the output since linking will clober it |
39 |
+ - use CXXFLAGS when linking |
40 |
+ - append LIBFLAGS to the individual targets instead of the final link |
41 |
+ |
42 |
+--- a/makefile |
43 |
++++ b/makefile |
44 |
+@@ -7,7 +7,7 @@ |
45 |
+ LIBFLAGS=-fPIC |
46 |
+ DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DRAR_SMP |
47 |
+ STRIP=strip |
48 |
+-LDFLAGS=-pthread |
49 |
++LDFLAGS+=-pthread |
50 |
+ DESTDIR=/usr |
51 |
+ |
52 |
+ # Linux using LCC |
53 |
+@@ -119,8 +119,7 @@ |
54 |
+ @rm -f *.o *.bak *~ |
55 |
+ |
56 |
+ unrar: clean $(OBJECTS) $(UNRAR_OBJ) |
57 |
+- @rm -f unrar |
58 |
+- $(LINK) -o unrar $(LDFLAGS) $(OBJECTS) $(UNRAR_OBJ) $(LIBS) |
59 |
++ $(LINK) -o unrar $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) $(UNRAR_OBJ) $(LIBS) |
60 |
+ $(STRIP) unrar |
61 |
+ |
62 |
+ sfx: WHAT=SFX_MODULE |
63 |
+@@ -130,10 +129,9 @@ |
64 |
+ $(STRIP) default.sfx |
65 |
+ |
66 |
+ lib: WHAT=RARDLL |
67 |
+-lib: CXXFLAGS+=$(LIBFLAGS) |
68 |
+-lib: clean $(OBJECTS) $(LIB_OBJ) |
69 |
+- @rm -f libunrar.so |
70 |
+- $(LINK) -shared -o libunrar.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ) |
71 |
++$(OBJECTS) $(LIB_OBJ): CXXFLAGS+=$(LIBFLAGS) |
72 |
++lib: $(OBJECTS) $(LIB_OBJ) |
73 |
++ $(LINK) -shared -o libunrar.so $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) $(LIB_OBJ) |
74 |
+ |
75 |
+ install-unrar: |
76 |
+ install -D unrar $(DESTDIR)/bin/unrar |
77 |
|
78 |
diff --git a/app-arch/unrar/files/unrar-5.2.2-no-auto-clean.patch b/app-arch/unrar/files/unrar-5.2.2-no-auto-clean.patch |
79 |
new file mode 100644 |
80 |
index 00000000000..ff78363cd5c |
81 |
--- /dev/null |
82 |
+++ b/app-arch/unrar/files/unrar-5.2.2-no-auto-clean.patch |
83 |
@@ -0,0 +1,17 @@ |
84 |
+if clean runs in parallel with $(OBJECTS), it is possible to build some |
85 |
+objects first, then the clean target fires and deletes some, and then we |
86 |
+try to link and fail. |
87 |
+ |
88 |
+https://bugs.gentoo.org/528218 |
89 |
+ |
90 |
+--- a/makefile |
91 |
++++ b/makefile |
92 |
+@@ -118,7 +118,7 @@ |
93 |
+ clean: |
94 |
+ @rm -f *.o *.bak *~ |
95 |
+ |
96 |
+-unrar: clean $(OBJECTS) $(UNRAR_OBJ) |
97 |
++unrar: $(OBJECTS) $(UNRAR_OBJ) |
98 |
+ $(LINK) -o unrar $(CXXFLAGS) $(LDFLAGS) $(OBJECTS) $(UNRAR_OBJ) $(LIBS) |
99 |
+ $(STRIP) unrar |
100 |
+ |
101 |
|
102 |
diff --git a/app-arch/unrar/unrar-5.4.5.ebuild b/app-arch/unrar/unrar-5.4.5.ebuild |
103 |
new file mode 100644 |
104 |
index 00000000000..fe4cf6daf3f |
105 |
--- /dev/null |
106 |
+++ b/app-arch/unrar/unrar-5.4.5.ebuild |
107 |
@@ -0,0 +1,62 @@ |
108 |
+# Copyright 1999-2017 Gentoo Foundation |
109 |
+# Distributed under the terms of the GNU General Public License v2 |
110 |
+ |
111 |
+EAPI="5" |
112 |
+ |
113 |
+inherit eutils flag-o-matic multilib toolchain-funcs |
114 |
+ |
115 |
+MY_PN=${PN}src |
116 |
+ |
117 |
+DESCRIPTION="Uncompress rar files" |
118 |
+HOMEPAGE="http://www.rarlab.com/rar_add.htm" |
119 |
+SRC_URI="http://www.rarlab.com/rar/${MY_PN}-${PV}.tar.gz" |
120 |
+ |
121 |
+LICENSE="unRAR" |
122 |
+SLOT="0" |
123 |
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris" |
124 |
+IUSE="" |
125 |
+ |
126 |
+RDEPEND="!<=app-arch/unrar-gpl-0.0.1_p20080417" |
127 |
+ |
128 |
+S=${WORKDIR}/unrar |
129 |
+ |
130 |
+src_prepare() { |
131 |
+ epatch "${FILESDIR}"/${PN}-5.0.2-build.patch |
132 |
+ epatch "${FILESDIR}"/${PN}-5.2.2-no-auto-clean.patch #528218 |
133 |
+ local sed_args=( -e "/libunrar/s:.so:$(get_libname ${PV%.*.*}):" ) |
134 |
+ if [[ ${CHOST} == *-darwin* ]] ; then |
135 |
+ sed_args+=( -e "s:-shared:-dynamiclib -install_name ${EPREFIX}/usr/$(get_libdir)/libunrar$(get_libname ${PV%.*.*}):" ) |
136 |
+ else |
137 |
+ sed_args+=( -e "s:-shared:& -Wl,-soname -Wl,libunrar$(get_libname ${PV%.*.*}):" ) |
138 |
+ fi |
139 |
+ sed -i "${sed_args[@]}" makefile || die |
140 |
+} |
141 |
+ |
142 |
+src_configure() { |
143 |
+ mkdir -p build-{lib,bin} |
144 |
+ printf 'VPATH = ..\ninclude ../makefile' > build-lib/Makefile || die |
145 |
+ cp build-{lib,bin}/Makefile || die |
146 |
+} |
147 |
+ |
148 |
+src_compile() { |
149 |
+ unrar_make() { |
150 |
+ emake CXX="$(tc-getCXX)" CXXFLAGS="${CXXFLAGS}" STRIP=true "$@" |
151 |
+ } |
152 |
+ |
153 |
+ unrar_make CXXFLAGS+=" -fPIC" -C build-lib lib |
154 |
+ ln -s libunrar$(get_libname ${PV%.*.*}) build-lib/libunrar$(get_libname) || die |
155 |
+ ln -s libunrar$(get_libname ${PV%.*.*}) build-lib/libunrar$(get_libname ${PV}) || die |
156 |
+ |
157 |
+ unrar_make -C build-bin |
158 |
+} |
159 |
+ |
160 |
+src_install() { |
161 |
+ dobin build-bin/unrar |
162 |
+ dodoc readme.txt |
163 |
+ |
164 |
+ dolib.so build-lib/libunrar* |
165 |
+ |
166 |
+ insinto /usr/include/libunrar${PV%.*.*} |
167 |
+ doins *.hpp |
168 |
+ dosym libunrar${PV%.*.*} /usr/include/libunrar |
169 |
+} |