]> git.ipfire.org Git - ipfire-3.x.git/blame - make.sh
Improved detection if buildspy is already running.
[ipfire-3.x.git] / make.sh
CommitLineData
df5e82b3 1#!/bin/bash
df5e82b3
MT
2############################################################################
3# #
f8e5510c 4# This file is part of the IPFire Firewall. #
df5e82b3 5# #
f8e5510c 6# IPFire is free software; you can redistribute it and/or modify #
df5e82b3
MT
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# #
f8e5510c 11# IPFire is distributed in the hope that it will be useful, #
df5e82b3
MT
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 #
f8e5510c 17# along with IPFire; if not, write to the Free Software #
df5e82b3
MT
18# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
19# #
acef7362 20# Copyright (C) 2008 IPFire-Team <info@ipfire.org>. #
df5e82b3
MT
21# #
22############################################################################
df5e82b3
MT
23#
24
10f9531b
MT
25NAME="IPFire" # Software name
26SNAME="ipfire" # Short name
dbb78edd
MT
27VERSION="3.0-alpha1" # Version number
28TOOLCHAINVERSION="${VERSION}-1" # Toolchain
63e22722 29SLOGAN="Lechery" # Software slogan
df5e82b3 30
15679d9f 31# Include funtions
ca8da28e 32. tools/make-include
df5e82b3 33
df5e82b3 34
ca8da28e
MT
35################################################################################
36# This builds the entire stage "toolchain" #
37################################################################################
38toolchain_build() {
df5e82b3 39
ca8da28e 40 ORG_PATH=$PATH
08874027 41 export PATH=${TOOLS_DIR}/usr/bin:${TOOLS_DIR}/bin:$PATH
ca8da28e
MT
42 STAGE_ORDER=01
43 STAGE=toolchain
df5e82b3 44
11f0ec61 45 LOGFILE="$BASEDIR/log_${TARGET}/_build.${STAGE_ORDER}-toolchain.log"
ca8da28e 46 export LOGFILE
98be0467 47
4a792716 48 build_spy stage ${STAGE}
98be0467 49
99bbe115
MT
50 # We can't skip packages in toolchain stage
51 SAVE_SKIP_PACKAGE_LIST=$SKIP_PACKAGE_LIST
52 SKIP_PACKAGE_LIST=
53
08874027 54 toolchain_make stage1
ca8da28e 55 # make distcc first so that CCACHE_PREFIX works immediately
16caed07 56 toolchain_make distcc
ca8da28e 57 toolchain_make ccache
08874027
MT
58 toolchain_make binutils PASS=1
59 toolchain_make gcc PASS=1
b66871de 60 toolchain_make linux-headers
ca8da28e 61 toolchain_make glibc
be472d5a 62 toolchain_make adjust-toolchain
9bfb004a 63 toolchain_make test-toolchain PASS=1
a041beae 64 toolchain_make zlib
08874027 65 toolchain_make gcc PASS=2
88068980 66 toolchain_make binutils PASS=2
9bfb004a 67 toolchain_make test-toolchain PASS=2
ca8da28e
MT
68 toolchain_make ncurses
69 toolchain_make bash
70 toolchain_make bzip2
71 toolchain_make coreutils
72 toolchain_make diffutils
e3d88b86 73 toolchain_make e2fsprogs
ca8da28e
MT
74 toolchain_make findutils
75 toolchain_make gawk
76 toolchain_make gettext
77 toolchain_make grep
78 toolchain_make gzip
7e71e64b 79 toolchain_make m4
ca8da28e
MT
80 toolchain_make make
81 toolchain_make patch
82 toolchain_make perl
83 toolchain_make sed
84 toolchain_make tar
85 toolchain_make texinfo
08874027
MT
86 toolchain_make flex
87 toolchain_make bc
356857d4 88 toolchain_make util-linux-ng
cf63eea7 89 toolchain_make strip
99bbe115 90 export PATH=$ORG_PATH SKIP_PACKAGE_LIST=$SAVE_SKIP_PACKAGE_LIST
ca8da28e 91}
df5e82b3 92
ca8da28e
MT
93################################################################################
94# This builds the entire stage "base" #
95################################################################################
96base_build() {
97
6e0756c3 98 PATH=${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:$TOOLS_DIR/bin
ca8da28e
MT
99 STAGE_ORDER=02
100 STAGE=base
101
11f0ec61 102 LOGFILE="$BASEDIR/log_${TARGET}/_build.${STAGE_ORDER}-base.log"
ca8da28e 103 export LOGFILE
98be0467 104
4a792716 105 build_spy stage ${STAGE}
98be0467 106
ca8da28e 107 ipfire_make stage2
2b926a51 108 ipfire_make scripts
b66871de 109 ipfire_make linux-headers
ca8da28e
MT
110 ipfire_make man-pages
111 ipfire_make glibc
3888140c 112 ipfire_make adjust-toolchain
6275cc34 113 ipfire_make test-toolchain
8be4c544 114 ipfire_make zlib
ca8da28e
MT
115 ipfire_make binutils
116 ipfire_make gcc
117 ipfire_make berkeley
3888140c
MT
118 ipfire_make sed
119 ipfire_make e2fsprogs
ca8da28e
MT
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
ca8da28e 126 ipfire_make libtool
2431e4ae
MT
127 ipfire_make perl
128 ipfire_make readline
520794d0
MT
129 ipfire_make gettext
130 ipfire_make make
05b75387 131 ipfire_make libidn
8d2b43e8 132 ipfire_make pkg-config
520794d0
MT
133 ipfire_make attr
134 ipfire_make libcap2
774900dc 135 ipfire_make paxctl
6c6da42f
MT
136 ipfire_make autoconf
137 ipfire_make automake
ca8da28e
MT
138 ipfire_make bash
139 ipfire_make bzip2
140 ipfire_make diffutils
d178ccd6 141 ipfire_make eventlog
ca8da28e
MT
142 ipfire_make file
143 ipfire_make findutils
144 ipfire_make flex
88068980 145 ipfire_make gmp
0e61af85 146 ipfire_make grub
ca8da28e 147 ipfire_make gawk
e1a120a3 148 ipfire_make glib2
ca8da28e
MT
149 ipfire_make grep
150 ipfire_make groff
151 ipfire_make gzip
82dfa139
MT
152 ipfire_make initd-tools
153 ipfire_make initscripts
05b75387 154 ipfire_make iputils
ca8da28e
MT
155 ipfire_make iproute2
156 ipfire_make kbd
157 ipfire_make less
0e61af85 158 ipfire_make man-db
0e61af85 159 ipfire_make module-init-tools
88068980 160 ipfire_make mpfr
ca8da28e
MT
161 ipfire_make patch
162 ipfire_make psmisc
ca8da28e 163 ipfire_make shadow
d178ccd6 164 ipfire_make syslog-ng
ca8da28e
MT
165 ipfire_make sysvinit
166 ipfire_make tar
167 ipfire_make texinfo
00d5fc09 168 ipfire_make udev
356857d4 169 ipfire_make util-linux-ng
ca8da28e 170 ipfire_make vim
ca8da28e 171}
df5e82b3 172
ca8da28e
MT
173################################################################################
174# This builds the entire stage "ipfire" #
175################################################################################
176ipfire_build() {
6e0756c3 177 PATH=${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
ca8da28e
MT
178 STAGE_ORDER=03
179 STAGE=ipfire
180
11f0ec61 181 LOGFILE="$BASEDIR/log_${TARGET}/_build.${STAGE_ORDER}-ipfire.log"
ca8da28e 182 export LOGFILE
98be0467 183
4a792716 184 build_spy stage ${STAGE}
98be0467 185
246556fe
MT
186 ### Building the configuration dirs and files
187 #
188 ipfire_make stage3
cc0b96e4
MT
189 ipfire_make lzma
190
b66871de 191 ipfire_make linux
d55b19f6
MT
192 ipfire_make aufs
193
51c2a8ee
MT
194 ### Building some general stuff
195 # STAGE 1
af084e59 196 ipfire_make libdaemon
cb7bc360 197 ipfire_make pcre
51c2a8ee 198 ipfire_make expat
fcf49a01
MT
199 ipfire_make dbus
200 ipfire_make dbus-glib
7def04b8 201 ipfire_make openssl
47815f74 202 ipfire_make perl-xml-parser
af084e59 203 ipfire_make intltool
51c2a8ee 204 ipfire_make python
8a8de99a
MT
205 ipfire_make python-dbus
206 ipfire_make python-urlgrabber
d1a556eb 207 ipfire_make python-IPy
c8787b95
MT
208 ipfire_make libxml2
209 ipfire_make libxslt
51c2a8ee
MT
210 ipfire_make popt
211 ipfire_make libusb
29ca8a35 212 ipfire_make libusb-compat # Can be removed if usbutils supports libusb-1.0
08874027 213 ipfire_make bc
22e99677 214 ipfire_make mingetty
a97daddb 215
246556fe
MT
216 ### Building some network stuff
217 #
218 ipfire_make libpcap
219 ipfire_make linux-atm
220 ipfire_make ppp
221 ipfire_make rp-pppoe
222 ipfire_make dhcp
223 ipfire_make iptables
a97daddb
MT
224 ipfire_make libnfnetlink
225 ipfire_make libnetfilter_queue
226 ipfire_make libnetfilter_conntrack
0ebfc06d 227 ipfire_make libnetfilter_log
31528ce8 228 ipfire_make python-netfilter_conntrack
246556fe 229 ipfire_make dnsmasq
a97daddb 230 ipfire_make l7-protocols
a97daddb
MT
231 ipfire_make bridge-utils
232 ipfire_make vlan
d3a6643e 233 ipfire_make bind
eb3b1821 234 ipfire_make whois
af084e59 235 ipfire_make avahi
246556fe
MT
236
237 ### Building some general stuff
51c2a8ee 238 # STAGE 2
7c8ff98a 239 ipfire_make pth
7dde2e19 240 ipfire_make libassuan
75b808a8 241 ipfire_make libgpg-error
2bb42c71 242 ipfire_make libgcrypt
6b28811f 243 ipfire_make libksba
6dbdc4dc 244 ipfire_make cracklib
fcfe88f5 245 ipfire_make pam PASS=1
51c12741 246 ipfire_make shadow-pam
fcfe88f5 247 ipfire_make pam PASS=2
246556fe
MT
248 ipfire_make slang
249 ipfire_make newt
250 ipfire_make cyrus-sasl
e4330b49
MT
251 ipfire_make openldap
252 ipfire_make pam_ldap
253 ipfire_make nss_ldap
cf63eea7 254 ipfire_make sqlite
246556fe 255 ipfire_make curl
aa9194b6 256 ipfire_make pinentry
5d6d8fb4 257 ipfire_make gnupg2
246556fe 258 ipfire_make sudo
296ce414 259 ipfire_make libjpeg
246556fe
MT
260 ipfire_make libpng
261 ipfire_make libtiff
262 ipfire_make libart
263 ipfire_make freetype
4599805c 264 ipfire_make fontconfig
7bdf5351 265 ipfire_make pixman
46e597a8 266 ipfire_make cairo
9ea352e8 267 ipfire_make pango
246556fe 268 ipfire_make lzo
b8b94b55
MT
269 ipfire_make lsof
270 ipfire_make br2684ctl
271 ipfire_make etherwake
b8b94b55 272 ipfire_make beep
7012b0f9 273 ipfire_make libuser
a3c1fce0 274 ipfire_make directfb
246556fe 275
c33b4fab
MT
276 ### Building vpn stuff
277 #
278 ipfire_make strongswan
28b0784f 279 #ipfire_make openvpn
c33b4fab 280
246556fe
MT
281 ### Building filesystem stuff
282 #
283 ipfire_make reiserfsprogs
284 ipfire_make libaal
285 ipfire_make reiser4progs
a97daddb 286 ipfire_make xfsprogs
90708ef5 287 ipfire_make sysfsutils
3ef36672 288 ipfire_make squashfs
246556fe
MT
289
290 ### Building hardware utils
291 #
292 ipfire_make pciutils
293 ipfire_make usbutils
294 ipfire_make hdparm
b8b94b55 295 ipfire_make smartmontools
90708ef5 296 ipfire_make lm-sensors
47815f74 297 ipfire_make parted
51c2a8ee 298 ipfire_make hal
f790dccc 299 ipfire_make hal-info
246556fe
MT
300
301 ### Building some important tools
302 #
908e611e 303 ipfire_make ulogd2
246556fe
MT
304 ipfire_make fcron
305 ipfire_make which
246556fe
MT
306 ipfire_make screen
307 ipfire_make rrdtool
308 ipfire_make ntp ### Needs config.
309 ipfire_make openssh
b8b94b55
MT
310 ipfire_make ez-ipupdate
311 ipfire_make noip
312 ipfire_make lighttpd
eda77718 313 ipfire_make webinterface
3ef5796a 314 ipfire_make collectd
15643257 315 ipfire_make logrotate
cf63eea7 316 #ipfire_make logwatch
d3a6643e 317 ipfire_make cpio
c856fe42 318 ipfire_make cdrtools
d3e22d25 319 ipfire_make python-parted
d3a6643e 320 ipfire_make memtest86+
cf63eea7 321 #ipfire_make pakfire
acb73b33 322 ipfire_make quagga
cf63eea7 323 #ipfire_make mISDN
cf63eea7 324 #ipfire_make wireless
5da9ffcf
MT
325
326 ipfire_make pyfire
246556fe
MT
327}
328
329################################################################################
330# This builds the entire stage "misc" #
331################################################################################
332misc_build() {
333
6e0756c3 334 PATH=${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
246556fe
MT
335 STAGE_ORDER=04
336 STAGE=misc
337
11f0ec61 338 LOGFILE="$BASEDIR/log_${TARGET}/_build.${STAGE_ORDER}-misc.log"
246556fe 339 export LOGFILE
98be0467 340
4a792716 341 build_spy stage ${STAGE}
98be0467 342
d3a6643e 343 ipfire_make stage4
099d753f 344
4cd91db9 345 ipfire_make miniupnpd
099d753f 346
d3a6643e
MT
347 ### Console tools
348 #
67deab0a 349 ipfire_make mc
d3a6643e
MT
350 #ipfire_make traceroute
351 #ipfire_make nmap
352 #ipfire_make rsync
8d91255f 353 ipfire_make tcpdump
2b69f747
MT
354 ipfire_make htop
355 ipfire_make nano
0bd28dc5
MT
356 ipfire_make squid
357
39c645cb
MT
358 ### Assembler
359 #
360 ipfire_make nasm
39c645cb 361 ipfire_make syslinux
db89f36d 362
d3e22d25
MT
363 ipfire_make bootutils
364 ipfire_make mkinitramfs
a3c1fce0 365 ipfire_make splashy
0bd28dc5 366
d3a6643e 367 #ipfire_make vsftpd
2b69f747 368
d3a6643e
MT
369 ## NTFS
370 #ipfire_make fuse
cf63eea7
MT
371 #ipfire_make ntfs-3g
372 #
373 ## Net tools
374 #ipfire_make bwm-ng
cf63eea7
MT
375 #
376 ## UPNP
377 #ipfire_make libupnp
378 #ipfire_make linux-igd
2b69f747 379
d3a6643e
MT
380 ### These will become addons as usual but will be integrated later
381 #
246556fe
MT
382 #ipfire_make snort
383 #ipfire_make oinkmaster
31c59de6
MT
384 #ipfire_make cups
385 #ipfire_make ghostscript
386 #ipfire_make foomatic
387 #ipfire_make hplip
388 #ipfire_make samba
31c59de6
MT
389 #ipfire_make postfix
390 #ipfire_make fetchmail
391 #ipfire_make cyrus-imapd
392 #ipfire_make clamav
393 #ipfire_make alsa
31c59de6
MT
394 #ipfire_make mpfire
395 #ipfire_make guardian
31c59de6 396 #ipfire_make ipfireseeder
31c59de6 397 #ipfire_make nfs
2b69f747 398
ba810f24
MT
399 ### Debugging
400 #
793c6908 401 ipfire_make pax-utils
b09b6cdd 402 ipfire_make paxtest
d47d185c 403 ipfire_make gdb
ba810f24 404 ipfire_make strace
1c6710d1 405 ipfire_make pychecker
df5e82b3
MT
406}
407
10f9531b 408################################################################################
a57b7dd3 409# This builds the entire stage "installer" #
10f9531b 410################################################################################
a57b7dd3 411installer_build() {
10f9531b 412
d3e22d25 413 PATH=${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
10f9531b 414 STAGE_ORDER=05
a57b7dd3 415 STAGE=installer
10f9531b 416
11f0ec61 417 LOGFILE="$BASEDIR/log_${TARGET}/_build.${STAGE_ORDER}-installer.log"
10f9531b
MT
418 export LOGFILE
419
4a792716 420 build_spy stage ${STAGE}
98be0467 421
10f9531b 422 ipfire_make stage5
a57b7dd3 423 ipfire_make pomona
df5e82b3
MT
424}
425
ca8da28e
MT
426################################################################################
427# This builds the entire stage "packages" #
428################################################################################
429packages_build() {
df5e82b3 430
6e0756c3 431 PATH=${TOOLS_DIR}/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/${MACHINE_REAL}-linux/bin
a57b7dd3 432 STAGE_ORDER=06
ca8da28e 433 STAGE=packages
df5e82b3 434
11f0ec61 435 LOGFILE="$BASEDIR/log_${TARGET}/_build.${STAGE_ORDER}-packages.log"
ca8da28e 436 export LOGFILE
0fbb45e9 437
4a792716 438 build_spy stage ${STAGE}
98be0467 439
10f9531b 440 toolchain_make strip
6d18f164
MT
441
442 # Generate ChangeLog
7755cdbf 443 git_log
10f9531b 444
9cb5b98a
MT
445 # Generate packages list
446 echo -n "Generating packages list"
447 software_list > $BASEDIR/doc/packages-list.txt
448 beautify message DONE
449
283eab18 450 if [ ${EMB} -eq 0 ]; then
485f0a3b 451 ipfire_make initramfs
b36abb20 452 ipfire_make images
32881254 453 ipfire_make pxe
485f0a3b
MT
454 ipfire_make cdrom
455
456 if check_loop; then
f3f8d56b 457 : #ipfire_make usb-key
485f0a3b
MT
458 else
459 echo -n "Can't build usb-key images on this machine"
460 beautify message WARN
461 fi
d5333f84 462 mv $LFS/$IMAGES_DIR/{*.iso,*.tar.gz,*.img.gz} $BASEDIR >>$LOGFILE 2>&1
485f0a3b
MT
463 else
464 if check_loop; then
465 # We put here the code that is done when
466 # we do an embedded build
467 :
468 fi
469 fi
c9673262 470
485f0a3b 471 # Build packages
084ab6f4 472 for i in $(ls -1 $BASEDIR/src/rootfiles/extras); do
2f9658ac
MT
473 package=$(cut -d. -f2 <<< $i)
474 if [ -e $BASEDIR/lfs/$package ]; then
475 echo -n $package
98be0467 476 beautify message SKIP
453b418b 477 else
2f9658ac 478 echo -n $package
453b418b
MT
479 beautify message SKIP
480 fi
fe7fe395 481 done
f90f9467 482
10f9531b
MT
483 # Cleanup
484 stdumount
485 rm -rf $LFS/tmp/*
486
487 cd $PWD
df5e82b3
MT
488}
489
490# See what we're supposed to do
ce85f613 491. $BASEDIR/tools/make-interactive