This repository was archived by the owner on Oct 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathcharliecloud.spec
204 lines (174 loc) · 5.89 KB
/
charliecloud.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
# Charliecloud fedora package spec file
#
# Contributors:
# Dave Love @loveshack
# Michael Jennings @mej
# Jordan Ogas @jogas
# Reid Priedhorksy @reidpr
# Don't try to compile python3 files with /usr/bin/python.
%{?el7:%global __python %__python3}
Name: charliecloud
Version: @VERSION@
Release: @RELEASE@%{?dist}
Summary: Lightweight user-defined software stacks for high-performance computing
License: ASL 2.0
URL: https://hpc.github.io/%{name}/
Source0: https://github.com/hpc/%{name}/releases/downloads/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: gcc rsync bash findutils
%if 0%{?el7}
Patch0: el7-pkgdir.patch
%endif
%if 0%{!?el7} && 0%{!?el8}
Requires: fuse3 squashfuse
BuildRequires: fuse3-libs fuse3-devel squashfuse-devel
Patch1: no-squashfuse-rpath.patch
%endif
%description
Charliecloud uses Linux user namespaces to run containers with no privileged
operations or daemons and minimal configuration changes on center resources.
This simple approach avoids most security risks while maintaining access to
the performance and functionality already on offer.
Container images can be built using Docker or anything else that can generate
a standard Linux filesystem tree.
For more information: https://hpc.github.io/charliecloud
%package builder
Summary: Charliecloud container image building tools
License: ASL 2.0 and MIT
BuildRequires: python3-devel
BuildRequires: python%{python3_pkgversion}-requests
Requires: %{name}
Requires: python3
Requires: python%{python3_pkgversion}-requests
%if 0%{!?el7}
Requires: git >= 2.28.1
%endif
Provides: bundled(python%{python3_pkgversion}-lark-parser) = 1.1.9
%description builder
This package provides ch-image, Charliecloud's completely unprivileged container
image manipulation tool.
%package doc
Summary: Charliecloud html documentation
License: BSD and ASL 2.0
BuildArch: noarch
Obsoletes: %{name}-doc < %{version}-%{release}
BuildRequires: python%{python3_pkgversion}-sphinx
BuildRequires: python%{python3_pkgversion}-sphinx_rtd_theme
Requires: python%{python3_pkgversion}-sphinx_rtd_theme
%description doc
Html and man page documentation for %{name}.
%package test
Summary: Charliecloud test suite
License: ASL 2.0
Requires: %{name} %{name}-builder
%if 0%{!?el7}
Requires: bats
%endif
Obsoletes: %{name}-test < %{version}-%{release}
%description test
Test fixtures for %{name}.
%prep
%setup -q
%if 0%{?el7}
%patch0 -p1
%endif
%if 0%{!?el7} && 0%{!?el8}
%patch 1 -p1
%endif
%build
# Use old inlining behavior, see:
# https://github.com/hpc/charliecloud/issues/735
CFLAGS=${CFLAGS:-%optflags -fgnu89-inline}; export CFLAGS
# FIXME: use --disable test when https://github.com/hpc/charliecloud/issues/1836
# is resolved.
%configure --docdir=%{_pkgdocdir} \
--libdir=%{_prefix}/lib \
--with-python=/usr/bin/python3 \
%if 0%{!?el7} && 0%{!?el8}
--with-libsquashfuse=/usr \
%endif
%if 0%{?el7}
--with-sphinx-build=%{_bindir}/sphinx-build-3.6
%else
--with-sphinx-build=%{_bindir}/sphinx-build
%endif
%install
%make_install
cat > README.EL7 <<EOF
For RHEL7 you must increase the number of available user namespaces to a non-
zero number (note the number below is taken from the default for RHEL8):
echo user.max_user_namespaces=3171 >/etc/sysctl.d/51-userns.conf
sysctl -p /etc/sysctl.d/51-userns.conf
Note for versions below RHEL7.6, you will also need to enable user namespaces:
grubby --args=namespace.unpriv_enable=1 --update-kernel=ALL
reboot
Please visit https://hpc.github.io/charliecloud/ for more information.
EOF
# Remove bundled sphinx bits.
%{__rm} -rf %{buildroot}%{_pkgdocdir}/html/_static/css
%{__rm} -rf %{buildroot}%{_pkgdocdir}/html/_static/fonts
%{__rm} -rf %{buildroot}%{_pkgdocdir}/html/_static/js
# Remove el7 test bits; unnecessary after #1836 is resolved.
%if 0%{?el7}
%{__rm} -f %{buildroot}%{_bindir}/ch-test
%{__rm} -rf %{buildroot}%{_libexecdir}/%{name}
%{__rm} -f %{buildroot}%{_mandir}/man1/ch-test.1*
%endif
# Use Fedora package sphinx bits.
sphinxdir=%{python3_sitelib}/sphinx_rtd_theme/static
ln -s "${sphinxdir}/css" %{buildroot}%{_pkgdocdir}/html/_static/css
ln -s "${sphinxdir}/fonts" %{buildroot}%{_pkgdocdir}/html/_static/fonts
ln -s "${sphinxdir}/js" %{buildroot}%{_pkgdocdir}/html/_static/js
# Remove bundled license and readme (prefer license and doc macros).
%{__rm} -f %{buildroot}%{_pkgdocdir}/LICENSE
%{__rm} -f %{buildroot}%{_pkgdocdir}/README.rst
%files
%license LICENSE
%doc README.rst %{?el7:README.EL7}
%{_bindir}/ch-checkns
%{_bindir}/ch-convert
%{_bindir}/ch-fromhost
%{_bindir}/ch-run
%{_bindir}/ch-run-oci
%{_mandir}/man1/ch-checkns.1*
%{_mandir}/man1/ch-convert.1*
%{_mandir}/man1/ch-fromhost.1*
%{_mandir}/man1/ch-run.1*
%{_mandir}/man1/ch-run-oci.1*
%{_mandir}/man7/charliecloud.7*
%{_mandir}/man7/ch-completion.bash.7*
%{_prefix}/lib/%{name}/base.sh
%{_prefix}/lib/%{name}/contributors.bash
%{_prefix}/lib/%{name}/version.sh
%{_prefix}/lib/%{name}/version.txt
%files builder
%{_bindir}/ch-image
%{_mandir}/man1/ch-image.1*
%{_prefix}/lib/%{name}/build.py
%{_prefix}/lib/%{name}/build_cache.py
%{_prefix}/lib/%{name}/charliecloud.py
%{_prefix}/lib/%{name}/filesystem.py
%{_prefix}/lib/%{name}/force.py
%{_prefix}/lib/%{name}/image.py
%{_prefix}/lib/%{name}/lark
%{_prefix}/lib/%{name}/lark-1.1.9.dist-info
%{_prefix}/lib/%{name}/misc.py
%{_prefix}/lib/%{name}/pull.py
%{_prefix}/lib/%{name}/push.py
%{_prefix}/lib/%{name}/registry.py
%{_prefix}/lib/%{name}/version.py
%{?el7:%{_prefix}/lib/%{name}/__pycache__}
%files doc
%license LICENSE
%{_pkgdocdir}/examples
%{_pkgdocdir}/html
%{?el7:%exclude %{_pkgdocdir}/examples/*/__pycache__}
%files test
%if 0%{?el7}
%else
%{_bindir}/ch-test
%{_libexecdir}/%{name}
%{_mandir}/man1/ch-test.1*
%endif
%changelog
* Thu Apr 16 2020 <[email protected]> - @VERSION@-@RELEASE@
- Add new charliecloud package.