+#
+# 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
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)
%build
%if %{with tests}
+# tests need UTF-8 locale
+LC_ALL=en_US.UTF-8 \
testrb -Itest test/
%endif
%{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