Summary: Gregorian calendar date calculations using Perl
Name: perl-Date-Calc
Version: 5.4
Release: 1%{?_dist_release}
License: distributable
Group: Development/Libraries
URL: http://search.cpan.org/search?dist=Date-Calc
Source0: http://www.cpan.org/authors/id/STBEY/Date-Calc-%{version}.tar.gz

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: perl >= 0:5.00503
BuildRequires: perl-Bit-Vector >= 6.4
BuildRequires: perl-Carp-Clan >= 5.3
Requires: perl-Bit-Vector >= 6.4
Requires: perl-Carp-Clan >= 5.3

%description
This package consists of a C library (intended to make life easier for C
developers) and a Perl module to access this library from Perl.

The library provides all sorts of date calculations based on the Gregorian
calendar (the one used in all western countries today), thereby complying
with all relevant norms and standards: ISO/R 2015-1971, DIN 1355 and, to
some extent, ISO 8601 (where applicable).

The package is designed as an efficient (and fast) toolbox, not a bulky
ready-made application. It provides extensive documentation and examples
of use, multi-language support and special functions for business needs.

%prep
%setup -q -n Date-Calc-%{version} 

%build
CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL INSTALLDIRS=vendor
make

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

find $RPM_BUILD_ROOT%{perl_vendorarch} -type f -print | \
	sed "s@^$RPM_BUILD_ROOT@@g" | \
	grep -v perllocal.pod | \
	grep -v "\.packlist" > Date-Calc-%{version}-filelist
if [ "$(cat Date-Calc-%{version}-filelist)X" = "X" ] ; then
    echo "ERROR: EMPTY FILE LIST"
    exit -1
fi
install -m 0644 blib/man3/* %{buildroot}%{_mandir}/man3

%check
LANG=C make test

%clean
rm -rf $RPM_BUILD_ROOT

%files -f Date-Calc-%{version}-filelist
%defattr(-,root,root)
%doc CHANGES.txt CREDITS.txt EXAMPLES.txt README.txt TOOLS.txt
%doc examples tools
%dir %{perl_vendorarch}/Date
%dir %{perl_vendorarch}/Date/Calc
%dir %{perl_vendorarch}/Date/Calendar
%dir %{perl_vendorarch}/auto/Date/Calc
%{_mandir}/man3/*

%changelog
* Sat Nov  8 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 5.4-1
- applied new versioning policy
- rebuilt with perl-5.10.0

* Sun Jan  2 2005 IWAI, Masaharu <iwai@alib.jp> 5.4-0vl1
- new upstream release
- update {Build,}Requires
- add Summary and description

* Thu Apr 17 2003 IWAI Masaharu <iwai@alib.jp> 5.3-0vl1
- version up to 5.3
- add directories in %%files section
- add some documents
- drop %%{perl_sitearch}/Carp ( installed from perl-Bit-Vector )

* Thu Apr 11 2002 IWAI Masaharu <iwaim@cc.mbn.or.jp> 5.0-15vl2
- add LANG=C for 'make test'

* Thu Apr 11 2002 IWAI Masaharu <iwaim@cc.mbn.or.jp> 5.0-15vl1
- build Rawhide-5.0-15 for Vine Linux
- added perl-Bit-Vector in {Build,}Requires

* Wed Jan 30 2002 cturner@redhat.com
- Specfile autogenerated

