[perl-Web-Scraper] Initial import.
corsepiu
corsepiu at fedoraproject.org
Tue Aug 14 13:37:53 UTC 2012
commit 02c0673fa6daf47bbe199c4a45a04122d7dfda51
Author: Ralf Corsépius <corsepiu at fedoraproject.org>
Date: Tue Aug 14 15:37:42 2012 +0200
Initial import.
.gitignore | 1 +
Web-Scraper-0.36-testsuite-hacks.patch | 34 ++++++++++
perl-Web-Scraper.spec | 108 ++++++++++++++++++++++++++++++++
sources | 1 +
4 files changed, 144 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..ebf7c07 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/Web-Scraper-0.36.tar.gz
diff --git a/Web-Scraper-0.36-testsuite-hacks.patch b/Web-Scraper-0.36-testsuite-hacks.patch
new file mode 100644
index 0000000..7c2560a
--- /dev/null
+++ b/Web-Scraper-0.36-testsuite-hacks.patch
@@ -0,0 +1,34 @@
+diff -Naur Web-Scraper-0.36.orig/t/07-live.t Web-Scraper-0.36/t/07-live.t
+--- Web-Scraper-0.36.orig/t/07-live.t 2009-03-24 19:52:13.000000000 +0100
++++ Web-Scraper-0.36/t/07-live.t 2012-08-07 08:05:54.969180784 +0200
+@@ -22,5 +22,5 @@
+ ---
+ furigana: こんのあさみ
+ title: 紺野あさ美
+-url: http://d.hatena.ne.jp/keyword/%ba%b0%cc%ee%a4%a2%a4%b5%c8%fe
++url: http://d.hatena.ne.jp/keyword/%BA%B0%CC%EE%A4%A2%A4%B5%C8%FE
+ EOF
+diff -Naur Web-Scraper-0.36.orig/t/18_http_response.t Web-Scraper-0.36/t/18_http_response.t
+--- Web-Scraper-0.36.orig/t/18_http_response.t 2009-03-24 19:52:13.000000000 +0100
++++ Web-Scraper-0.36/t/18_http_response.t 2012-08-07 08:42:39.263769651 +0200
+@@ -24,7 +24,7 @@
+ my $result = scraper {
+ process 'img.csschanger', image => '@src';
+ }->scrape($res);
+- is $result->{image}, 'http://b.hatena.ne.jp/images/logo1.gif', 'Absolute URI';
++ is $result->{image}, 'http://b.hatena.ne.jp/images/title_hotentry_curvebox-header.gif', 'Absolute URI';
+ }
+
+
+diff -Naur Web-Scraper-0.36.orig/t/19_decode_content.t Web-Scraper-0.36/t/19_decode_content.t
+--- Web-Scraper-0.36.orig/t/19_decode_content.t 2010-02-04 07:12:25.000000000 +0100
++++ Web-Scraper-0.36/t/19_decode_content.t 2012-08-07 08:42:53.138995596 +0200
+@@ -25,7 +25,7 @@
+ my $result = scraper {
+ process 'img.csschanger', image => '@src';
+ }->scrape($res);
+- is $result->{image}, 'http://b.hatena.ne.jp/images/logo1.gif', 'Absolute URI';
++ is $result->{image}, 'http://b.hatena.ne.jp/images/title_hotentry_curvebox-header.gif', 'Absolute URI';
+ }
+
+
diff --git a/perl-Web-Scraper.spec b/perl-Web-Scraper.spec
new file mode 100644
index 0000000..caf7f91
--- /dev/null
+++ b/perl-Web-Scraper.spec
@@ -0,0 +1,108 @@
+# Supported rpmbuild options:
+#
+# --with live-test/--without live-test
+# include/exclude LIVE_TEST testsuite
+# Default: --without (Requires networking, doesn't work in mock)
+%bcond_with live_test
+
+Name: perl-Web-Scraper
+Version: 0.36
+Release: 2%{?dist}
+Summary: Web Scraping Toolkit using HTML and CSS Selectors or XPath expressions
+License: GPL+ or Artistic
+Group: Development/Libraries
+URL: http://search.cpan.org/dist/Web-Scraper/
+Source0: http://www.cpan.org/authors/id/M/MI/MIYAGAWA/Web-Scraper-%{version}.tar.gz
+# Misc. hacks to make the testsuite working
+Patch0: Web-Scraper-0.36-testsuite-hacks.patch
+BuildArch: noarch
+
+BuildRequires: perl(base)
+BuildRequires: perl(Carp)
+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(HTML::TreeBuilder::LibXML) >= 0.13
+BuildRequires: perl(List::Util)
+BuildRequires: perl(LWP) >= 5.827
+BuildRequires: perl(LWP::UserAgent)
+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(warnings)
+BuildRequires: perl(XML::XPathEngine) >= 0.08
+BuildRequires: perl(YAML)
+BuildRequires: perl(strict)
+
+# Required by the testsuite
+BuildRequires: /bin/ps
+
+Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
+
+# rpm's deptracker misses these:
+Requires: perl(LWP::UserAgent)
+
+%{?perl_default_filter}
+
+%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 structure.
+
+%prep
+%setup -q -n Web-Scraper-%{version}
+%patch0 -p1
+
+%build
+# --skipdeps causes ExtUtils::AutoInstall not to try auto-installing
+# missing modules
+%{__perl} Makefile.PL INSTALLDIRS=vendor --skipdeps
+make %{?_smp_mflags}
+
+%install
+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 \;
+
+%{_fixperms} $RPM_BUILD_ROOT/*
+
+%check
+make test LEAK_TEST=1 %{?with_live_test:LIVE_TEST=1}
+
+%files
+%defattr(-,root,root,-)
+%doc Changes README
+%{_bindir}/scraper
+%{perl_vendorlib}/*
+%{_mandir}/man3/*
+
+%changelog
+* Tue Aug 07 2012 Ralf Corsépius <corsepiu at fedoraproject.org> 0.36-2
+- R: perl(LWP::UserAgent).
+- Make live tests working (Add Web-Scraper-0.36-testsuite-hacks.patch).
+- BR: /bin/ps.
+
+* Tue Jul 10 2012 Ralf Corsépius <corsepiu at fedoraproject.org> 0.36-1.20120710.0
+- Merge in Xavier's spec.
+
+* Fri Jan 21 2012 Ralf Corsépius <corsepiu at fedoraproject.org> 0.36-1.20120121.0
+- More deps.
+- Add %%{?perl_default_filter}.
+
+* Mon Dec 19 2011 Ralf Corsépius <corsepiu at fedoraproject.org> 0.36-1
+- Upstream update.
+- Add --with/without live-test (disabled by default).
+
+* Wed Mar 30 2011 Ralf Corsépius <corsepiu at fedoraproject.org> 0.34-1
+- Upstream update.
+- Spec cleanup.
+
+* Tue Dec 21 2010 Ralf Corsépius <corsepiu at fedoraproject.org> 0.32-1
+- Initial Fedora package.
diff --git a/sources b/sources
index e69de29..7cdc743 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+7161317424646e748b4ae81b92e78790 Web-Scraper-0.36.tar.gz
More information about the scm-commits
mailing list