#
# spec file for package zoo
#
# Copyright (c) 2015 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/
#


Name:           zoo
Version:        2.10
Release:        2032.1
Summary:        Pack Program
License:        SUSE-Public-Domain
Group:          Productivity/Archiving/Compression
Source:         zoo.tar.gz
Patch0:         zoo.patch
Patch1:         zoo-%{version}-tempfile.patch
Patch2:         zoo-gcc.patch
Patch3:         zoo-%{version}-CAN-2005-2349.patch
Patch4:         zoo-return.patch
Patch5:         zoo-security_pathsize.patch
Patch6:         zoo-security_parse.patch
Patch7:         zoo-%{version}-security-infinite_loop.patch
Patch8:         zoo-fclose.patch
Patch9:         zoo-%{version}-build-clean.patch
   
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Zoo is a packer based on the Lempel-Ziv algorithm. Lots of files on
DOS/AmigaDOS and TOS systems used this packer for their archives. The
compression rate of gzip is not reached, and thus zoo should only be
used for decompressing old archives.

%prep
%setup -q -n zoo
%patch0
%patch1
%patch2
%patch3
%patch4
%patch5
%patch6
%patch7
%patch8
%patch9 -p1

%build
make %{?_smp_mflags} linux OPTIM="%{optflags} -fPIE" LDFLAGS="-pie"

%install
mkdir -p %{buildroot}{%{_prefix}/bin,%{_mandir}/man1}
install zoo fiz %{buildroot}%{_prefix}/bin
install -m 644 zoo.1 fiz.1 %{buildroot}/%{_mandir}/man1/

%files
%defattr(-,root,root)
%doc Copyright
%{_bindir}/fiz
%{_bindir}/zoo
%doc %{_mandir}/man1/fiz.1.gz
%doc %{_mandir}/man1/zoo.1.gz

%changelog
* Fri Mar 13 2015 mpluskal@suse.com
- Cleanup spec file with spec-cleaner
* Tue Dec 23 2014 meissner@suse.com
- build with PIE support. stack-protector is now default
- zoo.patch: also include utime.h and unistd.h for some
  more prototypes to fix implicit warnings
* Fri Aug 22 2014 jengelh@inai.de
- Remove redundant %%clean section and old specfile tags;
  reset Release number as it is autocontrolled by OBS anyhow.
* Tue Nov 24 2009 crrodriguez@opensuse.org
- refresh patches with fuzz=0
* Thu Aug 13 2009 mseben@novell.com
- zoo-fclose.patch : use fclose to close fd (bnc#523301)
* Wed May  9 2007 lmichnovic@suse.cz
- fixed possible ZOO file decompression infinite loop DoS attack
  CVE-2007-1669 (security-infinite_loop.patch) [#271781]
* Mon Mar  6 2006 lmichnovic@suse.cz
- fixed buffer overflow (security_parse.patch) [155371]
* Fri Feb 24 2006 lmichnovic@suse.cz
- fixed security bug: buffer overflow when handling long filenames
  CVE-2006-0855 [#153057]
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Wed Jan 18 2006 lmichnovic@suse.cz
- wrote clean section
* Tue Jan 17 2006 lmichnovic@suse.cz
- enabled compilation with -fstack-protector
* Sat Jan 14 2006 schwab@suse.de
- Don't strip binaries.
- Use RPM_OPT_FLAGS.
- Fix random return values.
* Mon Aug 15 2005 ro@suse.de
- fix typo in last change
* Mon Aug 15 2005 mjancar@suse.cz
- add check for ".." to the CAN-2005-2349 fix (#62234)
* Thu Aug 11 2005 anicka@suse.cz
- fix CAN-2005-2349 directory traversal bug (#62234)
* Thu Feb 26 2004 hmacht@suse.de
- building as non-root
* Mon Nov 25 2002 jderfina@suse.cz
- Replaced varargs.h with stdarg.h and adapted for new gcc.
* Tue Sep 17 2002 ro@suse.de
- removed bogus self-provides
* Fri Jan 18 2002 okir@suse.de
- fix for tempfile race
* Thu Feb  8 2001 ro@suse.de
- fixed to compile
* Tue Aug 22 2000 nadvornik@suse.cz
- added buildroot
- fixed permissions
* Sat Feb 19 2000 kasal@suse.cz
- got rid of Makefile.Linux
- moved manpages to /usr/share/man
* Mon Sep 13 1999 bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Mon Nov  9 1998 ro@suse.de
- renamed function basename to my_basename to avoid conflict with glibc
* Thu Feb  6 1997 rj@suse.de
- new package (Version 2.10)