github.com/tri-adam/singularity@v3.1.1+incompatible/scripts/make-dist.sh (about)

     1  #!/bin/sh -
     2  # Copyright (c) Sylabs Inc. All rights reserved.
     3  # Use of this source code is governed by a BSD-style license that can be found
     4  # in the LICENSE file.
     5  set -e
     6  
     7  package_name=singularity
     8  
     9  if [ ! -f $package_name.spec ]; then
    10      echo "Run this from the top of the source tree after mconfig" >&2
    11      exit 1
    12  fi
    13  
    14  package_version_short="`sed -n 's/^Version: //p' $package_name.spec`"
    15  tree_version="$package_version_short-`sed -n 's/^Release: \([^%]*\).*/\1/p' $package_name.spec`"
    16  
    17  echo " DIST setup VERSION: $tree_version"
    18  echo $tree_version > VERSION
    19  rmfiles="VERSION"
    20  tarball="$package_name-$package_version_short.tar.gz"
    21  echo " DIST create tarball: $tarball"
    22  rm -f $tarball
    23  pathtop="$package_name"
    24  ln -sf .. builddir/$pathtop
    25  rmfiles="$rmfiles builddir/$pathtop"
    26  trap "rm -f $rmfiles" 0
    27  (echo VERSION; echo $package_name.spec; git ls-files) | \
    28      sed "s,^,$pathtop/," | tar -C builddir -T - -czf $tarball