3 # mkdist - make a distribution directory from a master manifest file
5 # usage: mkdist [-m manifest] [-s srcdir] [-r rootname] [-t] [-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 3 of the License, or
18 # (at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
34 echo usage: mkdist [-m manifest] [-s srcdir] [-r rootname] [-t] [-v] version 1>&2
40 if [ -n "$verbose" ]; then
45 while getopts m:s:r:tv name
48 m) MANIFEST=$OPTARG ;;
50 r) ROOTNAME=$OPTARG ;;
57 : ${MANIFEST:=$SRCDIR/MANIFEST}
61 shift $(( $OPTIND - 1 ))
68 newdir=${ROOTNAME}-$version
72 vmsg creating distribution for $ROOTNAME version $version in $newdir
74 if [ ! -d $newdir ]; then
75 mkdir $newdir || { echo $0: cannot make directory $newdir 1>&2 ; exit 1; }
81 while read fname type mode
83 [ -z "$fname" ] && continue
90 d) mkdir $newdir/$fname ;;
91 f) cp -p $SRCDIR/$fname $newdir/$fname ;;
92 s) ln -s $mode $newdir/$fname ; mode= ;; # symlink
93 l) ln $mode $newdir/$fname ; mode= ;; # hard link
94 *) echo "unknown file type $type" 1>&2 ;;
97 if [ -n "$mode" ]; then
98 chmod $mode $newdir/$fname
103 # cut off the `-alpha' in something like `2.0-alpha', leaving just the
105 #version=${version%%-*}
108 #*.*.*) vers=${version%.*} ;;
109 #*.*) vers=${version} ;;
112 #echo $vers > $newdir/.distribution
115 #*.*.*) plevel=${version##*.} ;;
118 #[ -z "$plevel" ] && plevel=0
119 #echo ${plevel} > $newdir/.patchlevel
123 if [ -n "$maketar" ]; then
124 tar cf ${tarfile} $newdir
126 vmsg ${tarfile}.gz created