mirror of
https://github.com/AdaCore/PolyORB.git
synced 2026-02-12 13:01:15 -08:00
[Imported from Perforce change 4056 at 2006-12-01 19:31:00] Subversion-branch: /trunk/polyorb Subversion-revision: 33237
131 lines
3.4 KiB
Bash
131 lines
3.4 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $Id: //droopi/main/utils/make_distrib#4 $
|
|
#
|
|
# This script builds a compressed archive suitable for distribution.
|
|
#
|
|
# Usage: make_distrib [-s] [-k?|-prcs|-n|-c] tag dir
|
|
#
|
|
# -s : suppress automatic version numbering and get info from VERSION.INFO
|
|
# -k? : override CVS keywords expansion
|
|
# -prcs : use prcs to extract files
|
|
# -n : assume a checkout has already been done in dir
|
|
# -c : assume current directory can be used as source
|
|
# tag : CVS or prcs tag or branch
|
|
# dir : the distribution will unpack in directory <dir> and will be
|
|
# named <dir>.tar.gz
|
|
#
|
|
# The VERSION.INFO file will be used to substitute some variables in files
|
|
# such as README, etc.
|
|
#
|
|
# The file MANIFEST contains the list of files to be included in this
|
|
# archive, one file per line.
|
|
#
|
|
|
|
if [ $# = 0 ]; then
|
|
echo "Usage: $0 [-k|-prcs|-n|-c] tag dir";
|
|
exit 0;
|
|
fi;
|
|
|
|
set -e
|
|
|
|
prcs=false
|
|
kk=
|
|
nocheckout=false
|
|
s=false
|
|
|
|
if test "x$1" = "x-s"; then
|
|
s=true
|
|
shift
|
|
fi
|
|
|
|
case $1 in
|
|
-k*) kk=$1; shift;;
|
|
-prcs) prcs=true; shift;;
|
|
-n) nocheckout=true; shift;;
|
|
-c) nocheckout=true; use_current=true; shift;;
|
|
*) ;;
|
|
esac
|
|
tag=$1
|
|
dir=$2
|
|
prev=`pwd`
|
|
tmp=${TMPDIR-/var/tmp}/make_distrib.$$
|
|
mkdir -p ${tmp}/${dir}
|
|
trap "rm -fr ${tmp}" 0
|
|
if $prcs; then
|
|
name=`echo *.prj | sed -e 's/\.prj//'`
|
|
echo Extracting module ${name} from prcs using tag ${tag}
|
|
cd ${tmp}/${dir}
|
|
prcs checkout -r${tag} ${name}
|
|
elif $usercurrent; then
|
|
tar cf - . | (cd $tmp/$dir && tar xpBf -)
|
|
cd $tmp/$dir
|
|
elif $nocheckout; then
|
|
cd ${dir}
|
|
else
|
|
root=`cat CVS/Root`
|
|
trunc_root=`echo ${root} | sed -e 's/^.*://'`
|
|
name=`sed -e "s,${trunc_root}/,," < CVS/Repository`
|
|
echo Extracting module ${name} from ${root} using tag ${tag}
|
|
cd ${tmp}
|
|
cvs -d ${root} co ${kk} -r ${tag} -d ${dir} ${name}
|
|
cd ${dir}
|
|
fi
|
|
if [ -f utils/VERSION.INFO ]; then
|
|
echo "Calling version file, then deleting it"
|
|
if $s; then
|
|
echo "(with no implicit version information)"
|
|
sh utils/VERSION.INFO
|
|
else
|
|
echo "(with version information derived from ${dir})"
|
|
sh utils/VERSION.INFO ${dir}
|
|
fi
|
|
rm -f utils/VERSION.INFO
|
|
else
|
|
echo "WARNING: unable to locate VERSION.INFO in directory utils"
|
|
fi
|
|
#if [ -f utils/mangle.sh ]; then
|
|
# chmod 755 utils/mangle.sh
|
|
# tm=/tmp/man$$
|
|
# sed -ne '1,/BEGIN\]/p' < Dist/glade_version.txt > $tm.1
|
|
# sed -ne '/END\]/,$p' < Dist/glade_version.txt > $tm.3
|
|
# sed -e '1,/BEGIN\]/d' -e '/END\]/,$d' < Dist/glade_version.txt | \
|
|
# utils/mangle.sh > $tm.2
|
|
# cat $tm.1 $tm.2 $tm.3 > Dist/glade_version.txt
|
|
# rm $tm.1 $tm.2 $tm.3
|
|
#else
|
|
# echo "WARNING: unable to locate mangle.sh in directory utils"
|
|
#fi
|
|
#if [ -f ${prev}/utils/normalize.pl ]; then
|
|
# echo Recentering keywords
|
|
# ${prev}/utils/normalize.pl `cat MANIFEST`
|
|
#fi
|
|
echo Generating auto-generated files
|
|
if [ -f support/reconfig ];then sh -e -x support/reconfig;fi
|
|
echo Doing the necessary date modifications
|
|
find . -name configure.in -exec touch {} \;
|
|
sleep 1
|
|
find . -name aclocal.m4 -exec touch {} \;
|
|
sleep 1
|
|
find . -name Makefile.in -exec touch {} \;
|
|
sleep 1
|
|
find . -name configure -exec touch {} \;
|
|
sleep 1
|
|
find . -name stamp-h.in -exec touch {} \;
|
|
sleep 1
|
|
find . -name config.h.in -exec touch {} \;
|
|
echo Adapting modes
|
|
chmod -R og=u-w .
|
|
flist=""
|
|
echo Packaging
|
|
for i in `cat MANIFEST`; do
|
|
flist="${flist} ${dir}/${i}"
|
|
done
|
|
cd ..
|
|
tar cf ${dir}.tar ${flist}
|
|
gzip --best ${dir}.tar
|
|
ls -l ${dir}.tar.gz
|
|
mv ${dir}.tar.gz ${prev}
|
|
cd ${prev}
|
|
rm -rf ${tmp}
|