File unrar.spec of Package unrar
#
# spec file for package unrar
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# majorversion should match the major version number.
%define majorversion 4
%define libsuffix 4_2_4
Name: unrar
Version: 4.2.4
Release: 0
License: SUSE-NonFree
Summary: A program to extract, test, and view RAR archives
Url: http://www.rarlab.com
Group: Productivity/Archiving/Compression
Source0: http://www.rarlab.com/rar/%{name}src-%{version}.tar.gz
Source1: unrar.1
Patch1: unrarsrc-3.9-types.patch
Patch2: unrarsrc-4.2.4-gcc.patch
Patch3: unrarsrc-3.9-variablesize.patch
Patch4: unrarsrc-4.2.4-soname.patch
# PATCH-FIX-UPSTREAM unrar-4.2.4-no_return.patch lazy.kent@opensuse.org -- fix no-return-in-nonvoid-function error
Patch5: unrar-4.2.4-no_return.patch
BuildRequires: gcc-c++
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
The unRAR utility is a freeware program distributed with source code
and developed for extracting, testing, and viewing the contents of
archives created with the RAR archiver.
%package -n libunrar%{libsuffix}
Summary: Decompress library for RAR v3 archives
Group: System/Libraries
%description -n libunrar%{libsuffix}
The libunrar library allows programs linking against it to decompress
existing RAR v3 archives.
%package -n libunrar-devel
Summary: Development files for libunrar
Group: Development/Libraries/C and C++
Requires: libunrar%{libsuffix} = %{version}
%description -n libunrar-devel
The libunrar-devel package contains libraries and header files for
developing applications that use libunrar.
%prep
%setup -q -n %{name}
%patch1
%patch2
%patch3
%patch4
%patch5
%build
make %{?_smp_mflags} -f makefile.unix CXXFLAGS="%{optflags} -Wall \
-fPIC -fmessage-length=0 -fno-strict-aliasing -fstack-protector" \
STRIP=true
#bnc#693890
rm -f *.o
make %{?_smp_mflags} -f makefile.unix lib libversion=%{version} \
CXXFLAGS="%{optflags} -Wall -fPIC -fmessage-length=0 \
-fno-strict-aliasing -fstack-protector" STRIP=true
%install
install -Dm 0755 unrar %{buildroot}%{_bindir}/unrar
install -Dm 0644 %{SOURCE1} %{buildroot}%{_mandir}/man1/unrar.1
install -Dm 0755 libunrar.so.%{version} \
%{buildroot}%{_libdir}/libunrar.so.%{version}
install -Dm 0644 dll.hpp %{buildroot}/%{_includedir}/unrar/dll.hpp
ln -s libunrar.so.%{version} \
%{buildroot}%{_libdir}/libunrar.so.%{majorversion}
ln -s libunrar.so.%{majorversion} %{buildroot}%{_libdir}/libunrar.so
%post -n libunrar%{libsuffix} -p /sbin/ldconfig
%postun -n libunrar%{libsuffix} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc license.txt readme.txt
%{_bindir}/unrar
%doc %{_mandir}/man1/unrar.1*
%files -n libunrar%{libsuffix}
%defattr(-,root,root)
%doc license.txt readme.txt
%{_libdir}/*.so.%{majorversion}*
%files -n libunrar-devel
%defattr(-,root,root)
%doc license.txt readme.txt
%{_includedir}/*
%{_libdir}/*.so
%changelog