/
katello-installer-base.spec
131 lines (101 loc) · 5.61 KB
/
katello-installer-base.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
# Not building for scl right now
%undefine scl_prefix
%global scl_ruby /usr/bin/ruby
#%%global prerelease .rc3
Name: katello-installer-base
Version: 3.8.0
Release: 1%{?dist}
Summary: Puppet-based installer for the Katello and Katello Capsule
Group: Applications/System
License: GPLv3+ and ASL 2.0
URL: https://theforeman.org/plugins/katello
Source0: https://fedorapeople.org/groups/katello/releases/source/tarball/katello-installer-%{version}.tar.gz
BuildArch: noarch
Obsoletes: katello-installer < 2.1.0
Requires: foreman-installer >= 1.17.0
Requires: %{?scl_prefix}puppet >= 4.0.0
Requires: katello-selinux
Requires: openssl
Requires: katello-certs-tools
Requires: foreman-proxy
Requires: /bin/readlink
%package -n foreman-installer-katello
Summary: Foreman-installer scenarios for Katello and Foreman proxies with content
Group: Applications/System
Obsoletes: katello-installer
Obsoletes: capsule-installer
Requires: %{name} = %{version}-%{release}
Requires: katello-service >= 3.0.0
%description -n foreman-installer-katello
A set of tools for installation of Katello and Foreman proxies with content
%posttrans -n foreman-installer-katello
# See if the currently selected scenario is capsule - and migrate it to be foreman-proxy-content
if [[ "`/bin/readlink -f /etc/foreman-installer/scenarios.d/last_scenario.yaml`" == "/etc/foreman-installer/scenarios.d/capsule.yaml" ]];
then
mv /etc/foreman-installer/scenarios.d/capsule-answers.yaml /etc/foreman-installer/scenarios.d/foreman-proxy-content-answers.yaml
ln -snf /etc/foreman-installer/scenarios.d/foreman-proxy-content.yaml /etc/foreman-installer/scenarios.d/last_scenario.yaml
fi
foreman-installer --scenario katello --migrations-only > /dev/null
foreman-installer --scenario foreman-proxy-content --migrations-only > /dev/null
%files -n foreman-installer-katello
%{_datadir}/foreman-installer-katello/bin
%config(noreplace) %attr(600, root, root) %{_sysconfdir}/foreman-installer/scenarios.d/katello-answers.yaml
%config(noreplace) %attr(600, root, root) %{_sysconfdir}/foreman-installer/scenarios.d/katello.yaml
%config(noreplace) %attr(600, root, root) %{_sysconfdir}/foreman-installer/scenarios.d/foreman-proxy-content-answers.yaml
%config(noreplace) %attr(600, root, root) %{_sysconfdir}/foreman-installer/scenarios.d/foreman-proxy-content.yaml
%dir %{_sysconfdir}/foreman-installer/scenarios.d/katello.migrations
%{_sysconfdir}/foreman-installer/scenarios.d/katello.migrations
%dir %{_sysconfdir}/foreman-installer/scenarios.d/foreman-proxy-content.migrations
%{_sysconfdir}/foreman-installer/scenarios.d/foreman-proxy-content.migrations
%{_sbindir}/foreman-proxy-certs-generate
%{_sbindir}/katello-certs-check
%description
A set of tools for installation of Katello and Katello Capsule,
including Foreman and Foreman Proxy.
%prep
%setup -q -n katello-installer-%{version}
%build
#replace shebangs
sed -ri '1sX(/usr/bin/ruby|/usr/bin/env ruby)X%{scl_ruby}X' bin/*
#configure the paths
sed -ri 'sX\./configX%{_sysconfdir}/foreman-installer/scenarios.dXg' config/katello-answers.yaml config/katello.yaml bin/foreman-proxy-certs-generate
sed -ri 'sX\./configX%{_sysconfdir}/foreman-installer/scenarios.dXg' config/foreman-proxy-content.yaml
sed -ri 'sX INSTALLER_DIR.*$X INSTALLER_DIR = "%{_datadir}/katello-installer-base"Xg' bin/foreman-proxy-certs-generate
sed -ri 'sX\:installer_dir.*$X:installer_dir: %{_datadir}/katello-installer-baseXg' config/*.yaml
# module paths
sed -ri 'sX./_build/modulesX%{_datadir}/foreman-installer/modulesXg' config/*.yaml
sed -ri 'sX../katello-installer/modulesX%{_datadir}/katello-installer-base/modulesXg' config/*.yaml
#hooks
sed -i -e 'sX../katello-installer/hooksX%{_datadir}/katello-installer-base/hooksXg' config/*.yaml
%install
install -d -m0755 %{buildroot}%{_sysconfdir}/foreman-installer/scenarios.d
install -d -m0755 %{buildroot}/%{_datadir}/katello-installer-base
install -d -m0755 %{buildroot}/%{_datadir}/foreman-installer-katello/bin
install -d -m0755 %{buildroot}/%{_sbindir}
cp -dpR checks modules hooks parser_cache %{buildroot}/%{_datadir}/katello-installer-base
cp -dpR bin/foreman-proxy-certs-generate %{buildroot}/%{_datadir}/foreman-installer-katello/bin/foreman-proxy-certs-generate
cp -dpR bin/katello-certs-check %{buildroot}/%{_datadir}/foreman-installer-katello/bin/katello-certs-check
cp -dpR config/katello-answers.yaml %{buildroot}/%{_sysconfdir}/foreman-installer/scenarios.d
cp -dpR config/foreman-proxy-content-answers.yaml %{buildroot}/%{_sysconfdir}/foreman-installer/scenarios.d
cp -dpR config/katello.yaml %{buildroot}/%{_sysconfdir}/foreman-installer/scenarios.d
cp -dpR config/katello.migrations %{buildroot}/%{_sysconfdir}/foreman-installer/scenarios.d
cp -dpR config/foreman-proxy-content.yaml %{buildroot}/%{_sysconfdir}/foreman-installer/scenarios.d
cp -dpR config/foreman-proxy-content.migrations %{buildroot}/%{_sysconfdir}/foreman-installer/scenarios.d
ln -sf %{_datadir}/foreman-installer-katello/bin/foreman-proxy-certs-generate %{buildroot}/%{_sbindir}/foreman-proxy-certs-generate
ln -sf %{_datadir}/foreman-installer-katello/bin/katello-certs-check %{buildroot}/%{_sbindir}/katello-certs-check
%files
%defattr(-,root,root,-)
%{_datadir}/katello-installer-base/modules
%{_datadir}/katello-installer-base/hooks
%{_datadir}/katello-installer-base/checks
%{_datadir}/katello-installer-base/parser_cache
%doc README.*
%changelog
* Thu Aug 30 2018 Eric D. Helms <ericdhelms@gmail.com> 3.8.0-1
- Release 3.8.0
* Tue Aug 21 2018 Eric D. Helms <ericdhelms@gmail.com> 3.8.0-0.1.rc3
- Release 3.8.0 RC3
* Wed Aug 08 2018 Eric D. Helms <ericdhelms@gmail.com> 3.8.0-0.1.rc2
- Release RC2
* Tue Jul 17 2018 Eric D. Helms <ericdhelms@gmail.com> 3.8.0-0.1.rc1
- RC1