-
Notifications
You must be signed in to change notification settings - Fork 1
/
rbenv-rubygem-cpanel-helper.spec.in
106 lines (81 loc) · 2.95 KB
/
rbenv-rubygem-cpanel-helper.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
%global gem_version <%= gem_version %>
%global ruby_version <%= ruby_version %>
%global gemname cpanel-helper
%global localbindir %{_usr}/local/bin
# our common rbenv stuff
%global rbenv /usr/bin/env RBENV_VERSION=%{ruby_version} /usr/bin/rbenv
%global rbenv_exec %{rbenv} exec
%global ruby %{rbenv_exec} ruby
%global erb %{rbenv_exec} erb
%global rake %{rbenv_exec} rake
%global _gem %{rbenv_exec} gem
%global gembindir %(%{ruby} -rrbconfig -e "puts RbConfig::CONFIG['bindir'].gsub(%r{(/versions/[^/-]+)(-p\\d+)?/}, '\\\\1/')")
%global gemdir %(%{ruby} -rrubygems -e 'puts Gem::dir.gsub(%r{(rbenv/versions/[^/-]+?)(-p\\d+)?(/lib/ruby)}, "\\\\1\\\\3")' 2>/dev/null)
%global gemdir_extensions %{gemdir}/extensions
%global gemdir_doc_extensions %{gemdir}/doc/extensions
%global geminstdir %{gemdir}/gems/%{gemname}-%{gem_version}
%global rbenv_root %(%rbenv root)
%global ruby_shim %{rbenv_root}/shims/ruby
%bcond_with rdoc
Summary: CPanel API library proxy
Name: rbenv-rubygem-%{gemname}
Version: %{gem_version}
Release: 1%{?dist}
Vendor: %{?_host_vendor}
License: ASL 2.0
Group: System Environment/Base
URL: http://www.puppetlabs.com/puppet/related-projects/%{name}
# Note this URL will only be valid at official tags from Puppet Labs
Source0: http://rubygems.org/gems/%{gemname}-%{version}.gem
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: rbenv-ruby = %{ruby_version}
Requires: rbenv-ruby = %{ruby_version}
Requires: rbenv >= 1.1.1
Requires: rbenv-rubygem(activesupport) >= 3.2.22.5
Provides: rbenv-rubygem(%{gemname}) = %{version}
Obsoletes: rubygem-%{gemname}
%description
CPanel API library that acts like small proxy between your app and CPanel. Can execute external JSON/XML CPanel API and internal XML'zed CPanel API2.
%if %{with rdoc}
%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
%description doc
This package contains documentation for %{name}.
%endif
%install
rm -rf %{buildroot}
%{_gem} install --local --install-dir %{buildroot}%{gemdir} \
%if %{with rdoc}
--document=rdoc \
%else
--no-document \
%endif
--force %{SOURCE0}
rm -rf %{buildroot}/%{geminstdir}/{etc,ext,install.rb,spec,.gitignore,test,*.gemspec,.ruby-version,.ruby-gemset}
%if %{without rdoc}
rm -f %{buildroot}/%{geminstdir}/{Rakefile,Gemfile,*.gemspec}
%endif
%clean
rm -rf %{buildroot}
%post
%{rbenv} rehash
%files
%defattr(-, root, root, -)
%dir %{geminstdir}
%{geminstdir}/lib
%{gemdir}/cache/%{gemname}-%{version}.gem
%{gemdir}/specifications/%{gemname}-%{version}.gemspec
%doc %{geminstdir}/README.textile
%if %{with rdoc}
%files doc
%defattr(-, root, root, -)
%{geminstdir}/Rakefile
%{geminstdir}/Gemfile
%{gemdir}/doc/%{gemname}-%{version}
%endif
%changelog
* %(env LANG=C date "+%a %b %d %Y") Yuri Arabadji <[email protected]> - %{version}-%{release}
autobuild