From 43e7d103a0aa620f5f75c4ccac2f5b6c3d3f9433 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 21 Oct 1999 15:59:54 +0000 Subject: Changes from Ralf with script-19991021-0. He fixed the %files issue and has mkbspspec in a better state. user.cfg is now gone. There are some miscellaneous changes to buildall done by Joel to clean up the build process. --- scripts/mkbspspec.in | 72 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 22 deletions(-) (limited to 'scripts/mkbspspec.in') diff --git a/scripts/mkbspspec.in b/scripts/mkbspspec.in index 49dbf459ac..5cc5cb82c3 100644 --- a/scripts/mkbspspec.in +++ b/scripts/mkbspspec.in @@ -1,31 +1,59 @@ #!/bin/sh # -RTEMS_DIR=`dirname $0` -RTEMS_VERSION=`grep Version ${RTEMS_DIR}/../VERSION | \ -sed -e 's%RTEMS[ ]*Version[ ]*\(.*\)[ ]*%\1%g'` - -bsp=$1 -target_alias=$2 -release=0 - -# Some linux distributions use /usr/src/packages -# redhat uses /usr/src/redhat -# others might use /usr/src -if test -d /usr/src/packages/SPECS; -then -dst=/usr/src/packages/SPECS; -elif test -d /usr/src/redhat/SPECS; - then -dst=/usr/src/redhat/SPECS; -elif test -d /usr/src/SPECS/; +RTEMS_DIR=`dirname $0`/@top_srcdir@ +RTEMS_VERSION=@RTEMS_VERSION@ + +CFG=setup.cache +dst=@RPM_SPECSdir@ + +usage() +{ + echo "$0 [options] " + echo " options:" + echo " -cfg " + echo " -o " + exit 1 ; +} + +while test $# -ge 3; do +case $1 in +-cfg) + shift + CFG=$1 + shift + ;; +-o) + shift + dst=$1 + shift + ;; +-*) + echo "invalid option $1"; + usage + ;; +esac +done + +if test ! $# -eq 2; then -dst=/usr/src/SPECS; + echo "Invalid number of arguments" + usage fi +# target to build for +target_alias=$1 +bsp=$2 + +. ./$CFG + +specfile=${dst}/$target_alias-$bsp-$RTEMS_VERSION.spec + sed -e "s%@Version@%${RTEMS_VERSION}%g" \ -e "s%@bsp@%${bsp}%g" \ --e "s%@Release@%${release}%g" \ +-e "s%@Release@%${rtems_release}%g" \ -e "s%@target_alias@%${target_alias}%g" \ -< ${RTEMS_DIR}/rtems.spec.in \ -> ${dst}/rtems-$target_alias-$bsp.spec +< ${RTEMS_DIR}/rtems/rtems.spec.in \ +> ${specfile} + +echo Generated ${specfile} -- cgit v1.2.3