File: build-singularity.def

package info (click to toggle)
singularity-container 4.1.5%2Bds4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 43,876 kB
  • sloc: asm: 14,840; sh: 3,190; ansic: 1,751; awk: 414; makefile: 413; python: 99
file content (64 lines) | stat: -rw-r--r-- 2,031 bytes parent folder | download | duplicates (2)
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
BootStrap: docker
From: almalinux:8

%post
    # Set build time env variable
    NOW=`date`
    echo "export NOW=\"${NOW}\"" >> $SINGULARITY_ENVIRONMENT

    # Install build dependencies
    dnf -y install cryptsetup gcc git golang libseccomp-devel libuuid-devel make rpm-build wget

    # Build/Install alien package converter
    dnf -y install 'dnf-command(config-manager)'
    dnf config-manager --set-enabled powertools
    dnf -y install epel-release perl
    dnf -y install debhelper dpkg-dev fakeroot
    dnf -y install alien

%runscript
    uname -r
    cat /etc/centos-release 
    echo "Container created: $NOW"
    echo "Singularity build target: $* "
    export EL_VERSION=8
    export VERSION=$*
    export TMP_DIR=$(mktemp -d -u -p .)
    curl -L -o singularity-${VERSION}.tar.gz https://github.com/sylabs/singularity/releases/download/v${VERSION}/singularity-${VERSION}.tar.gz
    rpmbuild --define "_topdir `pwd`/${TMP_DIR}" -tb singularity-${VERSION}.tar.gz
    cp ./${TMP_DIR}/RPMS/x86_64/singularity-${VERSION}-1.el${EL_VERSION}.x86_64.rpm .
    fakeroot alien singularity-${VERSION}-1.el${EL_VERSION}.x86_64.rpm
    chmod -R 777 ./${TMP_DIR}
    rm -rf ./${TMP_DIR}
    rm singularity-${VERSION}.tar.gz

%help

    SUMMARY
    This is a build container that generates installable singularity packages for singularity v3.x.x . 
    The container will output a deb and rpm in the current directory.

    KNOWN BUGS
    Some versions of singularity contain the character 'v', such as v3.0.0.
    The container will have to be rebuilt with the following statement modified:

        curl -L -o singularity-${VERSION}.tar.gz https://github.com/sylabs/singularity/releases/download/v${VERSION}/singularity-${VERSION}.tar.gz

    USAGE

        ./build-singularity.sif {version}

    	./build-singularity.sif 3.7.2

    CHANGELOG
    
    v1.0.1
    changed PowerTools -> powertools
    removed manual alien build for rpm package
    
    v1.0.0
    initial release

%labels
    Author chrismmaggio
    Version 1.0.1