1- #
1+ #
22# Copyright (c) 2017-2021, SyLabs, Inc. All rights reserved.
33# Copyright (c) 2017, SingularityWare, LLC. All rights reserved.
44#
55# Copyright (c) 2015-2017, Gregory M. Kurtzer. All rights reserved.
6- #
6+ #
77# Copyright (c) 2016, The Regents of the University of California, through
88# Lawrence Berkeley National Laboratory (subject to receipt of any required
99# approvals from the U.S. Dept. of Energy). All rights reserved.
10- #
10+ #
1111# This software is licensed under a customized 3-clause BSD license. Please
1212# consult LICENSE file distributed with the sources of this project regarding
1313# your rights to use or distribute this software.
14- #
14+ #
1515# NOTICE. This Software was developed under funding from the U.S. Department of
1616# Energy and the U.S. Government consequently retains certain rights. As such,
1717# the U.S. Government has been granted for itself and others acting on its
1818# behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software
1919# to reproduce, distribute copies to the public, prepare derivative works, and
20- # perform publicly and display publicly, and to permit other to do so.
21- #
22- #
23-
24- %define singgopath src/github.com/sylabs/singularity
20+ # perform publicly and display publicly, and to permit other to do so.
21+ #
22+ #
2523
2624# Disable debugsource packages; otherwise it ends up with an empty %files
2725# file in debugsourcefiles.list on Fedora
@@ -36,19 +34,11 @@ License: BSD-3-Clause-LBNL
3634URL: https://www.sylabs.io/singularity/
3735Source: %{name}-@
[email protected] 3836ExclusiveOS: linux
39- # RPM_BUILD_ROOT wasn't being set ... for some reason
40- %if "%{sles_version}" == "11"
41- BuildRoot: /var/tmp/singularity-%{version}-build
42- %endif
4337
4438BuildRequires: git
4539BuildRequires: gcc
4640BuildRequires: make
47- %if ! 0%{?el6}
48- %if "%{sles_version}" != "11"
4941BuildRequires: libseccomp-devel
50- %endif
51- %endif
5242%if "%{_target_vendor}" == "suse"
5343Requires: squashfs
5444%else
@@ -74,25 +64,19 @@ containers that can be used across host environments.
7464export RPM_BUILD_ROOT="%{buildroot}"
7565%endif
7666
77- if [ -d %{name}-%{version} ]; then
78- # Clean up old build root
79- # First clean go's modcache because directories are unwritable
80- GOPATH=$PWD/%{name}-%{version}/gopath go clean -modcache
81- rm -rf %{name}-%{version}
82- fi
83-
8467# Create our build root
68+ chmod -R +w %{name}-%{version} || true
69+ rm -rf %{name}-%{version}
8570mkdir %{name}-%{version}
8671
8772%build
8873cd %{name}-%{version}
8974
9075# Setup an empty GOPATH for the build
91- mkdir -p gopath
9276export GOPATH=$PWD/gopath
93- export PATH= $GOPATH/bin:$PATH
77+ mkdir -p " $GOPATH"
9478
95- # Perform the build outside of GOPATH as we are using go modules
79+ # Extract the source
9680tar -xf "%SOURCE0"
9781cd %{name}-@PACKAGE_VERSION@
9882
@@ -113,25 +97,16 @@ cd %{name}-@PACKAGE_VERSION@
11397 --mandir=%{_mandir} \
11498 --infodir=%{_infodir}
11599
116- cd builddir
117- make old_config=
100+ make -C builddir old_config=
118101
119102%install
120103cd %{name}-%{version}
121104
122- # Setup an empty GOPATH for the build
123105export GOPATH=$PWD/gopath
124- export PATH=$GOPATH/bin:$PATH
106+ cd %{name}-@PACKAGE_VERSION@
125107
126- # Enter the source builddir for the install
127- cd %{name}-@PACKAGE_VERSION@/builddir
128108mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
129- make DESTDIR=$RPM_BUILD_ROOT install man
130-
131- %if "%{suse_version}" == "11"
132- %clean
133- /bin/rm -rf %{buildroot}
134- %endif
109+ make -C builddir DESTDIR=$RPM_BUILD_ROOT install man
135110
136111%files
137112%attr(4755, root, root) %{_libexecdir}/singularity/bin/starter-suid
0 commit comments