3 # mkdist - make a distribution directory from a master manifest file
5 # usage: mkdist [-m manifest] [-s srcdir] [-r rootname] [-v] version
7 # SRCDIR defaults to src
8 # MANIFEST defaults to $SRCDIR/MANIFEST
13 # Copyright (C) 1996-2002 Free Software Foundation, Inc.
15 # This program is free software; you can redistribute it and/or modify
16 # it under the terms of the GNU General Public License as published by
17 # the Free Software Foundation; either version 2, or (at your option)
20 # This program is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
34 echo usage
: mkdist
[-m manifest
] [-s srcdir
] [-r rootname
] [-v] version
1>&2
40 if [ -n "$verbose" ]; then
45 while getopts m
:s
:r
:v name
48 m
) MANIFEST
=$OPTARG ;;
50 r
) ROOTNAME
=$OPTARG ;;
56 : ${MANIFEST:=$SRCDIR/MANIFEST}
60 shift $
(( $OPTIND - 1 ))
67 newdir
=${ROOTNAME}-$version
69 vmsg creating distribution
for $ROOTNAME version
$version in $newdir
71 if [ ! -d $newdir ]; then
72 mkdir
$newdir ||
{ echo $0: cannot
make directory
$newdir 1>&2 ; exit 1; }
78 while read fname
type mode
80 [ -z "$fname" ] && continue
87 d
) mkdir
$newdir/$fname ;;
88 f
) cp -p $SRCDIR/$fname $newdir/$fname ;;
89 s
) ln -s $mode $newdir/$fname ; mode
= ;; # symlink
90 l
) ln $mode $newdir/$fname ; mode
= ;; # hard link
91 *) echo "unknown file type $type" 1>&2 ;;
94 if [ -n "$mode" ]; then
95 chmod $mode $newdir/$fname
100 # cut off the `-alpha' in something like `2.0-alpha', leaving just the
102 #version=${version%%-*}
105 #*.*.*) vers=${version%.*} ;;
106 #*.*) vers=${version} ;;
109 #echo $vers > $newdir/.distribution
112 #*.*.*) plevel=${version##*.} ;;
115 #[ -z "$plevel" ] && plevel=0
116 #echo ${plevel} > $newdir/.patchlevel