]> git.pld-linux.org Git - packages/gem2rpm.git/blame_incremental - pld.spec.erb
fix for os-release containing quotes
[packages/gem2rpm.git] / pld.spec.erb
... / ...
CommitLineData
1<% if ! spec.development_dependencies.empty? -%>
2#
3# Conditional build:
4%bcond_without tests # build without tests
5
6<% end -%>
7%define pkgname <%= spec.name %>
8Summary: <%= spec.summary %>
9Name: ruby-%{pkgname}
10Version: <%= spec.version %>
11Release: 0.1
12License: <%= spec.licenses.empty? ? "GPL v2+ or Ruby" : spec.licenses.join(", ") %>
13Group: Development/Languages
14Source0: http://rubygems.org/downloads/%{pkgname}-%{version}.gem
15# Source0-md5: -
16URL: <%= spec.homepage %>
17BuildRequires: rpm-rubyprov
18BuildRequires: rpmbuild(macros) >= 1.656
19<% if ! spec.extensions.empty? -%>
20BuildRequires: ruby-devel
21<% end -%>
22<% if ! spec.executables.empty? -%>
23BuildRequires: sed >= 4.0
24<% end -%>
25<% if ! spec.development_dependencies.empty? -%>
26%if %{with tests}
27<% for d in spec.development_dependencies.sort -%>
28<% for req in d.requirement -%>
29BuildRequires: ruby-<%= d.name %> <%= req %>
30<% end -%>
31<% end -%>
32%endif
33<% end -%>
34<% if ! spec.required_rubygems_version.empty? and ! spec.required_rubygems_version.first.empty? -%>
35Requires: ruby-rubygems <%= spec.required_rubygems_version.first %>
36<% end -%>
37<% for d in spec.runtime_dependencies.sort -%>
38<% for req in d.requirement -%>
39Requires: ruby-<%= d.name %> <%= req %>
40<% end -%>
41<% end -%>
42<% if spec.extensions.empty? -%>
43BuildArch: noarch
44<% end -%>
45BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47%description
48<%= spec.description %>
49
50%prep
51%setup -q -n %{pkgname}-%{version}
52<% if ! spec.executables.empty? -%>
53%{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
54<% end -%>
55
56%build
57# write .gemspec
58%__gem_helper spec
59
60<% if !spec.extensions.empty? -%>
61cd ext/%{pkgname}
62%{__ruby} extconf.rb
63%{__make} \
64 CC="%{__cc}" \
65 LDFLAGS="%{rpmldflags}" \
66 CFLAGS="%{rpmcflags} -fPIC"
67<% end -%>
68
69%install
70rm -rf $RPM_BUILD_ROOT
71<% if spec.executables.empty? -%>
72install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir}}
73<% else -%>
74install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir}}
75<% end -%>
76cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
77<% if ! spec.executables.empty? -%>
78cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
79<% end -%>
80cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
81
82%clean
83rm -rf $RPM_BUILD_ROOT
84
85%files
86%defattr(644,root,root,755)
87<% for f in spec.executables.sort -%>
88%attr(755,root,root) %{_bindir}/<%= f %>
89<% end -%>
90%{ruby_vendorlibdir}/%{pkgname}.rb
91%{ruby_vendorlibdir}/%{pkgname}
92%{ruby_specdir}/%{pkgname}-%{version}.gemspec
This page took 0.066545 seconds and 4 git commands to generate.