%define src_file unzip60

Summary: A utility for unpacking zip files.
Summary(ja): zip ファイルを展開するユーティリティ
Name: unzip
Version: 6.0
Release: 2%{?_dist_release}
License: BSD
Group: Applications/Archiving
URL: http://www.info-zip.org/UnZip.html

Source: http://downloads.sourceforge.net/infozip/%{src_file}.tar.gz

# Not sent to upstream.
Patch1: unzip-6.0-bzip2-configure.patch
# Upstream plans to do this in zip (hopefully also in unzip).
Patch2: unzip-6.0-exec-shield.patch
# Upstream plans to do similar thing.
Patch3: unzip-6.0-close.patch
# Details in rhbz#532380.
# Reported to upstream: http://www.info-zip.org/board/board.pl?m-1259575993/
Patch4: unzip-6.0-attribs-overflow.patch
# Not sent to upstream, as it's Fedora/RHEL specific.
# Modify the configure script not to request the strip of binaries.
Patch5: unzip-6.0-nostrip.patch
Patch6: unzip-6.0-manpage-fix.patch
# Update match.c with recmatch() from zip 3.0's util.c
# This also resolves the license issue in that old function.
# Original came from here: https://projects.parabolagnulinux.org/abslibre.git/plain/libre/unzip-libre/match.patch
Patch7: unzip-6.0-fix-recmatch.patch
# Update process.c
Patch8: unzip-6.0-symlink.patch

# japanese charset support
# https://gist.github.com/hamano/573753
Patch200: unzip-6.0-japanese_charset.patch
# just ignore -E option, older nls patch use this.
Patch201: unzip-6.0-ignore-E-option.patch
# support ja_JP.utf8 locale
Patch202: unzip-6.0-japanese_charset-utf8.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-root

Vendor: Project Vine
Distribution: Vine Linux
Packager: daisuke

%description
The unzip utility is used to list, test, or extract files from a zip
archive.  Zip archives are commonly found on MS-DOS systems.  The zip
utility, included in the zip package, creates zip archives.  Zip and
unzip are both compatible with archives created by PKWARE(R)'s PKZIP
for MS-DOS, but the programs' options and default behaviors do differ
in some respects.

Install the unzip package if you need to list, test or extract files from
a zip archive.

%description -l ja
unzip ユーティリティは,zip アーカイブ内のファイルを一覧表示したり,
テスト/展開する為に使うユーティリティです.zip アーカイブは MS-DOS
システムで一般的に使われます.
zip パッケージに含まれる zip プログラムは zip アーカイブを
作成するのに使います.
zip と unzip は PKWARE(R) の MS-DOS 用 PKZIP で作成された zip アーカイブに
対応していますが,デフォルトの動作やプログラムオプション等一部が
異なります.


%prep
%setup -q -n %{src_file}
%patch1 -p1 -b .bzip2-configure
%patch2 -p1 -b .exec-shield
%patch3 -p1 -b .close
%patch4 -p1 -b .attribs-overflow
%patch5 -p1 -b .nostrip
%patch6 -p1 -b .manpage-fix
%patch7 -p1 -b .recmatch
%patch8 -p1 -b .symlink

%patch200 -p1 -b .jp
%patch201 -p1 -b .ignore-E
%patch202 -p1 -b .utf8

ln -s unix/Makefile Makefile

%build
make LOCAL_UNZIP="-D_FILE_OFFSET_BITS=64 -DNO_LCHMOD -D_MBCS -DNO_WORKING_ISPRINT" linux_noasm

%install
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT

make prefix=$RPM_BUILD_ROOT%{_prefix} MANDIR=$RPM_BUILD_ROOT/%{_mandir}/man1 install LF2=""


%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)
%doc README BUGS LICENSE INSTALL
%{_bindir}/*
%{_mandir}/*/*


%changelog
* Thu Jul 03 2014 Daisuke SUZUKI <daisuke@vinelinux.org> 6.0-2
- add patch202 to support ja_JP.utf8

* Thu May 22 2014 Daisuke SUZUKI <daisuke@vinelinux.org> 6.0-1
- update to 6.0
- replace nls patch.

* Tue Apr  5 2011 IWAI, Masaharu <iwai@alib.jp> 5.52-3vl6
- build on current VineSeed

* Wed Apr 15 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 5.52-2
- spec in utf-8
- add NLS patch

* Wed Apr 09 2008 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 5.52-1
- new upstream release
- add patch13 from fc8
- update patches to fit new release & drop old patches
- with new versioning polity

