Blob Blame History Raw
#
# Rebuild switch:
#  --with localtests         enable local tests
#

%define localtests 0
%{?_with_localtests:%define localtests 1}

Name:           perl-WWW-Mechanize
Version:        1.22
Release:        2%{?dist}
Summary:        Automates web page form & link interaction

Group:          Development/Libraries
License:        GPL or Artistic
URL:            http://search.cpan.org/dist/WWW-Mechanize/
Source0:        http://www.cpan.org/authors/id/P/PE/PETDANCE/WWW-Mechanize-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch
BuildRequires:  perl >= 1:5.6.1
BuildRequires:  perl(Test::Pod), perl(Test::Pod::Coverage), perl(Test::Exception)
BuildRequires:  perl(Test::Memory::Cycle), perl(Test::Taint), perl(Test::Warn)
BuildRequires:  perl(HTML::TokeParser), perl(LWP::UserAgent), perl(URI::URL)
BuildRequires:  perl(IO::Socket::SSL)
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

%description
"WWW::Mechanize", or Mech for short, helps you automate interaction
with a website.  It supports performing a sequence of page fetches
including following links and submitting forms. Each fetched page is
parsed and its links and forms are extracted. A link or a form can be
selected, form fields can be filled and the next page can be fetched.
Mech also stores a history of the URLs you've visited, which can be
queried and revisited.


%prep
%setup -q -n WWW-Mechanize-%{version}


%build
%{__perl} Makefile.PL INSTALLDIRS=vendor \
%if %{localtests}
    --local \
%else
    --nolocal \
%endif
    --mech-dump < /dev/null
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 -depth -type d -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 etc/www-mechanize-logo.png
%{_bindir}/mech-dump
%{perl_vendorlib}/WWW/
%{_mandir}/man1/*.1*
%{_mandir}/man3/*.3pm*


%changelog
* Sun Mar 18 2007 Jose Pedro Oliveira <jpo at di.uminho.pt> - 1.22-2
- New BR: perl(IO::Socket::SSL).

* Sun Mar 18 2007 Jose Pedro Oliveira <jpo at di.uminho.pt> - 1.22-1
- Update to 1.22.

* Tue Sep  5 2006 Jose Pedro Oliveira <jpo at di.uminho.pt> - 1.20-1
- Update to 1.20.
- Live tests have been dropped.

* Tue Feb 28 2006 Jose Pedro Oliveira <jpo at di.uminho.pt> - 1.18-2
- Re-enable test suite but without local and live tests.
  One local test fails in mock (see #165650 comment 4).
- New rebuild option: "--with localtests"

* Thu Feb  2 2006 Jose Pedro Oliveira <jpo at di.uminho.pt> - 1.18-1
- Update to 1.18.

* Thu Nov 10 2005 Jose Pedro Oliveira <jpo at di.uminho.pt> - 1.16-1
- Update to 1.16.

* Wed Aug 31 2005 Jose Pedro Oliveira <jpo at di.uminho.pt> - 1.14-2
- Added Test::LongString to the live tests build requirements.

* Wed Aug 31 2005 Jose Pedro Oliveira <jpo at di.uminho.pt> - 1.14-1
- Update to 1.14.

* Fri Aug 26 2005 Jose Pedro Oliveira <jpo at di.uminho.pt> - 1.12-4
- Added Test::Pod::Coverage to the BR list in order to improve test coverage.
- Disabled test suite as it fails in mock (see #165650 comment 4).

* Thu Aug 25 2005 Jose Pedro Oliveira <jpo at di.uminho.pt> - 1.12-3
- Conditional rebuild switch to enable live tests (RFE in #165650).

* Fri Jul  1 2005 Jose Pedro Oliveira <jpo at di.uminho.pt> - 1.12-2
- Dist tag.

* Sat Feb 26 2005 Jose Pedro Oliveira <jpo at di.uminho.pt> - 0:1.12-0.fdr.1
- Update to 1.12.

* Mon Feb 14 2005 Jose Pedro Oliveira <jpo at di.uminho.pt> - 0:1.10-0.fdr.1
- Update to 1.10.

* Sat Dec 25 2004 Jose Pedro Oliveira <jpo at di.uminho.pt> - 0:1.08-0.fdr.1
- Update to 1.08.

* Sun Jul 04 2004 Jose Pedro Oliveira <jpo at di.uminho.pt> - 0:1.02-0.fdr.1
- First build.