%define cpanname Net-SSLeay

Name:    perl-%{cpanname}
Version: 1.25
Release: 1.ker.rhel4
Summary: Perl extension for using OpenSSL.
License: Distributable
Group:   Development/Libraries
Source0: Net_SSLeay.pm-%{version}.tar.gz
URL:     http://search.cpan.org/search?mode=module&query=%{cpanname}
BuildRoot: %{_tmppath}/%{name}-root

%description
This module offers some high level convinience functions for accessing web
pages on SSL servers (for symmetry, same API is offered for accessing http
servers, too), a sslcat() function for writing your own clients, and finally
access to the SSL api of SSLeay/OpenSSL package so you can write servers or
clients for more complicated applications.

%prep
%setup -q -n Net_SSLeay.pm-%{version} 

%build
echo | CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL /usr PREFIX=$RPM_BUILD_ROOT/usr INSTALLDIRS=vendor
make config static dynamic
# out of memory on my test system (128MB RAM)
make test

%install

rm -rf $RPM_BUILD_ROOT
eval `perl '-V:installarchlib'`
mkdir -p $RPM_BUILD_ROOT/$installarchlib
make install

[ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress

find $RPM_BUILD_ROOT \( -name perllocal.pod -o -name .packlist \) -exec rm -v {} \;

find $RPM_BUILD_ROOT/usr -type f -print | \
	sed "s@^$RPM_BUILD_ROOT@@g" | \
	grep -v perllocal.pod | \
	grep -v "\.packlist" > %{name}-%{version}-filelist
if [ "$(cat %{name}-%{version}-filelist)X" = "X" ] ; then
    echo "ERROR: EMPTY FILE LIST"
    exit -1
fi

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_DIR/%{name}-%{version}


%files -f %{name}-%{version}-filelist
%defattr(-,root,root)
%doc Changes README

%changelog
* Sat Mar 05 2005 Milan Kerslager <kerslage@linux.cz> 1.25-1.ker.rhel4
- unified SPEC file
- rebuild for RHEL4

* Wed Jan 21 2004 Milan Kerslager <kerslage@linux.cz> 1.25-1.ker.rhel3
- initial build