File: package.sh

package info (click to toggle)
cppad 2026.00.00.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,584 kB
  • sloc: cpp: 112,960; sh: 6,146; ansic: 179; python: 71; sed: 12; makefile: 10
file content (46 lines) | stat: -rwxr-xr-x 1,121 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
#! /bin/bash -e
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
# SPDX-FileCopyrightText: Bradley M. Bell <bradbell@seanet.com>
# SPDX-FileContributor: 2003-25 Bradley M. Bell
# ----------------------------------------------------------------------------
if [ "$0" != "bin/package.sh" ]
then
   echo "bin/package.sh: must be executed from its parent directory"
   exit 1
fi
echo_eval() {
     echo $*
     eval $*
}
# grep, sed
source bin/grep_and_sed.sh
# -----------------------------------------------------------------------------
#
# version
version=`$sed -n -e '/^SET( *cppad_version *"[0-9.]*"/p' CMakeLists.txt | \
   $sed -e 's|.*"\([^"]*\)".*|\1|'`
#
# build
if [ ! -e 'build' ]
then
   echo_eval mkdir build
fi
#
# build/cppad-version
if ls build/cppad-* >& /dev/null
then
   echo_eval rm -r build/cppad-*
fi
mkdir build/cppad-$version
git ls-files -z | xargs -0 tar -czf build/cppad-$version/tar.tgz
cd build/cppad-$version
tar -xzf tar.tgz
rm tar.tgz
#
# build/cppad-$version.tgz
cd ..
echo_eval tar -czf cppad-$version.tgz cppad-$version
echo_eval rm -r cppad-$version
#
echo 'package.sh: OK'
exit 0