forked from theforeman/foreman-packaging
/
tfm.spec
419 lines (339 loc) · 15 KB
/
tfm.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
%{!?scl_name_base: %global scl_name_base tfm}
%global scl_vendor theforeman
%global _scl_prefix /opt/%{scl_vendor}
%{!?scl:%global scl %{scl_name_base}%{?scl_name_version}}
%{!?scl_vendor_in_name: %global scl_vendor_in_name 0}
%{?scl_package:%scl_package %scl}
# Fallback to sclo-ror42 etc. when scldevel's not in the buildroot
%global scl_ror tfm-ror52
%global scl_prefix_ror %{scl_ror}-
%global scl_ruby rh-ruby25
%global scl_prefix_ruby %{scl_ruby}-
# Do not produce empty debuginfo package.
%global debug_package %{nil}
%global install_scl 1
Summary: Package that installs %scl
Name: %scl_name
Version: 5.0
Release: 8%{?dist}
License: GPLv2+
Group: Applications/File
Source0: README
Source1: LICENSE
Source2: tfm.attr
# This should be removed as soon as scl-utils automatically generate
# dependencies on scl -runtime (rhbz#1054711).
Requires: %{scl_runtime}
Requires: %{scl_runtime}-assets
%if 0%{?install_scl}
Requires: %{scl_ror}
Requires: %{scl_ruby}
%endif
BuildRequires: scl-utils-build help2man
BuildRequires: %{scl_prefix_ror}scldevel
BuildRequires: %{scl_prefix_ror}runtime
BuildRequires: %{scl_prefix_ruby}scldevel
BuildRequires: %{scl_prefix_ruby}rubygems-devel
%description
This is the main package for %scl Software Collection.
Provides dependencies for Foreman (http://theforeman.org/).
%package runtime
Summary: Package that handles %scl Software Collection.
Group: Applications/File
Requires: scl-utils
Requires: %{scl_prefix_ror}runtime
Requires: %{scl_prefix_ruby}runtime
Requires: %{_root_bindir}/scl_source
Requires(post): policycoreutils-python
Obsoletes: ruby193-ruby-wrapper
# Obsolete packages no longer carried within this SCL to both clean up
# and to ensure smooth upgrades when old packages deps aren't satisified
Obsoletes: %{scl_prefix}npm(babel-preset-es2015) < 6.6.0-4
Obsoletes: %{scl_prefix}npm(flux) < 2.1.1-2
Obsoletes: %{scl_prefix}npm(intl) < 1.2.5-2
Obsoletes: %{scl_prefix}npm(moment) < 2.17.1-2
Obsoletes: %{scl_prefix}rubygem-ace-rails-ap < 4.1.1-2
Obsoletes: %{scl_prefix}rubygem-ansi < 1.4.3-7
Obsoletes: %{scl_prefix}rubygem-archive-tar-minitar < 0.5.2-12
Obsoletes: %{scl_prefix}rubygem-audited-activerecord < 4.2.0-3
Obsoletes: %{scl_prefix}rubygem-azure < 0.7.10-2
Obsoletes: %{scl_prefix}rubygem-azure-core < 0.1.1-3
Obsoletes: %{scl_prefix}rubygem-colorize < 0.7.7-5
Obsoletes: %{scl_prefix}rubygem-concurrent-ruby < 1.0.1-2
Obsoletes: %{scl_prefix}rubygem-dalli < 2.6.4-4
Obsoletes: %{scl_prefix}rubygem-ejs < 1.1.1-4
Obsoletes: %{scl_prefix}rubygem-flot-rails < 0.0.3-8
Obsoletes: %{scl_prefix}rubygem-faraday_middleware < 0.10.0-3
Obsoletes: %{scl_prefix}rubygem-fog-azure < 0.0.8-9
Obsoletes: %{scl_prefix}rubygem-foreigner < 1.7.1-4
Obsoletes: %{scl_prefix}rubygem-foreman_abrt < 0.0.7-3
Obsoletes: %{scl_prefix}rubygem-foreman_azure < 1.3.1-2
Obsoletes: %{scl_prefix}rubygem-foreman_param_lookup < 0.3.0-3
Obsoletes: %{scl_prefix}rubygem-foreman_reserve < 0.1.8.3-6
Obsoletes: %{scl_prefix}rubygem-foreman_snapshot < 0.1.0-5
Obsoletes: %{scl_prefix}rubygem-foremancli < 1.0-10
Obsoletes: %{scl_prefix}rubygem-hirb-unicode < 0.0.5-9
Obsoletes: %{scl_prefix}rubygem-i18n < 0.7.0-3
Obsoletes: %{scl_prefix}rubygem-ipaddrjs-rails < 1.1.1-2
Obsoletes: %{scl_prefix}rubygem-jquery_pwstrength_bootstrap_4 < 1.2.2-5
Obsoletes: %{scl_prefix}rubygem-jquery-rails < 3.1.0-4
Obsoletes: %{scl_prefix}rubygem-less < 2.5.1-5
Obsoletes: %{scl_prefix}rubygem-less-rails < 2.5.0-4
Obsoletes: %{scl_prefix}rubygem-macaddr < 1.7.1-2
Obsoletes: %{scl_prefix}rubygem-multi_json < 1.10.1-4
Obsoletes: %{scl_prefix}rubygem-multi-select-rails < 0.9.12-6
Obsoletes: %{scl_prefix}rubygem-nokogiri < 1.6.6.2-3
Obsoletes: %{scl_prefix}rubygem-protected_attributes < 1.1.3-4
Obsoletes: %{scl_prefix}rubygem-rails-observers < 0.1.2-8
Obsoletes: %{scl_prefix}rubygem-sass < 3.4.19-4
Obsoletes: %{scl_prefix}rubygem-sass-rails < 5.0.4-3
Obsoletes: %{scl_prefix}rubygem-select2-rails < 3.5.10-3
Obsoletes: %{scl_prefix}rubygem-smart_proxy_abrt < 0.0.8-4
Obsoletes: %{scl_prefix}rubygem-sprockets < 3.5.2-2
Obsoletes: %{scl_prefix}rubygem-sprockets-rails < 2.3.3-2
Obsoletes: %{scl_prefix}rubygem-table_print < 1.5.1-7
Obsoletes: %{scl_prefix}rubygem-turbolinks < 2.5.3-4
Obsoletes: %{scl_prefix}rubygem-underscore-rails < 1.8.3-5
Obsoletes: %{scl_prefix}rubygem-uuid < 2.3.8-2
Obsoletes: %{scl_prefix}rubygem-uuidtools < 2.1.3-6
Obsoletes: %{scl_prefix}rubygem-quiet_assets
Obsoletes: %{scl_prefix}rubygem-autoparse < 0.3.3-9
Obsoletes: %{scl_prefix}rubygem-launchy < 2.4.3-7
Obsoletes: %{scl_prefix}rubygem-foreman_one < 0.4-4
Obsoletes: %{scl_prefix}rubygem-foreman-opennebula < 4.8.0-7
Obsoletes: %{scl_prefix}rubygem-fog < 1.42.1-3
Obsoletes: %{scl_prefix}rubygem-extlib < 0.9.16-7
Obsoletes: %{scl_prefix}rubygem-docker-api < 1.28.0-5
%description runtime
Package shipping essential scripts to work with %scl Software Collection.
Provides dependencies for Foreman (http://theforeman.org/).
%package runtime-assets
Summary: Package that adds asset compilation for %scl Software Collection.
Group: Applications/File
Requires: %{scl_prefix}runtime
%description runtime-assets
Package shipping additional scripts to work with %scl Software Collection.
Provides additional asset compilation dependencies for Foreman
(http://theforeman.org/).
%package build
Summary: Package shipping basic build configuration
Group: Applications/File
Requires: scl-utils-build
Requires: %{scl_runtime}
Requires: %{scl_runtime}-assets
Requires: %{scl_prefix_ror}scldevel
Requires: %{scl_prefix_ruby}scldevel
%description build
Package shipping essential configuration macros to build %scl Software Collection.
Provides dependencies for Foreman (http://theforeman.org/).
%package scldevel
Summary: Package shipping development files for %scl
Group: Applications/File
Provides: scldevel(%{scl_name})
%description scldevel
Package shipping development files, especially usefull for development of
packages depending on %scl Software Collection.
Provides dependencies for Foreman (http://theforeman.org/).
%prep
%setup -T -c
# Expand macros used in README file.
cat > README << EOF
%{expand:%(cat %{SOURCE0})}
EOF
cp %{SOURCE1} .
%build
# Generate a helper script that will be used by help2man.
cat > h2m_helper << 'EOF'
#!/bin/bash
[ "$1" == "--version" ] && echo "%{scl_name} %{version} Software Collection" || cat README
EOF
chmod a+x h2m_helper
# Generate the man page from include.h2m and ./h2m_helper --help output.
help2man -N --section 7 ./h2m_helper -o %{scl_name}.7
%install
%scl_install
cat >> %{buildroot}%{_scl_scripts}/enable << EOF
. scl_source enable %{scl_ror}
if [ -e %{_scl_scripts}/enable_assets ]; then
. %{_scl_scripts}/enable_assets
fi
export PATH=%{_bindir}\${PATH:+:\${PATH}}
export LIBRARY_PATH=%{_libdir}dd\${LIBRARY_PATH:+:\${LIBRARY_PATH}}
export LD_LIBRARY_PATH=%{_libdir}\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}
export MANPATH=%{_mandir}:\${MANPATH}
export CPATH=%{_includedir}\${CPATH:+:\${CPATH}}
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}
export GEM_PATH=%{gem_dir}:\${GEM_PATH:+\${GEM_PATH}}\${GEM_PATH:-\`scl enable %{scl_ror} -- ruby -e "print Gem.path.join(':')"\`}
export GEM_HOME="%{gem_dir}"
EOF
# enable asset compilation collections optionally, only if -runtime-assets is
# installed, to reduce deps for -runtime
cat >> %{buildroot}%{_scl_scripts}/enable_assets << EOF
# noop
EOF
# additional rpm macros for builds in the collection to set the vendor correctly
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name}-config << EOF
%%scl_vendor %{scl_vendor}
%%_scl_prefix %{_scl_prefix}
EOF
# generate rpm macros file for dependent collections
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name}-scldevel << EOF
%%scl_%{scl_name} %{scl}
%%scl_prefix_%{scl_name} %{scl_prefix}
EOF
# generate a configuration file for daemon
cat >> %{buildroot}%{?_scl_scripts}/service-environment << EOF
# Services are started in a fresh environment without any influence of user's
# environment (like environment variable values). As a consequence,
# information of all enabled collections will be lost during service start up.
# If user needs to run a service under any software collection enabled, this
# collection has to be written into SCLNAME_SCLS_ENABLED variable in
# /opt/rh/sclname/service-environment.
$(printf '%%s' '%{scl}' | tr '[:lower:][:space:]' '[:upper:]_')_SCLS_ENABLED='%{scl}'
EOF
# Install generated man page.
mkdir -p %{buildroot}%{_mandir}/man7/
install -m 644 %{?scl_name}.7 %{buildroot}%{_mandir}/man7/%{?scl_name}.7
mkdir -p %{buildroot}%{_rpmconfigdir}/fileattrs/
cp %{SOURCE2} %{buildroot}%{_rpmconfigdir}/fileattrs/
# Install wrappers into system root to activate the SCL
%{__mkdir_p} %{buildroot}%{_root_bindir}
cat >> %{buildroot}%{_root_bindir}/%{scl_name}-ruby << EOF
#!/bin/bash
source scl_source enable %{scl_name}
exec ruby "\$@"
EOF
cat >> %{buildroot}%{_root_bindir}/%{scl_name}-rake << EOF
#!/bin/bash
source scl_source enable %{scl_name}
exec rake "\$@"
EOF
scl enable %{scl_ror} - << \EOF
# Fake tfm SCL environment.
GEM_PATH=%{gem_dir}:${GEM_PATH:+${GEM_PATH}}${GEM_PATH:-`ruby -e "print Gem.path.join(':')"`} \
X_SCLS=%{scl} \
ruby -rfileutils > rubygems_filesystem.list << \EOR
# Create RubyGems filesystem.
Gem.ensure_gem_subdirectories '%{buildroot}%{gem_dir}'
FileUtils.mkdir_p File.join '%{buildroot}', Gem.default_ext_dir_for('%{gem_dir}')
# Output the relevant directories.
Gem.default_dirs[:%{scl}_system].each { |k, p| puts p }
EOR
EOF
%post runtime
# Simple copy of context from system root to DSC root.
# In case new version needs some additional rules or context definition,
# it needs to be solved.
# Unfortunately, semanage does not have -e option in RHEL-5, so we would
# have to have its own policy for collection (inspire in mysql%{scl_name_version} package)
semanage fcontext -a -e / %{?_scl_root} >/dev/null 2>&1 || :
restorecon -R %{?_scl_root} >/dev/null 2>&1 || :
selinuxenabled && load_policy || :
%files
%files runtime -f rubygems_filesystem.list
%doc README
%license LICENSE
%exclude %{_scl_scripts}/enable_assets
%scl_files
%dir %{_mandir}/man*
%config(noreplace) %{?_scl_scripts}/service-environment
%{_mandir}/man7/%{scl_name}.*
%attr(755,-,-) %{_root_bindir}/%{scl_name}-rake
%attr(755,-,-) %{_root_bindir}/%{scl_name}-ruby
%files runtime-assets
%{_scl_scripts}/enable_assets
%files build
%license LICENSE
%{_root_sysconfdir}/rpm/macros.%{scl}-config
%{_rpmconfigdir}/fileattrs
%files scldevel
%license LICENSE
%{_root_sysconfdir}/rpm/macros.%{scl_name}-scldevel
%changelog
* Wed Sep 18 2019 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> - 5.0-8
- Quote a variable in the tfm- wrappers
* Tue Sep 17 2019 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> - 5.0-7
- Optimize SCL wrapper scripts
* Thu Apr 11 2019 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> - 5.0-6
- Obsolete tfm-rubygem-extlib
- Obsolete tfm-rubygem-docker-api
* Thu Mar 28 2019 Marek Hulan <mhulan@redhat.com> - 5.0-5
- Obsolete fog
* Thu Mar 28 2019 Marek Hulan <mhulan@redhat.com> - 5.0-4
- Obsolete rubygem-opennebula and rubygem-foreman_one
* Fri Mar 15 2019 kgaikwad <kavitagaikwad103@gmail.com> - 5.0-3
- Obsolete rubygem-autoparse and rubygem-launchy
* Thu Sep 13 2018 Eric D. Helms <ericdhelms@gmail.com> - 5.0-2
- Obsolete rubygem-faraday_middleware
* Mon Aug 27 2018 Eric D. Helms <ericdhelms@gmail.com> 5.0-1
- Update to rh-ruby25 and tfm-ror52
* Tue Aug 21 2018 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> - 4.0-4
- Remove rubygem-jquery_pwstrength_bootstrap_4
* Tue Jul 17 2018 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> - 4.0-3
- Remove foreman_abrt + smart_proxy_abrt
- Remove foreman_azure + dependencies
* Wed May 30 2018 Eric D. Helms <ericdhelms@gmail.com> - 4.0-2
- rebuilt
* Thu Jan 04 2018 Eric D. Helms <ericdhelms@gmail.com> 4.0-1
- Update tfm to use Rails 5.1 and Ruby 2.4 (ericdhelms@gmail.com)
- Remove babel-preset-es2015 (me@daniellobato.me)
- use %%license tag in tfm package (evgeni@golov.de)
- drop unused rubygem-protected_attributes (evgeni@golov.de)
- Remove flux packaging (ohadlevy@gmail.com)
- Removed old tito.props entries (lzap+git@redhat.com)
- Remove sinatra and tilt, replaced by EPEL7 (dominic@cleal.org)
* Fri Mar 31 2017 Dominic Cleal <dominic@cleal.org> 3.2-10
- Remove rails-observers gem (dominic@cleal.org)
* Fri Mar 24 2017 Dominic Cleal <dominic@cleal.org> 3.2-9
- Remove ace-rails-ap gem (dominic@cleal.org)
* Mon Mar 20 2017 Dominic Cleal <dominic@cleal.org> 3.2-8
- Remove colorize gem (dominic@cleal.org)
* Thu Feb 09 2017 Dominic Cleal <dominic@cleal.org> 3.2-7
- Remove table_print (dominic@cleal.org)
* Tue Jan 24 2017 Dominic Cleal <dominic@cleal.org> 3.2-6
- Remove audited-activerecord gem (dominic@cleal.org)
* Tue Nov 15 2016 Dominic Cleal <dominic@cleal.org> 3.2-5
- Remove rubygem-macaddr, uuid (dominic@cleal.org)
* Fri Sep 23 2016 Dominic Cleal <dominic@cleal.org> 3.2-4
- Remove rubygem-multi-select-rails (me@daniellobato.me)
* Wed Sep 07 2016 Dominic Cleal <dominic@cleal.org> 3.2-3
- Remove ipaddrjs-rails (dominic@cleal.org)
* Thu Sep 01 2016 Dominic Cleal <dominic@cleal.org> 3.2-2
- Remove select2-rails (elobatocs@gmail.com)
* Thu Aug 18 2016 Dominic Cleal <dominic@cleal.org> 3.2-1
- Remove unused v8314 dependency (dominic@cleal.org)
* Mon Aug 15 2016 Dominic Cleal <dominic@cleal.org> 3.1-5
- Remove unused flot-rails gem (dominic@cleal.org)
* Thu Aug 11 2016 Dominic Cleal <dominic@cleal.org> 3.1-4
- Remove dependencies replaced with webpack (elobatocs@gmail.com)
* Mon Jun 20 2016 Dominic Cleal <dominic@cleal.org> 3.1-3
- Remove foremancli, unmaintained (dominic@cleal.org)
* Thu May 12 2016 Dominic Cleal <dominic@cleal.org> 3.1-3
- Prevent enable_assets being shipped in tfm-runtime (dominic@cleal.org)
* Mon May 09 2016 Dominic Cleal <dominic@cleal.org> 3.1-2
- Replace hirb-unicode with hirb-unicode-steakknife (dominic@cleal.org)
* Wed May 04 2016 Dominic Cleal <dominic@cleal.org> 3.1-1
- Add tfm-runtime-assets subpackage (dominic@cleal.org)
* Fri Apr 29 2016 Dominic Cleal <dominic@cleal.org> 3.0-2
- Remove unused tfm-rubygem-ansi (dominic@cleal.org)
* Wed Apr 20 2016 Dominic Cleal <dominic@cleal.org> 3.0-1
- Rebuild tfm against sclo-ror42 (dominic@cleal.org)
- Remove foreigner and packages now in sclo-ror42 (dominic@cleal.org)
* Fri Apr 15 2016 Dominic Cleal <dominic@cleal.org> 2.0-4
- Remove archive-tar-minitar package (elobatocs@gmail.com)
* Mon Apr 11 2016 Dominic Cleal <dominic@cleal.org> 2.0-3
- Add uuidtools to obsoleted packages (dominic@cleal.org)
- Fix less, less-rails package names (dominic@cleal.org)
* Fri Jan 15 2016 Dominic Cleal <dcleal@redhat.com> 2.0-2
- Remove rubygem-less and rubygem-less-rails (ericdhelms@gmail.com)
* Mon Dec 21 2015 Dominic Cleal <dcleal@redhat.com> 2.0-1
- Change to use rh-ror41, rh-ruby22 collections (dcleal@redhat.com)
- Replace tfm-rubygem-sass with ror41-rubygem-sass (dcleal@redhat.com)
- Replace tfm-rubygem-sprockets with ror41-rubygem-sprockets
(dcleal@redhat.com)
* Tue Apr 28 2015 Dominic Cleal <dcleal@redhat.com> - 1.1-1
- Add tfm-ruby/rake wrappers to bindir
* Wed Feb 04 2015 Dominic Cleal <dcleal@redhat.com> - 1.0-2
- Provide changed vendor/dir prefix macros in tfm-build
* Wed Apr 02 2014 Dominic Cleal <dcleal@redhat.com> - 1.0-1
- Initial package.