#!/bin/bash
-USE_LFS_PATCHES=1
-USE_BLFS_PATCHES=1
-USE_HV_PATCHES=1
+source ../functions/main
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../functions-update
-source ../packages-list
+update_packages_init ${*}
-update_packages_init
+# These packages were already downloaded for stage2:
+lpkg 2 ${SHADOW}
+
+# These packages are only for stage3
+fpkg -m gnu ${WHICH}
+fpkg -e "tar.gz" ${BASHCOMPLETION} "http://www.caliban.org/files/bash"
+fpkg -s "software/utils/pciutils" ${PCIUTILS} ${KERNEL_URL}
+fpkg -m sf -e "tar.bz2" ${LIBUSB}
+fpkg -m sf -e "tar.bz2" -s "libusb" ${LIBUSB_COMPAT}
+fpkg -e "tar.xz" -s "linux/utils/usb/usbutils" ${USBUTILS} ${KERNEL_URL}
+fpkg -e "tar.xz" -s "software/network/rfkill" ${RFKILL} ${KERNEL_URL}
+fpkg ${REISERFSPROGS} "ftp://anduin.linuxfromscratch.org/BLFS/svn/r"
+fpkg -e "tar.gz" ${POPT} "http://rpm5.org/files/popt"
+fpkg -m sf ${LIBTIRPC}
+fpkg ${PAM} "https://fedorahosted.org/releases/l/i/linux-pam"
+fpkg -e "tar.gz" -f "${FCRON}.src" ${FCRON} "http://fcron.free.fr/archives"
+fpkg -e "tar.gz" ${OPENSSL} "ftp://ftp.openssl.org/source"
+fpkg -e "tar.gz" ${OPENSSH} "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable"
+fpkg ${LYNX} "ftp://lynx.isc.org/current"
+fpkg -m sf ${EXPAT}
+fpkg -m apa ${APR}
+fpkg -m apa -s apr ${APR_UTIL}
+fpkg -e "tar.gz" ${NEON} "http://www.webdav.org/neon"
+fpkg -m sf -s "tcl" ${TCL}
+fpkg -e "tar.gz" ${SQLITE} "http://www.sqlite.org/2014"
+fpkg ${SUBVERSION} "http://mirror.csclub.uwaterloo.ca/apache/subversion"
+fpkg -e "tar.gz" ${SUDO} "http://www.sudo.ws/sudo/dist"
+fpkg -m sf -e "tar.xz" ${STRACE}
+fpkg -m sf ${PCRE}
+fpkg -m sf ${HTOP}
+
+fpkg -m gnu ${WGET}
+fpkg -e "tar.gz" ${TCPWRAPPERS} "ftp://ftp.porcupine.org/pub/security"
+fpkg -m sf ${RPCBIND}
+fpkg -m sf -s "nfs" ${NFS_UTILS}
+fpkg -m hv -e "tar.gz" ${XINETD}
+fpkg -m sf ${DDCLIENT}
+fpkg -e "tar.gz" ${LIBPCAP} ${TCPDUMP_URL}
+fpkg -e "tar.gz" ${TCPDUMP} ${TCPDUMP_URL}
+fpkg ${NMAP} "http://download.insecure.org/nmap/dist"
+fpkg -e "tar.gz" -v 0 ${BIND} "ftp://ftp.isc.org/isc/bind9"
+fpkg ${IPTABLES} "http://www.netfilter.org/projects/iptables/files"
+fpkg ${CURL} "http://curl.haxx.se/download"
+fpkg -e "tar.gz" ${RSYNC} "http://samba.org/ftp/rsync/src"
+fpkg -m hv ${GETDATE}
+
+fpkg -e "tar.gz" ${LIBARCHIVE} "http://www.libarchive.org/downloads"
+fpkg -e "tar.gz" -s "v" -v 2 ${CMAKE} "http://www.cmake.org/files"
+
+fpkg -e "tar.gz" ${MYSQL} \
+ "http://anduin.linuxfromscratch.org/sources/BLFS/svn/m"
+fpkg -f "zip$(get_pkg_ver ${ZIP} | sed 's!\.!!g')" -s "infozip" \
+ -e "tar.gz" ${ZIP} ${SOURCEFORGE_URL}
+fpkg -f "unzip$(get_pkg_ver ${UNZIP} | sed 's!\.!!g')" -s "infozip" \
+ -e "tar.gz" ${UNZIP} ${SOURCEFORGE_URL}
+fpkg -f "unrarsrc-$(get_pkg_ver ${UNRAR})" -e "tar.gz" ${UNRAR} \
+ "http://www.rarlab.com/rar"
+fpkg -m sf -s "p7zip" -f "${P7ZIP}_src_all" ${P7ZIP}
+fpkg -e "tar.gz" ${PBZIP2} "http://compression.ca/pbzip2"
+fpkg -m gnu ${CPIO}
+fpkg -m gnu ${SCREEN}
+
+fpkg -m gnu ${PARTED}
+fpkg -m sf ${FUSE}
+fpkg -e "tar.gz" ${DOSFSTOOLS} "http://fossies.org/linux/misc"
+
+fpkg -e "tar.xz" -s "software/scm/git" ${GIT} ${KERNEL_URL}
+fpkg -e "tar.gz" -s "software/scm/git" \
+ "git-manpages-$(get_pkg_ver ${GIT})" ${KERNEL_URL}
+
+fpkg -e "tar.gz" ${DIALOG} "ftp://ftp.us.debian.org/debian/pool/main/d/dialog"
-if [ ${#} -eq 1 -a "x${1}" = "xtest" ]; then
- export TEST_INTEGRITY=1
+# Perl modules
+fpkg -m sf -s "pdl" ${PERL_MOD_PDL}
+fpkg -m pm -s "J/JO/JOSEPHW" ${PERL_MOD_XML_WRITER}
+fpkg -m pm -s "C/CH/CHORNY" ${PERL_MOD_XML_PARSER}
+
+# Utilities
+fpkg -m hv ${ACK}
+fpkg -e "tar.gz" ${COLORDIFF} "http://colordiff.sourceforge.net"
+
+fpkg -e "tar.gz" ${INTLTOOL} "http://launchpad.net/intltool/trunk/$(get_pkg_ver ${INTLTOOL})/+download"
+
+fpkg -e "tgz" ${SGML_COMMON} \
+ "http://gd.tuwien.ac.at/hci/kde/devel/docbook/SOURCES"
+fpkg -m hv ${SGML_DTD3}
+fpkg -m hv ${SGML_DTD4}
+fpkg -m sf -s "openjade" ${OPENSP}
+fpkg -m sf ${OPENJADE}
+fpkg -m hv ${SGML_SPM}
+fpkg -m sf -s "docbook" ${DOCBOOK_DSSSL}
+fpkg -e "tar.gz" ${DOCBOOK_UTILS} \
+ "ftp://sources.redhat.com/pub/docbook-tools/new-trials/SOURCES"
+fpkg -e "tar.gz" ${LIBXML2} "http://xmlsoft.org/sources"
+fpkg -e "tar.gz" ${LIBXSLT} "http://xmlsoft.org/sources"
+fpkg -m hv ${DOCBOOK_XML}
+fpkg -m sf -s "docbook" ${DOCBOOK_XSL}
+fpkg -m sf ${XMLTOMAN}
+fpkg ${XMLTO} "https://fedorahosted.org/releases/x/m/xmlto"
+
+fpkg -m sf -e "tar.gz" ${LIBJPEG}
+fpkg -m sf -e "tar.gz" ${LIBOPENJPEG}
+
+fpkg -m sf ${LIBPNG}
+fpkg -m gnome ${LIBART}
+fpkg -m sf ${LIBEXIF}
+fpkg -e "tar.gz" ${FRIBIDI} "http://fribidi.org/download"
+fpkg -m fd -o "icon-theme" ${HICOLOR_ICON_THEME}
+fpkg -e "tar.gz" ${TIFF} "http://download.osgeo.org/libtiff"
+fpkg -m sf ${GIFLIB}
+fpkg -m sf -s "lcms" ${LCMS}
+fpkg -m sf -s "lcms" ${LCMS2}
+fpkg -m sf ${LIBMNG}
+
+fpkg -m sf ${FREETYPE}
+fpkg -e "tar.gz" ${FONTCONFIG} "http://fontconfig.org/release"
+
+# Using HV-repackaged version, because Ckermit decompresses all of its files in
+# the current directory.
+fpkg -m hv ${CKERMIT}
+
+fpkg -m gnu ${LIBTASN1}
+fpkg -m gnu ${LIBUNISTRING}
+fpkg ${BDWGC} "http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source"
+fpkg -m gnu ${GUILE2}
+fpkg -s "libgpg-error" ${LIBGPG_ERROR} ${GNUPG_URL}
+fpkg -s "libgcrypt" ${LIBGCRYPT} ${GNUPG_URL}
+fpkg -e "tar.gz" ${NETTLE} "http://www.lysator.liu.se/~nisse/archive"
+fpkg -e "tar.xz" -s "gnutls/v" -v 2 ${GNUTLS} ${GNUPG_URL}
+
+fpkg -e "tar.gz" ${SASL2} "ftp://ftp.andrew.cmu.edu/pub/cyrus-mail"
+fpkg -e "tgz" ${OPENLDAP} \
+ "ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release"
+fpkg -m hv ${KERBEROS5} # Format bizarre de package...
+
+if [ "x${INST_TYPE}" = "xserver" -o "x${INST_TYPE}" = "xltsp-server" ]; then
+ fpkg -e "tar.gz" -f "sendmail.$(get_pkg_ver ${SENDMAIL})" ${SENDMAIL} \
+ "ftp://ftp.sendmail.org/pub/sendmail"
+else
+ fpkg -m sf -e "tar.bz2" ${MSMTP}
fi
-# These packages were already downloaded for stage1:
-lpkg 1 ${NANO}
+fpkg -m gnu ${PTH}
+fpkg -s "libassuan" ${LIBASSUAN} ${GNUPG_URL}
+fpkg -s "libksba" ${LIBKSBA} ${GNUPG_URL}
+fpkg -s "gnupg" ${GNUPG} ${GNUPG_URL}
+fpkg -m sf ${MUTT}
-# These packages were already downloaded for stage2:
-lpkg 2 ${INETUTILS}
+fpkg -e "tar.gz" ${YASM} "http://www.tortall.net/projects/yasm/releases"
-# These packages are only for stage3
-fpkg_gnu ${WHICH}
-fpkg ${PCIUTILS} ftp://ftp.kernel.org/pub/software/utils/pciutils
-fpkg_sf ${LIBUSB}
-fpkg_sf ${LIBUSB_COMPAT} libusb
-fpkg ${USBUTILS} ${SOURCEFORGE_URL}/project/linux-usb/usbutils
-fpkg ${REISERFSPROGS} http://www.kernel.org/pub/linux/utils/fs/reiserfs
-fpkg ${NET_TOOLS} http://www.tazenda.demon.co.uk/phil/net-tools
-fpkg ${POPT} http://rpm5.org/files/popt
-fpkg ${PAM} http://www.kernel.org/pub/linux/libs/pam/library
-fpkg ${OPENSSL} ftp://ftp.openssl.org/source
-fpkg ${OPENSSL_ROOT_CERTS} http://anduin.linuxfromscratch.org/files/BLFS
-fpkg ${OPENSSH} ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable
-fpkg_sf ${EXPAT}
-fpkg ${APR} http://apache.sunsite.ualberta.ca/apr
-fpkg ${APR_UTIL} http://apache.sunsite.ualberta.ca/apr
-fpkg ${NEON} http://www.webdav.org/neon
-fpkg_sf ${TCL} tcl
-fpkg ${SQLITE} http://www.sqlite.org
-fpkg ${SUBVERSION} http://subversion.tigris.org/downloads
-fpkg ${SUDO} http://www.sudo.ws/sudo/dist
-fpkg_sf ${STRACE}
-fpkg_sf ${PCRE}
-
-fpkg_gnu ${WGET}
-fpkg ${TCPWRAPPERS} ftp://ftp.porcupine.org/pub/security
-fpkg ${PORTMAP} http://neil.brown.name/portmap
-fpkg ${NFS_UTILS} ftp://ftp.kernel.org/pub/linux/utils/nfs
-fpkg_sf ${DDCLIENT}
-fpkg ${LIBPCAP} "http://www.tcpdump.org/release"
-fpkg ${TCPDUMP} "http://www.tcpdump.org/release"
-fpkg ${NMAP} "http://download.insecure.org/nmap/dist"
-fpkg -e "tar.gz" -s "$(get_pkg_ver ${BIND})" ${BIND} "http://gd.tuwien.ac.at/infosys/servers/isc/bind9"
-fpkg ${IPTABLES} "http://www.netfilter.org/projects/iptables/files"
-fpkg ${CURL} "http://curl.haxx.se/download"
-fpkg ${RSYNC} "http://samba.org/ftp/rsync/src"
-
-fpkg ${MYSQL} "ftp://mirror.mcs.anl.gov/pub/mysql/Downloads/MySQL-$(get_pkg_ver_base ${MYSQL})"
-
-fpkg -f "zip$(get_pkg_ver ${ZIP} | sed 's!\.!!g')" -s "infozip" ${ZIP} ${SOURCEFORGE_URL}
-fpkg -f "unzip$(get_pkg_ver ${UNZIP} | sed 's!\.!!g')" -s "infozip" ${UNZIP} ${SOURCEFORGE_URL}
-fpkg -f "unrarsrc-$(get_pkg_ver ${UNRAR})" ${UNRAR} "http://www.rarlab.com/rar"
-fpkg_gnu ${CPIO}
-
-fpkg_gnu ${PARTED}
-fpkg_gnu ${ED}
-fpkg_gnu ${BC}
-fpkg_sf ${FUSE}
-fpkg ${DOSFSTOOLS} "http://www.daniel-baumann.ch/software/dosfstools"
-fpkg ${CVS} "ftp://ftp.gnu.org/non-gnu/cvs/source/stable/$(get_pkg_ver ${CVS})"
-fpkg ${GIT} "http://www.kernel.org/pub/software/scm/git"
-fpkg ${GIT_MANPAGES} "http://www.kernel.org/pub/software/scm/git"
+# Audio
+if [ "x${INST_TYPE}" = "xworkstation" -o "x${INST_TYPE}" = "xltsp-server" ]; then
+ if [ "x${SOUND_CARD}" = "xyes" ]; then
-# Perl modules
-fpkg_sf ${PERL_MOD_PDL} pdl
-fpkg ${PERL_MOD_XML_WRITER} "http://www.cpan.org/modules/by-module/XML"
-fpkg ${PERL_MOD_XML_PARSER} "http://www.cpan.org/modules/by-module/XML"
-
-fpkg_gnome ${INTLTOOL}
-fpkg ${PYTHON} "http://www.python.org/ftp/python/$(get_pkg_ver ${PYTHON})"
-
-fpkg -e "tgz" ${SGML_COMMON} "http://gd.tuwien.ac.at/hci/kde/devel/docbook/SOURCES"
-fpkg_hv ${SGML_DTD3}
-fpkg_hv ${SGML_DTD4}
-fpkg_sf ${OPENSP} "openjade"
-fpkg_sf ${OPENJADE}
-fpkg_hv ${SGML_SPM} # For re-generating fontconfig documentation.
-fpkg_sf ${DOCBOOK_DSSSL} "docbook"
-fpkg ${DOCBOOK_UTILS} "http://sources-redhat.mirrors.redwire.net/docbook-tools/new-trials/SOURCES"
-fpkg ${LIBXML2} "http://xmlsoft.org/sources"
-fpkg ${LIBXSLT} "http://xmlsoft.org/sources"
-fpkg_hv ${DOCBOOK_XML}
-fpkg_sf ${DOCBOOK_XSL} "docbook"
-fpkg_sf ${XMLTOMAN}
-fpkg ${XMLTO} "https://fedorahosted.org/releases/x/m/xmlto"
-
-fpkg -f "jpegsrc.v$(get_pkg_ver ${LIBJPEG})" ${LIBJPEG} "http://www.ijg.org/files"
-fpkg -f "openjpeg_v$(get_pkg_ver ${LIBOPENJPEG} | sed 's!\.!_!g')" ${LIBOPENJPEG} "http://www.openjpeg.org"
-fpkg_sf ${LIBPNG}
-fpkg_gnome ${LIBART}
-fpkg_sf ${LIBEXIF}
-fpkg ${FRIBIDI} "http://fribidi.org/download"
-fpkg ${HICOLOR_ICON_THEME} "http://icon-theme.freedesktop.org/releases"
-fpkg ${TIFF} "http://libtiff.maptools.org/dl"
-fpkg_sf ${GIFLIB}
-fpkg ${LCMS} "http://www.littlecms.com"
-fpkg_sf ${LIBMNG}
-
-fpkg_sf ${FREETYPE}
-fpkg ${FONTCONFIG} "http://fontconfig.org/release"
+ fpkg -v 0 ${NASM} "http://www.nasm.us/pub/nasm/releasebuilds"
+ fpkg ${ALSA_LIB} "ftp://ftp.alsa-project.org/pub/lib"
+ fpkg ${ALSA_UTILS} "ftp://ftp.alsa-project.org/pub/utils"
+
+ fpkg -e "tgz" -f "${CDPARANOIA}.src" ${CDPARANOIA} "http://downloads.xiph.org/releases/cdparanoia"
+
+ fpkg -e "tgz" ${LADSPA} "http://www.ladspa.org/download"
+
+ fpkg -e "tar.gz" ${LIBOGG} "http://downloads.xiph.org/releases/ogg"
+ fpkg -e "tar.gz" ${LIBVORBIS} \
+ "http://downloads.xiph.org/releases/vorbis"
+ fpkg -e "zip" ${VORBISGAIN} "http://sjeng.org/ftp/vorbis"
+ fpkg -e "tar.xz" ${FLAC} "http://downloads.xiph.org/releases/flac"
+
+ fpkg -e "tar.gz" ${LIBSNDFILE} "http://www.mega-nerd.com/libsndfile/files"
+ fpkg -e "tar.gz" ${LIBSAMPLERATE} "http://www.mega-nerd.com/SRC"
+
+ fpkg -m sf ${LAME}
+ fpkg -m hv ${LIBA52}
+ fpkg -m hv ${LIBID3TAG}
+ fpkg -e "tar.gz" ${LIBMAD} "ftp://ftp.mars.org/pub/mpeg"
+
+ fpkg -m sf ${LIBFAAC}
+ fpkg ${LIBFAAD2} "http://downloads.sourceforge.net/faac"
+ fpkg ${LIBTHEORA} "http://downloads.xiph.org/releases/theora"
+ fpkg ${XVIDCORE} "http://downloads.xvid.org/downloads"
+ fpkg -f "${LIBX264}-stable" ${LIBX264} \
+ "ftp://ftp.videolan.org/pub/videolan/x264/snapshots"
+
+ fpkg -e "tar.gz" ${AUDIOFILE} "http://www.68k.org/~michael/audiofile"
+ fpkg -e "tgz" ${PORTAUDIO} "http://www.portaudio.com/archives"
+
+ fpkg -e "tar.gz" ${VAMP} "http://code.soundsoftware.ac.uk/attachments/download/224"
+ fpkg -e "tar.gz" ${FFTW} "http://www.fftw.org"
+ fpkg ${RUBBERBAND} \
+ "http://code.breakfastquay.com/attachments/download/23"
+
+ fpkg -e "tar.gz" ${SPEEX} "http://downloads.xiph.org/releases/speex"
+ fpkg -e "tar.gz" ${JACK} "http://jackaudio.org/downloads"
+ fpkg ${ALSA_PLUGINS} "ftp://ftp.alsa-project.org/pub/plugins"
+ fpkg -e "tar.gz" ${VORBIS_TOOLS} "http://downloads.xiph.org/releases/vorbis"
+
+ fpkg ${MOC} "ftp://ftp.daper.net/pub/soft/moc/stable"
+ fi
+fi
exit $?