-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrbenv-rubygem-cpanel-backup.spec.in
123 lines (93 loc) · 3.4 KB
/
rbenv-rubygem-cpanel-backup.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
%global gem_version <%= gem_version %>
%global ruby_version <%= ruby_version %>
%global gemname cpanel-backup
%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} -rubygems -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_without rdoc
Summary: CPanel Backup helper
Name: rbenv-rubygem-%{gemname}
Version: %{gem_version}
Release: 5%{?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
Requires: rbenv-rubygem(cpanel-helper) >= 0.3.3
Provides: rbenv-rubygem(%{gemname}) = %{version}
%if %{with rdoc}
%description
CPanel Backup helper that helps you backup & restore CPanel accounts.
%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} --bindir %{buildroot}%{gembindir} \
%if %{with rdoc}
--rdoc \
%else
--no-rdoc --no-ri \
%endif
--force %{SOURCE0}
install -d %{buildroot}/%{gembindir}
rm -rf %{buildroot}/%{geminstdir}/{etc,ext,install.rb,spec,*.gemspec,.gitignore,test}
install -d %{buildroot}%{localbindir}
mv %{buildroot}%{gembindir}/* %{buildroot}%{localbindir}/
%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
%{geminstdir}/sbin
%attr(0750,root,root) %{localbindir}/cpb_runner
%{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
%endif
%changelog
* Wed Jul 13 2016 Yuri Arabadji <[email protected]> - 0.1.7-4
- ruby ver bump
* Thu Nov 12 2015 Yuri Arabadji <[email protected]> - 0.1.6-3
- use direct ruby and place util into /usr/local/bin
* Thu Nov 05 2015 Yuri Arabadji <[email protected]> - 0.1.6-2
- ruby ver dep bump
* Sun Oct 05 2014 Yuri Arabadji <[email protected]> - 0.1.4-2
- fix ruby dep
* Sun Jul 14 2013 Yuri Arabadji <[email protected]> - 0.1.3-1
- rpmize