File unzip.spec of Package unzip
#
# spec file for package unzip
#
# Copyright (c) 2023 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%define file_version 60
Name: unzip
Version: 6.00
Release: 0
Summary: A program to unpack compressed files
Group: Productivity/Archiving/Compression
License: BSD-3-Clause
URL: https://www.info-zip.org
Source0: unzip60.tar.gz
BuildRequires: libnatspec-devel
BuildRequires: libbz2-devel
Patch0: CVE-2014-9636.patch
Patch1: CVE-2014-8139.patch
Patch2: CVE-2014-8140.patch
Patch3: CVE-2014-8141.patch
Patch4: CVE-2015-7696.patch
Patch5: CVE-2015-7697.patch
Patch6: CVE-2016-9844.patch
Patch7: CVE-2014-9913.patch
Patch8: CVE-2018-1000035.patch
Patch9: CVE-2022-0530.patch
Patch10: CVE-2022-0529.patch
Patch11: CVE-2018-18384.patch
Patch12: CVE-2019-13232_p1.patch
Patch13: CVE-2019-13232_p2.patch
Patch14: CVE-2019-13232_p3.patch
Patch15: CVE-2021-4217.patch
Patch1000: unzip-6.0-natspec.patch
Recommends: %{name}-doc
Recommends: libnatspec0
Conflicts: unzip-rcc
BuildRoot: %{_tmppath}/%{name}%{file_version}-build
%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 doc
Summary: Documentation files for unzip
Group: Productivity/Archiving/Compression
BuildArch: noarch
%description doc
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 unzip%{file_version}
%autopatch -p1
%build
export RPM_OPT_FLAGS="%{optflags} \
-D_GNU_SOURCE -DRCC_LAZY -DWILD_STOP_AT_DIR \
-DLARGE_FILE_SUPPORT -DUNICODE_SUPPORT \
-DUNICODE_WCHAR -DUTF8_MAYBE_NATIVE -DNO_LCHMOD \
-DUSE_ICONV_MAPPING -DUSE_BZIP2 \
-DDATE_FORMAT=DF_YMD \
-I. -fstack-protector -fno-strict-aliasing -fPIE"
make %{?_smp_mflags} \
-f unix/Makefile \
D_USE_BZ2=-DUSE_BZIP2 L_BZ2=-lbz2 \
LF2="-lnatspec -ldl -pie" \
linux_noasm
%check
make %{?_smp_mflags} -f unix/Makefile check
%install
make %{?_smp_mflags} -f unix/Makefile \
prefix=%{buildroot}%{_prefix} \
BINDIR=%{buildroot}%{_bindir} \
MANDIR=%{buildroot}%{_mandir}/man1 \
D_USE_BZ2=-DUSE_BZIP2 L_BZ2=-lbz2 \
install
%files
%defattr(-,root,root)
%{_bindir}/funzip
%{_bindir}/unzip
%{_bindir}/unzipsfx
%{_bindir}/zipgrep
%{_bindir}/zipinfo
%files doc
%defattr(-,root,root)
%{_mandir}/man1/funzip.1.gz
%{_mandir}/man1/unzip.1.gz
%{_mandir}/man1/unzipsfx.1.gz
%{_mandir}/man1/zipgrep.1.gz
%{_mandir}/man1/zipinfo.1.gz
%doc BUGS Contents History.* LICENSE README ToDo WHERE
%doc *.txt proginfo
%changelog