#!/bin/bash if [ !"$1" ]; then echo "Usage : faicvs 8985 where r8985 is the release number for the SVN tarball" exit fi RACINE=~/rpm/SPECS DIRBUILD=~/rpm/SOURCES DIRRPM=~/rpm/RPMS/i586 echo [$1] if [ "$1" == "" ];then export datum=`date +%Y''%m''%d` else export datum=$1 fi export release=$1 who='whoami' cd $RACINE if [ -r "$DIRBUILD/aMule-SVN-r$release.tar.bz2" ];then echo "File exists - will not download the file again^^" else if [ "/usr/bin/wget" ];then echo "Using wget for getting the tar file" #wget http://www.hirnriss.net/files/cvs/aMule-CVS-$datum.tar.bz2 wget http://amule.uw.hu/tarballs/aMule-SVN-r$release.tar.bz2 mv $RACINE/aMule-SVN-r$release.tar.bz2 $DIRBUILD fi fi if [ -r "$DIRBUILD/aMule-SVN-r$release.tar.bz2" ];then echo "Building RPM" #Template aMule-CVSs is edited to replace [RELEASE] into the value passed as argument sed -e "s/\[RELEASE\]/$release/" aMule-CVSs.spec > x.spec rpmbuild -bb --clean $RACINE/x.spec if [ -r $DIRRPM/aMule-SVN-r$release-mdv8.i586.rpm ];then echo "installing RPM" sudo urpme aMule-CVS && urpmi $DIRRPM/aMule-SVN-r$release-mdv8.i586.rpm # ncftpput -u -p $DIRRPM/aMule-CVS-$datum-mdv.i586.rpm fi fi