Commit beac0c92 authored by Vitaly Lipatov's avatar Vitaly Lipatov

release_helper: cleanup

parent 680ea494
......@@ -4,74 +4,12 @@
cd ..
SPECNAME=conf/libuniset.spec
REL=eter
DEFAULTARCH=i586
RPMDIR=~/RPM/RPMS/$DEFAULTARCH
RPMSOURCEDIR=~/RPM/SOURCES
FTPDIR=/var/ftp/pub/Ourside/i586/RPMS.uniset
PROJECT=uniset
GEN=/var/ftp/pub/Ourside/i586/genb.sh
BACKUPDIR=$FTPDIR/backup
RPMBUILD=/usr/bin/rpmbuild
fatal()
{
echo "Error: $@"
exit 1
}
# Run inside project dir (named as name) (arg: local for noncvs build)
prepare_tarball()
{
build_rpms_name $SPECNAME
NAMEVER=$BASENAME-$VERSION
WDPROJECT=$(pwd)
TARNAME=$NAMEVER.tar
DESTDIR=$TMPDIR/$NAMEVER
RET=0
mkdir -p $DESTDIR
rm -rf $DESTDIR/*
cp -r $WDPROJECT/* $DESTDIR/
cd $DESTDIR/
make distclean
# [ -a ./autogen.sh ] && ./autogen.sh
rm -rf autom4te.cache/
rm -rf .git
rm -rf .gear
echo "Make tarball $TARNAME ... from $DESTDIR"
mkdir -p $RPMSOURCEDIR/
$NICE tar cf $RPMSOURCEDIR/$TARNAME ../$NAMEVER $ETERTARPARAM || RET=1
rm -rf $DESTDIR
cd -
[ $RET ] && echo "build ok" || fatal "Can't create tarball"
}
add_changelog_helper()
{
tty -s || { echo "skip changelog fixing" ; return 1 ; }
#FIXME HACK!! POSIX, changelog
# . . ţ rpmbb
L="$LC_ALL"
export LC_ALL=POSIX
add_changelog -e "$@"
R=$?
export LC_ALL="$L"
if [ "$R" = "0" ]; then
shift
for SPEC in "$@" ; do
N=`grep -n '^%changelog' $SPEC | head -n 1 | sed s!:.*!!g`
# +1 -- comment with date and packager name
# +2 -- place for edit comments
vim +$(($N + 2)) $SPEC
done
fi
return $R
}
function send_notify()
{
......@@ -91,9 +29,9 @@ echo "inform mail sent to $MAILTO"
function cp2ftp()
{
mkdir -p $BACKUPDIR
mv -f $FTPDIR/$PROJECT* $BACKUPDIR/
mv -f $RPMDIR/$PROJECT* $FTPDIR/
chmod 'a+rw' $FTPDIR/$PROJECT*
mv -f $FTPDIR/*$PROJECT* $BACKUPDIR/
mv -f $RPMDIR/*$PROJECT* $FTPDIR/
chmod 'a+rw' $FTPDIR/*$PROJECT*
$GEN
}
......@@ -103,18 +41,18 @@ export BUILDNAME=$BASENAME-$VERSION-$RELEASE
add_changelog_helper "- new build" $SPECNAME
prepare_tarball || fatal "Can't prepare tarball"
#prepare_tarball || fatal "Can't prepare tarball"
rpmbb $SPECNAME || fatal "Can't build"
cp2ftp
rpmbs $SPECNAME
#rpmbs $SPECNAME
#send_notify
#
BASERELEASE=$(get_release $SPECNAME | sed -e "s/$REL//")
set_release $SPECNAME ${REL}$((BASERELEASE+1))
#
inc_release $SPECNAME
#
#cvs commit -m "Auto updated by $0 for $BUILDNAME" $SPECNAME || fatal "Can't commit spec"
# Note: we in topscrdir
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment