]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - make.sh
HinzugefĆ¼gt:
[ipfire-2.x.git] / make.sh
diff --git a/make.sh b/make.sh
index 0743d0627ff500a8d8fc11abb5796314e8685fa8..38807e20b88e69343b32d0c774e8d07e070d4d8a 100644 (file)
--- a/make.sh
+++ b/make.sh
@@ -2,35 +2,30 @@
 #
 ############################################################################
 #                                                                          #
-# This file is part of the IPCop Firewall.                                 #
+# This file is part of the IPFire Firewall.                                #
 #                                                                          #
-# IPCop is free software; you can redistribute it and/or modify            #
+# IPFire is free software; you can redistribute it and/or modify           #
 # it under the terms of the GNU General Public License as published by     #
 # the Free Software Foundation; either version 2 of the License, or        #
 # (at your option) any later version.                                      #
 #                                                                          #
-# IPCop is distributed in the hope that it will be useful,                 #
+# IPFire is distributed in the hope that it will be useful,                #
 # but WITHOUT ANY WARRANTY; without even the implied warranty of           #
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
 # GNU General Public License for more details.                             #
 #                                                                          #
 # You should have received a copy of the GNU General Public License        #
-# along with IPCop; if not, write to the Free Software                     #
+# along with IPFire; if not, write to the Free Software                    #
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
 #                                                                          #
-# Copyright (C) 2001 Mark Wormgoor <mark@wormgoor.com>.                    #
-#                                                                          #
-# (c) 2001 Eric S. Johansson <esj@harvee.billerica.ma.us> Check for Bash   #
-# (c) 2002 Thorsten Fischer <frosch@cs.tu-berlin.de> MD5Sum checking       #
+# Copyright (C) 2006 IPFire-Team <entwickler@ipfire.org>.                  #
 #                                                                          #
 ############################################################################
-#
-# $Id: make.sh,v 1.129.2.145 2006/02/01 07:04:09 gespinasse Exp $
 #
 
-  NAME="IPFire"                                # Software name
+  NAME="IPFire"                        # Software name
   SNAME="ipfire"                       # Short name
-  VERSION="1.4"                                # Version number
+  VERSION="1.4"                        # Version number
 # PREVIOUSTAG=IPCOP_v1_4_10_FINAL
   SLOGAN="We secure your network"      # Software slogan
   CONFIG_ROOT=/var/ipfire              # Configuration rootdir
