BUILDFIXES:
[people/pmueller/ipfire-2.x.git] / make.sh
CommitLineData
df5e82b3
MT
1#!/bin/bash
2#
3############################################################################
4# #
f8e5510c 5# This file is part of the IPFire Firewall. #
df5e82b3 6# #
f8e5510c 7# IPFire is free software; you can redistribute it and/or modify #
df5e82b3
MT
8# it under the terms of the GNU General Public License as published by #
9# the Free Software Foundation; either version 2 of the License, or #
10# (at your option) any later version. #
11# #
f8e5510c 12# IPFire is distributed in the hope that it will be useful, #
df5e82b3
MT
13# but WITHOUT ANY WARRANTY; without even the implied warranty of #
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15# GNU General Public License for more details. #
16# #
17# You should have received a copy of the GNU General Public License #
f8e5510c 18# along with IPFire; if not, write to the Free Software #
df5e82b3
MT
19# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
20# #
f8e5510c 21# Copyright (C) 2006 IPFire-Team <entwickler@ipfire.org>. #
df5e82b3
MT
22# #
23############################################################################
df5e82b3
MT
24#
25
f8e5510c 26 NAME="IPFire" # Software name
3ea75603 27 SNAME="ipfire" # Short name
f8e5510c 28 VERSION="1.4" # Version number
3ea75603
MT
29 SLOGAN="We secure your network" # Software slogan
30 CONFIG_ROOT=/var/ipfire # Configuration rootdir
df5e82b3 31 NICE=10
0eab8e84 32 MAX_RETRIES=3 # prefetch/check loop
df5e82b3
MT
33 KVER=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'`
34 MACHINE=`uname -m`
35
36 # Debian specific settings
37 if [ ! -e /etc/debian_version ]; then
38 FULLPATH=`which $0`
39 else
40 if [ -x /usr/bin/realpath ]; then
41 FULLPATH=`/usr/bin/realpath $0`
42 else
43 echo "ERROR: Need to do apt-get install realpath"
44 exit 1
45 fi
46 fi
47
48
49 PWD=`pwd`
50 BASENAME=`basename $0`
51 BASEDIR=`echo $FULLPATH | sed "s/\/$BASENAME//g"`
52 LOGFILE=$BASEDIR/log/_build.preparation.log
53 export BASEDIR LOGFILE
54 DIR_CHK=$BASEDIR/cache/check
55 mkdir $BASEDIR/log/ 2>/dev/null
56
57 if [ 'x86_64' = $MACHINE -o 'i686' = $MACHINE -o 'i586' = $MACHINE -o 'i486' = $MACHINE -o 'i386' = $MACHINE ]; then
58 echo "`date -u '+%b %e %T'`: Machine is ix86 (or equivalent)" | tee -a $LOGFILE
59 MACHINE=i386
60 BUILDTARGET=i386-pc-linux-gnu
61 CFLAGS="-O2 -mcpu=i386 -march=i386 -pipe -fomit-frame-pointer"
62 CXXFLAGS="-O2 -mcpu=i386 -march=i386 -pipe -fomit-frame-pointer"
63 elif [ 'alpha' = $MACHINE ]; then
64 echo "`date -u '+%b %e %T'`: Machine is Alpha AXP" | tee -a $LOGFILE
65 BUILDTARGET=alpha-unknown-linux-gnu
66 CFLAGS="-O2 -mcpu=ev4 -mieee -pipe"
67 CXXFLAGS="-O2 -mcpu=ev4 -mieee -pipe"
68 else
69 echo "`date -u '+%b %e %T'`: Can't determine your architecture - $MACHINE" | tee -a $LOGFILE
70 exit 1
71 fi
72
73# Define immediately
74stdumount() {
75 umount $BASEDIR/build/dev/pts 2>/dev/null;
94025eea
MT
76 umount $BASEDIR/build/proc 2>/dev/null;
77 umount $BASEDIR/build/install/mnt 2>/dev/null;
df5e82b3
MT
78 umount $BASEDIR/build/usr/src/cache 2>/dev/null;
79 umount $BASEDIR/build/usr/src/ccache 2>/dev/null;
80 umount $BASEDIR/build/usr/src/config 2>/dev/null;
94025eea
MT
81 umount $BASEDIR/build/usr/src/doc 2>/dev/null;
82 umount $BASEDIR/build/usr/src/html 2>/dev/null;
df5e82b3 83 umount $BASEDIR/build/usr/src/langs 2>/dev/null;
94025eea
MT
84 umount $BASEDIR/build/usr/src/lfs 2>/dev/null;
85 umount $BASEDIR/build/usr/src/log 2>/dev/null;
86 umount $BASEDIR/build/usr/src/src 2>/dev/null;
df5e82b3
MT
87}
88
89exiterror() {
90 stdumount
91 for i in `seq 0 7`; do
92 if ( losetup /dev/loop${i} 2>/dev/null | grep -q "/install/images" ); then
93 losetup -d /dev/loop${i} 2>/dev/null
94 fi;
95 done
96 echo "ERROR: $*"
97 echo " Check $LOGFILE for errors if applicable"
98 exit 1
99}
100
101entershell() {
102 if [ ! -e $BASEDIR/build/usr/src/lfs/ ]; then
103 exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/"
104 fi
105 echo "Entering to a shell inside LFS chroot, go out with exit"
106 chroot $LFS /tools/bin/env -i HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
107 PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
108 VERSION=$VERSION CONFIG_ROOT=$CONFIG_ROOT \
109 NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
110 CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" \
111 CCACHE_DIR=/usr/src/ccache \
112 CCACHE_HASHDIR=1 \
113 KVER=$KVER \
114 BUILDTARGET="$BUILDTARGET" MACHINE="$MACHINE" \
115 KGCC="ccache /usr/bin/gcc" \
116 /tools/bin/bash
117 if [ $? -ne 0 ]; then
118 exiterror "chroot error"
119 else
120 stdumount
121 fi
122}
123
124prepareenv() {
125 ############################################################################
126 # #
127 # Are we running the right shell? #
128 # #
129 ############################################################################
130 if [ ! "$BASH" ]; then
131 exiterror "BASH environment variable is not set. You're probably running the wrong shell."
132 fi
133
134 if [ -z "${BASH_VERSION}" ]; then
135 exiterror "Not running BASH shell."
136 fi
137
138
139 ############################################################################
140 # #
141 # Trap on emergency exit #
142 # #
143 ############################################################################
144 trap "exiterror 'Build process interrupted'" SIGINT SIGTERM SIGKILL SIGSTOP SIGQUIT
145
146
147 ############################################################################
148 # #
149 # Resetting our nice level #
150 # #
151 ############################################################################
152 echo "`date -u '+%b %e %T'`: Resetting our nice level to $NICE" | tee -a $LOGFILE
153 renice $NICE $$ > /dev/null
154 if [ `nice` != "$NICE" ]; then
155 exiterror "Failed to set correct nice level"
156 fi
157
158 ############################################################################
159 # #
160 # Checking if running as root user #
161 # #
162 ############################################################################
163 echo "`date -u '+%b %e %T'`: Checking if we're running as root user" | tee -a $LOGFILE
164 if [ `id -u` != 0 ]; then
165 exiterror "Not building as root"
166 fi
167
168
169 ############################################################################
170 # #
171 # Checking for necessary temporary space #
172 # #
173 ############################################################################
174 echo "`date -u '+%b %e %T'`: Checking for necessary space on disk $BASE_DEV" | tee -a $LOGFILE
175 BASE_DEV=`df -P -k $BASEDIR | tail -n 1 | awk '{ print $1 }'`
176 BASE_ASPACE=`df -P -k $BASEDIR | tail -n 1 | awk '{ print $4 }'`
177 if (( 2202000 > $BASE_ASPACE )); then
178 BASE_USPACE=`du -skx $BASEDIR | awk '{print $1}'`
179 if (( 2202000 - $BASE_USPACE > $BASE_ASPACE )); then
180 exiterror "Not enough temporary space available, need at least 2.1GB on $BASE_DEV"
181 fi
182 fi
183
184 ############################################################################
185 # #
186 # Building Linux From Scratch system #
187 # #
188 ############################################################################
189 echo "`date -u '+%b %e %T'`: Building Linux From Scratch system" | tee -a $LOGFILE
190
191 # Set umask
192 umask 022
193
194 # Set LFS Directory
195 LFS=$BASEDIR/build
196
197 # Check /tools symlink
198 if [ -h /tools ]; then
199 rm -f /tools
200 fi
201 if [ ! -a /tools ]; then
202 ln -s $BASEDIR/build/tools /
203 fi
204 if [ ! -h /tools ]; then
205 exiterror "Could not create /tools symbolic link."
206 fi
207
208 # Setup environment
209 set +h
210 LC_ALL=POSIX
211 export LFS LC_ALL CFLAGS CXXFLAGS
212 unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD
213
214 # Make some extra directories
215 mkdir -p $BASEDIR/build/{tools,etc,usr/src} 2>/dev/null
216 mkdir -p $BASEDIR/{cache,ccache} 2>/dev/null
217 mkdir -p $BASEDIR/build/dev/pts $BASEDIR/build/proc $BASEDIR/build/usr/src/{cache,config,doc,html,langs,lfs,log,src,ccache}
218
219 # Make all sources and proc available under lfs build
220 mount --bind /dev/pts $BASEDIR/build/dev/pts
221 mount --bind /proc $BASEDIR/build/proc
222 mount --bind $BASEDIR/cache $BASEDIR/build/usr/src/cache
223 mount --bind $BASEDIR/ccache $BASEDIR/build/usr/src/ccache
224 mount --bind $BASEDIR/config $BASEDIR/build/usr/src/config
225 mount --bind $BASEDIR/doc $BASEDIR/build/usr/src/doc
226 mount --bind $BASEDIR/html $BASEDIR/build/usr/src/html
227 mount --bind $BASEDIR/langs $BASEDIR/build/usr/src/langs
228 mount --bind $BASEDIR/lfs $BASEDIR/build/usr/src/lfs
229 mount --bind $BASEDIR/log $BASEDIR/build/usr/src/log
230 mount --bind $BASEDIR/src $BASEDIR/build/usr/src/src
231
232 # Run LFS static binary creation scripts one by one
233 export CCACHE_DIR=$BASEDIR/ccache
234 export CCACHE_HASHDIR=1
235
236 # Remove pre-install list of installed files in case user erase some files before rebuild
237 rm -f $BASEDIR/build/usr/src/lsalr 2>/dev/null
238}
239
240
241############################################################################
242# #
243# Necessary shell functions #
244# #
245############################################################################
246lfsmake1() {
247 if [ -f $BASEDIR/lfs/$1 ]; then
248 echo "`date -u '+%b %e %T'`: Building $*" | tee -a $LOGFILE
249 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t " download >> $LOGFILE 2>&1
250 if [ $? -ne 0 ]; then
251 exiterror "Download error in $1"
252 fi
253 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t md5sum" md5 >> $LOGFILE 2>&1
254 if [ $? -ne 0 ]; then
255 exiterror "md5sum error in $1, check file in cache or signature"
256 fi
257 cd $BASEDIR/lfs && make -f $* BUILDTARGET=$BUILDTARGET \
258 MACHINE=$MACHINE \
259 LFS_BASEDIR=$BASEDIR \
260 ROOT=$LFS \
261 KVER=$KVER \
262 install >> $LOGFILE 2>&1
263 if [ $? -ne 0 ]; then
264 exiterror "Building $*";
265 fi
266 else
267 exiterror "No such file or directory: $BASEDIR/$1"
268 fi
269 return 0
270}
271
272lfsmake2() {
273 if [ -f $BASEDIR/build/usr/src/lfs/$1 ]; then
274 echo "`date -u '+%b %e %T'`: Building $*" | tee -a $LOGFILE
275 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t " download >> $LOGFILE 2>&1
276 if [ $? -ne 0 ]; then
277 exiterror "Download error in $1"
278 fi
279 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t md5sum" md5 >> $LOGFILE 2>&1
280 if [ $? -ne 0 ]; then
281 exiterror "md5sum error in $1, check file in cache or signature"
282 fi
283 chroot $LFS /tools/bin/env -i HOME=/root \
284 TERM=$TERM PS1='\u:\w\$ ' \
285 PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
286 VERSION=$VERSION \
287 CONFIG_ROOT=$CONFIG_ROOT \
288 NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
289 CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" \
290 CCACHE_DIR=/usr/src/ccache CCACHE_HASHDIR=1 \
291 KVER=$KVER \
292 BUILDTARGET="$BUILDTARGET" MACHINE="$MACHINE" \
293 /tools/bin/bash -x -c "cd /usr/src/lfs && \
294 make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
295 if [ $? -ne 0 ]; then
296 exiterror "Building $*"
297 fi
298 else
299 exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
300 fi
301 return 0
302}
303
304ipcopmake() {
305 if [ -f $BASEDIR/build/usr/src/lfs/$1 ]; then
306 echo "`date -u '+%b %e %T'`: Building $*" | tee -a $LOGFILE
307 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t " download >> $LOGFILE 2>&1
308 if [ $? -ne 0 ]; then
309 exiterror "Download error in $1"
310 fi
311 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t md5sum" md5 >> $LOGFILE 2>&1
312 if [ $? -ne 0 ]; then
313 exiterror "md5sum error in $1, check file in cache or signature"
314 fi
315 chroot $LFS /tools/bin/env -i HOME=/root \
316 TERM=$TERM PS1='\u:\w\$ ' \
317 PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \
318 VERSION=$VERSION \
319 CONFIG_ROOT=$CONFIG_ROOT \
320 NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
321 CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" \
322 CCACHE_DIR=/usr/src/ccache CCACHE_HASHDIR=1 \
323 KVER=$KVER \
324 BUILDTARGET="$BUILDTARGET" MACHINE="$MACHINE" \
325 /bin/bash -x -c "cd /usr/src/lfs && \
326 make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
327 if [ $? -ne 0 ]; then
328 exiterror "Building $*"
329 fi
330 else
331 exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
332 fi
333 return 0
334}
335
e7164bb4
MT
336ipfiredist() {
337 if [ -f $BASEDIR/build/usr/src/lfs/$1 ]; then
338 echo "`date -u '+%b %e %T'`: Packaging $1" | tee -a $LOGFILE
98d413ac 339 cp -f $BASEDIR/src/scripts/make-packages.sh $BASEDIR/build/usr/local/bin
e7164bb4
MT
340 chroot $LFS /tools/bin/env -i HOME=/root \
341 TERM=$TERM PS1='\u:\w\$ ' \
342 PATH=/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin \
343 VERSION=$VERSION \
344 CONFIG_ROOT=$CONFIG_ROOT \
345 NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
346 CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" \
347 CCACHE_DIR=/usr/src/ccache CCACHE_HASHDIR=1 \
348 KVER=$KVER \
349 BUILDTARGET="$BUILDTARGET" MACHINE="$MACHINE" \
350 /bin/bash -x -c "cd /usr/src/lfs && \
351 make -f $1 LFS_BASEDIR=/usr/src dist" >>$LOGFILE 2>&1
352 if [ $? -ne 0 ]; then
353 exiterror "Packaging $1"
354 fi
355 else
356 exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
357 fi
93dc5548
MT
358# test -d $BASEDIR/packages || mkdir $BASEDIR/packages
359# mv -f $BASEDIR/build/paks/* $BASEDIR/packages/
e7164bb4
MT
360 return 0
361}
362
df5e82b3
MT
363
364installmake() {
365 if [ -f $BASEDIR/build/usr/src/lfs/$1 ]; then
366 echo "`date -u '+%b %e %T'`: Building $*" | tee -a $LOGFILE
367 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t " download >> $LOGFILE 2>&1
368 if [ $? -ne 0 ]; then
369 exiterror "Download error in $1"
370 fi
371 cd $BASEDIR/lfs && make -s -f $* LFS_BASEDIR=$BASEDIR MESSAGE="$1\t md5sum" md5 >> $LOGFILE 2>&1
372 if [ $? -ne 0 ]; then
373 exiterror "md5sum error in $1, check file in cache or signature"
374 fi
375 chroot $LFS /tools/bin/env -i HOME=/root \
376 TERM=$TERM PS1='\u:\w\$ ' \
377 PATH=/usr/local/bin:/opt/$MACHINE-uClibc/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin \
378 VERSION=$VERSION \
379 CONFIG_ROOT=$CONFIG_ROOT \
380 LFS_PASS="install" \
381 NAME="$NAME" SNAME="$SNAME" SLOGAN="$SLOGAN" \
382 CFLAGS="-Os" CXXFLAGS="-Os" \
383 CCACHE_DIR=/usr/src/ccache CCACHE_HASHDIR=1 \
384 KVER=$KVER \
385 BUILDTARGET="$BUILDTARGET" MACHINE="$MACHINE" \
386 /bin/bash -x -c "cd /usr/src/lfs && \
387 make -f $* LFS_BASEDIR=/usr/src install" >>$LOGFILE 2>&1
388 if [ $? -ne 0 ]; then
389 exiterror "Building $*"
390 fi
391 else
392 exiterror "No such file or directory: $BASEDIR/build/usr/src/lfs/$1"
393 fi
394 return 0
395}
396
397buildtoolchain() {
398 LOGFILE="$BASEDIR/log/_build.toolchain.log"
399 export LOGFILE
400 echo -ne "`date -u '+%b %e %T'`: Stage1 toolchain build \n" | tee -a $LOGFILE
401 # Build sed now, as we use some extensions
402 ORG_PATH=$PATH
403 NATIVEGCC=`gcc --version | grep GCC | awk {'print $3'}`
404 export NATIVEGCC GCCmajor=${NATIVEGCC:0:1} GCCminor=${NATIVEGCC:2:1} GCCrelease=${NATIVEGCC:4:1}
405 lfsmake1 ccache
406 lfsmake1 sed LFS_PASS=1
407 lfsmake1 m4 LFS_PASS=1
408 lfsmake1 bison LFS_PASS=1
409 lfsmake1 flex LFS_PASS=1
410 lfsmake1 binutils LFS_PASS=1
411 lfsmake1 gcc LFS_PASS=1
412 export PATH=$BASEDIR/build/usr/local/bin:$BASEDIR/build/tools/bin:$PATH
413
414 lfsmake1 linux
415 lfsmake1 tcl
416 lfsmake1 expect
417 lfsmake1 glibc
418 lfsmake1 dejagnu
419 lfsmake1 gcc LFS_PASS=2
420 lfsmake1 binutils LFS_PASS=2
421 lfsmake1 gawk
422 lfsmake1 coreutils
423 lfsmake1 bzip2
424 lfsmake1 gzip
425 lfsmake1 diffutils
426 lfsmake1 findutils
427 lfsmake1 make
428 lfsmake1 grep
429 lfsmake1 sed LFS_PASS=2
430 lfsmake1 m4 LFS_PASS=2
431 lfsmake1 bison LFS_PASS=2
432 lfsmake1 flex LFS_PASS=2
433 lfsmake1 gettext
434 lfsmake1 ncurses
435 lfsmake1 patch
436 lfsmake1 tar
437 lfsmake1 texinfo
438 lfsmake1 bash
439 lfsmake1 util-linux
440 lfsmake1 perl
441 export PATH=$ORG_PATH
442}
443
444buildbase() {
445 LOGFILE="$BASEDIR/log/_build.base.log"
446 export LOGFILE
447 echo -ne "`date -u '+%b %e %T'`: Stage2 linux base build \n" | tee -a $LOGFILE
448 # Run LFS dynamic binary creation scripts one by one
449 lfsmake2 stage2
450 lfsmake2 makedev
451 lfsmake2 linux
452 lfsmake2 man-pages
453 lfsmake2 glibc
454 lfsmake2 binutils
455 lfsmake2 gcc
456 lfsmake2 coreutils
457 lfsmake2 zlib
458 lfsmake2 mktemp
459 lfsmake2 iana-etc
460 lfsmake2 findutils
461 lfsmake2 gawk
462 lfsmake2 ncurses
463 lfsmake2 vim
464 lfsmake2 m4
465 lfsmake2 bison
466 lfsmake2 less
467 lfsmake2 groff
468 lfsmake2 sed
469 lfsmake2 flex
470 lfsmake2 gettext
471 lfsmake2 net-tools
472 lfsmake2 inetutils
473 lfsmake2 perl
474 lfsmake2 texinfo
475 lfsmake2 autoconf
476 lfsmake2 automake
477 lfsmake2 bash
478 lfsmake2 file
479 lfsmake2 libtool
480 lfsmake2 bzip2
481 lfsmake2 diffutils
482 lfsmake2 ed
483 lfsmake2 kbd
484 lfsmake2 e2fsprogs
485 lfsmake2 grep
486 if [ 'i386' = $MACHINE ]; then
487 lfsmake2 grub
488 elif [ 'alpha' = $MACHINE ]; then
489 lfsmake2 aboot
490 fi
491 lfsmake2 gzip
492 lfsmake2 man
493 lfsmake2 make
494 lfsmake2 modutils
495 lfsmake2 patch
496 lfsmake2 procinfo
497 lfsmake2 procps
498 lfsmake2 psmisc
499 lfsmake2 shadow
500 lfsmake2 sysklogd
501 lfsmake2 sysvinit
502 lfsmake2 tar
503 lfsmake2 util-linux
504}
505
506buildipcop() {
907cd036
MT
507 # Run IPFire make scripts one by one
508 LOGFILE="$BASEDIR/log/_build.ipfire.log"
df5e82b3
MT
509 export LOGFILE
510 echo -ne "`date -u '+%b %e %T'`: Stage3 $NAME build \n" | tee -a $LOGFILE
511
512 # Build these first as some of the kernel packages below rely on
513 # these for some of their client program functionality
514 ipcopmake configroot
515 ipcopmake dhcp
516 ipcopmake dhcpcd
517 ipcopmake libusb
518 ipcopmake libpcap
519 ipcopmake linux-atm
520 ipcopmake ppp
521 ipcopmake rp-pppoe
522 ipcopmake unzip
523 # Do SMP now
524 if [ 'i386' = $MACHINE ]; then
525 # abuse the SMP flag, and make an minimal installer kernel first
526 # so that the boot floppy always works.....
527 ipcopmake linux LFS_PASS=ipcop SMP=installer
528 ipcopmake linux LFS_PASS=ipcop SMP=1
529 ipcopmake 3cp4218 SMP=1
530 ipcopmake amedyn SMP=1
531 ipcopmake cxacru SMP=1
532 ipcopmake eagle SMP=1
533
534 # These are here because they have i386 only binary libraries
535 # included in the package.
536 ipcopmake cnx_pci SMP=1
537 ipcopmake fcdsl SMP=1
538 ipcopmake fcdsl2 SMP=1
539 ipcopmake fcdslsl SMP=1
540 ipcopmake fcdslusb SMP=1
541 ipcopmake fcdslslusb SMP=1
6ca65b88 542 ipcopmake fcpci SMP=1
df5e82b3
MT
543 ipcopmake pulsar SMP=1
544 ipcopmake unicorn SMP=1
545 fi
546
547 ipcopmake linux LFS_PASS=ipcop
548 ipcopmake 3cp4218
549 ipcopmake amedyn
550 ipcopmake cxacru
551 ipcopmake eciadsl
552 ipcopmake eagle
553 ipcopmake speedtouch
554 if [ 'i386' = $MACHINE ]; then
555 # These are here because they have i386 only binary libraries
556 # included in the package.
557 ipcopmake cnx_pci
558 ipcopmake fcdsl
559 ipcopmake fcdsl2
560 ipcopmake fcdslsl
561 ipcopmake fcdslusb
6ca65b88
MT
562 ipcopmake fcdslslusb
563 ipcopmake fcpci
df5e82b3
MT
564 ipcopmake pulsar
565 ipcopmake unicorn
566 fi
567
568 ipcopmake pcmcia-cs
569 ipcopmake expat
570 ipcopmake gdbm
571 ipcopmake gmp
572 ipcopmake openssl
573 ipcopmake python
574 ipcopmake libnet
575 ipcopmake libpng
576 ipcopmake gd
577 ipcopmake popt
578 ipcopmake slang
579 ipcopmake newt
580 ipcopmake libcap
581 ipcopmake pciutils
582 ipcopmake pcre
583 ipcopmake apache
584 ipcopmake arping
585 ipcopmake beep
586 ipcopmake bind
587 ipcopmake capi4k-utils
588 ipcopmake cdrtools
589 ipcopmake dnsmasq
590 ipcopmake dosfstools
591 ipcopmake ethtool
592 ipcopmake ez-ipupdate
593 ipcopmake fcron
594 ipcopmake perl-GD
595 ipcopmake gnupg
596 ipcopmake hdparm
597 ipcopmake ibod
598 ipcopmake initscripts
599 ipcopmake iptables
600 ipcopmake ipac-ng
601 ipcopmake ipaddr
602 ipcopmake iproute2
603 ipcopmake iptstate
604 ipcopmake iputils
605 ipcopmake isapnptools
606 ipcopmake isdn4k-utils
607 ipcopmake kudzu
608 ipcopmake logrotate
609 ipcopmake logwatch
610 ipcopmake mingetty
611 ipcopmake misc-progs
612 ipcopmake mtools
613 ipcopmake nano
614 ipcopmake nash
615 ipcopmake nasm
616 ipcopmake URI
617 ipcopmake HTML-Tagset
618 ipcopmake HTML-Parser
619 ipcopmake Compress-Zlib
620 ipcopmake Digest
621 ipcopmake Digest-SHA1
622 ipcopmake Digest-HMAC
623 ipcopmake libwww-perl
624 ipcopmake Net-DNS
625 ipcopmake Net-IPv4Addr
626 ipcopmake Net_SSLeay
4f8b6695
MT
627 ipcopmake IO-Stringy
628 ipcopmake Unix-Syslog
629 ipcopmake Mail-Tools
630 ipcopmake MIME-Tools
631 ipcopmake Net-Server
632 ipcopmake Convert-TNEF
633 ipcopmake Convert-UUlib
634 ipcopmake Archive-Tar
635 ipcopmake Archive-Zip
dace10b5 636 ipcopmake GeoIP
df8c7810 637 ipcopmake fwhits
df5e82b3
MT
638 ipcopmake noip_updater
639 ipcopmake ntp
640 ipcopmake oinkmaster
641 ipcopmake openssh
642 ipcopmake openswan
643 ipcopmake pptpclient
644 ipcopmake rrdtool
645 ipcopmake setserial
646 ipcopmake setup
647 ipcopmake snort
648 #ipcopmake speedycgi
649 ipcopmake squid
650 ipcopmake squid-graph
651 ipcopmake tcpdump
652 ipcopmake traceroute
653 ipcopmake vlan
5fcb6d5a 654 #ipcopmake wireless
df5e82b3
MT
655 ipcopmake libsafe
656 ipcopmake 3c5x9setup
b34fd95d
MT
657 echo -ne "`date -u '+%b %e %T'`: Building ### IPFire modules ### \n" | tee -a $LOGFILE
658 ipcopmake pakfire
6ef0bff8 659 ipcopmake startscripts
5e69ef1a 660## Zuerst die Libs und dann die Programme. Ordnung muss sein!
98d413ac 661 ipcopmake berkeley
4f8b6695 662 ipcopmake BerkeleyDB ## The Perl module
6ef0bff8 663 ipcopmake java
5e69ef1a 664 ipcopmake libtiff
c3defe9b 665 ipcopmake libjpeg
5e69ef1a
MT
666 ipcopmake libxml2
667 ipcopmake spandsp
668 ipcopmake lzo
6ef0bff8 669 ipcopmake openvpn
f8e5510c
MT
670 ipcopmake pkg-config
671 ipcopmake glib
180cd3be 672 ipcopmake xampp
5e69ef1a
MT
673 ipcopmake pam
674 ipcopmake pammysql
98d413ac
MT
675 ipcopmake saslauthd PASS=1
676 ipcopmake openldap
677 ipcopmake saslauthd PASS=2
a31b2bc4 678 ipcopmake xinetd
316160b0
MT
679 ipcopmake ghostscript
680 ipcopmake cups
b34fd95d 681# ipcopmake lpd ## Im Moment aus, da CUPS vorhanden ist.
98d413ac 682 ipcopmake samba
5e69ef1a
MT
683 ipcopmake sudo
684 ipcopmake mc
685 ipcopmake pwlib
686 ipcopmake openh323
1fe6c87b 687 ipcopmake wget
1fe6c87b 688 ipcopmake bridge-utils
b34fd95d 689 echo -ne "`date -u '+%b %e %T'`: Building ### Mailserver ### \n" | tee -a $LOGFILE
94025eea 690 ipcopmake postfix
93dc5548
MT
691 ipcopmake fetchmail
692 ipcopmake cyrusimap
f9a5a4f0 693 ipcopmake procmail
33a31f1a 694 ipcopmake mailx
f9315063
MT
695 ipcopmake clamav
696 ipcopmake razor
4f8b6695
MT
697 ipcopmake spamassassin
698 ipcopmake amavisd
b34fd95d 699 echo -ne "`date -u '+%b %e %T'`: Building ### VoIP-Server ### \n" | tee -a $LOGFILE
94025eea 700 ipcopmake stund
5e69ef1a 701 ipcopmake asterisk
b34fd95d 702 echo -ne "`date -u '+%b %e %T'`: Building ### MP3-Server ### \n" | tee -a $LOGFILE
316160b0
MT
703 ipcopmake lame
704 ipcopmake gnump3d
6ef0bff8
MT
705 echo -ne "`date -u '+%b %e %T'`: Building ### P2P-Clients ### \n" | tee -a $LOGFILE
706 ipcopmake applejuice
907cd036
MT
707 ipcopmake edonkeyclc
708 ipcopmake sane
d1dd6669 709 ipcopmake rsync
3b9f6349 710 ipcopmake tcpwrapper
769a61c5 711 ipcopmake portmap
6ef0bff8 712 ipcopmake screen
907cd036 713 ipcopmake nmap
a743d285 714 ipcopmake htop
769a61c5 715 ipcopmake nfs
ef05c8bb 716 ipcopmake ncftp
33a31f1a 717 ipcopmake ethereal
052ad1cd 718# wget http://www.guzu.net/linux/hddtemp.db && mv hddtemp.db $BASEDIR/build/etc/hddtemp.db
f8e5510c 719# ipcopmake hddtemp
0eab8e84 720# ipcopmake stunnel # Ausgeschaltet, weil wir es doch nicht nutzen
df5e82b3
MT
721}
722
723buildinstaller() {
724 # Run installer scripts one by one
725 LOGFILE="$BASEDIR/log/_build.installer.log"
726 export LOGFILE
727 echo -ne "`date -u '+%b %e %T'`: Stage4 installer build \n" | tee -a $LOGFILE
728 if [ 'i386' = $MACHINE ]; then
729 ipcopmake syslinux
730 ipcopmake as86
731 ipcopmake mbr
732 ipcopmake uClibc
733 fi
734 installmake busybox
735 installmake sysvinit
736 installmake e2fsprogs
737 installmake misc-progs
738 installmake slang
739 installmake util-linux
740 installmake newt
741 installmake pciutils
742 installmake pcmcia-cs
743 installmake kbd
744 installmake installer
745 installmake scsi.img
746 installmake driver.img
747 installmake initrd
748 installmake boot.img
749}
750
751buildpackages() {
752 LOGFILE="$BASEDIR/log/_build.packages.log"
753 export LOGFILE
754 echo "... see detailed log in _build.*.log files" >> $LOGFILE
755 echo -ne "`date -u '+%b %e %T'`: Stage5 packages build \n" | tee -a $LOGFILE
756 # Strip files
757 echo "`date -u '+%b %e %T'`: Stripping files" | tee -a $LOGFILE
758 find $LFS/lib $LFS/usr/lib $LFS/usr/share/rrdtool-* $LFS/install ! -type l \( -name '*.so' -o -name '*.so[\.0-9]*' \) \
759 ! -name 'libc.so' ! -name 'libpthread.so' ! -name 'libcrypto.so.0.9.7.sha1' \
94025eea 760 -ls -exec $LFS/tools/bin/strip --strip-all {} \; >> $LOGFILE 2>&1
df5e82b3
MT
761 # add -ls before -exec if you want to verify what files are stripped
762
763 find $LFS/{,s}bin $LFS/usr/{,s}bin $LFS/usr/local/{,s}bin ! -type l \
764 -exec file {} \; | grep " ELF " | cut -f1 -d ':' | xargs $LFS/tools/bin/strip --strip-all >> $LOGFILE 2>&1
765 # there add -v to strip to verify
766
767 if [ 'i386' = $MACHINE ]; then
768 # Create fcdsl packages
769 echo "`date -u '+%b %e %T'`: Building fcdsl tgz" | tee -a $LOGFILE
770 cp $LFS/install/images/fcdsl/license.txt $LFS >> $LOGFILE 2>&1
771 touch $LFS/var/run/{need-depmod-$KVER,need-depmod-$KVER-smp}
772 cd $LFS && tar cvfz $LFS/install/images/$SNAME-fcdsl-$VERSION.$MACHINE.tgz \
773 lib/modules/$KVER/misc/fcdsl*.o.gz \
774 lib/modules/$KVER-smp/misc/fcdsl*.o.gz \
775 usr/lib/isdn/{fds?base.bin,fd?ubase.frm} \
776 etc/fcdsl/fcdsl*.conf \
777 etc/drdsl/{drdsl,drdsl.ini} \
778 license.txt \
779 var/run/{need-depmod-$KVER,need-depmod-$KVER-smp} >> $LOGFILE 2>&1
780 rm -f $LFS/license.txt >> $LOGFILE 2>&1
781 cd $BASEDIR
782 fi
783
c2b15814 784# Create update for this version
df5e82b3
MT
785# echo "`date -u '+%b %e %T'`: Building update $VERSION tgz" | tee -a $LOGFILE
786# tar -cz -C $BASEDIR/build --files-from=$BASEDIR/updates/$VERSION/ROOTFILES.$MACHINE-$VERSION -f $BASEDIR/updates/$VERSION/patch.tar.gz --exclude='#*';
787# chmod 755 $BASEDIR/updates/$VERSION/setup
788# tar -cz -C $BASEDIR/updates/$VERSION -f $LFS/install/images/$SNAME-update-$VERSION.$MACHINE.tgz patch.tar.gz setup information
789# rm -f $LFS/var/run/{need-depmod-$KVER,need-depmod-$KVER-smp}
790
791 # Generating list of packages used
792 echo "`date -u '+%b %e %T'`: Generating packages list from logs" | tee -a $LOGFILE
793 rm -f $BASEDIR/doc/packages-list
794 for i in `ls -1tr $BASEDIR/log/[^_]*`; do
795 if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
3ea75603 796 echo " * `basename $i`" >>$BASEDIR/doc/packages-list
df5e82b3
MT
797 fi
798 done
3ea75603 799 echo "====== List of softwares used to build $NAME Version: $VERSION ======" > $BASEDIR/doc/packages-list.txt
df5e82b3
MT
800 grep -v 'configroot$\|img$\|initrd$\|initscripts$\|installer$\|install$\|ipcop$\|setup$\|stage2$\|smp$\|tools$\|tools1$\|tools2$' \
801 $BASEDIR/doc/packages-list | sort >> $BASEDIR/doc/packages-list.txt
802 rm -f $BASEDIR/doc/packages-list
c9673262 803 # packages-list.txt is ready to be displayed for wiki page
df5e82b3
MT
804
805 # Create ISO for CDRom and USB-superfloppy
c3defe9b
MT
806 ipcopmake cdrom
807 cp $LFS/install/images/{*.iso,*.tgz} $BASEDIR >> $LOGFILE 2>&1
c9673262 808
df5e82b3
MT
809 # Cleanup
810 stdumount
811 rm -rf $BASEDIR/build/tmp/*
812
813 # Generating total list of files
814 echo "`date -u '+%b %e %T'`: Generating files list from logs" | tee -a $LOGFILE
815 rm -f $BASEDIR/log/FILES
816 for i in `ls -1tr $BASEDIR/log/[^_]*`; do
817 if [ "$i" != "$BASEDIR/log/FILES" -a -n $i ]; then
818 echo "##" >>$BASEDIR/log/FILES
819 echo "## `basename $i`" >>$BASEDIR/log/FILES
820 echo "##" >>$BASEDIR/log/FILES
821 cat $i | sed "s%^\./%#%" | sort >> $BASEDIR/log/FILES
822 fi
823 done
824
825 cd $PWD
826
827}
828
829# See what we're supposed to do
830case "$1" in
831build)
832 BUILDMACHINE=`uname -m`
833 PACKAGE=`ls -v -r $BASEDIR/cache/$SNAME-1.4.*-toolchain-$BUILDMACHINE.tar.gz 2> /dev/null | head -n 1`
834 #only restore on a clean disk
835 if [ ! -f log/perl-*-tools ]; then
836 if [ ! -n "$PACKAGE" ]; then
837 echo "`date -u '+%b %e %T'`: Full toolchain compilation" | tee -a $LOGFILE
838 prepareenv
839 buildtoolchain
840 else
841 PACKAGENAME=${PACKAGE%.tar.gz}
842 echo "`date -u '+%b %e %T'`: Restore from $PACKAGE" | tee -a $LOGFILE
843 if [ `md5sum $PACKAGE | awk '{print $1}'` == `cat $PACKAGENAME.md5 | awk '{print $1}'` ]; then
844 tar zxf $PACKAGE
845 prepareenv
846 else
847 exiterror "$PACKAGENAME md5 did not match, check downloaded package"
848 fi
849 fi
850 else
851 echo "`date -u '+%b %e %T'`: Using installed toolchain" | tee -a $LOGFILE
852 prepareenv
853 fi
854 buildbase
855 buildipcop
856 buildinstaller
857 buildpackages
858 ;;
859shell)
860 # enter a shell inside LFS chroot
861 # may be used to changed kernel settings
862 prepareenv
863 entershell
864 ;;
865changelog)
d1dd6669 866 echo -n "Loading new Changelog from SVN: "
f9315063 867 svn log http://svn.ipfire.eu/svn/ipfire > doc/ChangeLog
d1dd6669 868 echo "Finished!"
df5e82b3
MT
869 ;;
870check)
871 echo "Checking sources files availability on the web"
872 if [ ! -d $DIR_CHK ]; then
873 mkdir -p $DIR_CHK
874 fi
875 FINISHED=0
876 cd $BASEDIR/lfs
877 for c in `seq $MAX_RETRIES`; do
878 if (( FINISHED==1 )); then
879 break
880 fi
881 FINISHED=1
882 cd $BASEDIR/lfs
883 for i in *; do
884 if [ -f "$i" -a "$i" != "Config" ]; then
885 make -s -f $i MACHINE=$MACHINE LFS_BASEDIR=$BASEDIR ROOT=$BASEDIR/build \
886 MESSAGE="$i\t ($c/$MAX_RETRIES)" check
887 if [ $? -ne 0 ]; then
888 echo "Check : wget error in lfs/$i"
889 FINISHED=0
890 fi
891 fi
892 done
893 done
894 cd -
895 ;;
896checkclean)
897 echo "Erasing sources files availability tags"
898 rm -rf $DIR_CHK/*
899 ;;
900clean)
901 for i in `mount | grep $BASEDIR | sed 's/^.*loop=\(.*\))/\1/'`; do
902 $LOSETUP -d $i 2>/dev/null
903 done
904 for i in `mount | grep $BASEDIR | cut -d " " -f 1`; do
905 umount $i
906 done
907 stdumount
908 for i in `seq 0 7`; do
909 if ( losetup /dev/loop${i} 2>/dev/null | grep -q "/install/images" ); then
910 umount /dev/loop${i} 2>/dev/null;
911 losetup -d /dev/loop${i} 2>/dev/null;
912 fi;
913 done
914 rm -rf $BASEDIR/build
915 rm -rf $BASEDIR/cdrom
f9315063 916 rm -rf $BASEDIR/packages
df5e82b3 917 rm -rf $BASEDIR/log
df5e82b3
MT
918 if [ -h /tools ]; then
919 rm -f /tools
920 fi
921 ;;
922dist)
4f8b6695 923 echo -ne "Updating & building source package from SVN: "
a414d696
MT
924 svn up > /dev/null
925 svn export http://svn.ipfire.eu/svn/ipfire ipfire-source/ --force > /dev/null
ecc898f7
MT
926 tar cfz ipfire-source-`date +'%Y-%m-%d'`-r`svn info | grep Revision | cut -c 11-`.tar.gz ipfire-source
927 rm ipfire-source/ -r
4f8b6695 928 echo "Finished!"
df5e82b3 929 ;;
f8e5510c 930newpak)
a9b17001
MT
931 # create structure for a new package
932 echo -e "Name of the new package: $2"
933 if [ ! -f "lfs/$2" ]; then
934 echo "`date -u '+%b %e %T'`: Creating directory src/paks/$2"
935 mkdir -p src/paks/$2
936 cd src/paks/$2
f8e5510c 937 echo "`date -u '+%b %e %T'`: Creating files"
a9b17001
MT
938 cp $BASEDIR/lfs/postfix $BASEDIR/lfs/$2
939
f8e5510c
MT
940 touch ROOTFILES
941 touch CONFFILES
942 touch {,un}install.sh
a9b17001 943 ## install.sh
f8e5510c
MT
944 echo '#!/bin/bash' > install.sh
945 echo '#' >> install.sh
946 echo '#################################################################' >> install.sh
947 echo '# #' >> install.sh
948 echo '# This file belongs to IPFire Firewall - GPLv2 - www.ipfire.org #' >> install.sh
949 echo '# #' >> install.sh
950 echo '#################################################################' >> install.sh
951 echo '#' >> install.sh
952 echo '# Extract the files' >> install.sh
953 echo 'tar xfz files.tgz -C /' >> install.sh
a9b17001
MT
954 echo 'cp -f ROOTFILES /opt/pakfire/installed/ROOTFILES.$2' >> install.sh
955 ## uninstall.sh
f8e5510c
MT
956 echo '#!/bin/bash' > uninstall.sh
957 echo '#################################################################' >> uninstall.sh
958 echo '# #' >> uninstall.sh
959 echo '# This file belongs to IPFire Firewall - GPLv2 - www.ipfire.org #' >> uninstall.sh
960 echo '# #' >> uninstall.sh
961 echo '#################################################################' >> uninstall.sh
962 echo '#' >> uninstall.sh
963 echo '# Delete the files' >> uninstall.sh
964 echo '## Befehl fehlt noch' >> uninstall.sh
a9b17001 965 echo 'rm -f /opt/pakfire/installed/ROOTFILES.$2' >> uninstall.sh
f8e5510c 966 echo "`date -u '+%b %e %T'`: Adding files to SVN"
a9b17001
MT
967 cd - && svn add lfs/$2 && svn add src/paks/$2
968
969 echo -n "Do you want to remove the folders? [y/n]"
970 read REM
971 if [ "$REM" == "y" ]; then
972 echo "Removing the folders..."
973 svn del src/paks/$2 --force
974 else
975 echo "Folders are kept."
976 fi
df5e82b3 977 else
a9b17001 978 echo "$2 already exists"
df5e82b3 979 fi
df5e82b3
MT
980 exit 0
981 ;;
982prefetch)
983 if [ ! -d $BASEDIR/cache ]; then
984 mkdir $BASEDIR/cache
985 fi
986 mkdir -p $BASEDIR/log
987 echo "`date -u '+%b %e %T'`:Preload all source files" | tee -a $LOGFILE
988 FINISHED=0
989 cd $BASEDIR/lfs
990 for c in `seq $MAX_RETRIES`; do
991 if (( FINISHED==1 )); then
992 break
993 fi
994 FINISHED=1
995 cd $BASEDIR/lfs
996 for i in *; do
997 if [ -f "$i" -a "$i" != "Config" ]; then
998 make -s -f $i LFS_BASEDIR=$BASEDIR MESSAGE="$i\t ($c/$MAX_RETRIES)" download >> $LOGFILE 2>&1
999 if [ $? -ne 0 ]; then
1000 echo "Prefetch : wget error in lfs/$i"
1001 FINISHED=0
1002 else
1003 if [ $c -eq 1 ]; then
1004 echo "Prefetch : lfs/$i files loaded"
1005 fi
1006 fi
1007 fi
1008 done
1009 done
1010 echo "Prefetch : verifying md5sum"
1011 ERROR=0
1012 for i in *; do
1013 if [ -f "$i" -a "$i" != "Config" ]; then
1014 make -s -f $i LFS_BASEDIR=$BASEDIR MESSAGE="$i\t " md5 >> $LOGFILE 2>&1
1015 if [ $? -ne 0 ]; then
1016 echo "md5 difference in lfs/$i"
1017 ERROR=1
1018 fi
1019 fi
1020 done
1021 if [ $ERROR -eq 0 ]; then
1022 echo "Prefetch : all files md5sum match"
1023 fi
1024 cd -
1025 ;;
df5e82b3
MT
1026toolchain)
1027 prepareenv
1028 buildtoolchain
1029 BUILDMACHINE=`uname -m`
1030 echo "`date -u '+%b %e %T'`: Create toolchain tar.gz for $BUILDMACHINE" | tee -a $LOGFILE
1031 cd $BASEDIR && tar -zc --exclude='log/_build.*.log' -f cache/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz \
1032 build/{bin,etc,usr/bin,usr/local} \
1033 build/tools/{bin,etc,*-linux-gnu,include,lib,libexec,sbin,share,var} \
1034 log >> $LOGFILE
1035 md5sum cache/$SNAME-$VERSION-toolchain-$BUILDMACHINE.tar.gz \
1036 > cache/$SNAME-$VERSION-toolchain-$BUILDMACHINE.md5
1037 stdumount
1038 ;;
1039gettoolchain)
1040 BUILDMACHINE=`uname -m`
1041 # arbitrary name to be updated in case of new toolchain package upload
e29556d8
MT
1042 PACKAGE=$SNAME-1.4-toolchain-$BUILDMACHINE
1043 URL_IPFIRE=`grep URL_IPFIRE lfs/Config | awk '{ print $3 }'`
df5e82b3
MT
1044 echo "`date -u '+%b %e %T'`: Load toolchain tar.gz for $BUILDMACHINE" | tee -a $LOGFILE
1045 cd $BASEDIR/cache
54113aa2 1046 wget $URL_IPFIRE/toolchains/$PACKAGE.tar.gz $URL_IPFIRE/toolchains/$PACKAGE.md5
df5e82b3
MT
1047 if [ $? -ne 0 ]; then
1048 echo "`date -u '+%b %e %T'`: error downloading toolchain for $BUILDMACHINE machine" | tee -a $LOGFILE
1049 else
1050 if [ "`md5sum $PACKAGE.tar.gz | awk '{print $1}'`" = "`cat $PACKAGE.md5 | awk '{print $1}'`" ]; then
1051 echo "`date -u '+%b %e %T'`: toolchain md5 ok" | tee -a $LOGFILE
e29556d8 1052 echo "`date -u '+%b %e %T'`: Uncompressing toolchain" | tee -a $LOGFILE
548f60a5 1053 cd $BASEDIR && tar xfz cache/$PACKAGE.tar.gz -C .
f9315063 1054 rm -vf $BASEDIR/cache/$PACKAGE.{tar.gz,md5}
df5e82b3
MT
1055 else
1056 exiterror "$PACKAGE.md5 did not match, check downloaded package"
1057 fi
1058 fi
1059 ;;
a9b17001
MT
1060update)
1061 echo "Load the latest source-files:"
1062 svn update
1063 ;;
3b9f6349
MT
1064commit)
1065 echo "Upload the changed files:"
3b9f6349 1066 svn commit
769a61c5 1067 svn up > /dev/null
3b9f6349 1068 ;;
f9315063
MT
1069make)
1070 echo "Do a complete compile:"
548f60a5 1071 ./make.sh prefetch && ./make.sh gettoolchain && ./make.sh build && ./make.sh paks
4f8b6695
MT
1072 ;;
1073diff)
1074 echo -ne "Make a local diff to last SVN revision: "
1075 svn diff > ipfire-diff-`date +'%Y-%m-%d-%H:%M'`-r`svn info | grep Revision | cut -c 11-`.diff
1076 echo "Finished!"
1077 echo "Diff was successfully saved to ipfire-diff-`date +'%Y-%m-%d-%H:%M'`-r`svn info | grep Revision | cut -c 11-`.diff"
f9315063 1078 ;;
0eab8e84
MT
1079sync)
1080 echo -e "Syncing Cache to FTP:"
1081 echo -ne "Password for mirror.ipfire.org: "; read PASS
ef05c8bb 1082 rm -f doc/packages-to-remove-from-ftp
0eab8e84
MT
1083 ncftpls -u web3 -p $PASS ftp://mirror.ipfire.org/html/source-packages/source/ > ftplist
1084 for i in `ls -w1 cache/`; do
1085 grep $i ftplist
1086 if [ "$?" -ne "0" ]; then
1087 ncftpput -u web3 -p $PASS mirror.ipfire.org /html/source-packages/source cache/$i
1088 if [ "$?" -eq "0" ]; then
1089 echo -e "$i was successfully uploaded to the ftp server."
1090 else
1091 echo -e "There was an error while uploading $i to the ftp server."
1092 fi
1093 fi
1094 done
ef05c8bb
MT
1095 for i in `cat ftplist`; do
1096 ls -w1 cache/ | grep $i
1097 if [ "$?" -eq "1" ]; then
1098 echo $i | grep -v toolchain >> doc/packages-to-remove-from-ftp
1099 fi
1100 done
0eab8e84
MT
1101 rm -f ftplist
1102 ;;
548f60a5
MT
1103paks)
1104 # Build IPFire packages
1105 prepareenv
1106 ipfiredist applejuice
1107 ipfiredist asterisk
1108 ipfiredist cyrusimap
1109 ipfiredist fetchmail
1110 ipfiredist gnump3d
1111 ipfiredist lame
1112 ipfiredist libtiff
1113 ipfiredist libxml2
1114 ipfiredist mc
1115 ipfiredist postfix
1116 ipfiredist pwlib
1117 ipfiredist sane
1118 ipfiredist spandsp
1119 ipfiredist sudo
1120 ipfiredist xampp
1121 ipfiredist xinetd
1122 test -d $BASEDIR/packages || mkdir $BASEDIR/packages
1123 mv -f $LFS/paks/*.tar.gz $LFS/paks/*.md5 $BASEDIR/packages >> $LOGFILE 2>&1
1124 rm -rf $LFS/paks
1125 rm -rf $BASEDIR/build/tmp/*
1126 ;;
df5e82b3 1127*)
0eab8e84 1128 echo "Usage: $0 {build|changelog|check|checkclean|clean|commit|diff|dist|gettoolchain|make|newpak|prefetch|shell|sync|toolchain|update}"
df5e82b3
MT
1129 cat doc/make.sh-usage
1130 exit 1
1131 ;;
3ea75603 1132esac