Name:           par2cmdline
Summary:        PAR 2.0 compatible file verification and repair tool
Version:        0.4
Release:        2%{?_dist_release}

Group:          Applications/Archiving
License:        GPLv2+
URL:            http://parchive.sourceforge.net/

Source:         http://downloads.sourceforge.net/project/parchive/par2cmdline/0.4/%{name}-%{version}.tar.gz
Patch1:         par2cmdline-0.4-debian.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-root
Obsoletes:      parchive <= 1.1.4
Provides:       parchive = 1.1.4.0.par2.%{version}

%description
par2cmdline is a program for creating and using PAR2 files to detect damage
in data files and repair them if necessary. PAR2 files are usually
published in binary newsgroups on Usenet; they apply the data-recovery
capability concepts of RAID-like systems to the posting and recovery of
multi-part archives.


%prep
%setup -q 
%patch1 -p1

# fix end-of-lines of several files
sed -i 's/\r//' AUTHORS PORTING README ROADMAP


%build
%configure
make %{_smp_mflags}
chmod 644 ChangeLog galois.h par1repairer.cpp par2repairer.cpp par2repairersourcefile.cpp par2repairersourcefile.h


%install
rm -rf $RPM_BUILD_ROOT

%makeinstall
ln -sf par2 $RPM_BUILD_ROOT/%{_bindir}/par


%clean
rm -rf $RPM_BUILD_ROOT


%check
chmod +x test[1-6] pretest posttest
make check-TESTS


%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING ChangeLog README 
%{_bindir}/par	
%{_bindir}/par2	
%{_bindir}/par2create	
%{_bindir}/par2repair	
%{_bindir}/par2verify

%changelog
* Fri Sep 02 2016 Toshiaki Ara <ara_t@384.jp> 0.4-2
- rebuild with gcc-5.4.0

* Sun Oct 10 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 0.4-1
- Initial build for Vine Linux
- brought patch from debian

