]> git.ipfire.org Git - ipfire-3.x.git/blob - make.sh
Fixed an error that erased the logfile.
[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) 2008 IPFire-Team <info@ipfire.org>. #
21 # #
22 ############################################################################
23 #
24
25 NAME="IPFire" # Software name
26 SNAME="ipfire" # Short name
27 VERSION="3.0-prealpha" # Version number
28 TOOLCHAINVERSION="${VERSION}-5" # 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=${TOOLS_DIR}/usr/bin:${TOOLS_DIR}/bin:$PATH
42 STAGE_ORDER=01
43 STAGE=toolchain
44
45 LOGFILE="$BASEDIR/log_${MACHINE}/_build.${STAGE_ORDER}-toolchain.log"
46 export LOGFILE
47
48 build_spy set stage ${STAGE} &
49
50 toolchain_make stage1
51 # make distcc first so that CCACHE_PREFIX works immediately
52 [ -z "$DISTCC_HOSTS" ] || toolchain_make distcc
53 toolchain_make ccache
54 toolchain_make gmp
55 toolchain_make mpfr
56 toolchain_make linux
57 toolchain_make binutils PASS=1
58 toolchain_make gcc PASS=1
59 toolchain_make glibc
60 toolchain_make adjust-toolchain
61 toolchain_make binutils PASS=2
62 toolchain_make gcc PASS=2
63 #toolchain_make tcl # Maybe this can be dropped
64 #toolchain_make expect # Maybe this can be dropped
65 #toolchain_make dejagnu # Maybe this can be dropped
66 toolchain_make ncurses
67 toolchain_make bash
68 toolchain_make bzip2
69 toolchain_make coreutils
70 toolchain_make diffutils
71 toolchain_make e2fsprogs
72 toolchain_make findutils
73 toolchain_make gawk
74 toolchain_make gettext
75 toolchain_make grep
76 toolchain_make gzip
77 toolchain_make m4
78 toolchain_make make
79 toolchain_make patch
80 toolchain_make perl
81 toolchain_make sed
82 toolchain_make tar
83 toolchain_make texinfo
84 #toolchain_make bison
85 toolchain_make flex
86 toolchain_make bc
87 toolchain_make util-linux-ng
88 toolchain_make strip
89 export PATH=$ORG_PATH
90 }
91
92 ################################################################################
93 # This builds the entire stage "base" #
94 ################################################################################
95 base_build() {
96
97 PATH=${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:$TOOLS_DIR/bin
98 STAGE_ORDER=02
99 STAGE=base
100
101 LOGFILE="$BASEDIR/log_${MACHINE}/_build.${STAGE_ORDER}-base.log"
102 export LOGFILE
103
104 build_spy set stage ${STAGE} &
105
106 ipfire_make stage2
107 ipfire_make scripts
108 ipfire_make initscripts
109 ipfire_make gmp
110 ipfire_make mpfr
111 ipfire_make linux
112 ipfire_make man-pages
113 ipfire_make glibc
114 ipfire_make adjust-toolchain
115 ipfire_make binutils
116 ipfire_make gcc
117 ipfire_make berkeley
118 ipfire_make sed
119 ipfire_make e2fsprogs
120 ipfire_make coreutils
121 ipfire_make iana-etc
122 ipfire_make m4
123 ipfire_make bison
124 ipfire_make ncurses
125 ipfire_make procps
126 ipfire_make libtool
127 ipfire_make perl
128 ipfire_make readline
129 ipfire_make zlib
130 ipfire_make gettext
131 ipfire_make make
132 ipfire_make attr
133 ipfire_make libcap2
134 ipfire_make paxctl
135 ipfire_make autoconf
136 ipfire_make automake
137 ipfire_make bash
138 ipfire_make bzip2
139 ipfire_make diffutils
140 ipfire_make file
141 ipfire_make findutils
142 ipfire_make flex
143 ipfire_make grub
144 ipfire_make gawk
145 ipfire_make grep
146 ipfire_make groff
147 ipfire_make gzip
148 ipfire_make inetutils
149 ipfire_make iproute2
150 ipfire_make kbd
151 ipfire_make less
152 ipfire_make man-db
153 ipfire_make module-init-tools
154 ipfire_make patch
155 ipfire_make psmisc
156 ipfire_make shadow
157 ipfire_make sysklogd
158 ipfire_make sysvinit
159 ipfire_make tar
160 ipfire_make texinfo
161 ipfire_make udev ## NEED TO INSTALL CONFIG
162 ipfire_make util-linux-ng
163 ipfire_make vim
164 }
165
166 ################################################################################
167 # This builds the entire stage "ipfire" #
168 ################################################################################
169 ipfire_build() {
170 PATH=${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
171 STAGE_ORDER=03
172 STAGE=ipfire
173
174 LOGFILE="$BASEDIR/log_${MACHINE}/_build.${STAGE_ORDER}-ipfire.log"
175 export LOGFILE
176
177 build_spy set stage ${STAGE} &
178
179 ### Building the configuration dirs and files
180 #
181 ipfire_make stage3
182 ipfire_make lzma
183
184 ipfire_make linux
185
186 ### Building some general stuff
187 # STAGE 1
188 ipfire_make pkg-config
189 ipfire_make expat
190 ipfire_make glib
191 ipfire_make dbus
192 ipfire_make dbus-glib
193 ipfire_make openssl
194 ipfire_make perl ### We are building the modules here.
195 ipfire_make python
196 ipfire_make python-dbus
197 ipfire_make python-urlgrabber
198 ipfire_make python-iconv
199 ipfire_make libxml2
200 ipfire_make libxslt
201 #ipfire_make libidn ### Do we need this?
202 ipfire_make pcre
203 ipfire_make popt
204 ipfire_make libusb
205 ipfire_make bc
206
207 ### Building some network stuff
208 #
209 ipfire_make libpcap
210 ipfire_make linux-atm
211 ipfire_make ppp
212 ipfire_make rp-pppoe
213 ipfire_make dhcp
214 ipfire_make iptables
215 ipfire_make libnfnetlink
216 ipfire_make libnetfilter_queue
217 ipfire_make libnetfilter_conntrack
218 ipfire_make libnetfilter_log
219 ipfire_make dnsmasq
220 ipfire_make l7-protocols
221 ipfire_make bridge-utils
222 ipfire_make vlan
223 ipfire_make bind
224 ipfire_make whois
225
226 ### Building some general stuff
227 # STAGE 2
228 ipfire_make pam PASS=1
229 ipfire_make shadow
230 ipfire_make pam PASS=2
231 ipfire_make slang
232 ipfire_make newt
233 ipfire_make cyrus-sasl
234 ipfire_make openldap
235 ipfire_make sqlite
236 ipfire_make curl
237 ipfire_make gnupg
238 ipfire_make sudo
239 #ipfire_make libjpeg
240 ipfire_make libpng
241 ipfire_make libtiff
242 ipfire_make libart
243 ipfire_make freetype
244 ipfire_make fontconfig
245 ipfire_make pixman
246 ipfire_make cairo
247 ipfire_make pango
248 ipfire_make lzo
249 ipfire_make lsof
250 ipfire_make br2684ctl
251 ipfire_make etherwake
252 ipfire_make beep
253 ipfire_make libuser
254
255 ### Building vpn stuff
256 #
257 ipfire_make strongswan
258 #ipfire_make openvpn
259
260 ### Building filesystem stuff
261 #
262 ipfire_make reiserfsprogs
263 ipfire_make libaal
264 ipfire_make reiser4progs
265 ipfire_make xfsprogs
266 ipfire_make sysfsutils
267
268 ### Building hardware utils
269 #
270 ipfire_make pciutils
271 ipfire_make usbutils
272 ipfire_make hdparm
273 ipfire_make smartmontools
274 ipfire_make lm-sensors
275 ipfire_make hal
276 ipfire_make hal-info
277
278 ### Building some important tools
279 #
280 ipfire_make ulogd2
281 ipfire_make fcron
282 ipfire_make which
283 ipfire_make screen
284 ipfire_make rrdtool
285 ipfire_make ntp ### Needs config.
286 ipfire_make openssh
287 ipfire_make ez-ipupdate
288 ipfire_make noip
289 ipfire_make lighttpd
290 ipfire_make collectd
291 #ipfire_make logrotate
292 #ipfire_make logwatch
293 ipfire_make cpio
294 ipfire_make cdrtools
295 ipfire_make parted
296 ipfire_make memtest86+
297 #ipfire_make pakfire
298 ipfire_make chkconfig
299
300 ipfire_make pyfire
301
302 ### -------------------------------------------------------------------------
303 ### Tools that maybe not needed
304 #
305 #ipfire_make gd
306 #ipfire_make libcap
307 #ipfire_make mtools
308 #ipfire_make mISDN
309
310 #ipfire_make wireless
311 #ipfire_make libsafe
312 }
313
314 ################################################################################
315 # This builds the entire stage "misc" #
316 ################################################################################
317 misc_build() {
318
319 PATH=${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
320 STAGE_ORDER=04
321 STAGE=misc
322
323 LOGFILE="$BASEDIR/log_${MACHINE}/_build.${STAGE_ORDER}-misc.log"
324 export LOGFILE
325
326 build_spy set stage ${STAGE} &
327
328 ipfire_make stage4
329
330 ### Console tools
331 #
332 ipfire_make mc
333 #ipfire_make traceroute
334 #ipfire_make nmap
335 #ipfire_make rsync
336 #ipfire_make tcpdump
337 ipfire_make htop
338 ipfire_make nano
339 ipfire_make squid
340
341 ### Assembler
342 #
343 ipfire_make nasm
344 ipfire_make syslinux
345
346 ipfire_make busybox
347
348 #ipfire_make squidguard ## CAN THIS BE BANISHED BY ANYTHING BETTER?
349 #ipfire_make calamaris ## CAN THIS BE BANISHED BY ANYTHING BETTER?
350 #ipfire_make vsftpd
351
352 ## NTFS
353 #ipfire_make fuse
354 #ipfire_make ntfs-3g
355 #
356 ## Net tools
357 #ipfire_make bwm-ng
358 #
359 ## UPNP
360 #ipfire_make libupnp
361 #ipfire_make linux-igd
362
363 ### These will become addons as usual but will be integrated later
364 #
365 #ipfire_make snort
366 #ipfire_make oinkmaster
367 #ipfire_make centerim
368 #ipfire_make tripwire
369 #ipfire_make java
370 #ipfire_make cups
371 #ipfire_make ghostscript
372 #ipfire_make foomatic
373 #ipfire_make hplip
374 #ipfire_make samba
375 #ipfire_make postfix
376 #ipfire_make fetchmail
377 #ipfire_make cyrus-imapd
378 #ipfire_make clamav
379 #ipfire_make alsa
380 #ipfire_make mpfire
381 #ipfire_make guardian
382 #ipfire_make libid3tag
383 #ipfire_make libmad
384 #ipfire_make libogg
385 #ipfire_make libvorbis
386 #ipfire_make lame
387 #ipfire_make sox
388 #ipfire_make libshout
389 #ipfire_make icecast
390 #ipfire_make icegenerator
391 #ipfire_make mpd
392 #ipfire_make mpc
393 #ipfire_make xvid
394 #ipfire_make libmpeg2
395 #ipfire_make videolan
396 #ipfire_make libpri
397 #ipfire_make asterisk
398 #ipfire_make libsigc++
399 #ipfire_make applejuice
400 #ipfire_make libtorrent
401 #ipfire_make rtorrent
402 #ipfire_make ipfireseeder
403 #ipfire_make nfs
404
405 # ---------------------------------------------------------------------------
406 #ipfire_make as86
407 #ipfire_make mbr
408
409 ### Debugging
410 #
411 ipfire_make strace
412 }
413
414 ################################################################################
415 # This builds the entire stage "installer" #
416 ################################################################################
417 installer_build() {
418
419 PATH=${TOOLS_DIR}/usr/bin:${UCLIBC_DIR}/bin:${UCLIBC_DIR}/usr/bin
420 PATH=$PATH:${UCLIBC_CC_CORE_STATIC_DIR}/bin:/bin:/usr/bin
421 PATH=$PATH:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
422 STAGE_ORDER=05
423 STAGE=installer
424
425 LOGFILE="$BASEDIR/log_${MACHINE}/_build.${STAGE_ORDER}-installer.log"
426 export LOGFILE
427
428 build_spy set stage ${STAGE} &
429
430 ipfire_make stage5
431 ipfire_make ccache
432 ipfire_make gmp
433 ipfire_make mpfr
434 ipfire_make linux
435 ipfire_make binutils
436 ipfire_make uClibc PASS=1
437 ipfire_make gcc PASS=1
438 ipfire_make uClibc PASS=2
439 ipfire_make gettext PASS=1
440 ipfire_make gcc PASS=2
441 ipfire_make gettext PASS=2
442 ipfire_make udev
443 ipfire_make pciutils
444 ipfire_make zlib
445 ipfire_make ncurses
446 ipfire_make pcre
447 ipfire_make popt
448 ipfire_make glib
449 ipfire_make readline
450 ipfire_make e2fsprogs
451 #ipfire_make xfsprogs
452 ipfire_make util-linux-ng
453 ipfire_make parted
454 ipfire_make expat
455 ipfire_make dbus
456 ipfire_make dbus-glib
457 ipfire_make hal
458 ipfire_make hal-info
459 ipfire_make openssl
460 ipfire_make python
461 ipfire_make python-dbus
462 ipfire_make python-parted
463 ipfire_make python-urlgrabber
464 ipfire_make python-iconv
465 ipfire_make pam
466 ipfire_make libuser
467 ipfire_make slang
468 ipfire_make newt
469 ipfire_make bash
470 ipfire_make strace
471 ipfire_make cpio
472 ipfire_make lzma
473 ipfire_make reiserfsprogs
474 ipfire_make pyfire
475 ipfire_make pomona
476 ipfire_make busybox
477 }
478
479 ################################################################################
480 # This builds the entire stage "packages" #
481 ################################################################################
482 packages_build() {
483
484 PATH=${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
485 STAGE_ORDER=06
486 STAGE=packages
487
488 LOGFILE="$BASEDIR/log_${MACHINE}/_build.${STAGE_ORDER}-packages.log"
489 export LOGFILE
490
491 build_spy set stage ${STAGE} &
492
493 toolchain_make strip
494
495 # Generate ChangeLog
496 git_log
497
498 if [ ${EMB} -eq 0 ]; then
499 ipfire_make initramfs
500
501 ipfire_make pxe
502 ipfire_make cdrom
503
504 if check_loop; then
505 : #ipfire_make usb-key
506 else
507 echo -n "Can't build usb-key images on this machine"
508 beautify message WARN
509 fi
510 mv $LFS/$IMAGES_DIR/{*.iso,*.tar.gz,*.img.gz} $BASEDIR >>$LOGFILE 2>&1
511 else
512 if check_loop; then
513 # We put here the code that is done when
514 # we do an embedded build
515 :
516 fi
517 fi
518
519 # Build packages
520 for i in $(ls -1 $BASEDIR/src/rootfiles/extras); do
521 package=$(cut -d. -f2 <<< $i)
522 if [ -e $BASEDIR/lfs/$package ]; then
523 echo -n $package
524 beautify message SKIP
525 else
526 echo -n $package
527 beautify message SKIP
528 fi
529 done
530
531 # Cleanup
532 stdumount
533 rm -rf $LFS/tmp/*
534
535 cd $PWD
536 }
537
538 # See what we're supposed to do
539 . $BASEDIR/tools/make-interactive