]> git.ipfire.org Git - ipfire-3.x.git/blob - make.sh
Added expat, dbus and hal
[ipfire-3.x.git] / make.sh
1 #!/bin/bash
2 ############################################################################
3 # #
4 # This file is part of the IPFire Firewall. #
5 # #
6 # IPFire is free software; you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation; either version 2 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # IPFire is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with IPFire; if not, write to the Free Software #
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
19 # #
20 # Copyright (C) 2007 IPFire-Team <info@ipfire.org>. #
21 # #
22 ############################################################################
23 #
24
25 NAME="IPFire" # Software name
26 SNAME="ipfire" # Short name
27 VERSION="2.9" # Version number
28 TOOLCHAINVERSION="${VERSION}" # Toolchain
29 SLOGAN="www.ipfire.org" # Software slogan
30
31 # Include funtions
32 . tools/make-include
33
34
35 ################################################################################
36 # This builds the entire stage "toolchain" #
37 ################################################################################
38 toolchain_build() {
39
40 ORG_PATH=$PATH
41 export PATH=$BASEDIR/build_${MACHINE}/usr/local/ccache/bin:$BASEDIR/build_${MACHINE}/usr/local/distcc/bin:$BASEDIR/build_${MACHINE}/$TOOLS_DIR/bin:$PATH
42 STAGE_ORDER=01
43 STAGE=toolchain
44
45 LOGFILE="$BASEDIR/log_${MACHINE}/_build.toolchain.log"
46 export LOGFILE
47
48 NATIVEGCC=`gcc --version | grep GCC | awk {'print $3'}`
49 export NATIVEGCC GCCmajor=${NATIVEGCC:0:1} GCCminor=${NATIVEGCC:2:1} GCCrelease=${NATIVEGCC:4:1}
50
51 # make distcc first so that CCACHE_PREFIX works immediately
52 [ -z "$DISTCC_HOSTS" ] || toolchain_make distcc
53 toolchain_make ccache
54
55 toolchain_make binutils PASS=1
56 toolchain_make gcc PASS=1
57 toolchain_make linux
58 toolchain_make glibc
59 toolchain_make adjust-toolchain
60 toolchain_make tcl
61 toolchain_make expect
62 toolchain_make dejagnu
63 toolchain_make gcc PASS=2
64 toolchain_make binutils PASS=2
65 toolchain_make ncurses
66 toolchain_make bash
67 toolchain_make bzip2
68 toolchain_make coreutils
69 toolchain_make diffutils
70 toolchain_make findutils
71 toolchain_make gawk
72 toolchain_make gettext
73 toolchain_make grep
74 toolchain_make gzip
75 toolchain_make make
76 toolchain_make patch
77 toolchain_make perl
78 toolchain_make sed
79 toolchain_make tar
80 toolchain_make texinfo
81 toolchain_make util-linux-ng
82 toolchain_make strip
83 export PATH=$ORG_PATH
84 }
85
86 ################################################################################
87 # This builds the entire stage "base" #
88 ################################################################################
89 base_build() {
90
91 PATH=/usr/local/ccache/bin:/usr/local/distcc/bin:/bin:/usr/bin:/sbin:/usr/sbin:$TOOLS_DIR/bin
92 STAGE_ORDER=02
93 STAGE=base
94
95 LOGFILE="$BASEDIR/log_${MACHINE}/_build.base.log"
96 export LOGFILE
97
98 ipfire_make stage2
99 ipfire_make linux
100 ipfire_make man-pages
101 ipfire_make glibc
102 ipfire_make adjust-toolchain
103 ipfire_make binutils
104 ipfire_make gcc
105 ipfire_make berkeley
106 ipfire_make sed
107 ipfire_make e2fsprogs
108 ipfire_make coreutils
109 ipfire_make iana-etc
110 ipfire_make m4
111 ipfire_make bison
112 ipfire_make ncurses
113 ipfire_make procps
114 ipfire_make libtool
115 ipfire_make perl
116 ipfire_make readline
117 ipfire_make zlib
118 ipfire_make autoconf
119 ipfire_make automake
120 ipfire_make bash
121 ipfire_make bzip2
122 ipfire_make diffutils
123 ipfire_make file
124 ipfire_make findutils
125 ipfire_make flex
126 ipfire_make grub
127 ipfire_make gawk
128 ipfire_make gettext
129 ipfire_make grep
130 ipfire_make groff
131 ipfire_make gzip
132 ipfire_make inetutils
133 ipfire_make iproute2
134 ipfire_make kbd
135 ipfire_make less
136 ipfire_make make
137 ipfire_make man-db
138 ipfire_make mktemp
139 ipfire_make module-init-tools
140 ipfire_make patch
141 ipfire_make psmisc
142 ipfire_make shadow
143 ipfire_make sysklogd
144 ipfire_make sysvinit
145 ipfire_make tar
146 ipfire_make texinfo
147 ipfire_make udev ## NEED TO INSTALL CONFIG
148 ipfire_make util-linux-ng
149 ipfire_make vim
150 }
151
152 ################################################################################
153 # This builds the entire stage "ipfire" #
154 ################################################################################
155 ipfire_build() {
156 PATH=/usr/local/ccache/bin:/usr/local/distcc/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
157 STAGE_ORDER=03
158 STAGE=ipfire
159
160 LOGFILE="$BASEDIR/log_${MACHINE}/_build.ipfire.log"
161 export LOGFILE
162
163 ### Building the configuration dirs and files
164 #
165 ipfire_make stage3
166
167 ### Building the kernel stuff
168 #
169 ipfire_make linux
170
171 ### Building some general stuff
172 # STAGE 1
173 ipfire_make pkg-config
174 ipfire_make expat
175 ipfire_make glib
176 ipfire_make libxml2
177 ipfire_make libxslt
178 ipfire_make openssl
179 ipfire_make perl ### We are building the modules here.
180 ipfire_make python
181 ipfire_make gmp
182 #ipfire_make libidn ### Do we need this?
183 ipfire_make pcre
184 ipfire_make popt
185 ipfire_make libusb
186 ipfire_make dbus
187
188 ### Building some network stuff
189 #
190 ipfire_make libpcap
191 ipfire_make linux-atm
192 ipfire_make ppp
193 ipfire_make rp-pppoe
194 ipfire_make dhcp
195 ipfire_make iptables
196 ipfire_make libnfnetlink
197 ipfire_make libnetfilter_queue
198 ipfire_make libnetfilter_conntrack
199 ipfire_make libnetfilter_log
200 ipfire_make dnsmasq
201 ipfire_make l7-protocols
202 ipfire_make iptstate
203 ipfire_make bridge-utils
204 ipfire_make vlan
205 ipfire_make bind
206
207 ### Building some general stuff
208 # STAGE 2
209 ipfire_make pam PASS=1
210 ipfire_make shadow
211 ipfire_make pam PASS=2
212 ipfire_make slang
213 ipfire_make newt
214 ipfire_make cyrus-sasl
215 ipfire_make openldap
216 ipfire_make sqlite
217 ipfire_make curl
218 ipfire_make gnupg
219 ipfire_make sudo
220 #ipfire_make libjpeg ### Do we need this?
221 ipfire_make libpng
222 ipfire_make libtiff
223 ipfire_make libart
224 ipfire_make freetype
225 ipfire_make lzo
226 ipfire_make lsof
227 ipfire_make br2684ctl
228 ipfire_make etherwake
229 ipfire_make htop
230 ipfire_make beep
231
232 ### Building vpn stuff
233 #
234 ipfire_make strongswan
235
236 ### Building filesystem stuff
237 #
238 ipfire_make reiserfsprogs
239 ipfire_make libaal
240 ipfire_make reiser4progs
241 ipfire_make xfsprogs
242 ipfire_make sysfsutils
243
244 ### Building hardware utils
245 #
246 ipfire_make pciutils
247 ipfire_make usbutils
248 ipfire_make hdparm
249 ipfire_make kudzu
250 ipfire_make smartmontools
251 ipfire_make lm-sensors
252 ipfire_make hal
253
254 ### Building some important tools
255 #
256 ipfire_make ulogd2
257 ipfire_make fcron
258 ipfire_make which
259 ipfire_make nano
260 ipfire_make screen
261 ipfire_make rrdtool
262 ipfire_make ntp ### Needs config.
263 ipfire_make openssh
264 ipfire_make ez-ipupdate
265 ipfire_make noip
266 ipfire_make lighttpd
267 ipfire_make lzma
268 ipfire_make collectd
269 #ipfire_make logrotate
270 #ipfire_make logwatch
271 ipfire_make cpio
272 ipfire_make cdrtools
273 ipfire_make parted
274 ipfire_make memtest86+
275 #ipfire_make pakfire
276 #ipfire_make initscripts
277
278 ipfire_make pyfire
279
280 ### -------------------------------------------------------------------------
281 ### Tools that maybe not needed
282 #
283 #ipfire_make expat
284 #ipfire_make gd
285 #ipfire_make libcap
286 #ipfire_make mtools
287 #ipfire_make mISDN
288
289 #ipfire_make nasm
290 #ipfire_make wireless
291 #ipfire_make libsafe
292 }
293
294 ################################################################################
295 # This builds the entire stage "misc" #
296 ################################################################################
297 misc_build() {
298
299 PATH=/usr/local/ccache/bin:/usr/local/distcc/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
300 STAGE_ORDER=04
301 STAGE=misc
302
303 LOGFILE="$BASEDIR/log_${MACHINE}/_build.misc.log"
304 export LOGFILE
305
306 ipfire_make stage4
307
308 ### Console tools
309 #
310 ipfire_make mc
311 #ipfire_make traceroute
312 #ipfire_make nmap
313 #ipfire_make rsync
314 #ipfire_make tcpdump
315
316 #ipfire_make squid
317 #ipfire_make squidguard ## CAN THIS BE BANISHED BY ANYTHING BETTER?
318 #ipfire_make calamaris ## CAN THIS BE BANISHED BY ANYTHING BETTER?
319 #ipfire_make vsftpd
320
321 ### Programs that are still for discussion
322 # package or in the standard system
323 #
324 ## NTFS
325 #ipfire_make fuse
326 #ipfire_make ntfs-3g
327 #
328 ## Net tools
329 #ipfire_make bwm-ng
330 #ipfire_make openvpn
331 #
332 ## UPNP
333 #ipfire_make libupnp
334 #ipfire_make linux-igd
335
336 ### These will become addons as usual but will be integrated later
337 #
338 #ipfire_make snort
339 #ipfire_make oinkmaster
340 #ipfire_make centerim
341 #ipfire_make tripwire
342 #ipfire_make java
343 #ipfire_make cups
344 #ipfire_make ghostscript
345 #ipfire_make foomatic
346 #ipfire_make hplip
347 #ipfire_make samba
348 #ipfire_make postfix
349 #ipfire_make fetchmail
350 #ipfire_make cyrus-imapd
351 #ipfire_make clamav
352 #ipfire_make alsa
353 #ipfire_make mpg123
354 #ipfire_make mpfire
355 #ipfire_make guardian
356 #ipfire_make libid3tag
357 #ipfire_make libmad
358 #ipfire_make libogg
359 #ipfire_make libvorbis
360 #ipfire_make lame
361 #ipfire_make sox
362 #ipfire_make libshout
363 #ipfire_make icecast
364 #ipfire_make icegenerator
365 #ipfire_make mpd
366 #ipfire_make mpc
367 #ipfire_make xvid
368 #ipfire_make libmpeg2
369 #ipfire_make videolan
370 #ipfire_make libpri
371 #ipfire_make asterisk
372 #ipfire_make libsigc++
373 #ipfire_make applejuice
374 #ipfire_make libtorrent
375 #ipfire_make rtorrent
376 #ipfire_make ipfireseeder
377 #ipfire_make nfs
378
379 # ---------------------------------------------------------------------------
380 #ipfire_make as86
381 #ipfire_make mbr
382 }
383
384 ################################################################################
385 # This builds the entire stage "installer" #
386 ################################################################################
387 installer_build() {
388
389 PATH=/usr/local/ccache/bin:/usr/local/distcc/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
390 STAGE_ORDER=05
391 STAGE=installer
392
393 LOGFILE="$BASEDIR/log_${MACHINE}/_build.installer.log"
394 export LOGFILE
395
396 ipfire_make stage5
397 ipfire_make busybox
398 ipfire_make installer
399 ipfire_make initramfs
400 }
401
402 ################################################################################
403 # This builds the entire stage "packages" #
404 ################################################################################
405 packages_build() {
406
407 PATH=/usr/local/ccache/bin:/usr/local/distcc/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
408 STAGE_ORDER=06
409 STAGE=packages
410
411 LOGFILE="$BASEDIR/log_${MACHINE}/_build.packages.log"
412 export LOGFILE
413
414 toolchain_make strip
415
416 # Generating list of packages used
417 ### MISSING ATM
418
419 ipfire_make cdrom
420
421 # Check if there is a loop device for building in virtual environments
422 #if [ -e /dev/loop/0 ] || [ -e /dev/loop0 ]; then
423 # ipfire_make usb-stick
424 #fi
425 mv $LFS/$IMAGES_DIR/{*.iso,*.tgz,*.img.gz} $BASEDIR >> $LOGFILE 2>&1
426
427 #ipfire_make core-updates
428 ### DISABLED ATM
429
430 for i in $(ls -1 $BASEDIR/src/rootfiles/extras); do
431 if [ -e $BASEDIR/lfs/$i ]; then
432 echo -n
433 ### Do nothing at the moment, we are gonna use a new packager
434 else
435 echo -n $i
436 beautify message SKIP
437 fi
438 done
439
440 # Cleanup
441 stdumount
442 rm -rf $LFS/tmp/*
443
444 cd $PWD
445 }
446
447 # See what we're supposed to do
448 case "$1" in
449 build)
450 clear
451 #a prebuilt toolchain package is only used if found in cache
452 if [ ! -d $BASEDIR/cache ]; then
453 exiterror "Use make.sh downloadsrc first!"
454 fi
455 cd $BASEDIR/cache/toolchains
456 PACKAGE=`ls -v -r $TOOLCHAINNAME.tar.bz2 2> /dev/null | head -n 1`
457 #only restore on a clean disk
458
459 echo -ne "Building for ${BOLD}${MACHINE} on ${MACHINE_REAL}${NORMAL}\n"
460
461 if [ -f $BASEDIR/log_${MACHINE}/02_base/stage2-LFS ]; then
462 prepareenv
463 echo "Using installed toolchain" >> $LOGFILE
464 beautify message DONE "Stage toolchain already built or extracted"
465 else
466 if [ -z "$PACKAGE" ]; then
467 echo "Full toolchain compilation" | tee -a $LOGFILE
468 prepareenv
469
470 # Check if host can build the toolchain
471 check_toolchain_prerequisites
472
473 beautify build_stage "Building toolchain"
474 toolchain_build
475 else
476 echo "Restore from $PACKAGE" | tee -a $LOGFILE
477 if [ `md5sum $BASEDIR/cache/toolchains/$PACKAGE | awk '{print $1}'` == `cat $BASEDIR/cache/toolchains/$TOOLCHAINNAME.md5 | awk '{print $1}'` ]; then
478 cd $BASEDIR && tar jxf $BASEDIR/cache/toolchains/$PACKAGE
479 prepareenv
480 else
481 exiterror "$TOOLCHAINNAME md5 did not match, check downloaded package"
482 fi
483 fi
484 fi
485
486 beautify build_stage "Building base"
487 base_build
488
489 beautify build_stage "Building $NAME"
490 ipfire_build
491
492 beautify build_stage "Building miscellaneous"
493 misc_build
494
495 beautify build_stage "Building installer"
496 installer_build
497
498 beautify build_stage "Building packages"
499 packages_build
500
501 echo ""
502 echo "... and all this hard work for this:"
503 du -bsh $BASEDIR/${SNAME}-${VERSION}.${MACHINE}.iso
504 ;;
505
506 shell)
507 # enter a shell inside LFS chroot
508 # may be used to changed kernel settings
509 prepareenv
510 entershell
511 ;;
512
513 changelog)
514 echo -n "Loading new Changelog from SVN: "
515 svn log http://svn.ipfire.org/svn/ipfire > doc/ChangeLog
516 beautify message DONE
517 ;;
518
519 clean)
520 echo -ne "Cleaning ${BOLD}$MACHINE${NORMAL} buildtree"
521 for i in `mount | grep $BASEDIR | sed 's/^.*loop=\(.*\))/\1/'`
522 do
523 $LOSETUP -d $i 2>/dev/null
524 done
525
526 for i in `mount | grep $BASEDIR | cut -d " " -f 1`
527 do
528 umount $i
529 done
530
531 stdumount
532
533 for i in `seq 0 7`
534 do
535 if ( losetup /dev/loop${i} 2>/dev/null | grep -q "/install/images" ); then
536 umount /dev/loop${i} 2>/dev/null;
537 losetup -d /dev/loop${i} 2>/dev/null;
538 fi;
539 done
540
541 rm -rf $BASEDIR/build_${MACHINE}
542 rm -rf $BASEDIR/log_${MACHINE}
543 rm -rf $BASEDIR/packages
544
545 if [ -h $TOOLS_DIR ]; then
546 rm -f $TOOLS_DIR
547 fi
548 beautify message DONE
549 ;;
550
551 downloadsrc)
552 LOGFILE=$BASEDIR/log_${MACHINE}/_build.preparation.log
553
554 if [ ! -d $BASEDIR/cache ]; then
555 mkdir $BASEDIR/cache
556 fi
557 mkdir -p $BASEDIR/log_${MACHINE}
558 echo -e "${BOLD}Preload all source files${NORMAL}" | tee -a $LOGFILE
559 cd $BASEDIR/lfs
560 for i in *; do
561 if [ -f "$i" -a "$i" != "Config" ]; then
562 echo -ne "Loading $i"
563 make -s -f $i LFS_BASEDIR=$BASEDIR MESSAGE="$i\t" download >> $LOGFILE 2>&1
564 if [ $? -ne 0 ]; then
565 beautify message FAIL
566 else
567 beautify message DONE
568 fi
569 fi
570 done
571 cd - >/dev/null 2>&1
572 ;;
573
574 toolchain)
575 prepareenv
576 # Check if host can build the toolchain
577 check_toolchain_prerequisites
578 toolchain_build
579 echo "Create toolchain tar.bz for $MACHINE" | tee -a $LOGFILE
580 # Safer inside the chroot
581 echo -ne "Stripping lib"
582 chroot $LFS $TOOLS_DIR/bin/find $TOOLS_DIR/lib \
583 -type f \( -name '*.so' -o -name '*.so[\.0-9]*' \) \
584 -exec $TOOLS_DIR/bin/strip --strip-debug {} \; 2>/dev/null
585 beautify message DONE
586 echo -ne "Stripping binaries"
587 chroot $LFS $TOOLS_DIR/bin/find /usr/local /usr/src/binutils-build $TOOLS_DIR/bin $TOOLS_DIR/sbin \
588 -type f \
589 -exec $TOOLS_DIR/bin/strip --strip-all {} \; 2> /dev/null
590 beautify message DONE
591 stdumount
592 echo -ne "Tar creation "
593 [ -d cache/toolchains ] || mkdir cache/toolchains
594 cd $BASEDIR && tar cj \
595 --exclude='log_${MACHINE}/_build.*.log' \
596 --file=cache/toolchains/$TOOLCHAINNAME.tar.bz2 \
597 build_${MACHINE} \
598 log_${MACHINE} >> $LOGFILE
599 beautify message DONE
600 echo `ls -sh cache/toolchains/$TOOLCHAINNAME.tar.bz2`
601 md5sum cache/toolchains/$TOOLCHAINNAME.tar.bz2 \
602 > cache/toolchains/$TOOLCHAINNAME.md5
603
604 stdumount
605 ;;
606
607 gettoolchain)
608 if [ ! -f $BASEDIR/cache/toolchains/$TOOLCHAINNAME.tar.bz2 ]; then
609 URL_TOOLCHAIN=`grep URL_TOOLCHAIN lfs/Config | awk '{ print $3 }'`
610 test -d $BASEDIR/cache/toolchains || mkdir $BASEDIR/cache/toolchains
611 echo "Loading toolchain for $MACHINE"
612 cd $BASEDIR/cache/toolchains
613 wget -c -nv $URL_TOOLCHAIN/$TOOLCHAINNAME.tar.bz2 $URL_TOOLCHAIN/$TOOLCHAINNAME.md5
614 if [ $? -ne 0 ]; then
615 echo -n "ERROR: Downloading toolchain for $MACHINE machine"
616 beautify message FAIL
617 echo "Precompiled toolchain not always available for every machine"
618 else
619 if [ "`md5sum $TOOLCHAINNAME.tar.bz2 | awk '{print $1}'`" = "`cat $TOOLCHAINNAME.md5 | awk '{print $1}'`" ]; then
620 beautify message DONE
621 echo "Toolchain md5 ok"
622 else
623 exiterror "$TOOLCHAINNAME.md5 did not match, check downloaded package"
624 fi
625 fi
626 else
627 echo -n "Toolchain for $MACHINE is already existing"
628 beautify message SKIP
629 fi
630 ;;
631
632 othersrc)
633 prepareenv
634 echo -ne "`date -u '+%b %e %T'`: Build sources iso for $MACHINE" | tee -a $LOGFILE
635 chroot $LFS /tools/bin/env -i HOME=/root \
636 TERM=$TERM PS1='\u:\w\$ ' \
637 PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \
638 VERSION=$VERSION NAME="$NAME" SNAME="$SNAME" MACHINE=$MACHINE \
639 /bin/bash -x -c "cd /usr/src/lfs && make -f sources-iso LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
640 mv $LFS/install/images/ipfire-* $BASEDIR >> $LOGFILE 2>&1
641 if [ $? -eq "0" ]; then
642 beautify message DONE
643 else
644 beautify message FAIL
645 fi
646 stdumount
647 ;;
648
649 svn)
650 . $BASEDIR/tools/make-subversion
651 case "$2" in
652 update|up)
653 svn_up
654 ;;
655 commit|ci)
656 clear
657 svn_commit
658 svn_up
659 ;;
660 dist)
661 svn_dist
662 ;;
663 diff|di)
664 svn_diff
665 ;;
666 esac
667 ;;
668
669 uploadsrc)
670 PWD=`pwd`
671 cd $BASEDIR/cache/
672 echo -e "Uploading cache to ftp server:"
673 for i in *; do
674 echo "${i}" | fgrep -q .md5 && continue
675 [ -e ${i}.md5 ] && continue
676 md5sum ${i} | tee ${i}.md5
677 done
678 ncftpls -u $FTP_CACHE_USER -p $FTP_CACHE_PASS ftp://$FTP_CACHE_URL/$FTP_CACHE_PATH/ > /tmp/ftplist
679 for i in *; do
680 if [ "$(basename $i)" == "toolchains" ]; then continue; fi
681 grep -q $(basename $i) /tmp/ftplist
682 if [ "$?" -ne "0" ]; then
683 echo -ne "$(basename $i)"
684 ncftpput -u $FTP_CACHE_USER -p $FTP_CACHE_PASS $FTP_CACHE_URL $FTP_CACHE_PATH/ $(basename $i)
685 if [ "$?" -ne "0" ]; then
686 beautify message FAIL
687 fi
688 fi
689 done
690 rm -f /tmp/ftplist
691 cd $PWD
692 exit 0
693 ;;
694
695 upload)
696 FTP_ISO_PORT=`echo "$FTP_ISO_URL" | awk -F: '{ print $2 }'`
697 FTP_ISO_URL=`echo "$FTP_ISO_URL" | awk -F: '{ print $1 }'`
698 if [ -z $FTP_ISO_PORT ]; then
699 FTP_ISO_PORT=21
700 fi
701 cat <<EOF > .ftp-commands
702 mkdir -p $FTP_ISO_PATH$SVN_REVISION
703 mkdir -p $FTP_ISO_PATH$SVN_REVISION/paks
704 quit
705 EOF
706 ncftp -u $FTP_ISO_USER -p $FTP_ISO_PASS -P $FTP_ISO_PORT $FTP_ISO_URL < .ftp-commands
707 rm -f .ftp-commands
708
709 case "$2" in
710 iso)
711 echo -e "Uploading the iso to $FTP_ISO_PATH/$SVN_REVISION."
712
713 md5sum ipfire-$VERSION.$MACHINE-full.iso > ipfire-$VERSION.$MACHINE-full.iso.md5
714 for i in svn_status ipfire-source-r$SVN_REVISION.tar.gz ipfire-$VERSION.$MACHINE-full.iso ipfire-$VERSION.$MACHINE-full.iso.md5 ipfire-$VERSION.$MACHINE-devel.iso ipfire-$VERSION.$MACHINE-devel.iso.md5; do
715 if [ -e "$i" ]; then
716 ncftpput -u $FTP_ISO_USER -p $FTP_ISO_PASS -P $FTP_ISO_PORT $FTP_ISO_URL $FTP_ISO_PATH$SVN_REVISION/ $i
717 if [ "$?" -eq "0" ]; then
718 echo "The file with name $i was successfully uploaded to $FTP_ISO_URL$FTP_ISO_PATH$SVN_REVISION/."
719 else
720 echo "There was an error while uploading the file $i to the ftp server."
721 exit 1
722 fi
723 fi
724 done
725 rm -f ipfire-$VERSION.$MACHINE-full.iso.md5
726 if [ "$3" = "--with-sources-cd" ]; then
727 ncftpput -u $FTP_ISO_USER -p $FTP_ISO_PASS -P $FTP_ISO_PORT $FTP_ISO_URL $FTP_ISO_PATH/$SVN_REVISION/ ipfire-sources-cd-$VERSION.$MACHINE.iso
728 fi
729 ;;
730 paks)
731 ncftpput -u $FTP_ISO_USER -p $FTP_ISO_PASS -P $FTP_ISO_PORT $FTP_ISO_URL $FTP_ISO_PATH$SVN_REVISION/paks packages/*
732 if [ "$?" -eq "0" ]; then
733 echo -e "The packages were successfully uploaded to $FTP_ISO_URL$FTP_ISO_PATH$SVN_REVISION/."
734 else
735 echo -e "There was an error while uploading the packages to the ftp server."
736 exit 1
737 fi
738 ;;
739 esac
740 ;;
741
742 batch)
743 if [ "$2" = "--background" ]; then
744 batch_script
745 exit $?
746 fi
747 if [ `screen -ls | grep -q ipfire` ]; then
748 echo "Build is already running, sorry!"
749 exit 1
750 else
751 if [ "$2" = "--rebuild" ]; then
752 export IPFIRE_REBUILD=1
753 echo "REBUILD!"
754 else
755 export IPFIRE_REBUILD=0
756 fi
757 echo -en "${BOLD}***IPFire-Batch-Build is starting...${NORMAL}"
758 screen -dmS ipfire $0 batch --background
759 evaluate 1
760 exit 0
761 fi
762 ;;
763
764 watch|attach)
765 watch_screen
766 ;;
767
768 *)
769 cat doc/make.sh-usage
770 ;;
771
772 esac