-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #370 from tri-adam/gopath
Remove GOPATH Use, Simplify RPM Spec
- Loading branch information
Showing
2 changed files
with
23 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
# | ||
# | ||
# Copyright (c) 2017-2021, SyLabs, Inc. All rights reserved. | ||
# 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. | ||
# | ||
# | ||
|
||
%define singgopath src/github.com/sylabs/singularity | ||
# perform publicly and display publicly, and to permit other to do so. | ||
# | ||
# | ||
|
||
# Disable debugsource packages; otherwise it ends up with an empty %files | ||
# file in debugsourcefiles.list on Fedora | ||
|
@@ -36,19 +34,11 @@ License: BSD-3-Clause-LBNL | |
URL: https://www.sylabs.io/singularity/ | ||
Source: %{name}-@[email protected] | ||
ExclusiveOS: linux | ||
# RPM_BUILD_ROOT wasn't being set ... for some reason | ||
%if "%{sles_version}" == "11" | ||
BuildRoot: /var/tmp/singularity-%{version}-build | ||
%endif | ||
|
||
BuildRequires: git | ||
BuildRequires: gcc | ||
BuildRequires: make | ||
%if ! 0%{?el6} | ||
%if "%{sles_version}" != "11" | ||
BuildRequires: libseccomp-devel | ||
%endif | ||
%endif | ||
%if "%{_target_vendor}" == "suse" | ||
Requires: squashfs | ||
%else | ||
|
@@ -74,25 +64,19 @@ containers that can be used across host environments. | |
export RPM_BUILD_ROOT="%{buildroot}" | ||
%endif | ||
|
||
if [ -d %{name}-%{version} ]; then | ||
# Clean up old build root | ||
# First clean go's modcache because directories are unwritable | ||
GOPATH=$PWD/%{name}-%{version}/gopath go clean -modcache | ||
rm -rf %{name}-%{version} | ||
fi | ||
|
||
# Create our build root | ||
chmod -R +w %{name}-%{version} || true | ||
rm -rf %{name}-%{version} | ||
mkdir %{name}-%{version} | ||
|
||
%build | ||
cd %{name}-%{version} | ||
|
||
# Setup an empty GOPATH for the build | ||
mkdir -p gopath | ||
export GOPATH=$PWD/gopath | ||
export PATH=$GOPATH/bin:$PATH | ||
mkdir -p "$GOPATH" | ||
|
||
# Perform the build outside of GOPATH as we are using go modules | ||
# Extract the source | ||
tar -xf "%SOURCE0" | ||
cd %{name}-@PACKAGE_VERSION@ | ||
|
||
|
@@ -113,25 +97,16 @@ cd %{name}-@PACKAGE_VERSION@ | |
--mandir=%{_mandir} \ | ||
--infodir=%{_infodir} | ||
|
||
cd builddir | ||
make old_config= | ||
make -C builddir old_config= | ||
|
||
%install | ||
cd %{name}-%{version} | ||
|
||
# Setup an empty GOPATH for the build | ||
export GOPATH=$PWD/gopath | ||
export PATH=$GOPATH/bin:$PATH | ||
cd %{name}-@PACKAGE_VERSION@ | ||
|
||
# Enter the source builddir for the install | ||
cd %{name}-@PACKAGE_VERSION@/builddir | ||
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 | ||
make DESTDIR=$RPM_BUILD_ROOT install man | ||
|
||
%if "%{suse_version}" == "11" | ||
%clean | ||
/bin/rm -rf %{buildroot} | ||
%endif | ||
make -C builddir DESTDIR=$RPM_BUILD_ROOT install man | ||
|
||
%files | ||
%attr(4755, root, root) %{_libexecdir}/singularity/bin/starter-suid | ||
|