#
# spec file for package perl-Data-Page
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           perl-Data-Page
%define cpan_name Data-Page
Summary:        Help when paging through sets of results
License:        GPL-1.0+ or Artistic-1.0
Group:          Development/Libraries/Perl
Version:        2.02
Release:        18.17
Url:            http://search.cpan.org/dist/Data-Page/
Source:         http://www.cpan.org/modules/by-module/Data/Data-Page-%{version}.tar.gz
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%{perl_requires}
BuildRequires:  perl
BuildRequires:  perl-macros
BuildRequires:  perl(Class::Accessor::Chained::Fast)
BuildRequires:  perl(Module::Build)
BuildRequires:  perl(Test::Exception)
BuildRequires:  perl(Test::More)
Requires:       perl(Class::Accessor::Chained::Fast)
Requires:       perl(Test::Exception)

%description
When searching through large amounts of data, it is often the case that a
result set is returned that is larger than we want to display on one page.
This results in wanting to page through various pages of data. The maths
behind this is unfortunately fiddly, hence this module.

The main concept is that you pass in the number of total entries, the number
of entries per page, and the current page number. You can then call methods
to find out how many pages of information there are, and what number the
first and last entries on the current page really are.

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

%build
%{__perl} Build.PL installdirs=vendor
./Build build flags=%{?_smp_mflags}

%check
./Build test

%install
./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
%perl_gen_filelist

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%files -f %{name}.files
%defattr(-,root,root,-)
%doc CHANGES README

%changelog
* Wed Dec  1 2010 coolo@novell.com
- switch to perl_requires macro
* Mon Sep  6 2010 chris@computersalat.de
- recreated by cpanspec 1.78
- noarch pkg
- fix deps
  o no need for Module::Build >= 0.35
* Tue Aug 31 2010 pascal.bleser@opensuse.org
- update to 2.02:
  * fix SQL documentation
  * added change_entries_per_page
  * run perltidy on the modules
- changes from 2.01:
  * add human-readable license to the documentation
* Tue Jul 22 2008 guru@unixtech.be
- new package