forked from apptainer/singularity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
singularity.spec.in
168 lines (134 loc) · 4.66 KB
/
singularity.spec.in
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
#
# Copyright (c) 2017, SingularityWare, LLC. All rights reserved.
#
# Copyright (c) 2015-2017, Gregory M. Kurtzer. All rights reserved.
#
# Copyright (c) 2016, The Regents of the University of California, through
# Lawrence Berkeley National Laboratory (subject to receipt of any required
# approvals from the U.S. Dept. of Energy). All rights reserved.
#
# This software is licensed under a customized 3-clause BSD license. Please
# consult LICENSE file distributed with the sources of this project regarding
# your rights to use or distribute this software.
#
# NOTICE. This Software was developed under funding from the U.S. Department of
# Energy and the U.S. Government consequently retains certain rights. As such,
# the U.S. Government has been granted for itself and others acting on its
# behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software
# to reproduce, distribute copies to the public, prepare derivative works, and
# perform publicly and display publicly, and to permit other to do so.
#
#
%{!?_rel:%{expand:%%global _rel 0.1}}
# This allows us to pick up the default value from the configure
%define with_slurm @with_slurm@
%if "%{with_slurm}" == "yes"
%define slurm 1
%else
%define slurm 0
%endif
Summary: Application and environment virtualization
Name: singularity
Version: @PACKAGE_VERSION@
Release: %{_rel}%{?dist}
# https://spdx.org/licenses/BSD-3-Clause-LBNL.html
License: BSD-3-Clause-LBNL
Group: System Environment/Base
URL: http://singularity.lbl.gov/
Source: %{name}-%{version}.tar.gz
ExclusiveOS: linux
BuildRoot: %{?_tmppath}%{!?_tmppath:/var/tmp}/%{name}-%{version}-%{release}-root
%if %slurm
# NOTE: doing a direct file dependency because experience has shown there are a few
# site-local RPMs that have random pieces missing.
BuildRequires: /usr/include/slurm/spank.h
%endif
%description
Singularity provides functionality to make portable
containers that can be used across host environments.
%package devel
Summary: Development libraries for Singularity
Group: System Environment/Development
%description devel
Development files for Singularity
%if %slurm
%package slurm
Summary: Singularity plugin for SLURM
Group: System Environment/Libraries
Requires: singularity = %{version}-%{release}
%description slurm
The Singularity plugin for SLURM allows jobs to be started within
a container. This provides a simpler interface to the user (they
don't have to be aware of the singularity executable) and doesn't
require a setuid binary.
%endif
%prep
%setup
%build
if [ ! -f configure ]; then
./autogen.sh
fi
%configure \
%if %slurm
--with-slurm
%else
--without-slurm
%endif
%{__make} %{?mflags}
%install
%{__make} install DESTDIR=$RPM_BUILD_ROOT %{?mflags_install}
rm -f $RPM_BUILD_ROOT/%{_libdir}/singularity/lib*.la
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
%doc examples AUTHORS.md CONTRIBUTING.md COPYRIGHT.md INSTALL.md LICENSE-LBNL.md LICENSE.md README.md
%attr(0755, root, root) %dir %{_sysconfdir}/singularity
%attr(0644, root, root) %config(noreplace) %{_sysconfdir}/singularity/*
%dir %{_localstatedir}/singularity
%dir %{_localstatedir}/singularity/mnt
%dir %{_localstatedir}/singularity/mnt/session
%dir %{_localstatedir}/singularity/mnt/container
%dir %{_localstatedir}/singularity/mnt/overlay
%{_bindir}/singularity
%{_bindir}/run-singularity
%{_mandir}/man1/*
%{_libdir}/singularity/lib*.so.*
%{_sysconfdir}/bash_completion.d/singularity
#SUID programs
%attr(4755, root, root) %{_libexecdir}/singularity/bin/action-suid
%attr(4755, root, root) %{_libexecdir}/singularity/bin/create-suid
%attr(4755, root, root) %{_libexecdir}/singularity/bin/expand-suid
%attr(4755, root, root) %{_libexecdir}/singularity/bin/export-suid
%attr(4755, root, root) %{_libexecdir}/singularity/bin/import-suid
%attr(4755, root, root) %{_libexecdir}/singularity/bin/mount-suid
# Binaries
%{_libexecdir}/singularity/bin/action
%{_libexecdir}/singularity/bin/bootstrap
%{_libexecdir}/singularity/bin/copy
%{_libexecdir}/singularity/bin/cleanupd
%{_libexecdir}/singularity/bin/create
%{_libexecdir}/singularity/bin/expand
%{_libexecdir}/singularity/bin/export
%{_libexecdir}/singularity/bin/get-section
%{_libexecdir}/singularity/bin/import
%{_libexecdir}/singularity/bin/mount
# Scripts
%{_libexecdir}/singularity/functions
%{_libexecdir}/singularity/image-handler.sh
# Directories
%{_libexecdir}/singularity/bootstrap-scripts
%{_libexecdir}/singularity/cli
%{_libexecdir}/singularity/python
%{_libexecdir}/singularity/helpers
%files devel
%defattr(-, root, root)
%{_libdir}/singularity/lib*.so
%{_libdir}/singularity/lib*.a
%{_includedir}/singularity/*.h
%if %slurm
%files slurm
%defattr(-, root, root)
%{_libdir}/slurm/singularity.so
%endif
%changelog