commit bc75cdcba573878a8f64846b25097253d0ac3b1b
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Wed Jul 8 19:51:52 2020 +0100
Add build fix
unrar-5.9.4-build.patch | 35 +++++++++++++++++++++++++++++++++++
unrar.spec | 17 ++++++++++-------
2 files changed, 45 insertions(+), 7 deletions(-)
---
diff --git a/unrar-5.9.4-build.patch b/unrar-5.9.4-build.patch
new file mode 100644
index 0000000..ae5ca0b
--- /dev/null
+++ b/unrar-5.9.4-build.patch
@@ -0,0 +1,35 @@
+Makefile: Fix parallel build issue
+
+If clean runs in parallel with $(OBJECTS), it is possible to build some
+objects first, then the clean target fires and deletes some, and then we
+try to link and fail.
+
+Gentoo-Bug:
https://bugs.gentoo.org/528218
+
+--- a/makefile
++++ b/makefile
+@@ -142,21 +142,18 @@
+ @rm -f $(OBJECTS) $(UNRAR_OBJ) $(LIB_OBJ)
+ @rm -f unrar libunrar.*
+
+-unrar: clean $(OBJECTS) $(UNRAR_OBJ)
+- @rm -f unrar
++unrar: $(OBJECTS) $(UNRAR_OBJ)
+ $(LINK) -o unrar $(LDFLAGS) $(OBJECTS) $(UNRAR_OBJ) $(LIBS)
+ $(STRIP) unrar
+
+ sfx: WHAT=SFX_MODULE
+-sfx: clean $(OBJECTS)
+- @rm -f default.sfx
++sfx: $(OBJECTS)
+ $(LINK) -o default.sfx $(LDFLAGS) $(OBJECTS)
+ $(STRIP) default.sfx
+
+ lib: WHAT=RARDLL
+ lib: CXXFLAGS+=$(LIBFLAGS)
+-lib: clean $(OBJECTS) $(LIB_OBJ)
+- @rm -f libunrar.*
++lib: $(OBJECTS) $(LIB_OBJ)
+ $(LINK) -shared -o libunrar.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ)
+ $(AR) rcs libunrar.a $(OBJECTS) $(LIB_OBJ)
+
diff --git a/unrar.spec b/unrar.spec
index 118c491..7073067 100644
--- a/unrar.spec
+++ b/unrar.spec
@@ -1,12 +1,13 @@
Name: unrar
Version: 5.9.4
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Utility for extracting, testing and viewing RAR archives
License: Freeware with further limitations
URL:
https://www.rarlab.com/rar_add.htm
Source0:
https://www.rarlab.com/rar/unrarsrc-%{version}.tar.gz
# Man page from Debian
Source1: unrar.1
+Patch0: unrar-5.9.4-build.patch
BuildRequires: gcc-c++
@@ -38,18 +39,17 @@ developing applications that use libunrar.
%prep
-%setup -q -n %{name}
+%autosetup -n %{name}
cp -p %SOURCE1 .
-sed -i -e 's|@rm -f unrar libunrar.*|@rm -f libunrar.*c|g' makefile
%build
-%{make_build} -f makefile \
+%{make_build} -f makefile unrar \
CXX="%{__cxx}" CXXFLAGS="%{optflags} -fPIC -DPIC"
LDFLAGS="%{?__global_ldflags} -pthread" \
- STRIP=: RANLIB=ranlib
-%{make_build} -f makefile clean
+ STRIP=:
+
%{make_build} -f makefile lib \
CXX="%{__cxx}" CXXFLAGS="%{optflags} -fPIC -DPIC"
LDFLAGS="%{?__global_ldflags} -pthread" \
- STRIP=: RANLIB=ranlib
+ STRIP=:
%install
@@ -92,6 +92,9 @@ touch -r license.txt %{buildroot}%{_sysconfdir}/rpm/macros.unrar
%changelog
+* Wed Jul 08 2020 Leigh Scott <leigh123linux(a)gmail.com> - 5.9.4-2
+- Add build fix
+
* Wed Jul 08 2020 Leigh Scott <leigh123linux(a)gmail.com> - 5.9.4-1
- Update to 5.9.4