LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File singularity.spec of Package singularity (Project home:cney)

#
# 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.
#
# 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 libsingularity libsingularity1

Name: singularity
Version: 2.6.1
Release: 0
Summary: Application and environment virtualization
# https://spdx.org/licenses/BSD-3-Clause-LBNL.html
License: BSD-3-Clause-LBNL
Group: Productivity/Clustering/Computing
URL: https://www.sylabs.io/

ExclusiveOS: linux

Source: %{name}-%{version}.tar.gz
Source5: singularity-rpmlintrc

BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: fdupes
BuildRequires: python
BuildRequires: libarchive-devel

Requires(pre): shadow
PreReq: permissions >= 20170922

BuildRoot:  %{_tmppath}/%{name}-%{version}-build

Requires: squashfs
Requires: %{libsingularity} = %{version}

%description
Singularity provides functionality to make portable
containers that can be used across host environments.


%package devel
Summary: Development libraries for Singularity
Group: Development/Libraries/C and C++
Requires: %{libsingularity} = %{version}
Requires: %{name} = %{version}

%description devel
Development package for singularity. This package includes the header files
and libraries for the Singularity API.


%package -n %{libsingularity}
Summary: Libraries for Singularity
Group: System/Libraries

%description -n %{libsingularity}
This package contains the library needed to run programs dynamically linked
with Singularity.


%prep
%setup

sed -i '1 s|#!/bin/bash.*$||' etc/bash_completion.d/singularity
sed -i '1 s|#!/usr/bin/env.*$||' libexec/python/shub/api.py
find . -type f -name '*.py' -exec sed -ri 's|#![[:blank:]]*/usr/bin/env[[:blank:]]+(.*)$|#!/usr/bin/\1|' {} +
rm -rf examples/legacy

%build
./autogen.sh
%configure \
    --localstatedir=/var/lib \
    --with-gnu-ld \
    --with-userns

%{__make} %{?_smp_mflags} CFLAGS+=-fPIE LDFLAGS+=-pie

%install
%makeinstall
rm -f %{buildroot}/%{_libdir}/%{name}/lib%{name}-*.a
rm -f %{buildroot}/%{_libdir}/%{name}/lib%{name}-*.la
mkdir -p %{buildroot}/%{_datadir}/bash-completion/completions
mv %{buildroot}/etc/bash_completion.d/singularity %{buildroot}/%{_datadir}/bash-completion/completions
%fdupes %{buildroot}

%post -n %{libsingularity} -p /sbin/ldconfig
%postun -n %{libsingularity} -p /sbin/ldconfig

%pre
getent group %{name} >/dev/null || groupadd -r %{name}
exit 0

%post
%set_permissions %{_libexecdir}/%{name}/bin/action-suid
%set_permissions %{_libexecdir}/%{name}/bin/mount-suid
%set_permissions %{_libexecdir}/%{name}/bin/start-suid

%verifyscript
%verify_permissions %{_libexecdir}/%{name}/bin/action-suid
%verify_permissions %{_libexecdir}/%{name}/bin/mount-suid
%verify_permissions %{_libexecdir}/%{name}/bin/start-suid

%clean
#echo NOOP
rm -rf %{buildroot}

%files
%defattr(-,root,root)

%license COPYRIGHT.md LICENSE-LBNL.md LICENSE.md
%doc examples CHANGELOG.md CONTRIBUTORS.md README.md

%attr(0755,root,root) %dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/*

%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/%{name}


%{_bindir}/%{name}
%{_bindir}/run-%{name}

%dir %{_libexecdir}/%{name}
%dir %{_libexecdir}/%{name}/bin
%dir %{_libexecdir}/%{name}/cli

%{_libexecdir}/%{name}/bin/action
%{_libexecdir}/%{name}/bin/builddef
%{_libexecdir}/%{name}/bin/cleanupd
%{_libexecdir}/%{name}/bin/docker-extract
%{_libexecdir}/%{name}/bin/get-configvals
%{_libexecdir}/%{name}/bin/get-section
%{_libexecdir}/%{name}/bin/image-type
%{_libexecdir}/%{name}/bin/mount
%{_libexecdir}/%{name}/bin/prepheader
%{_libexecdir}/%{name}/bin/start

%{_libexecdir}/%{name}/cli/action_argparser.*
%{_libexecdir}/%{name}/cli/apps.*
%{_libexecdir}/%{name}/cli/bootstrap.*
%{_libexecdir}/%{name}/cli/build.*
%{_libexecdir}/%{name}/cli/check.*
%{_libexecdir}/%{name}/cli/create.*
%{_libexecdir}/%{name}/cli/exec.*
%{_libexecdir}/%{name}/cli/help.*
%{_libexecdir}/%{name}/cli/image.*
%{_libexecdir}/%{name}/cli/inspect.*
%{_libexecdir}/%{name}/cli/instance.*
%{_libexecdir}/%{name}/cli/mount.*
%{_libexecdir}/%{name}/cli/pull.*
%{_libexecdir}/%{name}/cli/run.*
%{_libexecdir}/%{name}/cli/selftest.*
%{_libexecdir}/%{name}/cli/shell.*
%{_libexecdir}/%{name}/cli/test.*

%{_libexecdir}/%{name}/bootstrap-scripts
%{_libexecdir}/%{name}/functions
%{_libexecdir}/%{name}/handlers
%{_libexecdir}/%{name}/helpers
%{_libexecdir}/%{name}/image-handler.sh
%{_libexecdir}/%{name}/python

#SUID programs
%attr(4750,root,%{name}) %{_libexecdir}/%{name}/bin/action-suid
%attr(4750,root,%{name}) %{_libexecdir}/%{name}/bin/mount-suid
%attr(4750,root,%{name}) %{_libexecdir}/%{name}/bin/start-suid

%dir %{_localstatedir}/lib/%{name}
%dir %{_localstatedir}/lib/%{name}/mnt
%dir %{_localstatedir}/lib/%{name}/mnt/container
%dir %{_localstatedir}/lib/%{name}/mnt/final
%dir %{_localstatedir}/lib/%{name}/mnt/overlay
%dir %{_localstatedir}/lib/%{name}/mnt/session

%exclude %{_libdir}/%{name}/lib%{name}-*.so*

%{_mandir}/man1/%{name}.1.gz


%files -n %{libsingularity}
%defattr(-,root,root)
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/lib%{name}-*.so.*


%files devel
%defattr(-,root,root)
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/*.h
%{_libdir}/%{name}/lib%{name}-*.so


%changelog