[packages/gem2rpm] add support for PLD template
glen
glen at pld-linux.org
Wed Apr 24 09:44:40 CEST 2013
commit 7d625e4e053a338fb04d48e05c25c491870b6a94
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Wed Apr 24 10:36:55 2013 +0300
add support for PLD template
gem2rpm.spec | 6 +++++-
pld.patch | 19 +++++++++++++++++
pld.spec.erb | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 93 insertions(+), 1 deletion(-)
---
diff --git a/gem2rpm.spec b/gem2rpm.spec
index dc374cc..984ded9 100644
--- a/gem2rpm.spec
+++ b/gem2rpm.spec
@@ -1,7 +1,7 @@
Summary: Generate rpm specfiles from gems
Name: gem2rpm
Version: 0.8.1
-Release: 0.3
+Release: 0.4
License: GPL v2+
Group: Development/Languages
Source0: http://rubygems.org/gems/%{name}-%{version}.gem
@@ -10,7 +10,9 @@ Source0: http://rubygems.org/gems/%{name}-%{version}.gem
# tar czvf gem2rpm-0.8.1-tests.tgz test/
Source1: %{name}-%{version}-tests.tgz
# Source1-md5: d7d8bc231dc405bbce00f570c89f530e
+Source2: pld.spec.erb
Patch0: gems.patch
+Patch1: pld.patch
URL: https://github.com/lutter/gem2rpm/
BuildRequires: rpm-rubyprov
BuildRequires: rpmbuild(macros) >= 1.656
@@ -34,6 +36,8 @@ Documentation for %{name}.
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
+cp -p %{SOURCE2} templates
%build
%if %{with tests}
diff --git a/pld.patch b/pld.patch
new file mode 100644
index 0000000..69e5bd0
--- /dev/null
+++ b/pld.patch
@@ -0,0 +1,19 @@
+--- gem2rpm-0.8.1/lib/gem2rpm/distro.rb~ 2013-04-24 10:31:39.000000000 +0300
++++ gem2rpm-0.8.1/lib/gem2rpm/distro.rb 2013-04-24 10:34:23.957321979 +0300
+@@ -1,6 +1,7 @@
+ module Gem2Rpm
+ class Distro
+ FEDORA = :fedora
++ PLD = :pld
+ OPENSUSE = :opensuse
+ DEFAULT = :default
+
+@@ -22,6 +23,8 @@
+ end
+ elsif !release_files.grep(/SuSe/).empty?
+ OPENSUSE
++ elsif !release_files.grep(/pld/).empty?
++ PLD
+ else
+ DEFAULT
+ end
diff --git a/pld.spec.erb b/pld.spec.erb
new file mode 100644
index 0000000..c5f899d
--- /dev/null
+++ b/pld.spec.erb
@@ -0,0 +1,69 @@
+# Generated from <%= format.gem_path %> by gem2rpm -*- rpm-spec -*-
+%define rbname <%= spec.name %>
+%define version <%= spec.version %>
+%define release 1
+
+Summary: <%= spec.summary %>
+Name: ruby-gems-%{rbname}
+
+Version: %{version}
+Release: %{release}
+Group: Development/Ruby
+License: Distributable
+URL: <%= spec.homepage %>
+Source0: %{rbname}-%{version}.gem
+# Make sure the spec template is included in the SRPM
+Source1: ruby-gems-%{rbname}.spec.in
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+Requires: ruby <%= spec.required_ruby_version %>
+Requires: ruby-gems >= <%= Gem::RubyGemsVersion %>
+<% for d in spec.dependencies -%>
+<% for req in d.requirement -%>
+Requires: ruby-gems-<%= d.name %> <%= req %>
+<% end -%>
+<% end -%>
+BuildRequires: ruby <%= spec.required_ruby_version %>
+BuildRequires: ruby-gems >= <%= Gem::RubyGemsVersion %>
+BuildArch: noarch
+Provides: ruby(<%= spec.name.capitalize %>) = %{version}
+
+%define gemdir <%= Gem.dir %>
+%define gembuilddir %{buildroot}%{gemdir}
+
+%description
+<%= spec.description %>
+
+%prep
+%setup -T -c
+
+%build
+
+%install
+%{__rm} -rf %{buildroot}
+mkdir -p %{gembuilddir}
+gem install --local --install-dir %{gembuilddir} --force %{SOURCE0}
+<% if ! spec.executables.empty? -%>
+mkdir -p %{buildroot}/%{_bindir}
+mv %{gembuilddir}/bin/* %{buildroot}/%{_bindir}
+rmdir %{gembuilddir}/bin
+<% end -%>
+
+%clean
+%{__rm} -rf %{buildroot}
+
+%files
+%defattr(-, root, root)
+<% for f in spec.executables -%>
+%{_bindir}/<%= f %>
+<% end -%>
+<% format.file_entries.each do |entry, data| -%>
+<% path = entry['path'] -%>
+<% doc_prefix = spec.extra_rdoc_files.include?(path) ? "%doc " : "" -%>
+<%= doc_prefix %>%{gemdir}/gems/<%= spec.name %>-<%= spec.version %>/<%= path %>
+<% end %>
+
+%doc %{gemdir}/doc/<%= spec.name %>-<%= spec.version %>
+%{gemdir}/cache/<%= format.gem_path %>
+%{gemdir}/specifications/<%= format.gem_path %>spec
+
+%changelog
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/gem2rpm.git/commitdiff/7d625e4e053a338fb04d48e05c25c491870b6a94
More information about the pld-cvs-commit
mailing list