@@ -342,7 +337,7 @@ ipcopmake() {
 ipfiredist() {
        if [ -f $BASEDIR/build/usr/src/lfs/$1 ]; then
                echo "`date -u '+%b %e %T'`: Packaging $1" | tee -a $LOGFILE
-               cp -f $BASEDIR/src/scripts/make-packages.sh $BASEDIR/build/usr/sbin/
+               cp -f $BASEDIR/src/scripts/make-packages.sh $BASEDIR/build/usr/local/bin
                chroot $LFS /tools/bin/env -i   HOME=/root \
                                                TERM=$TERM PS1='\u:\w\$ ' \
                                                PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \
@@ -361,12 +356,8 @@ ipfiredist() {
        else
                exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
        fi
-       if [ -e $BASEDIR/packages ]; then
-               mv -f $BASEDIR/build/paks/* $BASEDIR/packages/
-       else
-               mkdir -p $BASEDIR/packages
-               mv -f $BASEDIR/build/paks/* $BASEDIR/packages/
-       fi
+#      test -d $BASEDIR/packages || mkdir $BASEDIR/packages
+#      mv -f $BASEDIR/build/paks/* $BASEDIR/packages/
        return 0
 }
 
@@ -652,17 +643,49 @@ buildipcop() {
   ipcopmake libsafe
   ipcopmake 3c5x9setup
   echo -ne "`date -u '+%b %e %T'`: Building IPFire modules \n" | tee -a $LOGFILE
-  ipcopmake berkeley-DB
+## Zuerst die Libs und dann die Programme. Ordnung muss sein!
+  ipcopmake berkeley
+  ipcopmake libtiff
+  ipcopmake libjpeg
+  ipcopmake libxml2
+  ipcopmake spandsp
+  ipcopmake lzo
+  ipcopmake pkg-config
+  ipcopmake glib
   ipcopmake xampp
   ipcopmake pam
   ipcopmake pammysql
-  ipcopmake saslauthd
-  ipcopmake postfix
-  ipcopmake stund
-  ipcopmake lpd
+  ipcopmake saslauthd PASS=1
+  ipcopmake openldap
+  ipcopmake saslauthd PASS=2
+  ipcopmake xinetd
+  ipcopmake ghostscript
+  ipcopmake cups
+  ipcopmake samba
+  ipcopmake sudo
+  ipcopmake mc
   ipcopmake pwlib
   ipcopmake openh323
-
+  ipcopmake wget
+  ipcopmake bridge-utils
+  ipcopmake postfix
+  ipcopmake fetchmail
+  ipcopmake cyrusimap
+  ipcopmake stund
+#  ipcopmake lpd
+  ipcopmake openvpn
+  ipcopmake asterisk
+  ipcopmake edonkeyclc
+  ipcopmake sane
+  ipcopmake lame
+  ipcopmake gnump3d
+  ipcopmake clamav
+#  ipcopmake spamassassin
+  ipcopmake rsync
+  ipcopmake tcpwrapper
+#  wget http://www.guzu.net/linux/hddtemp.db && mv hddtemp.db $BASEDIR/build/etc/hddtemp.db
+#  ipcopmake hddtemp
+# ipcopmake stunnel # Ausgeschaltet, weil wir es doch nicht nutzen
 }
 
 buildinstaller() {
@@ -745,14 +768,29 @@ buildpackages() {
   grep -v 'configroot$\|img$\|initrd$\|initscripts$\|installer$\|install$\|ipcop$\|setup$\|stage2$\|smp$\|tools$\|tools1$\|tools2$' \
        $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 IPCopSoftwares
+  # packages-list.txt is ready to be displayed for wiki page
 
   # Create ISO for CDRom and USB-superfloppy
   ipcopmake cdrom
   cp $LFS/install/images/{*.iso,*.tgz} $BASEDIR >> $LOGFILE 2>&1
-  
+
   # Build IPFire packages
+  ipfiredist asterisk
+  ipfiredist cyrusimap
+  ipfiredist fetchmail
+  ipfiredist gnump3d
+  ipfiredist libtiff
+  ipfiredist libxml2
+  ipfiredist mc
   ipfiredist postfix
+  ipfiredist pwlib
+  ipfiredist sane
+  ipfiredist spandsp
+  ipfiredist sudo
+  ipfiredist xampp
+  ipfiredist xinetd
+  test -d $BASEDIR/packages || mkdir $BASEDIR/packages
+  cp -f $LFS/paks/*.tar.gz $LFS/paks/*.md5 $BASEDIR/packages >> $LOGFILE 2>&1
 
   # Cleanup
   stdumount
@@ -811,20 +849,9 @@ shell)
        entershell
        ;;
 changelog)
-       echo "Building doc/Changelog from CVS"
-       # cv2cl script come from http://www.red-bean.com/cvs2cl/
-       if [ ! -s $BASEDIR/doc/CVS/Tag ]; then
-               BRANCHOPTS=""
-       else
-               BRANCH=`cat $BASEDIR/doc/CVS/Tag`
-               BRANCH=${BRANCH:1}
-               BRANCHOPTS="--follow-only $BRANCH"
-       fi
-       
-       $BASEDIR/tools/cvs2cl.pl --gmt --show-dead $BRANCHOPTS -f $BASEDIR/doc/ChangeLog
-       rm -f $BASEDIR/doc/ChangeLog.bak
-       echo
-       echo "Commit the change now to update CVS"
+       echo -n "Loading new Changelog from SVN: "
+       svn log > doc/ChangeLog
+       echo "Finished!"
        ;;
 check)
        echo "Checking sources files availability on the web"
@@ -879,72 +906,61 @@ clean)
        fi
        ;;
 dist)
-       echo "Building source package from CVS, list of changed files, MD5 of release files"
-       if [ ! -s $BASEDIR/doc/CVS/Tag ]; then
-               BRANCH=""
-               BRANCHOPTS="-D `date +'%Y-%m-%d'`"
-       else
-               BRANCH=`cat $BASEDIR/doc/CVS/Tag`
-               BRANCH=${BRANCH:1}
-               BRANCHOPTS="-r $BRANCH"
-       fi
+       echo "Building source package from SVN: "
+       svn export http://svn.ipfire.eu/svn/ipfire ipfire-source/ --force
+       tar cfz ipfire-source-`date +'%Y-%m-%d'`-r`svn info | grep Revision | cut -c 11-`.tar.gz ipfire-source
+       rm ipfire-source/ -r
+       ;;
+newpak)
+       # create structure for a new package
+       echo -e "Name of the new package: $2"
+       if [ ! -f "lfs/$2" ]; then
+               echo "`date -u '+%b %e %T'`: Creating directory src/paks/$2"
+               mkdir -p src/paks/$2
+               cd src/paks/$2
+               echo "`date -u '+%b %e %T'`: Creating files"
+               cp $BASEDIR/lfs/postfix $BASEDIR/lfs/$2
 
-       rm -rf $BASEDIR/build/tmp/$SNAME-$VERSION $BASEDIR/doc/release.txt
-       cd $BASEDIR/build/tmp
-       # build sources tgz
-       echo "Export tree $BRANCH $SNAME-$VERSION"
-       cvs -z3 -d `cat $BASEDIR/CVS/Root` export $BRANCHOPTS ipcop
-       if [ $? -eq 0 ]; then
-               mv ipcop $SNAME-$VERSION
-               tar cfz $BASEDIR/$SNAME-sources-$VERSION.tgz $SNAME-$VERSION
-               cd $BASEDIR
+               touch ROOTFILES
+               touch CONFFILES
+               touch {,un}install.sh
+       ## install.sh
+               echo '#!/bin/bash' > install.sh
+               echo '#' >> install.sh
+               echo '#################################################################' >> install.sh
+               echo '#                                                               #' >> install.sh
+               echo '# This file belongs to IPFire Firewall - GPLv2 - www.ipfire.org #' >> install.sh
+               echo '#                                                               #' >> install.sh
+               echo '#################################################################' >> install.sh
+               echo '#' >> install.sh
+               echo '# Extract the files' >> install.sh
+               echo 'tar xfz files.tgz -C /' >> install.sh
+               echo 'cp -f ROOTFILES /opt/pakfire/installed/ROOTFILES.$2' >> install.sh
+       ## uninstall.sh
+               echo '#!/bin/bash' > uninstall.sh
+               echo '#################################################################' >> uninstall.sh
+               echo '#                                                               #' >> uninstall.sh
+               echo '# This file belongs to IPFire Firewall - GPLv2 - www.ipfire.org #' >> uninstall.sh
+               echo '#                                                               #' >> uninstall.sh
+               echo '#################################################################' >> uninstall.sh
+               echo '#' >> uninstall.sh
+               echo '# Delete the files' >> uninstall.sh
+               echo '## Befehl fehlt noch' >> uninstall.sh
+               echo 'rm -f /opt/pakfire/installed/ROOTFILES.$2' >> uninstall.sh
+               echo "`date -u '+%b %e %T'`: Adding files to SVN"
+               cd - && svn add lfs/$2 && svn add src/paks/$2
 
-               if [ ! -d $BASEDIR/build/tmp/$PREVIOUSTAG ]; then
-                       # export previous version to be compared with actual, this help to check wich files need to go in update
-                       cd $BASEDIR/build/tmp
-                       echo "Export tree $PREVIOUSTAG"
-                       cvs -z3 -d `cat $BASEDIR/CVS/Root` export -r $PREVIOUSTAG ipcop
-                       mv ipcop $PREVIOUSTAG
-               fi
-               if [ -d $BASEDIR/build/tmp/$PREVIOUSTAG -o -d $BASEDIR/build/tmp/$SNAME-$VERSION ]; then
-                       cd $BASEDIR/build/tmp
-                       echo "diff $PREVIOUSTAG <> $BRANCH $SNAME-$VERSION >doc/updated-sources.txt"
-                       diff -rq $PREVIOUSTAG $SNAME-$VERSION > $BASEDIR/doc/updated-sources.txt
-                       mv $BASEDIR/doc/updated-sources.txt $BASEDIR/doc/updated-sources.bak
-                       sed -e "s+Files $PREVIOUSTAG\/++" \
-                               -e "s+ and .*$++" \
-                               -e "s+src/rc.d+etc/rc.d+" \
-                               -e "s+^langs/+var/ipcop/langs/+" \
-                               -e "s+html/cgi-bin+home/httpd/cgi-bin+" $BASEDIR/doc/updated-sources.bak \
-                               > $BASEDIR/doc/updated-sources.txt
-                       rm -f $BASEDIR/doc/updated-sources.bak
+               echo -n "Do you want to remove the folders? [y/n]"
+               read REM
+               if  [ "$REM" == "y" ]; then
+                       echo "Removing the folders..."
+                       svn del src/paks/$2 --force
+               else
+                       echo "Folders are kept."
                fi
-       fi
-       ;;
-newupdate)
-       # create structure for $VERSION update
-       if [ ! -f "updates/$VERSION" ]; then
-               mkdir -p updates/$VERSION
-               cd updates/$VERSION
-               touch information
-               echo 'etc/issue' > ROOTFILES.alpha-$VERSION
-               echo 'etc/issue' > ROOTFILES.i386-$VERSION
-               echo 'patch.tar.gz' > .cvsignore
-               sed -e "s+^UPGRADEVERSION.*$+UPGRADEVERSION=$VERSION+" $BASEDIR/src/scripts/updatesetup > setup
-               chmod 755 setup
-               cd ..
-               echo "Adding directory $VERSION to cvs"
-               cvs add $VERSION
-               echo "Adding files to cvs"
-               cvs add $VERSION/ROOTFILES.alpha-$VERSION \
-                       $VERSION/ROOTFILES.i386-$VERSION \
-                       $VERSION/information \
-                       $VERSION/setup \
-                       $VERSION/.cvsignore
        else
-               echo "update/$VERSION already exist"
+               echo "$2 already exists"
        fi
-       cd -
        exit 0
        ;;
 prefetch)
@@ -991,40 +1007,6 @@ prefetch)
        fi
        cd -
        ;;
-rootfiles)
-       PREVIOUSVERSION=`echo $PREVIOUSTAG | sed -e 's/IPCOP_v//' -e 's/_FINAL//' -e 's/_/\./g'`
-       # make md5 list of actual build
-       # some packages include a timestamp (kernel/perl/python/vim and more), so md5 vary at each build
-       # anyway, it is sometime usable after a patch or a minor upgrade to know wich files include in update
-       if [ ! -f "$BASEDIR/build/install/cdrom/$SNAME-$VERSION.tgz" ]; then
-               echo "need cdrom be build to read include files list, use ./make.sh build before."
-       else
-               tar tzf $BASEDIR/build/install/cdrom/$SNAME-$VERSION.tgz > $BASEDIR/updates/$VERSION/FILES.tmp
-               cd $BASEDIR/build
-               rm -f $BASEDIR/updates/$VERSION/FILES-$MACHINE-$VERSION.md5
-               for line in `cat $BASEDIR/updates/$VERSION/FILES.tmp`; do
-                       if [ -f "$line" -a ! -L "$line" ]; then
-                               md5sum "$line" >> $BASEDIR/updates/$VERSION/FILES-$MACHINE-$VERSION.md5
-                       fi
-               done
-               diff $BASEDIR/updates/$PREVIOUSVERSION/FILES-$MACHINE-$PREVIOUSVERSION.md5 \
-                       $BASEDIR/updates/$VERSION/FILES-$MACHINE-$VERSION.md5 \
-                       > $BASEDIR/updates/$VERSION/FILES-$MACHINE.diff
-               awk '$1==">" {print $3}' $BASEDIR/updates/$VERSION/FILES-$MACHINE.diff \
-                       > $BASEDIR/updates/$VERSION/ROOTFILES.add.$MACHINE
-               awk '$1=="<" {print $3}' $BASEDIR/updates/$VERSION/FILES-$MACHINE.diff \
-                       > $BASEDIR/updates/$VERSION/ROOTFILES.remove.$MACHINE.tmp
-               rm -f $BASEDIR/updates/$VERSION/ROOTFILES.remove.$MACHINE
-               for line in `cat $BASEDIR/updates/$VERSION/ROOTFILES.remove.$MACHINE.tmp`; do
-                       # a file is only removed when not in add file
-                       if ( ! grep -q "^$line$" $BASEDIR/updates/$VERSION/ROOTFILES.add.$MACHINE ); then
-                               echo $line >> $BASEDIR/updates/$VERSION/ROOTFILES.remove.$MACHINE
-                       fi
-               done
-               rm -f $BASEDIR/updates/$VERSION/{FILES.tmp,FILES-*.diff,ROOTFILES.remove.*.tmp}
-       fi
-       exit 0
-       ;;
 toolchain)
        prepareenv
        buildtoolchain
@@ -1041,23 +1023,34 @@ toolchain)
 gettoolchain)
        BUILDMACHINE=`uname -m`
        # arbitrary name to be updated in case of new toolchain package upload
-       PACKAGE=$SNAME-1.4.11-toolchain-$BUILDMACHINE
-       URL_SFNET=`grep URL_SFNET lfs/Config | awk '{ print $3 }'`
+       PACKAGE=$SNAME-1.4-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 -c $URL_SFNET/ipcop/$PACKAGE.tar.gz $URL_SFNET/ipcop/$PACKAGE.md5
+       wget $URL_IPFIRE/toolchains/$PACKAGE.tar.gz $URL_IPFIRE/toolchains/$PACKAGE.md5
        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
+                       echo "`date -u '+%b %e %T'`: Uncompressing toolchain" | tee -a $LOGFILE
+                       cd $BASEDIR && tar xvfz cache/$PACKAGE.tar.gz -C .
                else
                        exiterror "$PACKAGE.md5 did not match, check downloaded package"
                fi
        fi
        ;;
+update)
+       echo "Load the latest source-files:"
+       svn update
+       ;;
+commit)
+       echo "Upload the changed files:"
+       ./make.sh changelog
+       svn commit
+       ;;
 *)
-       echo "Usage: $0 {build|changelog|check|checkclean|clean|dist|gettoolchain|newupdate|prefetch|rootfiles|shell|toolchain}"
+       echo "Usage: $0 {build|changelog|check|checkclean|clean|commit|dist|gettoolchain|newpak|prefetch|shell|toolchain|update}"
        cat doc/make.sh-usage
        exit 1
        ;;