-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathopenchami.spec
More file actions
89 lines (75 loc) · 3.06 KB
/
openchami.spec
File metadata and controls
89 lines (75 loc) · 3.06 KB
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
Name: openchami
Version: %{version}
Release: %{rel}
Summary: OpenCHAMI RPM package
License: MIT
URL: https://openchami.org
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
Requires: podman
Requires: jq
Requires: curl
Requires(post): coreutils
Requires(post): openssl
Requires(post): hostname
Requires(post): sed
%description
The quadlets, systemd units, and config files for the Open Composable, Heterogeneous, Adaptable Management Infrastructure
%prep
%setup -q
%build
# nothing to build
%install
# 1) Install config, unit, and script files
mkdir -p %{buildroot}/etc/openchami/configs \
%{buildroot}/etc/openchami/pg-init \
%{buildroot}/etc/containers/systemd \
%{buildroot}/etc/systemd/system \
%{buildroot}/usr/bin \
%{buildroot}/etc/profile.d \
%{buildroot}/usr/libexec/openchami
cp -r systemd/configs/* %{buildroot}/etc/openchami/configs/
cp -r systemd/containers/* %{buildroot}/etc/containers/systemd/
cp -r systemd/volumes/* %{buildroot}/etc/containers/systemd/
cp -r systemd/networks/* %{buildroot}/etc/containers/systemd/
cp -r systemd/targets/* %{buildroot}/etc/systemd/system/
cp -r systemd/system/* %{buildroot}/etc/systemd/system/
cp scripts/bootstrap_openchami.sh %{buildroot}/usr/libexec/openchami/
cp scripts/openchami-certificate-update %{buildroot}/usr/bin/
cp scripts/openchami_profile.sh %{buildroot}/etc/profile.d/openchami.sh
cp scripts/multi-psql-db.sh %{buildroot}/etc/openchami/pg-init/multi-psql-db.sh
cp scripts/ohpc-nodes.sh %{buildroot}/usr/libexec/openchami/
chmod +x %{buildroot}/usr/libexec/openchami/bootstrap_openchami.sh
chmod +x %{buildroot}/usr/libexec/openchami/ohpc-nodes.sh
chmod +x %{buildroot}/usr/libexec/openchami/bootstrap_openchami.sh
chmod +x %{buildroot}/usr/bin/openchami-certificate-update
chmod +x %{buildroot}/usr/libexec/openchami/ohpc-nodes.sh
chmod 600 %{buildroot}/etc/openchami/configs/openchami.env
chmod 644 %{buildroot}/etc/openchami/configs/*
%files
%license LICENSE
%config(noreplace) /etc/openchami/configs/*
/etc/containers/systemd/*
/etc/systemd/system/openchami.target
/etc/systemd/system/openchami-cert-renewal.service
/etc/systemd/system/openchami-cert-renewal.timer
/etc/systemd/system/openchami-cert-trust.service
/usr/libexec/openchami/bootstrap_openchami.sh
/usr/libexec/openchami/ohpc-nodes.sh
/etc/profile.d/openchami.sh
/etc/openchami/pg-init/multi-psql-db.sh
/usr/bin/openchami-certificate-update
%pre
if [ -f /etc/containers/systemd/coresmd.container ]; then
echo 'WARNING: /etc/containers/systemd/coresmd.container as been replaced by /etc/containers/systemd/coresmd-coredhcp.container.'
echo ' Migrate to coresmd-coredhcp to avoid any issues.'
fi
%post
# reload systemd so new units are seen
systemctl daemon-reload
# bootstrap
systemctl stop firewalld
/usr/libexec/openchami/bootstrap_openchami.sh
%postun
# reload systemd on uninstall
systemctl daemon-reload