]> git.pld-linux.org Git - packages/gem2rpm.git/commitdiff
use source tarball; run tests
authorElan Ruusamäe <glen@delfi.ee>
Mon, 29 Apr 2013 20:55:02 +0000 (23:55 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Mon, 29 Apr 2013 20:55:02 +0000 (23:55 +0300)
gem2rpm.spec
style.patch

index 104b82f7ad07c3459bc4cad919dad805aeab4024..580df46f95fe5819fee65977978216b8810b866a 100644 (file)
@@ -1,15 +1,15 @@
+#
+# Conditional build:
+%bcond_without tests           # build without tests
+
 Summary:       Generate rpm specfiles from gems
 Name:          gem2rpm
 Version:       0.9.2
-Release:       0.8
+Release:       0.9
 License:       GPL v2+
 Group:         Development/Languages
-Source0:       http://rubygems.org/gems/%{name}-%{version}.gem
-# Source0-md5: 6988e28332369a79067d45b8c61f2851
-# git clone https://github.com/lutter/gem2rpm.git && cd gem2rpm && git checkout v0.8.1
-# tar czvf gem2rpm-0.8.1-tests.tgz test/
-Source1:       %{name}-0.8.1-tests.tgz
-# Source1-md5: d7d8bc231dc405bbce00f570c89f530e
+Source0:       https://github.com/lutter/gem2rpm/archive/v%{version}.tar.gz
+# Source0-md5: 133c4cae2e26c24a5db0453e2cbe2a72
 Source2:       pld.spec.erb
 Patch0:                gems.patch
 Patch1:                pld.patch
@@ -17,7 +17,11 @@ Patch2:              style.patch
 URL:           https://github.com/lutter/gem2rpm/
 BuildRequires: rpm-rubyprov
 BuildRequires: rpmbuild(macros) >= 1.656
-Requires:      ruby
+%if %{with tests}
+%if %(locale -a | grep -q '^en_US$'; echo $?)
+BuildRequires: glibc-localedb-all
+%endif
+%endif
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -45,6 +49,8 @@ cp -p %{SOURCE2} templates
 
 %build
 %if %{with tests}
+# tests need UTF-8 locale
+LC_ALL=en_US.UTF-8 \
 testrb -Itest test/
 %endif
 
@@ -68,11 +74,3 @@ rm -rf $RPM_BUILD_ROOT
 %{ruby_rubylibdir}/gem2rpm.rb
 %{ruby_rubylibdir}/gem2rpm
 %{_datadir}/ruby/templates
-
-%if 0
-%files doc
-%defattr(644,root,root,755)
-%doc %{gem_docdir}
-%doc %{gem_instdir}/README
-%doc %{gem_instdir}/AUTHORS
-%endif
index 17748ac9ae3864976675fb8f04e801f383e706af..b30f968c11494437845b3bb550db9bbd3a98fe7f 100644 (file)
@@ -9,3 +9,36 @@
      end
  
      # Expands the not equal version operator '!=' into equivalent '<' and
+--- gem2rpm-0.9.2/test/test_helpers.rb~        2013-04-23 10:58:32.000000000 +0300
++++ gem2rpm-0.9.2/test/test_helpers.rb 2013-04-29 23:51:55.467457420 +0300
+@@ -19,12 +19,12 @@
+   def test_first_level_pessimistic_version_constraint
+     r = Gem::Requirement.new(["~> 1.2"])
+-    assert_equal(["=> 1.2", "< 2"], Gem2Rpm::Helpers.requirement_versions_to_rpm(r))
++    assert_equal([">= 1.2", "< 2"], Gem2Rpm::Helpers.requirement_versions_to_rpm(r))
+   end
+   def test_second_level_pessimistic_version_constraint
+     r = Gem::Requirement.new(["~> 1.2.3"])
+-    assert_equal(["=> 1.2.3", "< 1.3"], Gem2Rpm::Helpers.requirement_versions_to_rpm(r))
++    assert_equal([">= 1.2.3", "< 1.3"], Gem2Rpm::Helpers.requirement_versions_to_rpm(r))
+   end
+   def test_pessimistic_version_constraint_with_trailing_text
+@@ -32,13 +32,13 @@
+     gem_version = Gem::Version.create(Gem::RubyGemsVersion)
+     if gem_version >= Gem::Version.create("1.3.2")
+       r = Gem::Requirement.new(["~> 1.2.3.beta.8"])
+-      assert_equal(["=> 1.2.3.beta.8", "< 1.3"], Gem2Rpm::Helpers.requirement_versions_to_rpm(r))
++      assert_equal([">= 1.2.3.beta.8", "< 1.3"], Gem2Rpm::Helpers.requirement_versions_to_rpm(r))
+     end
+   end
+   def test_second_level_pessimistic_version_constraint_with_two_digit_version
+     r = Gem::Requirement.new(["~> 1.12.3"])
+-    assert_equal(["=> 1.12.3", "< 1.13"], Gem2Rpm::Helpers.requirement_versions_to_rpm(r))
++    assert_equal([">= 1.12.3", "< 1.13"], Gem2Rpm::Helpers.requirement_versions_to_rpm(r))
+   end
+   def test_first_level_not_equal_version_constraint
This page took 0.072304 seconds and 4 git commands to generate.