%define perl_vendorlib %(eval "`perl -V:installvendorlib`"; echo $installvendorlib)

Summary: Perl extension providing access to the GSSAPIv2 library
Name: perl-GSSAPI
Version: 0.26
Release: 1%{?_dist_release}
License: distributable
Group: Development/Libraries
URL: http://search.cpan.org/~gbarr/Authen-SASL/
Source0: GSSAPI-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-root
#BuildArch: noarch
BuildRequires: krb5-devel
BuildRequires: perl-Test-Pod
BuildRequires: perl-Test-Pod-Coverage
Requires: perl 

%description
This module gives access to the routines of the GSSAPI library, as
described in rfc2743 and rfc2744 and implemented by the Kerberos-1.2
distribution from MIT.

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

%build
CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL INSTALLDIRS=vendor
make OPTIMIZE="%{optflags}"

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

[ -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" > GSSAPI-%{version}-filelist
if [ "$(cat GSSAPI-%{version}-filelist)X" = "X" ] ; then
    echo "ERROR: EMPTY FILE LIST"
    exit -1
fi

%clean
rm -rf $RPM_BUILD_ROOT

%check
make test

%files -f GSSAPI-%{version}-filelist
%defattr(-,root,root,-)
%dir %{perl_vendorarch}/GSSAPI
%dir %{perl_vendorarch}/auto/GSSAPI

%changelog
* Wed Mar 11 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.26-1
- initial package for Vine Linux