summaryrefslogtreecommitdiffstats
path: root/scripts/rtemsdoc/mkspec.in
blob: 52725bcc5afe426d706a91a2a89ea393e8c008ca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#! /bin/sh 

RTEMS_DIR=`dirname $0`/@top_srcdir@
PACKAGE_BUGREPORT=@PACKAGE_BUGREPORT@

CFG=../setup.cache
exe_ext=@EXEEXT@

usage()
{
  echo "$0 [options]"
  echo "  options:"
  echo "    -cfg <setup.cache>"
  echo "    -o <rpm-spec-dir>"
  exit 1 ;
}

specsrc=${RTEMS_DIR}/rtemsdoc/rtemsdoc.spec.in

while test $# -ge 2; do
case $1 in
-cfg) 
  shift
  CFG=$1
  shift
  ;;
-o)
  shift
  dst=$1
  shift
  ;;
-*)
  echo "invalid option $1";
  usage
  ;;
esac
done

if test ! $# -eq 0;
then
  echo "Invalid number of arguments" >&2
  usage >&2
fi

. ./$CFG

sed -e "s%@PACKAGE_BUGREPORT\@%@PACKAGE_BUGREPORT@%g" \
    -e "s%@rtems_rpm_release\@%${rtems_rpm_release}%g" \
    -e "s%@rtems_version\@%${rtems_version}%g" \
    -e "s%@rtems_rpm_version\@%${rtems_rpm_version}%g" \
    -e "s,@rpm_build_root\@,${rpm_build_root},g" \
    -e "s%@exe_ext\@%${exe_ext}%g" \
< ${specsrc}