File: make-dist.sh

package info (click to toggle)
singularity-container 4.0.3%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 21,672 kB
  • sloc: asm: 3,857; sh: 2,125; ansic: 1,677; awk: 414; makefile: 110; python: 99
file content (56 lines) | stat: -rwxr-xr-x 1,612 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
#!/bin/sh -
# Copyright (c) 2018-2021, Sylabs Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be found
# in the LICENSE file.
set -e

package_name=singularity-ce

if [ ! -f $package_name.spec ]; then
    echo "Run this from the top of the source tree after mconfig" >&2
    exit 1
fi

version=$1

if test -z "${version}" ; then
    cat >&2 <-EOT
	This program requires a version number as argument.
	
	        $0 {version}
	EOT
    exit 1
fi

echo " DIST setup VERSION: ${version}"
echo "${version}" > VERSION
rmfiles="VERSION"
tarball="${package_name}-${version}.tar.gz"
echo " DIST create tarball: $tarball"
rm -f $tarball
pathtop="${package_name}-${version}"
ln -sf .. builddir/$pathtop
rmfiles="$rmfiles builddir/$pathtop"
trap "rm -f $rmfiles" 0

# modules should have been vendored using the correct version of the Go
# tool, so we expect to find a vendor directory. Bail out if there isn't
# one.
if test ! -d vendor ; then
    echo 'E: vendor directory not found. Abort.'
    exit 1
fi

# conmon should have been vendored as a submodule
if test ! -f third_party/conmon/Makefile ; then
    echo 'E: conmon source not found. Abort.'
    exit 1
fi

# XXX(mem): In order to accept filenames with colons in it (because of a
# version number like x.y.z:1.2.3), pass the --force-local flag to tar.
# This is understood by GNU tar. If other tar programs (also called
# "tar") don't, this will need to be fixed.
(echo VERSION; echo $package_name.spec; echo vendor; git ls-files) | \
    sed "s,^,$pathtop/," |
    tar --force-local -C builddir -T - -czf "$tarball"