%define pkgname Config-IniFiles

Summary:	A perl module for reading .ini-style configuration files.
Name:		perl-%{pkgname}
Version:	2.68
Release:	1%{?_dist_release}
Group:		Development/Libraries
License:	GPL+ or Artistic
URL:		http://config-inifiles.sourceforge.net/
Source0:	%{pkgname}-%{version}.tar.gz
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
BuildArch:	noarch

BuildRequires:  perl(Module::Build::Compat)
BuildRequires:  perl(ExtUtils::MakeMaker)
BuildRequires:  perl(Test::More)
BuildArch:      noarch
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

%description
Config::IniFiles provides a way to have readable configuration files
outside your Perl script. Configurations can be imported (inherited,
stacked,...), sections can be grouped, and settings can be accessed
from a tied hash.

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

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

%install
rm -rf %{buildroot}
make pure_install PERL_INSTALL_ROOT=%{buildroot}
find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
find %{buildroot} -type d -depth -exec rmdir {} 2>/dev/null ';'
chmod -R u+w %{buildroot}/*

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

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

%check
make test


%clean
rm -rf %{buildroot}


%files -f %{pkgname}-%{version}-filelist
%defattr(-,root,root)
%doc README MANIFEST


%changelog
* Thu Mar 01 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 2.68-1
- updated to 2.68

* Sat Apr 30 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.39-2
- rebuild with perl-5.12.3

* Tue Jan 06 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 2.39-1
- apply new versioning policy 

* Wed May 16 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 2.39-0vl1
- new upstream release

* Sun Oct 03 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 2.38-0vl1
- initial build for Vine Linux