* Wed Apr 09 2008 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 5.51-11vl4
- fix changelog typo

* Wed Apr 09 2008 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 5.51-10vl4
- update patch100 to fix ppc issue (it was patch5, from rhel4)
- renumber patchs
- add patch 2,3 to support big archive (from rhel4)
- with new versioning polity

* Fri Mar 21 2008 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 5.51-9vl1.1
- add patch5 for fix CVE-2005-4667
- add patch6 for fix CVE-2008-0888 
- add Vendor/Distribution tag

* Tue May 10 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 5.51-9vl1
- new upstream release
- based on 5.51-9 Fedora development
  * Thu Feb 10 2005 Ivana Varekova <varekova@redhat.com> 5.51-9
  - fix the other problem with unpacking zipfiles containing symlinks
    (bug #134073)
  * Thu Feb 03 2005 Ivana Varekova <varekova@redhat.com> 5.51-8
  - fix segfault with unpacking of zipfiles containing dangling symlinks
    (bug #134073)
  * Thu Dec 02 2004 Lon Hohberger <lhh@redhat.com> 5.51-5
  - Fix segfault on extraction of symlinks
  * Mon Jun 21 2004 Lon Hohberger <lhh@redhat.com> 5.51-4
  - Extend max file/archive size to 2^32-8193 (4294959103) bytes
  * Tue Jun 08 2004 Lon Hohberger <lhh@redhat.com> 5.51-1.1
  - Update to 5.51; remove dotdot patch.

* Tue Sep 23 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 5.50-5vl2
- merged patch1 from Vine Linux 2.6 updates
  - Thu Aug 28 2003 Tomohiro 'Tomo-p' KATO <tomop@teamgedoh.net> 5.50-4vl3
  - replace patch1 from RedHat (RHSA-2003:199-02).

  - Fri Jul 18 2003 Kunio Murasawa <murasawa@fa2.so-net.ne.jp> 5.50-4vl2
  - added patch1 from Redhat (RHSA-2003:199-01)


* Sun Dec  1 2002 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 5.50-5vl1
- modified changelog section :-P (merge rawhidee changelogs)

  - Sun Dec  1 2002 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 5.50-4vl2
  - rebuild with new toolchains

  - Sun May 26 2002 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 5.50-4vl1
  - based on 5.50-4 from Rawhide 
  - previous Vine version was 5.41-3vl1:

  - Tue Dec 26 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
  - 5.41-3vl1
  - based on 5.41-3 from Rawhide
  - added Japanese summary and description
  - use better macros

* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Thu May 23 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Thu Apr 25 2002 Trond Eivind Glomsr︰ <teg@redhat.com> 5.50-3
- Rebuild

* Tue Apr  2 2002 Trond Eivind Glomsr︰ <teg@redhat.com> 5.50-2
- Make it not strip

* Wed Mar 13 2002 Trond Eivind Glomsr︰ <teg@redhat.com> 5.50-1
- 5.50

* Thu Feb 21 2002 Trond Eivind Glomsr︰ <teg@redhat.com> 5.42-3
- Rebuild

* Wed Jan 09 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Mon May 21 2001 Trond Eivind Glomsr︰ <teg@redhat.com>
- 5.42
- Don't strip binaries explicitly
- build without assembly, it doesn't seem to increase performance 
- make it respect RPM_OPT_FLAGS, define _GNU_SOURCE
- use %%{_tmppath}
- "License:" replaces "Copyright:"
- Update URL
- include zipgrep
- COPYING doesn't exist anymore, include LICENSE instead

* Thu Jul 13 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Sun Jun 11 2000 BIll Nottingham <notting@redhat.com>
- rebuild in new env.; FHS fixes.

* Tue Apr 18 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- 4.51 (an acceptable license at last...)

* Thu Feb  3 2000 Bill Nottingham <notting@redhat.com>
- handle compressed man pages

* Fri Jul 30 1999 Bill Nottingham <notting@redhat.com>
- update to 5.40

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
- auto rebuild in the new build environment (release 5)

* Thu Dec 17 1998 Michael Maher <mike@redhat.com>
- built for 6.0

* Tue Aug 11 1998 Jeff Johnson <jbj@redhat.com>
- build root

* Mon Apr 27 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr

* Tue Oct 21 1997 Erik Troan <ewt@redhat.com>
- builds on non i386 platforms

* Mon Oct 20 1997 Otto Hammersmith <otto@redhat.com>
- updated the version

* Thu Jul 10 1997 Erik Troan <ewt@redhat.com>
- built against glibc