Name:           lzip
Version:        1.12
Release:        1%{?_dist_release}
Summary:        LZMA compressor with integrity checking

Group:          Applications/Archiving
License:        GPLv3+
URL:            http://www.nongnu.org/lzip/lzip.html
Source0:        http://download.savannah.gnu.org/releases/lzip/lzip-%{version}.tar.gz

# 2009-02-15: sent to upstream bug report mailinglist lzip-bug@nongnu.org
Patch0:         lzip-1.4-missing_cstdio.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-root

Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info

%description
Lzip compresses data using LZMA (Lempel-Ziv-Markov chain-Algorithm). It
supports integrity checking using CRC (Cyclic Redundancy Check). To archive
multiple files, tar can be used with lzip. Please note, that the lzip file
format (.lz) is not compatible with the lzma file format (.lzma).


%prep
%setup -q
%patch0 -p1 -b .missing_cstdio

%build
%configure CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" CPPFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_OPT_FLAGS"
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install install-man DESTDIR=$RPM_BUILD_ROOT

# if install-info is present, this is created by upstream's makefile
rm -Rf $RPM_BUILD_ROOT%{_infodir}/dir


%check
make check


%clean
rm -rf $RPM_BUILD_ROOT


%post
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :

%preun
if [ $1 = 0 ] ; then
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
fi


%files
%defattr(-,root,root,-)
# TODO is currently empty
%doc AUTHORS ChangeLog COPYING NEWS README
%{_bindir}/*
%{_infodir}/lzip.info*
%{_mandir}/man1/*


%changelog
* Wed May 4 2011 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.12-1
- Update to new release

* Mon Sep 27 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.11-1
- Update to new release

* Sun May 30 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.10-1
- Update to new release

* Thu Jan 21 2010 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.9-1
- Update to new release

* Sun Sep 6 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.8-1
- Update to new release

* Thu Jul 2 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.7-1
- Update to new release

* Wed Jun 24 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.6-1
- Update to new release
- dropt Source1

* Fri Apr 24 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.5-1
- Update to new release
- spec in UTF-8

* Thu Apr 23 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.4-2
- changed Group to Applications/Archiving

* Sat Apr 11 2009 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.4-1vl5
- initial build for VineSeed (import Fedora Package)

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sun Feb 15 2009 Till Maas <opensource@till.name> - 1.4-1
- Update to new release
- Add compile fixes for gcc 4.4 (missing #include <cstdio.h>)

* Thu Nov 27 2008 Till Maas <opensource@till.name> - 1.1-2
- fix type in summary
- call testsuite in %%check
- remove empty TODO file from %%doc

* Wed Nov 26 2008 Till Maas <opensource@till.name> - 1.1-1
- Initial spec for Fedora
