File mingw-unzip.spec of Package mingw-unzip

#
# spec file for package mingw-unzip
#
# Copyright (c) 2017 SUSE LINUX 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/
#


%if ! 0%{__isa_bits}
%ifarch x86_64
  %define __isa_bits 64
%else
  %define __isa_bits 32
%endif
%endif

%define mingw mingw%{__isa_bits}
%{expand:%{_%{mingw}_package_header}}
%define mingw_debug_package  %{expand:%{_%{mingw}_debug_package}}
%define mingw_make           %{expand:%{_%{mingw}_make}}
%define mingw_bindir         %{expand:%{_%{mingw}_bindir}}

Name:           mingw-unzip
%define _name unzip
Version:        6.00
Release:        0
%define fileversion 60
Summary:        A program to unpack compressed files
License:        BSD-3-Clause
Group:          Productivity/Archiving/Compression
Url:            http://www.info-zip.org/
Source:         http://sourceforge.net/projects/infozip/files/UnZip%206.x%20%28latest%29/UnZip%206.0/%{_name}%{fileversion}.tar.gz
Source1:        pre_checkin.sh
Patch0:         unzip.dif
Patch1:         unzip-iso8859_2.patch
Patch3:         unzip-optflags.patch
Patch4:         unzip-5.52-filename_too_long.patch
Patch5:         unzip-no_file_name_translation.patch
Patch11:        unzip-no-build-date.patch
Patch12:        unzip-dont_call_isprint.patch
Patch13:        Fix-CVE-2014-8139-unzip.patch
Patch14:        Fix-CVE-2014-8140-and-CVE-2014-8141.patch
Patch15:        CVE-2015-7696.patch
Patch16:        CVE-2015-7697.patch
Patch17:        CVE-2016-9844.patch
Patch18:        CVE-2014-9913.patch
Patch100:       mingw-provides-tzset.patch
Patch101:       dont-use-__G.patch
Patch102:       unzip-no-build-date-win32.patch
Recommends:     %{_name}-doc

BuildRequires:  %{mingw}-cross-binutils
BuildRequires:  %{mingw}-cross-gcc
BuildRequires:  %{mingw}-filesystem
BuildArch:      noarch

%description
UnZip is an extraction utility for archives compressed in .zip format
(known as "zip files").  Although highly compatible both with PKWARE's
PKZIP(tm) and PKUNZIP utilities for MS-DOS and with Info-ZIP's own Zip
program, our primary objectives have been portability and non-MS-DOS
functionality. This version can also extract encrypted archives.

%package -n %{mingw}-%{_name}
Summary:        A program to unpack compressed files
Group:          Productivity/Archiving/Compression

%description -n %{mingw}-%{_name}
UnZip is an extraction utility for archives compressed in .zip format
(known as "zip files").  Although highly compatible both with PKWARE's
PKZIP(tm) and PKUNZIP utilities for MS-DOS and with Info-ZIP's own Zip
program, our primary objectives have been portability and non-MS-DOS
functionality. This version can also extract encrypted archives.

%prep
%setup -q -n %{_name}%{fileversion}
%patch0
%patch1
%patch3
%patch4
%patch5
%patch11
%patch12
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch100 -p1
%patch101 -p1
%patch102 -p1

%build

export RPM_OPT_FLAGS=" \
  -DRCC_LAZY -DWILD_STOP_AT_DIR \
  -DDATE_FORMAT=DF_YMD -I."

%{mingw_make} %{?_smp_mflags} \
  NOASM=1 \
  CC=${CC} \
  LOCAL_UNZIP="${CFLAGS} ${RPM_OPT_FLAGS}" \
  CC_CPU_OPT="" \
  RC=${WINDRES} \
  LD="${CC} ${CFLAGS} ${LDFLAGS} ${RPM_OPT_FLAGS}" \
  -f win32/Makefile.gcc

%check
# nothing

%install
mkdir -p %{buildroot}%{mingw_bindir}
for i in unzip.exe funzip.exe unzipsfx.exe;	do
	install $i %{buildroot}%{mingw_bindir}/$i
done
ln -s unzip.exe %{buildroot}%{mingw_bindir}/zipinfo.exe

%files -n %{mingw}-%{_name}
%defattr(-,root,root)
%{mingw_bindir}/unzip.exe
%{mingw_bindir}/funzip.exe
%{mingw_bindir}/unzipsfx.exe
%{mingw_bindir}/zipinfo.exe
%doc LICENSE

%changelog
openSUSE Build Service is sponsored by