X-Git-Url: http://git.ipfire.org/?p=ipfire-2.x.git;a=blobdiff_plain;f=make.sh;h=d9bfb84f929cf26137410a72a95606b18ccf143b;hp=e2baff571142f240973fc4429456ae0fc70862d8;hb=27996c53e756406da9bcf45c1ce7583c2412666c;hpb=c6cb9d251398f1b67e9cc3ec3e98bfaa106c46ad diff --git a/make.sh b/make.sh index e2baff5711..d9bfb84f92 100644 --- a/make.sh +++ b/make.sh @@ -32,11 +32,11 @@ MAX_RETRIES=3 # prefetch/check loop KVER=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'` MACHINE=`uname -m` + SVN_REVISION=`svn info | grep Revision | cut -c 11-` # Setzen des IPFire Builds if [ -e ./.svn ]; then FIREBUILD=`cat .svn/entries |sed -n 's/^[ \t]*revision=\"// p' | sed -n 's/\".*$// p'` -# VERSION="$VERSION (Build:$FIREBUILD)" fi # Debian specific settings @@ -59,6 +59,10 @@ DIR_CHK=$BASEDIR/cache/check mkdir $BASEDIR/log/ 2>/dev/null + if [ -f .config ]; then + . .config + fi + if [ 'x86_64' = $MACHINE -o 'i686' = $MACHINE -o 'i586' = $MACHINE -o 'i486' = $MACHINE -o 'i386' = $MACHINE ]; then echo "`date -u '+%b %e %T'`: Machine is ix86 (or equivalent)" >> $LOGFILE MACHINE=i386 @@ -729,7 +733,10 @@ buildipcop() { ipcopmake asterisk ipcopmake mpg123 echo -ne "`date -u '+%b %e %T'`: Building ### MP3-Server ### \n" | tee -a $LOGFILE + ipcopmake libogg + ipcopmake libvorbis ipcopmake lame + ipcopmake sox ipcopmake gnump3d echo -ne "`date -u '+%b %e %T'`: Building ### P2P-Clients ### \n" | tee -a $LOGFILE ipcopmake applejuice @@ -750,6 +757,7 @@ buildipcop() { ipcopmake cftp ipcopmake etherwake ipcopmake ethereal + ipcopmake tftp-hpa # ipcopmake stunnel # Ausgeschaltet, weil wir es doch nicht nutzen } @@ -823,7 +831,7 @@ buildpackages() { fi done echo "====== List of softwares used to build $NAME Version: $VERSION ======" > $BASEDIR/doc/packages-list.txt - grep -v 'configroot$\|img$\|initrd$\|initscripts$\|installer$\|install$\|ipcop$\|setup$\|pakfire$\|stage2$\|smp$\|tools$\|tools1$\|tools2$' \ + grep -v 'configroot$\|img$\|initrd$\|initscripts$\|installer$\|install$\|ipfire$\|setup$\|pakfire$\|stage2$\|smp$\|tools$\|tools1$\|tools2$\|^ipfire-logs' \ $BASEDIR/doc/packages-list | sort >> $BASEDIR/doc/packages-list.txt rm -f $BASEDIR/doc/packages-list # packages-list.txt is ready to be displayed for wiki page @@ -863,7 +871,7 @@ ipfirepackages() { fi ipfiredist amavisd ipfiredist applejuice - # ipfiredist asterisk + ipfiredist asterisk ipfiredist clamav ipfiredist cups ipfiredist cyrusimap @@ -871,7 +879,9 @@ ipfirepackages() { ipfiredist gnump3d ipfiredist java ipfiredist lame + ipfiredist libogg ipfiredist libtiff + ipfiredist libvorbis ipfiredist libxml2 ipfiredist mailx ipfiredist mldonkey @@ -881,20 +891,26 @@ ipfirepackages() { ipfiredist postfix ipfiredist procmail ipfiredist samba + ipfiredist sox ipfiredist spamassassin ipfiredist web-cyradm ipfiredist xampp - ipfiredist xinetd +# ipfiredist xinetd test -d $BASEDIR/packages || mkdir $BASEDIR/packages mv -f $LFS/install/packages/*.{tar.gz,md5} $BASEDIR/packages >> $LOGFILE 2>&1 rm -rf $BASEDIR/build/install/packages/* } +update_logs() { + tar cfz log/ipfire-logs-`date +'%Y-%m-%d-%H:%M'`.tgz log/_build.* + rm -f log/_build.* +} + # See what we're supposed to do case "$1" in build) BUILDMACHINE=`uname -m` - PACKAGE=`ls -v -r $BASEDIR/cache/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz 2> /dev/null | head -n 1` + PACKAGE=`ls -v -r $BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz 2> /dev/null | head -n 1` #only restore on a clean disk if [ ! -f log/perl-*-tools ]; then if [ ! -n "$PACKAGE" ]; then @@ -1092,36 +1108,53 @@ toolchain) buildtoolchain BUILDMACHINE=`uname -m` echo "`date -u '+%b %e %T'`: Create toolchain tar.gz for $BUILDMACHINE" | tee -a $LOGFILE - cd $BASEDIR && tar -zc --exclude='log/_build.*.log' -f cache/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz \ + test -d $BASEDIR/cache/toolchains || mkdir $BASEDIR/cache/toolchains + cd $BASEDIR && tar -zc --exclude='log/_build.*.log' -f cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz \ build/{bin,etc,usr/bin,usr/local} \ build/tools/{bin,etc,*-linux-gnu,include,lib,libexec,sbin,share,var} \ log >> $LOGFILE - md5sum cache/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz \ - > cache/$SNAME-$VERSION-toolchain-$BUILDMACHINE.md5 + md5sum cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz \ + > cache/toolchains/$SNAME-$VERSION-toolchain-$BUILDMACHINE.md5 stdumount ;; gettoolchain) BUILDMACHINE=`uname -m` # arbitrary name to be updated in case of new toolchain package upload PACKAGE=$SNAME-$VERSION-toolchain-$BUILDMACHINE - URL_IPFIRE=`grep URL_IPFIRE lfs/Config | awk '{ print $3 }'` - echo "`date -u '+%b %e %T'`: Load toolchain tar.gz for $BUILDMACHINE" | tee -a $LOGFILE - cd $BASEDIR/cache - wget $URL_IPFIRE/toolchains/$PACKAGE.tar.gz $URL_IPFIRE/toolchains/$PACKAGE.md5 >& /dev/null - if [ $? -ne 0 ]; then - echo "`date -u '+%b %e %T'`: error downloading toolchain for $BUILDMACHINE machine" | tee -a $LOGFILE - else - if [ "`md5sum $PACKAGE.tar.gz | awk '{print $1}'`" = "`cat $PACKAGE.md5 | awk '{print $1}'`" ]; then - echo "`date -u '+%b %e %T'`: toolchain md5 ok" | tee -a $LOGFILE + if [ ! -f $BASEDIR/cache/toolchains/$PACKAGE.tar.gz ]; then + URL_IPFIRE=`grep URL_IPFIRE lfs/Config | awk '{ print $3 }'` + test -d $BASEDIR/cache/toolchains || mkdir $BASEDIR/cache/toolchains + echo "`date -u '+%b %e %T'`: Load toolchain tar.gz for $BUILDMACHINE" | tee -a $LOGFILE + cd $BASEDIR/cache/toolchains + wget $URL_IPFIRE/toolchains/$PACKAGE.tar.gz $URL_IPFIRE/toolchains/$PACKAGE.md5 >& /dev/null + if [ $? -ne 0 ]; then + echo "`date -u '+%b %e %T'`: error downloading toolchain for $BUILDMACHINE machine" | tee -a $LOGFILE else - exiterror "$PACKAGE.md5 did not match, check downloaded package" + if [ "`md5sum $PACKAGE.tar.gz | awk '{print $1}'`" = "`cat $PACKAGE.md5 | awk '{print $1}'`" ]; then + echo "`date -u '+%b %e %T'`: toolchain md5 ok" | tee -a $LOGFILE + else + exiterror "$PACKAGE.md5 did not match, check downloaded package" + fi fi + else + echo "Toolchain is already downloaded. Exiting..." fi ;; +sources-iso) + prepareenv + echo "`date -u '+%b %e %T'`: Build sources iso for $MACHINE" | tee -a $LOGFILE + chroot $LFS /tools/bin/env -i HOME=/root \ + TERM=$TERM PS1='\u:\w\$ ' \ + PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \ + VERSION=$VERSION NAME="$NAME" SNAME="$SNAME" MACHINE=$MACHINE \ + /bin/bash -x -c "cd /usr/src/lfs && make -f sources-iso LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1 + mv $LFS/install/images/ipfire-* $BASEDIR >> $LOGFILE 2>&1 + stdumount + ;; svn) case "$2" in update|up) - clear + # clear echo -n "Load the latest source files..." svn update >> $PWD/log/_build.svn.update.log if [ $? -eq 0 ]; then @@ -1138,10 +1171,13 @@ svn) echo ".Fail!" exit 1 fi + chmod 755 $0 + exit 0 ;; commit|ci) clear - echo "Upload the changed files..." + #$0 changelog + #echo "Upload the changed files..." sleep 1 svn commit $0 svn up @@ -1186,19 +1222,103 @@ svn) ;; esac ;; -sync) - echo -e "Syncing Cache to FTP:" - if [ -f .pass ]; then - PASS="`cat .pass`" +make-config) + echo -e "This is for creating your configuration..." + echo -e "We will need some input:" + echo -e "" + echo -n "FTP-DOMAIN FOR THE ISO: " + read IPFIRE_FTP_URL_EXT + echo -n "PATH FOR $IPFIRE_FTP_URL_EXT: " + read IPFIRE_FTP_PATH_EXT + echo -n "USERNAME FOR $IPFIRE_FTP_URL_EXT: " + read IPFIRE_FTP_USER_EXT + echo -n "PASSWORD FOR $IPFIRE_FTP_URL_EXT: " + read -s IPFIRE_FTP_PASS_EXT + echo "" + echo "(You can leave this empty if the cache-server is the same as your iso-server.)" + echo -n "FTP-DOMAIN FOR THE CACHE: " + read IPFIRE_FTP_URL_INT + echo -n "PATH FOR $IPFIRE_FTP_URL_INT: " + read IPFIRE_FTP_PATH_INT + if [ $IPFIRE_FTP_URL_INT ]; then + echo -n "USERNAME FOR $IPFIRE_FTP_URL_INT: " + read IPFIRE_FTP_USER_INT + echo -n "PASSWORD FOR $IPFIRE_FTP_URL_INT: " + read -s IPFIRE_FTP_PASS_INT + else + IPFIRE_FTP_URL_INT=$IPFIRE_FTP_URL_EXT + IPFIRE_FTP_USER_INT=$IPFIRE_FTP_USER_EXT + IPFIRE_FTP_PASS_INT=$IPFIRE_FTP_PASS_EXT + echo "USERNAME FOR $IPFIRE_FTP_URL_INT: $IPFIRE_FTP_USER_INT" + echo "PASSWORD FOR $IPFIRE_FTP_URL_INT: !HIDDEN!" + fi + echo "" + echo "(You can leave this empty if the pak-server is the same as your iso-server.)" + echo -n "FTP-DOMAIN FOR THE PAKS: " + read IPFIRE_FTP_URL_PAK + echo -n "PATH FOR $IPFIRE_FTP_URL_PAK: " + read IPFIRE_FTP_PATH_PAK + if [ $IPFIRE_FTP_URL_PAK ]; then + echo -n "USERNAME FOR $IPFIRE_FTP_URL_PAK: " + read IPFIRE_FTP_USER_PAK + echo -n "PASSWORD FOR $IPFIRE_FTP_URL_PAK: " + read -s IPFIRE_FTP_PASS_PAK else - echo -ne "Password for mirror.ipfire.org: "; read PASS + IPFIRE_FTP_URL_PAK=$IPFIRE_FTP_URL_EXT + IPFIRE_FTP_USER_PAK=$IPFIRE_FTP_USER_EXT + IPFIRE_FTP_PASS_PAK=$IPFIRE_FTP_PASS_EXT + echo "USERNAME FOR $IPFIRE_FTP_URL_PAK: $IPFIRE_FTP_USER_PAK" + echo "PASSWORD FOR $IPFIRE_FTP_URL_PAK: !HIDDEN!" fi - rm -f doc/packages-to-remove-from-ftp - ncftpls -u web3 -p $PASS ftp://mirror.ipfire.org/html/source-packages/source/ > ftplist + echo "" + echo -e "ONE OR MORE EMAIL ADDRESS(ES) TO WHICH THE REPORTS WILL BE SENT" + echo -e "(seperated by comma)" + read IPFIRE_MAIL_REPORT + echo -n "EMAIL FROM: " + read IPFIRE_MAIL_FROM + echo -n "EMAIL SERVER: " + read IPFIRE_MAIL_SERVER + echo -n "LOGIN TO MAIL SERVER: " + read IPFIRE_MAIL_USER + echo -n "MAIL PASSWORD: " + read -s IPFIRE_MAIL_PASS + echo -n "Saving..." + for i in `seq 20`; do + sleep 0.1; echo -n "." + done + echo ".Finished!" + cat < .config +### ISO server +IPFIRE_FTP_URL_EXT=$IPFIRE_FTP_URL_EXT +IPFIRE_FTP_PATH_EXT=$IPFIRE_FTP_PATH_EXT +IPFIRE_FTP_USER_EXT=$IPFIRE_FTP_USER_EXT +IPFIRE_FTP_PASS_EXT=$IPFIRE_FTP_PASS_EXT +### cache server +IPFIRE_FTP_URL_INT=$IPFIRE_FTP_URL_INT +IPFIRE_FTP_PATH_INT=$IPFIRE_FTP_PATH_INT +IPFIRE_FTP_USER_INT=$IPFIRE_FTP_USER_INT +IPFIRE_FTP_PASS_INT=$IPFIRE_FTP_PASS_INT +### paks server +IPFIRE_FTP_URL_PAK=$IPFIRE_FTP_URL_PAK +IPFIRE_FTP_PATH_PAK=$IPFIRE_FTP_PATH_PAK +IPFIRE_FTP_USER_PAK=$IPFIRE_FTP_USER_PAK +IPFIRE_FTP_PASS_PAK=$IPFIRE_FTP_PASS_PAK +### mail reports +IPFIRE_MAIL_REPORT=$IPFIRE_MAIL_REPORT +IPFIRE_MAIL_FROM=$IPFIRE_MAIL_FROM +IPFIRE_MAIL_SERVER=$IPFIRE_MAIL_SERVER +IPFIRE_MAIL_USER=$IPFIRE_MAIL_USER +IPFIRE_MAIL_PASS=$IPFIRE_MAIL_PASS +END + ;; +sync) + echo -e "Syncing cache to ftp:" +# rm -f doc/packages-to-remove-from-ftp + ncftpls -u $IPFIRE_FTP_USER_INT -p $IPFIRE_FTP_PASS_INT ftp://$IPFIRE_FTP_URL_INT$IPFIRE_FTP_PATH_INT/ > ftplist for i in `ls -w1 cache/`; do grep $i ftplist if [ "$?" -ne "0" ]; then - ncftpput -u web3 -p $PASS mirror.ipfire.org /html/source-packages/source cache/$i + ncftpput -u $IPFIRE_FTP_USER_INT -p $IPFIRE_FTP_PASS_INT $IPFIRE_FTP_URL_INT $IPFIRE_FTP_PATH_INT/ cache/$i if [ "$?" -eq "0" ]; then echo -e "$i was successfully uploaded to the ftp server." else @@ -1206,50 +1326,46 @@ sync) fi fi done - for i in `cat ftplist`; do - ls -w1 cache/ | grep $i - if [ "$?" -eq "1" ]; then - echo $i | grep -v toolchain >> doc/packages-to-remove-from-ftp - fi - done +# for i in `cat ftplist`; do +# ls -w1 cache/ | grep $i +# if [ "$?" -eq "1" ]; then +# echo $i | grep -v toolchain >> doc/packages-to-remove-from-ftp +# fi +# done rm -f ftplist ;; -pub-iso) - echo -e "Upload the ISO to the beta-mirror!" - if [ -f .pass ]; then - PASS="`cat .pass`" - else - echo -ne "Password for mirror.ipfire.org: "; read PASS - fi - ncftpls -u web3 -p $PASS ftp://mirror.ipfire.org/html/source-packages/beta/ | grep `svn info | grep Revision | cut -c 11-` - if [ "$?" -eq "1" ]; then - cp $BASEDIR/ipfire-install-1.4.i386.iso $BASEDIR/ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso - md5sum ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso > ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso.md5 - ncftpput -u web3 -p $PASS mirror.ipfire.org /html/source-packages/beta/ ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso - ncftpput -u web3 -p $PASS mirror.ipfire.org /html/source-packages/beta/ ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso.md5 - if [ "$?" -eq "0" ]; then - echo -e "The ISO of Revision `svn info | grep Revision | cut -c 11-` was successfully uploaded to the ftp server." - else - echo -e "There was an error while uploading the ISO to the ftp server." - fi - else - echo -e "File with name ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso already exists on the ftp server!" - fi - rm -f ipfire-install-1.4.i386-r`svn info | grep Revision | cut -c 11-`.iso{,.md5} - ;; -pub-paks) - echo -e "Upload the packages to the beta-mirror!" - if [ -f .pass ]; then - PASS="`cat .pass`" - else - echo -ne "Password for mirror.ipfire.org: "; read PASS - fi - ncftpput -z -u web3 -p $PASS mirror.ipfire.org /html/source-packages/packages/ packages/* - if [ "$?" -eq "0" ]; then - echo -e "The packages were successfully uploaded to the ftp server." - else - echo -e "There was an error while uploading the packages to the ftp server." - fi +upload) + case "$2" in + iso) + echo -e "Uploading the iso to $IPFIRE_FTP_URL_EXT." + ncftpls -u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT ftp://$IPFIRE_FTP_URL_EXT$IPFIRE_FTP_PATH_EXT/ | grep $SVN_REVISION + if [ "$?" -eq "1" ]; then + cp $BASEDIR/ipfire-install-$VERSION.i386.iso $BASEDIR/ipfire-install-$VERSION.i386-r`svn info | grep Revision | cut -c 11-`.iso + md5sum ipfire-install-$VERSION.i386-r$SVN_REVISION.iso > ipfire-install-$VERSION.i386-r$SVN_REVISION.iso.md5 + ncftpput -V -u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ ipfire-install-$VERSION.i386-r$SVN_REVISION.iso + ncftpput -V -u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ ipfire-install-$VERSION.i386-r$SVN_REVISION.iso.md5 + ncftpput -V -u $IPFIRE_FTP_USER_EXT -p $IPFIRE_FTP_PASS_EXT $IPFIRE_FTP_URL_EXT $IPFIRE_FTP_PATH_EXT/ ipfire-source-*-r$SVN_REVISION.tar.gz + if [ "$?" -eq "0" ]; then + echo -e "The ISO of Revision $SVN_REVISION was successfully uploaded to the ftp server." + else + echo -e "There was an error while uploading the iso to the ftp server." + exit 1 + fi + else + echo -e "File with name ipfire-install-$VERSION.i386-r$SVN_REVISION.iso already exists on the ftp server!" + fi + rm -f ipfire-install-$VERSION.i386-r$SVN_REVISION.iso{,.md5} + ;; + paks) + ncftpput -z -u $IPFIRE_FTP_USER_PAK -p $IPFIRE_FTP_PASS_PAK $IPFIRE_FTP_URL_PAK $IPFIRE_FTP_PATH_PAK/ packages/* + if [ "$?" -eq "0" ]; then + echo -e "The packages were successfully uploaded to the ftp server." + else + echo -e "There was an error while uploading the packages to the ftp server." + exit 1 + fi + ;; + esac ;; build-only) rm -f $BASEDIR/log/$2* @@ -1262,10 +1378,206 @@ build-silent) echo "Build started... This will take a while!" echo "You can see the status with 'screen -x ipfire'." ;; +mail) + chmod 755 tools/sendEmail + ATTACHMENT=/tmp/ipfire-build-logs-R$SVN_REVISION.tar.gz + if [ "$2" = "ERROR" ]; then + SUBJECT="ERROR: IPFIRE-BUILD R$SVN_REVISION on `hostname`" + echo "ERROR: $0 build!" + cat < /tmp/ipfire_mail_body +When I was building IPFire on `hostname`, I have found an ERROR! +Here you can see the logs and detect the reason for this error. + +Best Regards +Your IPFire-Build-Script +END + fi + if [ "$2" = "SUCCESS" ]; then + SUBJECT="SUCCESS: IPFIRE-BUILD R$SVN_REVISION on `hostname`" + cat < /tmp/ipfire_mail_body +Building IPFire on `hostname` in Revision $SVN_REVISION was successfull! +You can find the ISO on your ftp server. + +Statistics: +----------- +Started: $IPFIRE_START_TIME +Finished: `date` + +Best Regards +Your IPFire-Build-Script +END + fi + if [ "$2" = "SVNUPDATE" ]; then + SUBJECT="SVNUPDATE: IPFIRE-BUILD R$SVN_REVISION on `hostname`" + echo "ERROR: $0 svn up!" + cat < /tmp/ipfire_mail_body +When I was downloading the latest svn source, +I have found an ERROR! +Here you can see the logs and detect the reason for this error. + +Best Regards +Your IPFire-Build-Script +END + fi + + if [ "$2" = "SVNDIST" ]; then + SUBJECT="SVNDIST: IPFIRE-BUILD R$SVN_REVISION on `hostname`" + echo "ERROR: $0 svn dist!" + cat < /tmp/ipfire_mail_body +When I was exporting the latest svn source, +I have found an ERROR! +Here you can see the logs and detect the reason for this error. + +Best Regards +Your IPFire-Build-Script +END + fi + + if [ "$2" = "PREFETCH" ]; then + SUBJECT="PREFETCH: IPFIRE-BUILD R$SVN_REVISION on `hostname`" + echo "ERROR: $0 prefetch!" + cat < /tmp/ipfire_mail_body +When I was downloading the source packages, +I have found an ERROR! +Here you can see the logs and detect the reason for this error. + +Best Regards +Your IPFire-Build-Script +END + fi + + if [ "$2" = "ISO" ]; then + SUBJECT="ISO: IPFIRE-BUILD R$SVN_REVISION on `hostname`" + echo "ERROR: $0 upload iso!" + cat < /tmp/ipfire_mail_body +When I was uploading the iso image, +I have found an ERROR! +Here you can see the logs and detect the reason for this error. + +Best Regards +Your IPFire-Build-Script +END + fi + + if [ "$2" = "PAKS" ]; then + SUBJECT="PAKS: IPFIRE-BUILD R$SVN_REVISION on `hostname`" + echo "ERROR: $0 upload paks!" + cat < /tmp/ipfire_mail_body +When I was uploading the packages, +I have found an ERROR! +Here you can see the logs and detect the reason for this error. + +Best Regards +Your IPFire-Build-Script +END + fi + + tar cfz $ATTACHMENT log/_build* + cat <> /tmp/ipfire_mail_body + +Here is a summary... The full logs are in the attachment. +--------------------------------------------------------- + +`tail log/_*` +END + cat /tmp/ipfire_mail_body | tools/sendEmail -q \ + -f $IPFIRE_MAIL_FROM \ + -t $IPFIRE_MAIL_REPORT \ + -u $SUBJECT \ + -s $IPFIRE_MAIL_SERVER:25 \ + -xu $IPFIRE_MAIL_USER \ + -xp $IPFIRE_MAIL_PASS \ + -l log/_build.mail.log \ + -a $ATTACHMENT # -v + rm -f /tmp/ipfire_mail_body $ATTACHMENT + ;; +unattended) + if [ ! -f .config ]; then + echo "No configuration found. Try ./make.sh make-config." + fi + ### This is our procedure that will compile the IPFire by herself... + echo "### UPDATE LOGS" + update_logs + echo "### SAVING TIME" + export IPFIRE_START_TIME=`date` + + echo "### GETTING TOOLCHAIN" + $0 gettoolchain + + echo "### RUNNING SVN-UPDATE" + $0 svn update + if [ $? -ne 0 ]; then + $0 mail SVNUPDATE + exit 1 + fi + + echo "### EXPORT SOURCES" + $0 svn dist + if [ $? -ne 0 ]; then + $0 mail SVNDIST + exit 1 + fi + + echo "### RUNNING PREFETCH" + $0 prefetch | grep -q "md5 difference" + if [ $? -eq 0 ]; then + $0 mail PREFETCH + exit 1 + fi + + echo "### RUNNING BUILD" + $0 build + if [ $? -ne 0 ]; then + $0 mail ERROR + exit 1 + fi + + echo "### MAKING SOURCES-ISO" + $0 sources-iso + + echo "### UPLOADING ISO" + $0 upload iso + if [ $? -ne 0 ]; then + $0 mail ISO + exit 1 + fi + + echo "### UPLOADING PAKS" + $0 upload paks + if [ $? -ne 0 ]; then + $0 mail PAKS + exit 1 + fi + + echo "### SUCCESS!" + $0 mail SUCCESS + exit 0 + ;; +batch) + if [ `screen -ls | grep batch` ]; then + echo "Build is already running, sorry!" + exit 1 + else + echo -n "IPFire-Batch-Build is starting..." + screen -dmS ipfire $0 unattended + if [ "$?" -eq "0" ]; then + echo ".Done!" + else + echo ".ERROR!" + exit 1 + fi + #if [ "$2" -eq "-v" ]; then + # screen -x ipfire + #else + # echo "You may attach you with '-v'." + #fi + exit 0 + fi + ;; *) clear svn info - select name in "Exit" "IPFIRE: Prefetch" "IPFIRE: Build (silent)" "IPFIRE: Watch Build" "IPFIRE: Clean" "SVN: Commit" "SVN: Update" "SVN: Status" "SVN: Diff" "Help" + select name in "Exit" "IPFIRE: Prefetch" "IPFIRE: Build (silent)" "IPFIRE: Watch Build" "IPFIRE: Batch" "IPFIRE: Clean" "SVN: Commit" "SVN: Update" "SVN: Status" "SVN: Diff" "LOG: Tail" "Help" do case $name in "IPFIRE: Prefetch") @@ -1281,14 +1593,20 @@ build-silent) sleep 0.1; echo -n "." done echo ".Ready!" - sleep 0.5 + sleep 0.3 screen -x ipfire ;; + "IPFIRE: Batch") + $0 batch + ;; "IPFIRE: Clean") $0 clean ;; "SVN: Commit") - $0 svn commit + echo "Are your sure to Update all Files to the Server (write: yes)?"; read input + if [ "$input" == "yes" ]; then + $0 svn commit + fi ;; "SVN: Update") $0 svn update @@ -1303,6 +1621,9 @@ build-silent) echo "Usage: $0 {build|changelog|check|checkclean|clean|gettoolchain|newpak|prefetch|shell|sync|toolchain}" cat doc/make.sh-usage ;; + "LOG: Tail") + tail -f log/_* + ;; "Exit") break ;;