8
0
Files
perl-Web-Scraper/perl-Web-Scraper.spec

117 lines
3.8 KiB
RPMSpec
Raw Normal View History

#
# spec file for package perl-Web-Scraper (Version 0.34)
#
# Copyright (c) 2010 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-Web-Scraper
Version: 0.34
Release: 1
License: GPL+ or Artistic
%define cpan_name Web-Scraper
Summary: Web Scraping Toolkit using HTML and CSS Selectors or XPath expressions
Url: http://search.cpan.org/dist/Web-Scraper/
Group: Development/Libraries/Perl
Source: http://www.cpan.org/authors/id/M/MI/MIYAGAWA/%{cpan_name}-%{version}.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(HTML::Entities)
BuildRequires: perl(HTML::Selector::XPath) >= 0.03
BuildRequires: perl(HTML::Tagset)
BuildRequires: perl(HTML::TreeBuilder) >= 3.23
BuildRequires: perl(HTML::TreeBuilder::XPath) >= 0.08
BuildRequires: perl(LWP) >= 5.827
BuildRequires: perl(Scalar::Util)
BuildRequires: perl(Test::Base)
BuildRequires: perl(Test::More)
BuildRequires: perl(Test::Requires)
BuildRequires: perl(UNIVERSAL::require)
BuildRequires: perl(URI)
BuildRequires: perl(XML::XPathEngine) >= 0.08
BuildRequires: perl(YAML)
Requires: perl(HTML::Entities)
Requires: perl(HTML::Selector::XPath) >= 0.03
Requires: perl(HTML::Tagset)
Requires: perl(HTML::TreeBuilder) >= 3.23
Requires: perl(HTML::TreeBuilder::XPath) >= 0.08
Requires: perl(LWP) >= 5.827
Requires: perl(Scalar::Util)
Requires: perl(UNIVERSAL::require)
Requires: perl(URI)
Requires: perl(XML::XPathEngine) >= 0.08
Requires: perl(YAML)
%{perl_requires}
%description
Web::Scraper is a web scraper toolkit, inspired by Ruby's equivalent
Scrapi. It provides a DSL-ish interface for traversing HTML documents and
returning a neatly arranged Perl data strcuture.
The *scraper* and *process* blocks provide a method to define what
segments of a document to extract. It understands HTML and CSS Selectors
as well as XPath expressions.
%package -n scraper
Summary: Web Scraping Tool using HTML and CSS Selectors or XPath expressions
Group: Productivity/Networking/Web/Utilities
Requires: %{name} = %{version}
%if 0%{?suse_version} >= 1120
BuildArch: noarch
%endif
%description -n scraper
Web::Scraper is a web scraper toolkit, inspired by Ruby's equivalent
Scrapi. It provides a command-line tool for traversing HTML documents and
returning a neatly arranged Perl data strcuture.
%prep
%setup -q -n "Web-Scraper-%{version}"
%__sed -i '/^auto_install/d' Makefile.PL
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
%{__make} %{?_smp_mflags}
%install
%perl_make_install
%perl_process_packlist
mkdir .rpmdoc
for f in Changes README; do
%__ln_s -f "../%{name}/$f" .rpmdoc/"$f"
done
%check
%__make test
%clean
%{?buildroot:%__rm -rf "%{buildroot}"}
%files
%defattr(-,root,root)
%doc Changes README
%dir %{perl_vendorlib}/Web
%{perl_vendorlib}/Web/Scraper.pm
%{perl_vendorlib}/Web/Scraper
%doc %{perl_man3dir}/Web::Scraper.%{perl_man3ext}%{ext_man}
%doc %{perl_man3dir}/Web::Scraper::*.%{perl_man3ext}%{ext_man}
%files -n scraper
%defattr(-,root,root)
%doc .rpmdoc/*
%{_bindir}/scraper