Commit 8b514aa4 authored by Pavel Vainerman's avatar Pavel Vainerman

new build scripts

parent 2f78b331
...@@ -4,32 +4,117 @@ ...@@ -4,32 +4,117 @@
cd .. cd ..
SPECNAME=conf/uniset.spec SPECNAME=conf/uniset.spec
check_key REL=setri
DEFAULTARCH=i586
RPMDIR=~/RPM/RPMS/$DEFAULTARCH
RPMSOURCEDIR=~/RPM/SOURCES
FTPDIR=/var/ftp/pub/Ourside/RPMS.uniset
PROJECT=uniset
GEN=/var/ftp/pub/Ourside/genbase.sh
BACKUPDIR=$FTPDIR/backup
RPMBUILD=/usr/bin/rpmbuild
update_from_cvs 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.bz2
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/
echo "Make tarball $TARNAME ... from $DESTDIR"
mkdir -p $RPMSOURCEDIR/
$NICE tar cfj $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()
{
export EMAIL="$USER@server"
CURDATE=`date`
MAILTO="devel@server"
# FIXME:
mutt $MAILTO -s "[19910B] New build: $BUILDNAME" <<EOF
: $BUILDNAME
--
your $0
$CURDATE
EOF
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*
$GEN
}
# ------------------------------------------------------------------------
build_rpms_name $SPECNAME build_rpms_name $SPECNAME
export BUILDNAME=$BASENAME-$VERSION-$RELEASE export BUILDNAME=$BASENAME-$VERSION-$RELEASE
cvs update $SPECNAME ChangeLog && ./cvs2cl.pl && cvs commit -m "Auto updated by $0 for $BUILDNAME" ChangeLog || fatal "can't update Changelog"
add_changelog_helper "- new build" $SPECNAME add_changelog_helper "- new build" $SPECNAME
prepare_tarball prepare_tarball
rpmbb $SPECNAME || fatal "Can't build" rpmbb $SPECNAME || fatal "Can't build"
DESTDIR=/var/ftp/pvt/Etersoft/Ourside/i586/RPMS.ourside/ #cp2ftp
build_rpms_name $SPECNAME
if [ -d ${DESTDIR} ] ; then rpmbs $SPECNAME
rm -f $DESTDIR/$BASENAME* #send_notify
echo "Copying to $DESTDIR"
cp $RPMDIR/RPMS/$DEFAULTARCH/$BASENAME-*$VERSION-$RELEASE.* $DESTDIR/ || fatal "Can't copying"
chmod o+r $DESTDIR/$BASENAME-*
fi
# #
BASERELEASE=$(get_release $SPECNAME | sed -e "s/alt//") BASERELEASE=$(get_release $SPECNAME | sed -e "s/$REL//")
set_release $SPECNAME alt$((BASERELEASE+1)) set_release $SPECNAME ${REL}$((BASERELEASE+1))
cvs commit -m "Auto updated by $0 for $BUILDNAME" $SPECNAME || fatal "Can't commit spec" #cvs commit -m "Auto updated by $0 for $BUILDNAME" $SPECNAME || fatal "Can't commit spec"
# Note: we in topscrdir # Note: we in topscrdir
#TAG=${BUILDNAME//./_} #TAG=${BUILDNAME//./_}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Name: uniset Name: uniset
Version: 0.96 Version: 0.96
Release: alt11 Release: setri1
Summary: UniSet Summary: UniSet
License: GPL License: GPL
Group: Development/C++ Group: Development/C++
...@@ -180,6 +180,9 @@ Libraries needed to develop for uniset extentions ...@@ -180,6 +180,9 @@ Libraries needed to develop for uniset extentions
%changelog %changelog
* Mon Apr 06 2009 Pavel Vainerman <pv@altlinux.ru> 0.96-alt11
- new build
* Sat Jan 17 2009 Pavel Vainerman <pv@altlinux.ru> 0.96-alt7 * Sat Jan 17 2009 Pavel Vainerman <pv@altlinux.ru> 0.96-alt7
- new version - new version
......
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