]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - make.sh
Geaendert:
[ipfire-2.x.git] / make.sh
diff --git a/make.sh b/make.sh
index a7cccf0236b903b0a4f94211ab3fd189cd81ccb9..66e821ff284b8eb851c776efd6dc98b5ad18d98c 100644 (file)
--- a/make.sh
+++ b/make.sh
@@ -25,7 +25,7 @@
 
   NAME="IPFire"                        # Software name
   SNAME="ipfire"                       # Short name
-  VERSION="1.4"                        # Version number
+  VERSION="2.0"                        # Version number
   SLOGAN="We secure your network"      # Software slogan
   CONFIG_ROOT=/var/ipfire              # Configuration rootdir
   NICE=10
   KVER=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'`
   MACHINE=`uname -m`
 
+  # 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
   if [ ! -e /etc/debian_version ]; then
        FULLPATH=`which $0`
@@ -55,6 +61,7 @@
   mkdir $BASEDIR/log/ 2>/dev/null
 
   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)" | tee -a $LOGFILE
        MACHINE=i386
        BUILDTARGET=i386-pc-linux-gnu
@@ -335,8 +342,8 @@ ipcopmake() {
 
 ipfiredist() {
        if [ -f $BASEDIR/build/usr/src/lfs/$1 ]; then
+#         if [ ! `ls -w1 $BASEDIR/packages/*.tar.gz | grep $1` ]; then
                echo "`date -u '+%b %e %T'`: Packaging $1" | tee -a $LOGFILE
-               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 \
@@ -352,11 +359,12 @@ ipfiredist() {
                if [ $? -ne 0 ]; then
                        exiterror "Packaging $1"
                fi
+#         else
+#              echo "`date -u '+%b %e %T'`: Packaging: The package $1 already exists"
+#         fi
        else
                exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
        fi
-#      test -d $BASEDIR/packages || mkdir $BASEDIR/packages
-#      mv -f $BASEDIR/build/paks/* $BASEDIR/packages/
        return 0
 }
 
@@ -524,8 +532,8 @@ buildipcop() {
   if [ 'i386' = $MACHINE ]; then 
        # abuse the SMP flag, and make an minimal installer kernel first
        # so that the boot floppy always works.....
-       ipcopmake linux         LFS_PASS=ipcop SMP=installer
-       ipcopmake linux         LFS_PASS=ipcop SMP=1
+       ipcopmake linux         LFS_PASS=ipfire SMP=installer
+       ipcopmake linux         LFS_PASS=ipfire SMP=1
        ipcopmake 3cp4218       SMP=1
        ipcopmake amedyn        SMP=1
        ipcopmake cxacru        SMP=1
@@ -540,11 +548,13 @@ buildipcop() {
        ipcopmake fcdslusb      SMP=1
        ipcopmake fcdslslusb    SMP=1
        ipcopmake fcpci SMP=1
+       ipcopmake fcclassic     SMP=1
        ipcopmake pulsar        SMP=1
        ipcopmake unicorn       SMP=1
+       ipcopmake promise-sata-300-tx SMP=1
   fi
 
-  ipcopmake linux      LFS_PASS=ipcop
+  ipcopmake linux      LFS_PASS=ipfire
   ipcopmake 3cp4218    
   ipcopmake amedyn     
   ipcopmake cxacru     
@@ -560,9 +570,11 @@ buildipcop() {
        ipcopmake fcdslsl       
        ipcopmake fcdslusb      
        ipcopmake fcdslslusb 
-       ipcopmake fcpci 
-       ipcopmake pulsar        
-       ipcopmake unicorn       
+       ipcopmake fcpci
+       ipcopmake fcclassic
+       ipcopmake pulsar        
+       ipcopmake unicorn
+       ipcopmake promise-sata-300-tx
   fi
 
   ipcopmake pcmcia-cs
@@ -602,6 +614,7 @@ buildipcop() {
   ipcopmake iproute2
   ipcopmake iptstate
   ipcopmake iputils
+  ipcopmake l7-protocols
   ipcopmake isapnptools
   ipcopmake isdn4k-utils
   ipcopmake kudzu
@@ -633,8 +646,12 @@ buildipcop() {
   ipcopmake Convert-UUlib
   ipcopmake Archive-Tar
   ipcopmake Archive-Zip
+  ipcopmake Text-Tabs+Wrap
+  ipcopmake Locale-Country
   ipcopmake GeoIP
   ipcopmake fwhits
+  ipcopmake berkeley
+  ipcopmake BerkeleyDB ## The Perl module
   ipcopmake noip_updater
   ipcopmake ntp
   ipcopmake oinkmaster
@@ -646,31 +663,37 @@ buildipcop() {
   ipcopmake setup
   ipcopmake snort
   #ipcopmake speedycgi
+  ipcopmake saslauthd PASS=1
+  ipcopmake openldap
   ipcopmake squid
   ipcopmake squid-graph
+  ipcopmake squidguard
   ipcopmake tcpdump
   ipcopmake traceroute
   ipcopmake vlan
   #ipcopmake wireless
   ipcopmake libsafe
   ipcopmake 3c5x9setup
-  echo -ne "`date -u '+%b %e %T'`: Building ### IPFire modules ### \n" | tee -a $LOGFILE
+#  echo -ne "`date -u '+%b %e %T'`: Building ### IPFire modules ### \n" | tee -a $LOGFILE
   ipcopmake pakfire
+  ipcopmake startscripts
 ## Zuerst die Libs und dann die Programme. Ordnung muss sein!
-  ipcopmake berkeley
-  ipcopmake BerkeleyDB ## The Perl module
+  ipcopmake java
   ipcopmake libtiff
   ipcopmake libjpeg
+  ipcopmake lcms
+  ipcopmake libmng
+  ipcopmake freetype
+  ipcopmake bootsplash
   ipcopmake libxml2
   ipcopmake spandsp
   ipcopmake lzo
+  ipcopmake openvpn
   ipcopmake pkg-config
   ipcopmake glib
   ipcopmake xampp
   ipcopmake pam
   ipcopmake pammysql
-  ipcopmake saslauthd PASS=1
-  ipcopmake openldap
   ipcopmake saslauthd PASS=2
   ipcopmake xinetd
   ipcopmake ghostscript
@@ -679,40 +702,54 @@ buildipcop() {
   ipcopmake samba
   ipcopmake sudo
   ipcopmake mc
-  ipcopmake pwlib
-  ipcopmake openh323
+#  ipcopmake pwlib
+#  ipcopmake openh323
   ipcopmake wget
+  ipcopmake wput
   ipcopmake bridge-utils
+  ipcopmake screen
+  ipcopmake hddtemp
+  ipcopmake smartmontools
+  ipcopmake htop
+  ipcopmake lynx
   echo -ne "`date -u '+%b %e %T'`: Building ### Mailserver ### \n" | tee -a $LOGFILE
   ipcopmake postfix
+  ipcopmake procmail
   ipcopmake fetchmail
   ipcopmake cyrusimap
-  ipcopmake procmail
+  ipcopmake web-cyradm
   ipcopmake mailx
   ipcopmake clamav
   ipcopmake razor
   ipcopmake spamassassin
-  ipcopmake amavisd
+#  ipcopmake amavisd
   echo -ne "`date -u '+%b %e %T'`: Building ### VoIP-Server ### \n" | tee -a $LOGFILE
   ipcopmake stund
+  ipcopmake zaptel
+  ipcopmake libpri
+  ipcopmake bristuff
   ipcopmake asterisk
+  ipcopmake mpg123
   echo -ne "`date -u '+%b %e %T'`: Building ### MP3-Server ### \n" | tee -a $LOGFILE
   ipcopmake lame
   ipcopmake gnump3d
-  ipcopmake java
-  ipcopmake openvpn
+  echo -ne "`date -u '+%b %e %T'`: Building ### P2P-Clients ### \n" | tee -a $LOGFILE
+  ipcopmake applejuice
   ipcopmake edonkeyclc
-  ipcopmake sane
-  ipcopmake rsync
+#  ipcopmake sane
+  echo -ne "`date -u '+%b %e %T'`: Building ### Net-Tools ### \n" | tee -a $LOGFILE
+  ipcopmake ntop
+#  ipcopmake rsync
   ipcopmake tcpwrapper
   ipcopmake portmap
-  ipcopmake nmap
-  ipcopmake htop
   ipcopmake nfs
+  ipcopmake nmap
+  ipcopmake mbmon
+  ipcopmake iftop
   ipcopmake ncftp
+  ipcopmake cftp
+  ipcopmake etherwake
   ipcopmake ethereal
-#  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
 }
 
@@ -753,7 +790,7 @@ buildpackages() {
   echo "`date -u '+%b %e %T'`: Stripping files" | tee -a $LOGFILE
   find $LFS/lib $LFS/usr/lib $LFS/usr/share/rrdtool-* $LFS/install ! -type l \( -name '*.so' -o -name '*.so[\.0-9]*' \) \
        ! -name 'libc.so' ! -name 'libpthread.so' ! -name 'libcrypto.so.0.9.7.sha1' \
-       -ls -exec $LFS/tools/bin/strip --strip-all {} \; >> $LOGFILE 2>&1
+        -exec $LFS/tools/bin/strip --strip-all {} \; >> $LOGFILE 2>&1
   # add -ls before -exec if you want to verify what files are stripped
 
   find $LFS/{,s}bin $LFS/usr/{,s}bin $LFS/usr/local/{,s}bin ! -type l \
@@ -776,13 +813,6 @@ buildpackages() {
        rm -f $LFS/license.txt >> $LOGFILE 2>&1
        cd $BASEDIR
   fi
-
-#  Create update for this version
-#  echo "`date -u '+%b %e %T'`: Building update $VERSION tgz" | tee -a $LOGFILE
-#  tar -cz -C $BASEDIR/build --files-from=$BASEDIR/updates/$VERSION/ROOTFILES.$MACHINE-$VERSION -f $BASEDIR/updates/$VERSION/patch.tar.gz --exclude='#*'; 
-#  chmod 755 $BASEDIR/updates/$VERSION/setup
-#  tar -cz -C $BASEDIR/updates/$VERSION -f $LFS/install/images/$SNAME-update-$VERSION.$MACHINE.tgz patch.tar.gz setup information
-#  rm -f $LFS/var/run/{need-depmod-$KVER,need-depmod-$KVER-smp}
   
   # Generating list of packages used
   echo "`date -u '+%b %e %T'`: Generating packages list from logs" | tee -a $LOGFILE
@@ -793,32 +823,17 @@ 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$\|stage2$\|smp$\|tools$\|tools1$\|tools2$' \
+  grep -v 'configroot$\|img$\|initrd$\|initscripts$\|installer$\|install$\|ipcop$\|setup$\|pakfire$\|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
 
   # Create ISO for CDRom and USB-superfloppy
   ipcopmake cdrom
+  rm -f $LFS/install/images/*usb*
   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
+  ipfirepackages
 
   # Cleanup
   stdumount
@@ -840,11 +855,45 @@ buildpackages() {
 
 }
 
+ipfirepackages() {
+  if [ -d "$BASEDIR/packages" ]; then
+         for i in `ls $BASEDIR/packages`; do
+               touch $BASEDIR/build/install/packages/$i.empty
+         done
+  fi
+  ipfiredist amavisd
+  ipfiredist applejuice
+  # ipfiredist asterisk
+  ipfiredist clamav
+  ipfiredist cups
+  ipfiredist cyrusimap
+  ipfiredist fetchmail
+  ipfiredist gnump3d
+  ipfiredist java
+  ipfiredist lame
+  ipfiredist libtiff
+  ipfiredist libxml2
+  ipfiredist mailx
+  ipfiredist nfs
+  ipfiredist nmap
+  ipfiredist ntop
+  ipfiredist postfix
+  ipfiredist procmail
+  ipfiredist samba
+  ipfiredist spamassassin
+  ipfiredist web-cyradm
+  ipfiredist xampp
+  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/*
+}
+
 # See what we're supposed to do
 case "$1" in 
 build)
        BUILDMACHINE=`uname -m`
-       PACKAGE=`ls -v -r $BASEDIR/cache/$SNAME-1.4.*-toolchain-$BUILDMACHINE.tar.gz 2> /dev/null | head -n 1`
+       PACKAGE=`ls -v -r $BASEDIR/cache/$SNAME-1.4-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
@@ -865,8 +914,17 @@ build)
                echo "`date -u '+%b %e %T'`: Using installed toolchain" | tee -a $LOGFILE
                prepareenv
        fi
+
        buildbase
        buildipcop
+
+       # Setzen des IPFire Builds
+       if [ "$FIREBUILD" ]; then
+               echo "$FIREBUILD" > $BASEDIR/build/var/ipfire/firebuild
+       else
+               echo "_(OvO)_" > $BASEDIR/build/var/ipfire/firebuild
+       fi
+
        buildinstaller
        buildpackages
        ;;
@@ -952,7 +1010,6 @@ newpak)
                cp $BASEDIR/lfs/postfix $BASEDIR/lfs/$2
 
                touch ROOTFILES
-               touch CONFFILES
                touch {,un}install.sh
        ## install.sh
                echo '#!/bin/bash' > install.sh
@@ -1057,20 +1114,22 @@ gettoolchain)
        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
+       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
-                       echo "`date -u '+%b %e %T'`: Uncompressing toolchain" | tee -a $LOGFILE
-                       cd $BASEDIR && tar xvfz cache/$PACKAGE.tar.gz -C .
-                       rm -vf $BASEDIR/cache/$PACKAGE.{tar.gz,md5}
                else
                        exiterror "$PACKAGE.md5 did not match, check downloaded package"
                fi
        fi
        ;;
+paks)
+       prepareenv
+       # buildpackages
+       ipfirepackages
+       ;;
 update)
        echo "Load the latest source-files:"
        svn update
@@ -1078,11 +1137,13 @@ update)
 commit)
        echo "Upload the changed files:"
        svn commit
-       svn up > /dev/null
+       ./make.sh sync
+       clear
+       svn up
        ;;
 make)
        echo "Do a complete compile:"   
-       ./make.sh prefetch && ./make.sh build
+       ./make.sh prefetch && ./make.sh gettoolchain && ./make.sh build
        ;;
 diff)
        echo -ne "Make a local diff to last SVN revision: "
@@ -1092,7 +1153,11 @@ diff)
        ;;
 sync)
        echo -e "Syncing Cache to FTP:"
-       echo -ne "Password for mirror.ipfire.org: "; read PASS
+       if [ -f .pass ]; then
+               PASS="`cat .pass`"
+       else
+               echo -ne "Password for mirror.ipfire.org: "; read PASS
+       fi
        rm -f doc/packages-to-remove-from-ftp
        ncftpls -u web3 -p $PASS ftp://mirror.ipfire.org/html/source-packages/source/ > ftplist
        for i in `ls -w1 cache/`; do
@@ -1114,8 +1179,51 @@ sync)
        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
+       ;;
+build-only)
+       rm -f $BASEDIR/log/$2*
+       BUILDMACHINE=`uname -m`
+       prepareenv
+       ipcopmake $2
+       ;;
 *)
-       echo "Usage: $0 {build|changelog|check|checkclean|clean|commit|diff|dist|gettoolchain|make|newpak|prefetch|shell|sync|toolchain|update}"
+       echo "Usage: $0 {build|changelog|check|checkclean|clean|commit|diff|dist|gettoolchain|make|newpak|prefetch|pub-iso|pub-paks|shell|sync|toolchain|update}"
        cat doc/make.sh-usage
        exit 1
        ;;