]> git.pld-linux.org Git - packages/gem2rpm.git/blobdiff - gem2rpm.spec
up to 0.10.1
[packages/gem2rpm.git] / gem2rpm.spec
index cec388a54802ee8d2c1e3e59d1265ed8e1d82032..04468ec260009e77b20ec57a01171037bd34ee8b 100644 (file)
@@ -1,22 +1,28 @@
+#
+# Conditional build:
+%bcond_with    tests           # tests require networking
+
 Summary:       Generate rpm specfiles from gems
 Name:          gem2rpm
-Version:       0.8.1
-Release:       0.5
+Version:       0.10.1
+Release:       1
 License:       GPL v2+
 Group:         Development/Languages
-Source0:       http://rubygems.org/gems/%{name}-%{version}.gem
-# Source0-md5: d3c9416f225ae944fd195e69e122d46e
-# 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}-%{version}-tests.tgz
-# Source1-md5: d7d8bc231dc405bbce00f570c89f530e
+Source0:       https://github.com/lutter/gem2rpm/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: a22be828b4aeff0387a735daae969c5c
 Source2:       pld.spec.erb
 Patch0:                gems.patch
 Patch1:                pld.patch
+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
+Requires:      ruby-rubygems
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -35,12 +41,19 @@ Documentation for %{name}.
 
 %prep
 %setup -q
+%{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 cp -p %{SOURCE2} templates
 
+# cleanup backups after patching
+find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
+
 %build
 %if %{with tests}
+# tests need UTF-8 locale
+LC_ALL=en_US.UTF-8 \
 testrb -Itest test/
 %endif
 
@@ -64,11 +77,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
This page took 0.066292 seconds and 4 git commands to generate.