diff --git a/curb-0.9.7.gem b/curb-0.9.7.gem new file mode 100644 index 0000000..233bcb4 Binary files /dev/null and b/curb-0.9.7.gem differ diff --git a/curb-disable-network-lookup-test.patch b/curb-disable-network-lookup-test.patch new file mode 100644 index 0000000..bdb232f --- /dev/null +++ b/curb-disable-network-lookup-test.patch @@ -0,0 +1,16 @@ +diff -uNr curb-0.8.6.ORIG/tests/tc_curl_easy.rb curb-0.8.6/tests/tc_curl_easy.rb +--- curb-0.8.6.ORIG/tests/tc_curl_easy.rb 2014-08-04 09:29:20.903000000 +0000 ++++ curb-0.8.6/tests/tc_curl_easy.rb 2014-08-04 09:29:59.193000000 +0000 +@@ -948,9 +948,9 @@ + + def test_easy_http_verbs_must_respond_to_str + # issue http://github.com/taf2/curb/issues#issue/45 +- assert_nothing_raised do +- c = Curl::Easy.new ; c.url = 'http://example.com' ; c.http(:get) +- end ++ #assert_nothing_raised do ++ #c = Curl::Easy.new ; c.url = 'http://example.com' ; c.http(:get) ++ #end + + assert_raise RuntimeError do + c = Curl::Easy.new ; c.url = 'http://example.com' ; c.http(FooNoToS.new) diff --git a/rubygem-curb-0.9.7-libcurl-762-seems-to-have-changed-file-slightly.patch b/rubygem-curb-0.9.7-libcurl-762-seems-to-have-changed-file-slightly.patch new file mode 100644 index 0000000..ba27531 --- /dev/null +++ b/rubygem-curb-0.9.7-libcurl-762-seems-to-have-changed-file-slightly.patch @@ -0,0 +1,55 @@ +From 55c7f485672465461bb8b8a4589601c208a3d82c Mon Sep 17 00:00:00 2001 +From: Todd Fisher +Date: Mon, 26 Nov 2018 13:54:47 -0500 +Subject: [PATCH] libcurl 7.62 seems to have changed file:// slightly to + include headers when reading files? + +--- + tests/tc_curl_easy.rb | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/tests/tc_curl_easy.rb b/tests/tc_curl_easy.rb +index 63b43df..954d837 100644 +--- a/tests/tc_curl_easy.rb ++++ b/tests/tc_curl_easy.rb +@@ -28,8 +28,6 @@ def test_threads + c = Curl.get($TEST_URL) + assert_match(/^# DO NOT REMOVE THIS COMMENT/, c.body_str) + assert_match(/^# DO NOT REMOVE THIS COMMENT/, c.body) +- assert_equal "", c.header_str +- assert_equal "", c.head + end + end + end +@@ -41,7 +39,6 @@ def test_class_perform_01 + assert_instance_of Curl::Easy, c = Curl::Easy.perform($TEST_URL) + assert_match(/^# DO NOT REMOVE THIS COMMENT/, c.body_str) + assert_match(/^# DO NOT REMOVE THIS COMMENT/, c.body) +- assert_equal "", c.header_str + end + + def test_class_perform_02 +@@ -49,7 +46,6 @@ def test_class_perform_02 + assert_instance_of Curl::Easy, c = Curl::Easy.perform($TEST_URL) { |curl| curl.on_body { |d| data << d; d.length } } + + assert_nil c.body_str +- assert_equal "", c.header_str + assert_match(/^# DO NOT REMOVE THIS COMMENT/, data) + end + +@@ -144,7 +140,6 @@ def test_get_01 + c = Curl::Easy.new($TEST_URL) + assert_equal true, c.http_get + assert_match(/^# DO NOT REMOVE THIS COMMENT/, c.body_str) +- assert_equal "", c.header_str + end + + def test_get_02 +@@ -156,7 +151,6 @@ def test_get_02 + assert_equal true, c.http_get + + assert_nil c.body_str +- assert_equal "", c.header_str + assert_match(/^# DO NOT REMOVE THIS COMMENT/, data) + end + diff --git a/rubygem-curb.spec b/rubygem-curb.spec new file mode 100644 index 0000000..954c0e4 --- /dev/null +++ b/rubygem-curb.spec @@ -0,0 +1,64 @@ +%global gem_name curb +Name: rubygem-%{gem_name} +Version: 0.9.7 +Release: 1 +Summary: Ruby libcurl bindings +License: Ruby +URL: https://github.com/taf2/curb +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +Patch0: curb-disable-network-lookup-test.patch +Patch1: rubygem-curb-0.9.7-libcurl-762-seems-to-have-changed-file-slightly.patch +BuildRequires: ruby(release) rubygems-devel ruby-devel rubygem(test-unit) libcurl-devel gcc +%description +Curb (probably CUrl-RuBy or something) provides Ruby-language bindings for the +libcurl(3), a fully-featured client-side URL transfer library. cURL and +libcurl live at http://curl.haxx.se/. + +%package doc +Summary: Documentation for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch +%description doc +Documentation for %{name}. + +%prep +%setup -q -n %{gem_name}-%{version} +gem unpack %{SOURCE0} +%patch0 -p1 +%patch1 -p1 + +%build +gem build ../%{gem_name}-%{version}.gemspec +%gem_install + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ +mkdir -p %{buildroot}%{gem_extdir_mri} +cp -a .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/ +rm -rf %{buildroot}%{gem_instdir}/ext/ + +%check +pushd .%{gem_instdir} +ruby -e 'Dir.glob "./tests/tc_*.rb", &method(:require)' +popd + +%files +%dir %{gem_instdir} +%{gem_extdir_mri} +%license %{gem_instdir}/LICENSE +%{gem_libdir} +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_docdir} +%doc %{gem_instdir}/README.markdown +%{gem_instdir}/Rakefile +%{gem_instdir}/doc.rb +%{gem_instdir}/tests + +%changelog +* Fri Jul 24 2020 wutao - 0.9.7-1 +- package init diff --git a/rubygem-curb.yaml b/rubygem-curb.yaml new file mode 100644 index 0000000..62400e5 --- /dev/null +++ b/rubygem-curb.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: taf2/curb +tag_prefix: "^" +seperator: "."