Fix rpm versioning

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@7899 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-12-12 00:25:51 +00:00
parent 8ae77e6830
commit 587ca5148f
2 changed files with 17 additions and 3 deletions

View File

@ -253,7 +253,7 @@ sub initialize() {
ORIGINAL_POLICY_MATCH => '', ORIGINAL_POLICY_MATCH => '',
LOGPARMS => '', LOGPARMS => '',
TC_SCRIPT => '', TC_SCRIPT => '',
VERSION => '4.1.3', VERSION => "4.1.3",
CAPVERSION => 40100 , CAPVERSION => 40100 ,
); );
# #

View File

@ -2,6 +2,8 @@
[ $# -eq 1 ] || { echo "usage: setversion <version>" >&2; exit 1; } [ $# -eq 1 ] || { echo "usage: setversion <version>" >&2; exit 1; }
VERSION=$1
for product in common lite shell perl; do for product in common lite shell perl; do
eval perl -p -i -e "'s/VERSION=.*/VERSION=$1/'" Shorewall-${product}/install.sh eval perl -p -i -e "'s/VERSION=.*/VERSION=$1/'" Shorewall-${product}/install.sh
done done
@ -10,12 +12,24 @@ for product in common lite; do
eval perl -p -i -e "'s/^VERSION=.*/VERSION=$1/'" Shorewall-${product}/uninstall.sh Shorewall-${product}/fallback.sh eval perl -p -i -e "'s/^VERSION=.*/VERSION=$1/'" Shorewall-${product}/uninstall.sh Shorewall-${product}/fallback.sh
done done
case $VERSION in
*.*.*.*)
RELEASE=${VERSION##*.}
RPMVERSION=${VERSION%.*}-${RELEASE}
;;
*)
RPMVERSION=${VERSION}
RELEASE=1
;;
esac
for product in common lite shell perl; do for product in common lite shell perl; do
eval perl -n -i -e "'s/^%define version .*/%device version $1/; \ eval perl -n -i -e "'s/^%define version .*/%define version ${RPMVERSION}/; \
s/^%define release .*/%define release ${RELEASE}/; \
print \$_; \ print \$_; \
if ( /%changelog/ ) {\ if ( /%changelog/ ) {\
print \"\* $(date +'%a %b %d %Y') Tom Eastep tom\\@shorewall.net\\n\"; \ print \"\* $(date +'%a %b %d %Y') Tom Eastep tom\\@shorewall.net\\n\"; \
print \"- Updated to $1\\n\"; \ print \"- Updated to ${RPMVERSION}-${RELEASE}\\n\"; \
}'" Shorewall-${product}/shorewall-${product}.spec }'" Shorewall-${product}/shorewall-${product}.spec
done done