File: generate-rpm-specfile

package info (click to toggle)
syslog-ng 4.8.1-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 20,440 kB
  • sloc: ansic: 177,631; python: 13,035; cpp: 11,611; makefile: 7,011; sh: 5,147; java: 3,651; xml: 3,344; yacc: 1,377; lex: 599; perl: 193; awk: 190; objc: 162
file content (18 lines) | stat: -rwxr-xr-x 691 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

. /dbld/functions.sh

MODE=$1

if [ $MODE = "snapshot" ]; then
    echo "Generating snapshot version in syslog-ng.spec"
    sed -e "s/^Version: \([0-9.]\+\).*$/Version: $VERSION/" \
            -e "s/^Release: \([0-9.]\+\).*$/Release: \1+`date +%Y%m%dT%H%M%S`/" -i packaging/rhel/syslog-ng.spec
elif [ $MODE = "release" ]; then
    echo "Validating that your RPM specfile matches the current version"
    RPM_VERSION=`grep ^Version packaging/rhel/syslog-ng.spec | cut -d ' ' -f2`
    if [ "${RPM_VERSION}" != "${VERSION}" ]; then
	echo "The version numbers in syslog-ng.spec do not match the current version number. Cannot generate a release tarball this way"
	exit 1
    fi
fi