2007-12-12 00:58:43 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
[ $# -eq 1 ] || { echo "usage: setversion <version>" >&2; exit 1; }
|
|
|
|
|
2007-12-12 01:25:51 +01:00
|
|
|
VERSION=$1
|
|
|
|
|
|
|
|
case $VERSION in
|
|
|
|
*.*.*.*)
|
|
|
|
RELEASE=${VERSION##*.}
|
|
|
|
RPMVERSION=${VERSION%.*}-${RELEASE}
|
2007-12-12 16:45:20 +01:00
|
|
|
SUFFIX="-$RELEASE"
|
2007-12-12 01:25:51 +01:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
RPMVERSION=${VERSION}
|
|
|
|
RELEASE=1
|
2007-12-12 16:45:20 +01:00
|
|
|
SUFFIX=
|
2007-12-12 01:25:51 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2007-12-12 00:58:43 +01:00
|
|
|
for product in common lite shell perl; do
|
2007-12-12 16:45:20 +01:00
|
|
|
dir=Shorewall-${product}${SUFFIX}
|
2007-12-12 16:55:33 +01:00
|
|
|
|
|
|
|
for file in $dir/install.sh $dir/uninstall.sh $dir/fallback.sh; do
|
2007-12-12 16:45:20 +01:00
|
|
|
[ -f $file ] && eval perl -p -i -e "'s/^VERSION=.*/VERSION=${VERSION}/'" $file
|
|
|
|
done
|
|
|
|
|
2007-12-12 16:55:33 +01:00
|
|
|
file=$dir/shorewall-${product}.spec
|
2007-12-12 16:45:20 +01:00
|
|
|
[ -f $file ] && eval perl -n -i -e "'s/^%define version .*/%define version ${RPMVERSION}/; \
|
|
|
|
s/^%define release .*/%define release ${RELEASE}/; \
|
|
|
|
print \$_; \
|
|
|
|
if ( /%changelog/ ) {\
|
|
|
|
print \"\* $(date +'%a %b %d %Y') Tom Eastep tom\\@shorewall.net\\n\"; \
|
|
|
|
print \"- Updated to ${RPMVERSION}-${RELEASE}\\n\"; \
|
|
|
|
}'" $file
|
2007-12-12 00:58:43 +01:00
|
|
|
done
|
|
|
|
|
2007-12-12 16:45:20 +01:00
|
|
|
file=Shorewall-perl${SUFFIX}/Shorewall/Config.pm
|
|
|
|
[ -f $file ] && eval perl -p -i -e "'s/^(\s+)VERSION => .*/\$1VERSION => \"${VERSION}\",/'" $file
|
2007-12-12 00:58:43 +01:00
|
|
|
|
|
|
|
|