-
Notifications
You must be signed in to change notification settings - Fork 145
/
rubygem-smart_proxy_dhcp_device42.spec
129 lines (102 loc) · 3.94 KB
/
rubygem-smart_proxy_dhcp_device42.spec
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
123
124
125
126
127
128
129
# template: smart_proxy_plugin
%{?scl:%scl_package rubygem-%{gem_name}}
%{!?scl:%global pkg_name %{name}}
%{!?_root_datadir:%global _root_datadir %{_datadir}}
%{!?_root_sharedstatedir:%global _root_sharedstatedir %{_sharedstatedir}}
%{!?_root_sysconfdir:%global _root_sysconfdir %{_sysconfdir}}
%global gem_name smart_proxy_dhcp_device42
%global plugin_name dhcp_device42
%global foreman_proxy_min_version 1.25
%global foreman_proxy_dir %{_root_datadir}/foreman-proxy
%global foreman_proxy_statedir %{_root_sharedstatedir}/foreman-proxy
%global foreman_proxy_bundlerd_dir %{foreman_proxy_dir}/bundler.d
%global foreman_proxy_settingsd_dir %{_root_sysconfdir}/foreman-proxy/settings.d
%global smart_proxy_dynflow_bundlerd_dir %{!?scl:/opt/theforeman/tfm/root}%{_datadir}/smart_proxy_dynflow_core/bundler.d
Name: %{?scl_prefix}rubygem-%{gem_name}
Version: 1.0.7
Release: 5%{?foremandist}%{?dist}
Summary: Device42 DHCP provider plugin for Foreman's smart proxy
Group: Applications/Internet
License: GPLv3
URL: https://www.device42.com
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# start specfile generated dependencies
Requires: foreman-proxy >= %{foreman_proxy_min_version}
Requires: %{?scl_prefix_ruby}ruby(release)
Requires: %{?scl_prefix_ruby}ruby
Requires: %{?scl_prefix_ruby}ruby(rubygems)
Requires: %{?scl_prefix}rubygem(httparty) >= 0.15
Requires: %{?scl_prefix}rubygem(httparty) < 1
BuildRequires: %{?scl_prefix_ruby}ruby(release)
BuildRequires: %{?scl_prefix_ruby}ruby
BuildRequires: %{?scl_prefix_ruby}rubygems-devel
BuildArch: noarch
Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version}
Provides: foreman-proxy-plugin-%{plugin_name} = %{version}
# end specfile generated dependencies
%{?scl:Obsoletes: rubygem-%{gem_name}}
%description
Device42 DHCP provider plugin for Foreman's smart proxy.
%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%{?scl:Obsoletes: rubygem-%{gem_name}-doc}
%description doc
Documentation for %{name}.
%prep
%{?scl:scl enable %{scl} - << \EOF}
gem unpack %{SOURCE0}
%{?scl:EOF}
%setup -q -D -T -n %{gem_name}-%{version}
%{?scl:scl enable %{scl} - << \EOF}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%{?scl:EOF}
%build
# Create the gem as gem install only works on a gem file
%{?scl:scl enable %{scl} - << \EOF}
gem build %{gem_name}.gemspec
%{?scl:EOF}
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
# by default, so that we can move it into the buildroot in %%install
%{?scl:scl enable %{scl} - << \EOF}
%gem_install
%{?scl:EOF}
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
# bundler file
mkdir -p %{buildroot}%{foreman_proxy_bundlerd_dir}
mv %{buildroot}%{gem_instdir}/bundler.d/%{plugin_name}.rb \
%{buildroot}%{foreman_proxy_bundlerd_dir}
# sample config
mkdir -p %{buildroot}%{foreman_proxy_settingsd_dir}
mv %{buildroot}%{gem_instdir}/config/dhcp_device42.yml.example \
%{buildroot}%{foreman_proxy_settingsd_dir}/dhcp_device42.yml
%files
%dir %{gem_instdir}
%config(noreplace) %attr(0640, root, foreman-proxy) %{foreman_proxy_settingsd_dir}/dhcp_device42.yml
%license %{gem_instdir}/LICENSE
%{gem_instdir}/config
%{gem_libdir}
%{foreman_proxy_bundlerd_dir}/%{plugin_name}.rb
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/README.md
%changelog
* Tue May 12 2020 Adam Ruzicka <aruzicka@redhat.com> 1.0.7-5
- Change localstatedir to sharedstatedir
* Tue Jan 07 2020 Eric D. Helms <ericdhelms@gmail.com> - 1.0.7-4
- Build for SCL
* Thu Sep 26 2019 Eric D. Helms <ericdhelms@gmail.com> - 1.0.7-3
- Update to SCL based template
* Wed Sep 12 2018 Bryan Kearney <bryan.kearney@gmail.com> - 1.0.7-2
- Move licenes which are GPL-* to GPLv3
* Mon Apr 23 2018 Anatolii Chmykhalo <anatolii.chmykhalo@device42.com> 1.0.7-1
- Update to 1.0.7
* Wed Feb 14 2018 Daniel Lobato Garcia <me@daniellobato.me> 1.0.4-1
- new package built with tito