]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/make-tar.sh
ncurses 5.7 - patch 20110212
[ncurses.git] / Ada95 / make-tar.sh
1 #!/bin/sh
2 # $Id: make-tar.sh,v 1.6 2010/11/06 19:59:07 tom Exp $
3 ##############################################################################
4 # Copyright (c) 2010 Free Software Foundation, Inc.                          #
5 #                                                                            #
6 # Permission is hereby granted, free of charge, to any person obtaining a    #
7 # copy of this software and associated documentation files (the "Software"), #
8 # to deal in the Software without restriction, including without limitation  #
9 # the rights to use, copy, modify, merge, publish, distribute, distribute    #
10 # with modifications, sublicense, and/or sell copies of the Software, and to #
11 # permit persons to whom the Software is furnished to do so, subject to the  #
12 # following conditions:                                                      #
13 #                                                                            #
14 # The above copyright notice and this permission notice shall be included in #
15 # all copies or substantial portions of the Software.                        #
16 #                                                                            #
17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
18 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
19 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
20 # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
21 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
22 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
23 # DEALINGS IN THE SOFTWARE.                                                  #
24 #                                                                            #
25 # Except as contained in this notice, the name(s) of the above copyright     #
26 # holders shall not be used in advertising or otherwise to promote the sale, #
27 # use or other dealings in this Software without prior written               #
28 # authorization.                                                             #
29 ##############################################################################
30 # Construct a tar-file containing only the Ada95 tree as well as its associated
31 # documentation.  The reason for doing that is to simplify distributing the
32 # ada binding as a separate package.
33
34 TARGET=`pwd`
35
36 : ${ROOTNAME:=ncurses-Ada95}
37 : ${DESTDIR:=$TARGET}
38 : ${TMPDIR:=/tmp}
39
40 # This can be run from either the Ada95 subdirectory, or from the top-level
41 # source directory.  We will put the tar file in the original directory.
42 test -d ./Ada95 && cd ./Ada95
43
44 BUILD=$TMPDIR/make-tar$$
45 trap "cd /; rm -rf $BUILD; exit 0" 0 1 2 5 15
46
47 umask 077
48 if ! ( mkdir $BUILD )
49 then
50         echo "? cannot make build directory $BUILD"
51 fi
52
53 umask 022
54 mkdir $BUILD/$ROOTNAME
55
56 cp -p -r * $BUILD/$ROOTNAME/ || exit
57
58 # Add the config.* utility scripts from the top-level directory.
59 for i in . ..
60 do
61         for j in config.guess config.sub install-sh tar-copy.sh
62         do
63                 test -f $i/$j && cp -p $i/$j $BUILD/$ROOTNAME/
64         done
65 done
66
67 # Add the ada documentation.
68 mkdir $BUILD/$ROOTNAME/doc || exit
69 cd ../doc/html || exit
70
71 cp -p -r Ada* $BUILD/$ROOTNAME/doc/
72 cp -p -r ada $BUILD/$ROOTNAME/doc/
73
74 cd $BUILD || exit 
75
76 # There is no need for this script in the tar file.
77 rm -f $ROOTNAME/make-tar.sh
78
79 # Remove build-artifacts.
80 find . -name RCS -exec rm -rf {} \;
81 find . -name "*.gz" -exec rm -rf {} \;
82
83 # Make the files writable...
84 chmod -R u+w .
85
86 tar cf - $ROOTNAME | gzip >$DESTDIR/$ROOTNAME.tar.gz
87 cd $DESTDIR
88
89 pwd
90 ls -l $ROOTNAME.tar.gz