Debian Codegraph @

make-release-tarballs

raw
1 #!/bin/bash
2 #
3 # make-release-tarballs
4 # create release tarballs for CafeOBJ
5 #
6 # Copyright (c) 2014-2018, Norbert Preining. All rights reserved.
7 #
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions
10 # are met:
11 #
12 # * Redistributions of source code must retain the above copyright
13 # notice, this list of conditions and the following disclaimer.
14 #
15 # * Redistributions in binary form must reproduce the above
16 # copyright notice, this list of conditions and the following
17 # disclaimer in the documentation and/or other materials
18 # provided with the distribution.
19 #
20 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESSED
21 # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
24 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
26 # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #
32
33 version=$1
34 vminor=$2
35 shift
36 shift
37 # remaining components are the lisp interpreters for which we build
38
39 default_components="bin share"
40
41 TAR=tar
42 if [ `uname` = 'Darwin' ] ; then
43 TAR=gnutar
44 fi
45
46 if [ x$vminor = x ] ; then
47 echo "Usage: make-dist-tarball VERSION MINOR <lisp-interpreters>" >&2
48 exit
49 fi
50
51
52 if [ ! -d dist/lib/cafeobj-$version ] ; then
53 echo "Did you configure --enable-distribution && make && make install?" >&2
54 exit 1
55 fi
56
57 if ! [ -d dist/bin -o -d dist/share ] ; then
58 echo "Did you configure --enable-distribution && make && make install?" >&2
59 exit 1
60 fi
61
62 for i in $* ; do
63 case $i in
64 acl-standalone|sbcl) true ;;
65 *) echo "Unsupported standalone lisp interpreter: $i" >&2 ; exit ;;
66 esac
67 done
68
69 cd dist
70
71 for i in $* ; do
72 distdir=lib/cafeobj-$version/$i
73 case $i in
74 acl-standalone) sname=acl ; dumpfile=$distdir/CafeOBJ ;;
75 sbcl) sname=sbcl; dumpfile=$distdir/cafeobj.sbcl ;;
76 esac
77 if ! [ -d $distdir ] ; then
78 echo "Cannot find dump for $i, exiting." >&2
79 exit 1
80 fi
81 case `file $dumpfile` in
82 *32-bit*) arch=x86 ;;
83 *64-bit*) arch=x64 ;;
84 *) echo "Cannot determine arch of CafeOBJ dump!" >&2 ; exit 1 ;;
85 esac
86 #
87 # we have to make sure that the current engine is the default one
88 # selected in the wrapper script!
89 sed -e "s/^engine=.*/engine=$i/" bin/cafeobj > bin/cafeobj.new
90 mv bin/cafeobj.new bin/cafeobj
91 chmod ugo+x bin/cafeobj
92 echo "Building $sname standalone for $arch`uname` ..."
93 $TAR --numeric-owner --owner=0 --group=0 -cvzf ../cafeobj-$version$vminor-${sname}-${arch}`uname`.tar.gz \
94 $default_components $distdir
95 done
96
97 cd ..
98