File: make-dist.sh

package info (click to toggle)
apptainer 1.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,748 kB
  • sloc: sh: 3,321; ansic: 1,706; awk: 414; python: 103; makefile: 54
file content (54 lines) | stat: -rwxr-xr-x 1,691 bytes parent folder | download
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
#!/bin/sh -
# Copyright (c) Contributors to the Apptainer project, established as
#   Apptainer a Series of LF Projects LLC.
#   For website terms of use, trademark policy, privacy policy and other
#   project policies see https://lfprojects.org/policies
# Copyright (c) 2018-2019, 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=apptainer

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

# 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"