rpmrb 1.09 KB
#!/bin/sh
# 2006, 2008 (c) Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
# 
#   ,  ,
# ,        :
# rpmrb   []
#      2.6.1 (), 2.6 (major)  .1 (minor)

# load common functions, compatible with local and installed script
. `dirname $0`/../share/eterbuild/functions/common
load_mod spec

REMOTE=
if [ "$1" = "-r" ] ; then
	REMOTE=$1
	shift
fi

SPEC=$1
VER=$2
# need for rpmgs
GSSETRELEASE=$3
test -n "$GSSETRELEASE" || GSSETRELEASE=alt1
export GSSETRELEASE

if [ "$1" = "-h" ]; then
	echo "rpmrb spec [vermajor][.verminor] [rel] - update spec to vermajor.verminor version, build %rel release"
	exit 0
fi

test -e "$SPEC" || fatal "use with spec"

rpmgs $SPEC $VER || fatal "Error with get source"
add_changelog_helper "- new version $(get_version $SPEC) (with rpmrb script)" $SPEC || echog "Changelog entry already exists"

rpmbsh $REMOTE -i $SPEC || fatal "Error with build in hasher"
rpmbs -u $SPEC || fatal "Error with upload"