shorewall_code/tools/build/setversion

25 lines
947 B
Bash
Executable File

#!/bin/sh
[ $# -eq 1 ] || { echo "usage: setversion <version>" >&2; exit 1; }
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
for product in common lite shell perl; do
eval perl -n -i -e "'s/^%define version .*/%device version $1/; \
print \$_; \
if ( /%changelog/ ) {\
print \"\* $(date +'%a %b %d %Y') Tom Eastep tom\\@shorewall.net\\n\"; \
print \"- Updated to $1\\n\"; \
}'" Shorewall-${product}/shorewall-${product}.spec
done
eval perl -p -i -e "'s/^(\s+)VERSION => .*/\$1VERSION => \"$1\",/'" Shorewall-perl/Shorewall/Config.pm