]> git.pld-linux.org Git - packages/gem2rpm.git/commitdiff
add support for PLD template
authorElan Ruusamäe <glen@delfi.ee>
Wed, 24 Apr 2013 07:36:55 +0000 (10:36 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Wed, 24 Apr 2013 07:44:30 +0000 (10:44 +0300)
gem2rpm.spec
pld.patch [new file with mode: 0644]
pld.spec.erb [new file with mode: 0644]

index dc374cc104a95126711c19f4dcca9ca8aa12b7c7..984ded9d9e5da298e3a2c5a6c39d728cea886f6f 100644 (file)
@@ -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 (file)
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 (file)
index 0000000..c5f899d
--- /dev/null
@@ -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
This page took 0.086438 seconds and 4 git commands to generate.