-
Notifications
You must be signed in to change notification settings - Fork 5
/
ondemand-runtime.spec
222 lines (188 loc) · 6.55 KB
/
ondemand-runtime.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
%global scl ondemand
%global scl_name_base %scl
%global _scl_prefix /opt/ood
%scl_package %scl
%{!?package_release: %define package_release 1}
%if 0%{?rhel} >= 8
%global ruby ruby
%global nodejs nodejs
%global apache httpd
%global ruby_version 3.1
%endif
%if 0%{?amzn} == 2023
%global ruby ruby3.2
%global nodejs nodejs
%global apache httpd
%global ruby_version 3.2
%endif
%global ondemand_gem_home %{_datadir}/gems/%{ruby_version}
%global ondemand_apps_gem_home %{ondemand_gem_home}/apps
%global ondemand_core_gem_home %{ondemand_gem_home}/ondemand
# Attempts to speed up builds on non x86_64
%global debug_package %{nil}
%global __os_install_post %{nil}
Name: ondemand-runtime
Version: %{package_version}
Release: %{package_release}%{?dist}
Summary: Package that handles %{scl} Software Collection.
License: MIT
BuildRequires: scl-utils-build
Requires: scl-utils
Obsoletes: ondemand-python
%description
Package shipping essential scripts to work with %{scl} Software Collection.
%package -n ondemand-build
Summary: Package shipping basic build configuration
Requires: scl-utils-build
Requires: curl
Requires: make
Requires: zlib-devel
Requires: libxslt-devel
%description -n ondemand-build
Package shipping essential configuration macros to build %{scl} Software Collection.
%package -n ondemand-scldevel
Summary: Package shipping development files for %{scl}
%description -n ondemand-scldevel
Package shipping development files, especially useful for development of
packages depending on %{scl} Software Collection.
%package -n ondemand-ruby
Summary: Meta package for pulling in SCL Ruby %{ruby}
%if 0%{?rhel} >= 8
Requires: %{ruby} >= 3.1, %{ruby} < 3.2
Requires: rubygem-rake
Requires: rubygem-bundler >= 2.1
Requires: ruby-devel
Requires: rubygems
Requires: rubygems-devel
# In some cases this RPM doesn't get pulled in
Requires: rubygem-bigdecimal
Requires: sqlite-devel
%endif
%if 0%{?amzn} == 2023
Requires: %{ruby}
Requires: %{ruby}-rubygem-rake
Requires: %{ruby}-rubygem-bundler >= 2.1
Requires: %{ruby}-devel
Requires: %{ruby}-rubygems
Requires: rubygems-devel
# In some cases this RPM doesn't get pulled in
Requires: %{ruby}-rubygem-bigdecimal
Requires: sqlite-devel
%endif
Obsoletes: ondemand-rubygem-bundler
%description -n ondemand-ruby
Meta package for pulling in SCL Ruby %{ruby}
%package -n ondemand-nodejs
Summary: Meta package for pulling in SCL nodejs %{nodejs}
%if 0%{?rhel} == 9
Requires: %{nodejs} >= 1:18.0, %{nodejs} < 1:19.0
Requires: npm
%endif
%if 0%{?rhel} == 8
Requires: %{nodejs} >= 1:18.0, %{nodejs} < 1:19.0
Requires: npm
%endif
%if 0%{?amzn} == 2023
Requires: %{nodejs} >= 1:18.0, %{nodejs} < 1:19.0
Requires: npm
%endif
%description -n ondemand-nodejs
Meta package for pulling in SCL nodejs %{nodejs}
%package -n ondemand-apache
Summary: Meta package for pulling in SCL apache %{apache}
%if 0%{?rhel} >= 8
Requires: %{apache} >= 2.4, %{apache} < 2.5
Requires: httpd-devel
Requires: mod_ssl
Requires: mod_ldap
%endif
%if 0%{?amzn} == 2023
Requires: %{apache} >= 2.4, %{apache} < 2.5
Requires: httpd-devel
Requires: mod_ssl
Requires: mod_ldap
%endif
%description -n ondemand-apache
Meta package for pulling in SCL apache %{apache}
%prep
%setup -c -T
%install
%scl_install
# Hacks to reduce number of objects in RPM which
# should speed up non x86_64 builds running on x86_64 hardware
rm -f $RPM_BUILD_DIR/%{buildsubdir}/filelist
rm -f $RPM_BUILD_DIR/%{buildsubdir}/filesystem
rm -rf %{buildroot}%{_datadir}/man/man*/*
rm -rf %{buildroot}%{_datadir}/locale/*
# End hacks
# The %undefine macros in Amazon Linux throw errors
%if 0%{?amzn} == 2023
cat > %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config << EOF
%%scl %scl
EOF
%endif
mkdir -p %{buildroot}/opt/rh
ln -s ../ood/ondemand %{buildroot}/opt/rh/%{scl}
mkdir -p %{buildroot}%{ondemand_apps_gem_home}
mkdir -p %{buildroot}%{ondemand_core_gem_home}
cat >> %{buildroot}%{_scl_scripts}/enable << EOF
export PATH="%{_bindir}:%{_sbindir}\${PATH:+:\${PATH}}"
export LD_LIBRARY_PATH="%{_libdir}\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}"
export MANPATH="%{_mandir}:\${MANPATH:-}"
export PKG_CONFIG_PATH="%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
export RUBYLIB="%{_datadir}/ruby/vendor_ruby:%{_libdir}/ruby/vendor_ruby\${RUBYLIB:+:\${RUBYLIB}}"
export GEM_HOME="%{ondemand_gem_home}"
shopt -s nullglob
for dir in %{ondemand_apps_gem_home}/* ; do
export GEM_PATH="\${dir}:\${GEM_PATH}"
done
for dir in %{ondemand_core_gem_home}/* ; do
export GEM_PATH="\${dir}:\${GEM_PATH}"
done
shopt -u nullglob
export GEM_PATH="\${GEM_HOME}:\${GEM_PATH}"
EOF
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel << EOF
%%scl_%{scl_name_base} %{scl}
%%scl_prefix_%{scl_name_base} %{scl_prefix}
%%_scl_prefix_%{scl_name_base} %{_scl_prefix}
%%scl_%{scl_name_base}_gem_home %{ondemand_gem_home}
%%scl_%{scl_name_base}_core_gem_home %{ondemand_core_gem_home}
%%scl_%{scl_name_base}_apps_gem_home %{ondemand_apps_gem_home}
EOF
%files
%scl_files
/opt/rh/%{scl}
%files -n ondemand-build
%{_root_sysconfdir}/rpm/macros.%{scl}-config
%files -n ondemand-scldevel
%{_root_sysconfdir}/rpm/macros.%{scl_name_base}-scldevel
%files -n ondemand-ruby
%{ondemand_gem_home}
%{ondemand_apps_gem_home}
%{ondemand_core_gem_home}
%files -n ondemand-nodejs
%files -n ondemand-apache
%changelog
* Tue Jan 29 2019 Trey Dockendorf <[email protected]> 1.5-5
- Depend on apache devel and add some more marcos to aid in package development
using ondemand ([email protected])
* Tue Jan 29 2019 Trey Dockendorf <[email protected]> 1.5-4
- Fix meta packages to actually get created Ensure SCL variables are used
everywhere so only one place to update dependencies ([email protected])
* Tue Jan 29 2019 Trey Dockendorf <[email protected]> 1.5-3
- Add meta packages to define SCL dependencies ([email protected])
* Wed Jan 16 2019 Trey Dockendorf <[email protected]> 1.5-2
- Add symlink /opt/rh/ondemand so that httpd24 assumption of loading SCL from
/opt/rh will work ([email protected])
* Wed Jan 16 2019 Trey Dockendorf <[email protected]> 1.5-1
- Bump ondemand-runtime to 1.5 and add RUBYLIB ([email protected])
* Wed Jan 16 2019 Trey Dockendorf <[email protected]> 1.4-4
- Disable nfsmountable for ondemand-runtime to hopefully avoid files ending up
in /etc ([email protected])
* Tue Jan 15 2019 Trey Dockendorf <[email protected]> 1.4-3
- Add _scl_prefix_ondemand macro ([email protected])
* Tue Jan 15 2019 Trey Dockendorf <[email protected]> 1.4-2
- Add ondemand-scldevel subpackage to ondemand-runtime ([email protected])
* Tue Jan 15 2019 Trey Dockendorf <[email protected]> 1.4-1
- new package built with tito