2 # $Id: make-tar.sh,v 1.10 2011/03/26 20:46:51 tom Exp $
3 ##############################################################################
4 # Copyright (c) 2010,2011 Free Software Foundation, Inc. #
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: #
14 # The above copyright notice and this permission notice shall be included in #
15 # all copies or substantial portions of the Software. #
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. #
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 #
29 ##############################################################################
30 # Construct a tar-file containing only the test tree as well as its associated
31 # scripts. The reason for doing that is to simplify distributing the test
32 # programs as a separate package.
39 : ${PKG_NAME:=ncurses-examples}
40 : ${ROOTNAME:=ncurses-test}
45 grep_assign
=`egrep "^$2\>" "$1" | sed -e "s/^$2[ ]*=[ ]*//" -e 's/"//g'`
46 eval $2=\"$grep_assign\"
50 grep_assign ..
/dist.mk NCURSES_MAJOR
51 grep_assign ..
/dist.mk NCURSES_MINOR
52 grep_assign ..
/dist.mk NCURSES_PATCH
55 # The rpm spec-file in the ncurses tree is a template. Fill in the version
56 # information from dist.mk
59 -e "s/\\<MAJOR\\>/$NCURSES_MAJOR/g" \
60 -e "s/\\<MINOR\\>/$NCURSES_MINOR/g" \
61 -e "s/\\<YYYYMMDD\\>/$NCURSES_PATCH/g" $1 >$1.new
67 test -f $1 && chmod u
+w
$1
69 `echo $PKG_NAME|tr '[A-Z]' '[a-z]'` ($NCURSES_PATCH) unstable; urgency=low
71 * snapshot of ncurses subpackage for $PKG_NAME.
73 -- `head -1 $HOME/.signature` `date -R`
77 # This can be run from either the subdirectory, or from the top-level
78 # source directory. We will put the tar file in the original directory.
79 test -d .
/test && cd .
/test
82 BUILD
=$TMPDIR/make-tar$$
83 trap "cd /; rm -rf $BUILD; exit 0" 0 1 2 5 15
88 echo "? cannot make build directory $BUILD"
92 mkdir
$BUILD/$ROOTNAME
94 cp -p -r * $BUILD/$ROOTNAME/ ||
exit
96 # Add the config.* utility scripts from the top-level directory.
99 for j
in config.guess config.sub install-sh tar-copy.sh
101 test -f $i/$j && cp -p $i/$j $BUILD/$ROOTNAME/
105 # Make rpm and dpkg scripts for test-builds
107 for spec
in $BUILD/$ROOTNAME/package
/*.spec
111 make_changelog
$BUILD/$ROOTNAME/package
/debian
/changelog
113 cp -p $SOURCE/NEWS
$BUILD/$ROOTNAME
115 # cleanup empty directories (an artifact of ncurses source archives)
117 touch $BUILD/$ROOTNAME/MANIFEST
118 ( cd $BUILD/$ROOTNAME && find .
-type f
-print |
$SOURCE/misc
/csort
>MANIFEST
)
122 # Remove build-artifacts.
123 find .
-name RCS
-exec rm -rf {} \
;
124 find $BUILD/$ROOTNAME -type d
-exec rmdir {} \
; 2>/dev
/null
125 find $BUILD/$ROOTNAME -type d
-exec rmdir {} \
; 2>/dev
/null
126 find $BUILD/$ROOTNAME -type d
-exec rmdir {} \
; 2>/dev
/null
128 # There is no need for this script in the tar file.
129 rm -f $ROOTNAME/make-tar.sh
131 # Remove build-artifacts.
132 find .
-name "*.gz" -exec rm -rf {} \
;
134 # Make the files writable...
137 tar cf
- $ROOTNAME |
gzip >$DESTDIR/$ROOTNAME.
tar.gz
141 ls -l $ROOTNAME.
tar.gz