%define	module	Crypt-DSA
%define name	perl-%{module}
%define	version	1.17
%define	release	1%{_dist_release}

Name:		%{name}
Version:	%{version}
Release:	%{release}
Summary:	DSA Signatures and Key Generation
Group:		Development/Languages
License:	GPL or Artistic
Url:		http://search.cpan.org/dist/%{module}/
Source:         http://search.cpan.org/CPAN/authors/id/B/BT/BTROTT/%{module}-%{version}.tar.gz
BuildArch:	noarch
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildRequires:  perl-Digest-SHA1, perl(Math::BigInt)
BuildRequires:  perl(Carp)
BuildRequires:  perl(Convert::PEM)
BuildRequires:  perl(Crypt::DES_EDE3)
BuildRequires:  perl(Data::Buffer) >= 0.01
BuildRequires:  perl(Digest::SHA1)
BuildRequires:  perl(ExtUtils::MakeMaker)
BuildRequires:  perl(File::Spec)
BuildRequires:  perl(File::Which) >= 0.05
BuildRequires:  perl(IPC::Open3)
BuildRequires:  perl(Math::BigInt) >= 1.78
BuildRequires:  perl(Math::BigInt::GMP)
BuildRequires:  perl(Perl::MinimumVersion) >= 1.20
BuildRequires:  perl(Test::CPAN::Meta) >= 0.12
BuildRequires:  perl(Test::More) >= 0.42
BuildRequires:  perl(Test::MinimumVersion) >= 0.008
BuildRequires:  perl(Test::Pod) >= 1.26
BuildRequires:  openssl
Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
# Crypt::DSA::Keychain calls openssl for DSA parameter generation
Requires:       openssl
# Some operations are really slow without GMP (or Pari, but we test with GMP)
Requires:       perl(Math::BigInt::GMP)

Vendor:         Project Vine
Distribution:   Vine Linux

%description
Crypt::DSA is an implementation of the DSA (Digital Signature Algorithm) 
signature verification system. The implementation itself is pure Perl, 
although the heavy-duty mathematics underneath are provided by 
the Math::Pari library.

This package provides DSA signing, signature verification, 
and key generation.

%prep
%setup -q -n %{module}-%{version}

%build
CFLAGS="%{optflags}" %{__perl} Makefile.PL INSTALLDIRS="vendor"
%{__make} 

%check
echo -e "\n\nWill take several minutes for the tests. Please wait.\n\n"
## WARNING: you'll need many hardware input / network traffic
## to keep the 'entropy pool' filled with random bits - 
## otherwise the test will take enormous amount of time (shaolin)
%{__make} test
%{__make} test AUTOMATED_TESTING=1 TEST_FILES="xt/*.t"

%install
make pure_install DESTDIR=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find %{buildroot} -depth -type d -exec rmdir {} ';' 2>/dev/null
%{_fixperms} %{buildroot}

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc README Changes
%{_mandir}/man3*/*
%{perl_vendorlib}/Crypt/*

%changelog
* Mon Mar 12 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 1.17-1
- updated to 1.17

* Fri May 02 2008 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 0.14-1vl5
- rebuild with perl 5.10
- new versioning policy

* Mon Mar 10 2008 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 0.14-0vl1
- built for VineSeed

* Sat Mar 08 2008 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 0.14-0vl0.43
- add Requires: perl-Convert-PEM/perl-Data-Buffer

* Sun Mar 02 2008 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 0.14-0vl0.42
- built for Vine 4.2 (testing)
- 1st build for Vine


