Name: perl-File-MMagic-XS
Version: 0.09002
Release: 1%{?dist}
Summary: Guess file type with XS
Group: Development/Libraries
License: Apache Software License
URL: http://search.cpan.org/dist/File-MMagic-XS
Source0: http://search.cpan.org/CPAN/authors/id/D/DM/DMAKI/File-MMagic-XS-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: perl(File::MMagic), gdbm-devel
Requires: perl(File::MMagic)
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
%description
This is a port of Apache2 mod_mime_magic.c in Perl, written in XS with the aim
of being efficient and fast especially for applications that need to be run for
an extended amount of time.
%prep
%setup -q -n File-MMagic-XS-%{version}
cat << \EOF > %{name}-prov
#!/bin/sh
%{__perl_provides} $* |\
sed -e '/^perl(File::MMagic::XS)$/d'
EOF
%define __perl_provides %{_builddir}/File-MMagic-XS-%{version}/%{name}-prov
chmod +x %{__perl_provides}
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
find $RPM_BUILD_ROOT -type f -name '*.bs' -a -size 0 -exec rm -f {} ';'
find $RPM_BUILD_ROOT -type d -depth -exec rmdir {} 2>/dev/null ';'
chmod -R u+w $RPM_BUILD_ROOT/*
%check
make test
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc Changes
%{perl_vendorarch}/auto/File/MMagic/
%{perl_vendorarch}/File/MMagic/
%{_mandir}/man3/*
%changelog
* Thu Jul 19 2007 Tom "spot" Callaway <tcallawa@redhat.com> 0.09002-1
- hate hate hate perl versioning
* Sun Sep 10 2006 Tom "spot" Callaway <tcallawa@redhat.com> 0.08-2
- filter out extra perl(File::MMagic::XS) provides
- fix license descriptor to make rpmlint happy
* Thu Aug 3 2006 Tom "spot" Callaway <tcallawa@redhat.com> 0.08-1
- initial package for Fedora Extras