Hello, I've gotten through the first few stages of building a package for Singularity but it is breaking on the install step. The specific instructions for building and installing Singularity are here.

./mconfig && \
make -C builddir && \
sudo make -C builddir install

I am guessing that the sudo is not necessary but I have tried all the options I can think of, specifically:

sudo make -C builddir install
make -C builddir install
%make -C builddir install

but they all error out. Using sudo gives

`ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

sudo: no tty present and no askpass program specified
`

Using % at the beginning gives

INSTALL /usr/local/libexec/singularity/bin/starter
INSTALL /usr/local/var/singularity/mnt/session
install: cannot create directory ‘/usr/local’: Permission denied
install: cannot create directory ‘/usr/local’: Permission denied
make: *** [Makefile:250: /usr/local/var/singularity/mnt/session] Error 1
make: *** [Makefile:238: /usr/local/libexec/singularity/bin/starter] Error 1

And using the basic "make -C builddir install" gives

install: cannot create directory ‘/usr/local’: Permission denied
make: *** [Makefile:164: /usr/local/bin/singularity] Error 1

Any assistance is greatly appreciated! I have solbuild-config-unstable installed and have ran sudo solbuild init. The setup and build stages run fine as well so it appears to just be an issue with that final install stage. And just to make sure, here is my package.yaml in case I made a mistake somewhere else in there:

name : singularity
version : 3.3.0
release : 1
source :
- git|https://github.com/sylabs/singularity.git : a066ffcb65c2f4a8f10a16623f228e0a7c49da2b
license: BSD-3-Clause
component : system.devel
summary : Containerization software.
description: |
Singularity placeholder
builddeps :
- openssl-devel
- crossguid-devel
- gpgme-devel
- golang
- squashfs-tools
- libseccomp-devel
- wget
- pkg-config
- git
setup : |
export PATH=/usr/local/go/bin:$PATH
set -m
./mconfig
build : |
%make -C builddir
install : |
%make -C builddir install

export PATH=/usr/local/go/bin:$PATH

This path is incorrect
https://dev.getsol.us/source/golang/browse/master/pspec_x86_64.xml$21

%make -C builddir install

You should use the %make_install macro
https://getsol.us/articles/packaging/package.yml/en/#actionable-macros

Good luck! 🙂

PS: You'll have to read the section concerning the build dependencies + the list should be sorted in alphabetical order and all the packages that are in system.base and system.devel should be omitted from the dependencies.

( and Josh made a great serie of youtube videos, starting here )

Awesome, thank you both kyrios and ender, took a bit of trial and error but I was able to get it to build. In the end it was a combination of the suggestion and what I had. It needed %make_install -C builddir to fully build in case anyone else runs across a similar issue one day. I'll go ahead and post my final yaml as well. Obviously if you see anything wrong with it right off I would be happy to hear!

name      : singularity
version   : 3.3.0
release   : 1
source    :
    - git|https://github.com/sylabs/singularity.git : a066ffcb65c2f4a8f10a16623f228e0a7c49da2b
license: BSD-3-Clause
component : virt
summary   : Application containers for Linux
description: |
    Application containers for Linux
builddeps : 
    - crossguid-devel
    - git
    - golang
    - pkgconfig(gpgme)
    - pkgconfig(libseccomp) 
    - pkgconfig(libssl)
    - squashfs-tools
    - wget

setup     : |
    export PATH=/usr/local/go:$PATH
    set -m
    ./mconfig
build     : |
    %make -C builddir
install   : |
    %make_install -C builddir

Mod Edit: Fix Code Tags.