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