#!/bin/sh # Set initial variables: CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-gdb SRC=/devel/manpagesrc INFO=/devel/info-pages/usr/info TEX=/devel/texinfo-docs if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi if [ ! -d $PKG ]; then mkdir -p $PKG # place for the package to be built fi # Explode the package framework: cd $PKG explodepkg $CWD/_gdb.tar.gz # Function to handle manpage source: man2gz () { # $1 is source page name, $2 is target name for preformatted # output (full path && name) and $3 is the same, but for the # source. mkdir -p `dirname $2` groff -Tascii -mandoc $1 | gzip -9c > $2 if [ ! "$3" = "" ]; then mkdir -p `dirname $3` cat $1 > $3 fi } echo "+==========+" echo "| gdb-4.14 |" echo "+==========+" cd $TMP tar xzvf $CWD/gdb-4.14.tar.gz cd gdb-4.14 cat $CWD/gdb-4.14.diff | patch ./configure --prefix=/usr i486-slackware-linux make CFLAGS=-O2 LDFLAGS=-s cd gdb cat gdb > $PKG/usr/bin/gdb for file in gdb.info* ; do cat $file | gzip -9c > $INFO/$file.gz done man2gz gdb.1 $PKG/usr/man/preformat/cat1/gdb.1.gz $SRC/usr/man/man1/gdb.1 cd doc cp gdb.texinfo $TEX/gdb.texi # Build the package: cd $PKG tar czvf $TMP/gdb.tgz . # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/gdb-4.14 rm -rf $PKG fi