2008-05-03 17:01:13 +00:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
#Framework, welches ein komplettes Linux System aus den Sourcen erstellt
|
|
|
|
|
#dieses Framework wird im CVS Repository
|
|
|
|
|
#:pserver:cvs.tramp-bbs.de:/opt/cvs zur Verf<72>gung gestellt
|
|
|
|
|
#
|
|
|
|
|
#Lage dieser Datei im Archiv: $HeadURL$
|
|
|
|
|
#
|
|
|
|
|
#(c) 2003 Harald Kueller, Germany
|
|
|
|
|
#This program is free software; you can redistribute it and/or
|
|
|
|
|
#modify ist under the terms of the GNU General Public License
|
|
|
|
|
#as published by the Free Software Foundation; either version
|
|
|
|
|
#2 of the License, or (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
#This program is distributed in the hope that it will be useful,
|
|
|
|
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
#See the GNU General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
#You should have received a copy of the GNU General Public License
|
|
|
|
|
#along with this program; if not write to the Free Software Foundation,
|
|
|
|
|
#Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
#
|
|
|
|
|
#Beschreibung:
|
|
|
|
|
#Script zur Erzeugung von Viitor Packages
|
|
|
|
|
#
|
|
|
|
|
#Aufrufparameter:
|
|
|
|
|
# -h gibt eine Hilfe aus
|
|
|
|
|
#
|
|
|
|
|
#Letzte <20>nderung von: $Author$
|
|
|
|
|
#Datum der letzten <20>nderung: $Date$
|
|
|
|
|
#Version der Datei: $Revision$
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
if [ ! -f $HOME/.ViitorMake ]; then
|
|
|
|
|
echo "Please run Scripts/initViitorMake"
|
|
|
|
|
echo "From ViitorMake Root Direktory"
|
|
|
|
|
echo "This will create a File $HOME/.ViitorMake"
|
|
|
|
|
echo "with necessary information for running"
|
|
|
|
|
echo "ViitorMake Scripts"
|
|
|
|
|
exit 10
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
source $HOME/.ViitorMake
|
|
|
|
|
|
|
|
|
|
echo_help() {
|
|
|
|
|
echo "$0 -s <sourcepath>"
|
|
|
|
|
echo " -a <ArchivePath+name>"
|
|
|
|
|
echo " -n <ShortName>"
|
|
|
|
|
echo " -d <ShortDescription"
|
|
|
|
|
echo " -v <Version>"
|
|
|
|
|
echo " -q <Source URL>"
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while getopts :s:a::n:d:v:q: opt_char; do
|
|
|
|
|
case $opt_char in
|
|
|
|
|
s)
|
|
|
|
|
TMPROOT=$OPTARG
|
|
|
|
|
;;
|
|
|
|
|
a)
|
|
|
|
|
ARCHIVE=$OPTARG
|
|
|
|
|
;;
|
|
|
|
|
n)
|
|
|
|
|
SHORTNAME=$OPTARG
|
|
|
|
|
;;
|
|
|
|
|
d)
|
|
|
|
|
DESCRIPT=$OPTARG
|
|
|
|
|
;;
|
|
|
|
|
v)
|
|
|
|
|
MODVERSION=$OPTARG
|
|
|
|
|
;;
|
|
|
|
|
q)
|
|
|
|
|
MODSRC=$OPTARG
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
echo_help
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
if [ ! "$TMPROOT" ]; then
|
|
|
|
|
echo "source tree not set"
|
|
|
|
|
echo_help
|
|
|
|
|
fi
|
|
|
|
|
if [ ! "$ARCHIVE" ]; then
|
|
|
|
|
echo "Archive Name not set"
|
|
|
|
|
echo_help
|
|
|
|
|
fi
|
|
|
|
|
if [ ! "$SHORTNAME" ]; then
|
|
|
|
|
echo "Package Short name not set"
|
|
|
|
|
echo_help
|
|
|
|
|
fi
|
|
|
|
|
if [ ! "$DESCRIPT" ]; then
|
|
|
|
|
echo "Package Description not set"
|
|
|
|
|
echo_help
|
|
|
|
|
fi
|
|
|
|
|
if [ ! "$MODVERSION" ]; then
|
|
|
|
|
echo "Package Version not set"
|
|
|
|
|
echo_help
|
|
|
|
|
fi
|
|
|
|
|
if [ ! "$MODSRC" ]; then
|
|
|
|
|
echo "Package source URL not set"
|
|
|
|
|
echo_help
|
|
|
|
|
fi
|
|
|
|
|
|
2009-11-18 08:04:32 +00:00
|
|
|
|
if [ ! -d $TMPROOT/../$$ ]; then
|
|
|
|
|
mkdir -p $TMPROOT/../$$
|
|
|
|
|
fi
|
|
|
|
|
|
2009-11-19 19:53:02 +00:00
|
|
|
|
ARCHCONTENTS="bin.drg bin.cont bin.tar dev.drg dev.cont dev.tar man.drg man.cont man.tar"
|
2009-11-18 08:04:32 +00:00
|
|
|
|
DEPFILE=$TMPROOT/../$$/dep
|
2009-11-18 08:23:12 +00:00
|
|
|
|
METAFILE=$TMPROOT/../$$/meta
|
2008-05-03 17:01:13 +00:00
|
|
|
|
|
|
|
|
|
WDIR=`pwd`
|
|
|
|
|
source $VMAKEDIR/functions/functions
|
|
|
|
|
|
|
|
|
|
if [ ! "$TMPROOT" ]; then
|
|
|
|
|
echo "Syntax: $0 PKGSRCPATH ARCHIVEDESTPATH"
|
|
|
|
|
exit 10
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ ! "$ARCHIVE" ]; then
|
|
|
|
|
echo "Syntax: $0 PKGSRCPATH ARCHIVEDESTPATH"
|
|
|
|
|
exit 10
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ -d $TMPROOT/usr/man ]; then
|
|
|
|
|
mkdir -p $TMPROOT/usr/share
|
|
|
|
|
mv $TMPROOT/usr/man $TMPROOT/usr/share
|
|
|
|
|
fi
|
|
|
|
|
if [ -d $TMPROOT/usr/info ]; then
|
|
|
|
|
mkdir -p $TMPROOT/usr/share
|
|
|
|
|
mv $TMPROOT/usr/info $TMPROOT/usr/share
|
|
|
|
|
fi
|
|
|
|
|
if [ -d $TMPROOT/usr/doc ]; then
|
|
|
|
|
mkdir -p $TMPROOT/usr/share
|
|
|
|
|
mv $TMPROOT/usr/doc $TMPROOT/usr/share
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
GenDependics $TMPROOT >/tmp/deps$$
|
|
|
|
|
if [ -f /tmp/deps$$ ]; then
|
|
|
|
|
for i in `cat /tmp/deps$$`; do
|
2009-11-18 08:23:12 +00:00
|
|
|
|
echo "WARN $i"
|
|
|
|
|
done |bzip2 -c >$DEPFILE
|
2008-05-03 17:01:13 +00:00
|
|
|
|
rm /tmp/deps$$
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cd $TMPROOT
|
|
|
|
|
MANTMPROOT=$TMPROOT.man
|
|
|
|
|
DEVTMPROOT=$TMPROOT.dev
|
|
|
|
|
for i in `find . -name "man" -type d`; do
|
|
|
|
|
if ls -d $i/man[0-9] 2>&1 >/dev/null; then
|
|
|
|
|
DIR=`dirname $i`
|
|
|
|
|
mkdir -p $MANTMPROOT/$DIR
|
|
|
|
|
mv $i $MANTMPROOT/$DIR
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
for i in `find . -name "info" -type d`; do
|
|
|
|
|
if [ -f $i/dir ]; then
|
|
|
|
|
DIR=`dirname $i`
|
|
|
|
|
mkdir -p $MANTMPROOT/$DIR
|
|
|
|
|
mv $i $MANTMPROOT/$DIR
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
for i in `find . -type d -name "doc"`; do
|
|
|
|
|
if [ ! -d $MANTMPROOT/usr/share/doc ]; then
|
|
|
|
|
mkdir -p $MANTMPROOT/usr/share/doc
|
|
|
|
|
fi
|
|
|
|
|
cd $i
|
|
|
|
|
tar -cf - .|tar -C $MANTMPROOT/usr/share/doc -xf -
|
|
|
|
|
cd -
|
|
|
|
|
rm -r $i
|
|
|
|
|
done
|
|
|
|
|
for i in `find . -name "*.[ah]"`; do
|
|
|
|
|
DIR=`dirname $i`
|
|
|
|
|
mkdir -p $DEVTMPROOT/$DIR
|
|
|
|
|
mv $i $DEVTMPROOT/$DIR
|
|
|
|
|
done
|
|
|
|
|
for i in `find . -name "*.hxx"`; do
|
|
|
|
|
DIR=`dirname $i`
|
|
|
|
|
mkdir -p $DEVTMPROOT/$DIR
|
|
|
|
|
mv $i $DEVTMPROOT/$DIR
|
|
|
|
|
done
|
|
|
|
|
for i in `find . -name "*.hpp"`; do
|
|
|
|
|
DIR=`dirname $i`
|
|
|
|
|
mkdir -p $DEVTMPROOT/$DIR
|
|
|
|
|
mv $i $DEVTMPROOT/$DIR
|
|
|
|
|
done
|
|
|
|
|
for i in `find . -name "*.la"`; do
|
|
|
|
|
DIR=`dirname $i`
|
|
|
|
|
mkdir -p $DEVTMPROOT/$DIR
|
|
|
|
|
mv $i $DEVTMPROOT/$DIR
|
|
|
|
|
done
|
2009-04-20 09:49:36 +00:00
|
|
|
|
InitDispatch
|
2008-05-03 17:01:13 +00:00
|
|
|
|
if [ ! `find . -type f|wc -l` == "0" ]; then
|
2009-04-20 09:49:36 +00:00
|
|
|
|
DispatchCMD "cd $TMPROOT" \
|
|
|
|
|
"MakeMgtFiles bin" \
|
2009-11-18 08:04:32 +00:00
|
|
|
|
"tar -jcvf $TMPROOT/../$$/bin.tar ."
|
2008-05-03 17:01:13 +00:00
|
|
|
|
fi
|
|
|
|
|
if [ -d $MANTMPROOT ]; then
|
2009-04-20 09:49:36 +00:00
|
|
|
|
DispatchCMD "cd $MANTMPROOT" \
|
|
|
|
|
"MakeMgtFiles man" \
|
2009-11-18 08:04:32 +00:00
|
|
|
|
"tar -jcvf $TMPROOT/../$$/man.tar ."
|
2008-05-03 17:01:13 +00:00
|
|
|
|
fi
|
|
|
|
|
if [ -d $DEVTMPROOT ]; then
|
2009-04-20 09:49:36 +00:00
|
|
|
|
DispatchCMD "cd $DEVTMPROOT" \
|
|
|
|
|
"MakeMgtFiles dev" \
|
2009-11-18 08:04:32 +00:00
|
|
|
|
"tar -jcvf $TMPROOT/../$$/dev.tar ."
|
2008-05-03 17:01:13 +00:00
|
|
|
|
fi
|
2009-04-20 09:49:36 +00:00
|
|
|
|
EndDispatch
|
2008-05-03 17:01:13 +00:00
|
|
|
|
|
2009-11-18 08:23:12 +00:00
|
|
|
|
echo -e "ModuleName: $SHORTNAME\n" \
|
|
|
|
|
"Module Version: $MODVERSION\n" \
|
|
|
|
|
"Quellen: $MODSRC" \
|
|
|
|
|
"Description:" \
|
|
|
|
|
"$DESCRIPT" |\
|
|
|
|
|
bzip2 -c >$METAFILE
|
2009-11-18 08:04:32 +00:00
|
|
|
|
|
|
|
|
|
cd $TMPROOT/../$$
|
|
|
|
|
if [ -f $DEPFILE ]; then
|
|
|
|
|
LINE="`wc -c $DEPFILE|awk '{print $1}'` "
|
|
|
|
|
else
|
|
|
|
|
LINE="0 "
|
|
|
|
|
fi
|
|
|
|
|
if [ -f $METAFILE ]; then
|
|
|
|
|
LINE=$LINE"`wc -c $METAFILE|awk '{print $1}'` "
|
|
|
|
|
else
|
|
|
|
|
LINE=$LINE"0 "
|
|
|
|
|
fi
|
2009-11-19 19:53:02 +00:00
|
|
|
|
for i in *.cont *.drg *.md5; do
|
2009-11-18 08:23:12 +00:00
|
|
|
|
bzip2 $i
|
|
|
|
|
mv $i.bz2 $i
|
|
|
|
|
done
|
|
|
|
|
|
2009-11-18 08:04:32 +00:00
|
|
|
|
for i in $ARCHCONTENTS; do
|
|
|
|
|
if [ -f $i ]; then
|
|
|
|
|
LINE=$LINE"`wc -c $i|awk '{print $1}'` "
|
|
|
|
|
else
|
|
|
|
|
LINE=$LINE"0 "
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
echo $LINE >$ARCHIVE
|
|
|
|
|
if [ -f $DEPFILE ]; then
|
|
|
|
|
cat $DEPFILE >>$ARCHIVE
|
|
|
|
|
fi
|
|
|
|
|
if [ -f $METAFILE ]; then
|
|
|
|
|
cat $METAFILE >>$ARCHIVE
|
|
|
|
|
fi
|
|
|
|
|
for i in $ARCHCONTENTS; do
|
|
|
|
|
if [ -f $i ]; then
|
|
|
|
|
cat $i >>$ARCHIVE
|
|
|
|
|
fi
|
|
|
|
|
done
|