File: update-spec-file

package info (click to toggle)
cortado 0.6.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,740 kB
  • sloc: java: 21,834; xml: 592; sh: 78; makefile: 17
file content (36 lines) | stat: -rwxr-xr-x 903 bytes parent folder | download | duplicates (6)
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
#!/bin/bash

scriptsdir=`dirname $0`
topsrcdir=`cd $scriptsdir/.. && pwd`

# this script updates the spec file to fill in VERSION and RELEASE
# this script takes the VERSION as an argument
# if no nano given, VERSION is set to version and RELEASE to 1
# if nano is given, VERSION is set to version and RELEASE is set to 0.revision.1

VERSION=$1

nano=`echo $VERSION | cut -d'.' -f 4`

branch=`$scriptsdir/get-branch`
revision=`$scriptsdir/get-revision`
# sanitize the nr (modified) output for a spec file
revision=`echo $revision | sed 's/ (modified)/.modified/g'`

if test "x$nano" = "x"
then
  RELEASE=1
else
  RELEASE=0.git.$revision
  if test "x$branch" != "xtrunk"
  then
    RELEASE=$RELEASE.$branch
  fi
  RELEASE=$RELEASE.1
fi

cat $topsrcdir/cortado.spec.in | \
  sed s/@VERSION@/$VERSION/ | \
  sed s/@RELEASE@/$RELEASE/ > $topsrcdir/cortado.spec
echo Version: $VERSION
echo Release: $RELEASE