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
|
|
|
|
|
2007-12-12 00:58:43 +01:00
|
|
|
for product in common lite shell perl; do
|
|
|
|
eval perl -p -i -e "'s/VERSION=.*/VERSION=$1/'" Shorewall-${product}/install.sh
|
|
|
|
done
|
|
|
|
|
|
|
|
for product in common lite; do
|
|
|
|
eval perl -p -i -e "'s/^VERSION=.*/VERSION=$1/'" Shorewall-${product}/uninstall.sh Shorewall-${product}/fallback.sh
|
|
|
|
done
|
|
|
|
|
2007-12-12 01:25:51 +01:00
|
|
|
case $VERSION in
|
|
|
|
*.*.*.*)
|
|
|
|
RELEASE=${VERSION##*.}
|
|
|
|
RPMVERSION=${VERSION%.*}-${RELEASE}
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
RPMVERSION=${VERSION}
|
|
|
|
RELEASE=1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2007-12-12 00:58:43 +01:00
|
|
|
for product in common lite shell perl; do
|
2007-12-12 01:25:51 +01:00
|
|
|
eval perl -n -i -e "'s/^%define version .*/%define version ${RPMVERSION}/; \
|
|
|
|
s/^%define release .*/%define release ${RELEASE}/; \
|
2007-12-12 00:58:43 +01:00
|
|
|
print \$_; \
|
|
|
|
if ( /%changelog/ ) {\
|
|
|
|
print \"\* $(date +'%a %b %d %Y') Tom Eastep tom\\@shorewall.net\\n\"; \
|
2007-12-12 01:25:51 +01:00
|
|
|
print \"- Updated to ${RPMVERSION}-${RELEASE}\\n\"; \
|
2007-12-12 00:58:43 +01:00
|
|
|
}'" Shorewall-${product}/shorewall-${product}.spec
|
|
|
|
done
|
|
|
|
|
|
|
|
eval perl -p -i -e "'s/^(\s+)VERSION => .*/\$1VERSION => \"$1\",/'" Shorewall-perl/Shorewall/Config.pm
|
|
|
|
|
|
|
|
|