-
Notifications
You must be signed in to change notification settings - Fork 25
/
manageiq-core
75 lines (63 loc) · 2.41 KB
/
manageiq-core
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
%package core
Summary: %{product_summary} Core
Requires: ruby >= 3
# Include weak dependencies of Ruby that we actually need
Requires: ruby-default-gems
Requires: rubygem-bigdecimal
Requires: rubygem-io-console
Requires: rubygem-irb
Requires: %{name}-gemset = %{version}-%{release}
Requires: %{name}-ansible-venv = %{version}-%{release}
Requires: git
Requires: net-snmp
Requires: net-snmp-libs
Requires: net-snmp-utils
Requires: socat
%description core
%{product_summary} Core
%pre core
# ensure this user exists (build and upgrade)
/usr/bin/id manageiq > /dev/null 2>&1 || /usr/sbin/useradd --system --create-home manageiq
# create a manageiq home directory if it doesn't exist
mkdir -p /home/manageiq && chown manageiq:manageiq /home/manageiq
%posttrans core
# 'bin' needs to be copied, not symlinked
[[ -e /var/www/miq/vmdb/bin ]] && rm -rf /var/www/miq/vmdb/bin
cp -a %{gemset_root}/vmdb/bin /var/www/miq/vmdb/bin
files=".bundle Gemfile.lock"
for file in ${files}
do
[[ -e /var/www/miq/vmdb/${file} ]] && rm -rf /var/www/miq/vmdb/${file}
ln -s %{gemset_root}/vmdb/${file} /var/www/miq/vmdb/${file}
done
%post core
# These directories contain files not owned by this rpm.
# For upgrades, ensure the files have the correct group privs
# so root and manageiq users can read them.
[ -e %{app_root}/certs/v2_key ] && %{__chown} manageiq.manageiq %{app_root}/certs/v2_key
[ -e %{app_root}/certs/v2_key ] && %{__chmod} o-rw %{app_root}/certs/v2_key
[ -e %{app_root}/certs/server.cer ] && %{__chmod} g+r %{app_root}/certs/server.cer
[ -e %{app_root}/certs/server.cer.key ] && %{__chmod} g+r %{app_root}/certs/server.cer.key
%{__chown} -R manageiq.manageiq %{app_root}/log
%{__chmod} -R o-rw %{app_root}/log
%{__chown} -R manageiq.manageiq %{app_root}/tmp/pids
%{__chmod} -R o-rw %{app_root}/tmp/pids
%{__chown} -R manageiq.manageiq %{app_root}/data
%files core
%defattr(-,root,root,-)
%{app_root}
%attr(-,manageiq,manageiq) %{app_root}/certs
%attr(-,manageiq,manageiq) %{app_root}/config
%attr(-,manageiq,manageiq) %{app_root}/log
%attr(-,manageiq,manageiq) %{app_root}/tmp
%attr(-,manageiq,manageiq) %{app_root}/data
%config(noreplace) %{app_root}/config/cable.yml
%exclude %{app_root}/public/pictures
%exclude %{app_root}/public/assets
%exclude %{app_root}/public/packs
%exclude %{app_root}/public/ui
%exclude %{app_root}/public/upload
%exclude %{app_root}/log/apache
%{manifest_root}/BUILD
%{manifest_root}/BUILD_RPM_BUILD
/usr/share/ansible/roles/