-#!/bin/sh
-
-# Must be defined before sourcing other files.
-LFS_STAGE="stage4"
-
-# Reading system configuration informations, functions and package versions.
-source ../functions
-source ../functions-update
-source ../packages-list
-
-update_packages_init
-
-# Begin
-
-# Gnome 2 core packages
-fpkg_gnome ${ORBIT2}
-fpkg_gnome ${LIBBONOBO}
-fpkg_gnome ${GCONF}
-fpkg_gnome ${GNOME_MIME_DATA}
-fpkg_gnome ${GNOME_VFS}
-fpkg_gnome ${GNOME_VFS_MONIKERS}
-fpkg_gnome ${LIBGNOME}
-fpkg_gnome ${LIBGNOMECANVAS}
-fpkg_gnome ${LIBBONOBOUI}
-fpkg_gnome ${GNOME_ICON_THEME}
-fpkg_gnu ${LIBTASN1}
-fpkg_gnome ${GNOME_KEYRING}
-fpkg_gnome ${LIBGNOMEUI}
-fpkg_gnome ${GNOME_THEMES}
-fpkg_gnome ${SCROLLKEEPER}
-fpkg_gnome ${GNOME_DOC_UTILS}
-fpkg_gnome ${GNOME_DESKTOP}
-fpkg_gnome ${GNOME_BACKGROUNDS}
-fpkg_gnome ${GNOME_MENUS}
-fpkg_gnome ${GNOME_PANEL}
-fpkg_gnome ${GNOME_SESSION}
-fpkg_gnome ${VTE}
-fpkg_gnome ${GNOME_TERMINAL}
-fpkg_gnome ${LIBGTOP}
-fpkg_gnome ${LIBGNOMEKBD}
-fpkg_gnome ${LIBGAIL_GNOME}
-fpkg_gnome ${GNOME_APPLETS}
-fpkg_gnome ${EEL}
-fpkg_gnome ${NAUTILUS}
-fpkg_gnome ${YELP}
-fpkg_gnome ${METACITY}
-fpkg_gnome ${GNOME_CONTROL_CENTER}
-fpkg_gnome ${GNOME_USER_DOCS}
-
-# Gnome 2 additional packages - Libraries
-fpkg_gnome ${LIBGNOMECUPS}
-fpkg_gnome ${LIBGNOMEPRINT}
-fpkg_gnome ${LIBGNOMEPRINTUI}
-fpkg_gnome ${GTKHTML}
-fpkg_gnome ${EVOLUTION_DATA_SERVER}
-fpkg_gnome ${GTKSOURCEVIEW}
-fpkg_gnome ${SYSTEM_TOOLS_BACKENDS}
-fpkg_gnome ${GNOME_AUDIO}
-
-# Gnome 2 additional packages - Utilities
-fpkg_gnome ${GEDIT}
-fpkg_gnome ${EOG}
-fpkg_gnome ${EVINCE}
-fpkg_gnome ${FILE_ROLLER}
-fpkg_gnome ${GCONF_EDITOR}
-fpkg_gnome ${GNOME_UTILS}
-fpkg_gnome ${GNOME_SYSTEM_MONITOR}
-fpkg_gnome ${NAUTILUS_CD_BURNER}
-fpkg_gnome ${GSTREAMER}
-fpkg_gnome ${GST_PLUGINS_BASE}
-fpkg ${GST_PLUGINS_GOOD} "http://gstreamer.freedesktop.org/src/gst-plugins-good"
-fpkg ${GST_PLUGINS_BAD} "http://gstreamer.freedesktop.org/src/gst-plugins-bad"
-fpkg ${GST_PLUGINS_UGLY} "http://gstreamer.freedesktop.org/src/gst-plugins-ugly"
-fpkg ${GST_FFMPEG} "http://gstreamer.freedesktop.org/src/gst-ffmpeg"
-fpkg_gnome ${GNOME_MEDIA}
-fpkg_gnome ${GNOME_NETSTATUS}
-fpkg_gnome ${GCALCTOOL}
-fpkg_gnome ${GUCHARMAP}
-fpkg_gnome ${ZENITY}
-
-fpkg_gnome ${GNOME_KEYRING_MANAGER}
-fpkg_gnome ${GNOME_VOLUME_MANAGER}
-fpkg ${LIBMUSICBRAINZ} "http://ftp.musicbrainz.org/pub/musicbrainz"
-fpkg_gnome ${GNOME_SOUND_JUICER}
-fpkg ${ISO_CODES} "ftp://pkg-isocodes.alioth.debian.org/pub/pkg-isocodes"
-
-fpkg_gnome ${GNOME_TOTEM}
-fpkg_gnome ${GDM}
-fpkg ${LIBNOTIFY} "http://www.galago-project.org/files/releases/source/libnotify"
-fpkg ${GNOME_MOUNT} "http://people.freedesktop.org/~david/dist"
-
-fpkg_gnome ${RHYTHMBOX}
-
-fpkg_gnome ${LIBGSF}
-fpkg_gnome ${GOFFICE}
-fpkg_gnome ${GNUMERIC}
-fpkg_sf ${WV}
-fpkg ${ABIWORD} "http://www.abisource.com/downloads/abiword/$(get_pkg_ver ${ABIWORD})/source"
-
-fpkg_gnome ${EVOLUTION_EXCHANGE}
-fpkg_gnome ${EVOLUTION}
-
-fpkg ${LIBGPG_ERROR} "http://ftp.gnupg.org/gcrypt/libgpg-error"
-fpkg ${LIBGCRYPT} "http://ftp.gnupg.org/gcrypt/libgcrypt"
-fpkg ${GNUTLS} "http://ftp.gnupg.org/gcrypt/gnutls"
-fpkg_sf ${PIDGIN}
-
-# Return last error
+#!/bin/bash
+
+USE_LFS_PATCHES=1
+USE_BLFS_PATCHES=1
+USE_HV_PATCHES=1
+
+source ../functions/main
+
+update_packages_init ${*}
+
+# These packages were already downloaded in previous stages:
+lpkg 3 ${SUBVERSION}
+
+fpkg -m gnu ${HELP2MAN}
+fpkg -m gnu ${GSL}
+fpkg -s "$(get_pkg_ver ${CUPS})" -f "${CUPS}-source" ${CUPS} \
+ "http://ftp.easysw.com/pub/cups"
+fpkg -e "tar.gz" -f "$(get_pkg_name ${CUPS_PDF})_$(get_pkg_ver ${CUPS_PDF})" \
+ ${CUPS_PDF} "http://www.cups-pdf.de/src"
+fpkg -m sf -e "tar.bz2" ${SPLIX}
+fpkg -e "tar.gz" ${FOOMATIC_FILTERS} "http://www.openprinting.org/download/foomatic/"
+fpkg -e "tar.gz" ${FOO2ZJS} "http://foo2zjs.rkkda.com"
+
+fpkg -m gnome ${GLIB_NETWORKING}
+fpkg -e "tgz" ${ICU} "http://download.icu-project.org/files/icu4c/49.1.2"
+
+fpkg -m gnome ${LIBSIGCPP}
+fpkg -e zip ${JASPER} "http://www.ece.uvic.ca/~mdadams/jasper/software"
+fpkg -m gnome ${GLIBMM}
+fpkg -e "tar.gz" ${CAIRO} ${CAIRO_URL}
+fpkg -e "tar.gz" ${CAIROMM} ${CAIRO_URL}
+fpkg -m gnome ${PANGO}
+fpkg -m gnome ${PANGOMM}
+fpkg -m gnome ${ATK}
+fpkg -m gnome ${GDK_PIXBUF}
+fpkg -m gnome ${GTK}
+fpkg -m gnome ${ATKMM}
+fpkg -m gnome ${GTKMM}
+fpkg -m gnome ${GTK_ENGINES}
+fpkg -m gnome ${PYGOBJECT}
+fpkg -e "tar.bz2" ${PYCAIRO} ${CAIRO_URL}
+fpkg -m gnome ${PYGTK}
+
+fpkg -m gnu ${EMACS}
+fpkg -m hv ${MMM_MODE}
+fpkg -e "tar.gz" ${HVCLOCK} "http://www.hugovil.com/repository/hvclock"
+fpkg -e "tar.gz" ${WMNOTIFY} "http://www.hugovil.com/repository/wmnotify"
+
+fpkg -e "tar.xz" ${DESKTOP_FILE_UTILS} \
+ "http://freedesktop.org/software/desktop-file-utils/releases"
+fpkg -e "tar.xz" ${SHARED_MIME_INFO} "http://people.freedesktop.org/~hadess"
+fpkg -e "tar.gz" ${STARTUP_NOTIFICATION} "http://www.freedesktop.org/software/startup-notification/releases"
+fpkg -m gnome ${LIBWNCK}
+fpkg -e "tar.xz" ${ISO_CODES} "http://pkg-isocodes.alioth.debian.org/downloads"
+fpkg -m gnome ${LIBXKLAVIER}
+fpkg -m gnome ${LIBGLADE}
+fpkg -m gnome ${GCONF}
+fpkg -m gnome ${GNOME_KEYRING}
+fpkg -m gnome ${LIBSOUP}
+
+fpkg -e "tar.bz2" -m sf ${GPARTED}
+fpkg -m sf ${GHOSTSCRIPT}
+fpkg -m sf -s "ghostscript" ${GHOSTSCRIPT_FONTS_STD}
+fpkg -m sf -s "ghostscript" ${GHOSTSCRIPT_FONTS_OTHER}
+fpkg -e "tar.gz" ${LIBSPECTRE} "http://libspectre.freedesktop.org/releases"
+fpkg -e "tar.xz" ${IMAGE_MAGICK} "ftp://ftp.imagemagick.org/pub/ImageMagick"
+fpkg -e "tar.gz" ${VIEWNIOR} "http://cloud.github.com/downloads/xsisqox/Viewnior"
+fpkg -m fd -s "none" ${POPPLER}
+fpkg -m gnome ${LIBCROCO}
+fpkg -m gnome ${LIBRSVG}
+fpkg ${BABL} "ftp://ftp.gtk.org/pub/babl/$(get_pkg_ver2 ${BABL})"
+fpkg ${GEGL} "ftp://ftp.gimp.org/pub/gegl/$(get_pkg_ver2 ${GEGL})"
+fpkg ${GIMP} "ftp://ftp.gimp.org/pub/gimp/v$(get_pkg_ver2 ${GIMP})"
+fpkg -m sf -s "gimp-print" -e "tar.bz2" ${GUTENPRINT}
+fpkg -m sf -s "boost" ${BOOST}
+fpkg -m sf ${INKSCAPE}
+
+fpkg ${CDRTOOLS} "ftp://ftp.berlios.de/pub/cdrecord"
+fpkg -e "tar.gz" ${DVDRWTOOLS} \
+ "http://fy.chalmers.se/~appro/linux/DVD+RW/tools"
+fpkg -s "$(get_pkg_ver ${LIBDVDCSS})" ${LIBDVDCSS} \
+ "http://www.videolan.org/pub/libdvdcss"
+fpkg -e "tar.bz2" ${LIBDVDREAD} "http://dvdnav.mplayerhq.hu/releases"
+fpkg -e "tar.gz" ${DVDFS} "http://jspenguin.org:81/dvdfs"
+fpkg -e "tar.bz2" ${VOBCOPY} "http://vobcopy.org/download"
+
+fpkg -e "tar.xz" ${TEXLIVE} "ftp://tug.org/texlive/historic/2012"
+fpkg -e "tar.xz" ${TEXLIVE_TEXMF} "ftp://tug.org/texlive/historic/2012"
+
+fpkg -e "tar.gz" ${SANE_BACKENDS} \
+ "ftp://ftp2.sane-project.org/pub/sane/${SANE_BACKENDS}"
+fpkg -e "tar.gz" ${XSANE} "ftp://ftp2.sane-project.org/pub/sane/xsane"
+
+fpkg ${ICON_NAMING_UTILS} "http://tango.freedesktop.org/releases"
+fpkg ${TANGO_ICON_THEME} "http://tango.freedesktop.org/releases"
+fpkg -e "tar.gz" ${TANGO_ICON_THEME_EXTRAS} \
+ "http://tango.freedesktop.org/releases"
+fpkg -m gnome ${GNOME_ICON_THEME}
+
+fpkg -m gnome ${EVINCE}
+
+fpkg -e "tar.gz" ${LIBOIL} "http://liboil.freedesktop.org/download"
+fpkg -m gnome ${VTE}
+fpkg -m sf ${GRIP}
+fpkg -m sf -e "tar.bz2" ${CDRDAO}
+fpkg -m sf -e "tar.bz2" ${EASYTAG}
+fpkg -m sf -e "tar.bz2" -s "fontforge/fontforge-source" ${FONTFORGE}
+fpkg -m gnu ${GUILE1}
+fpkg -e "tar.gz" ${LILYPOND} \
+ "http://lilypond.org/download/sources/v$(get_pkg_ver2 ${LILYPOND})"
+fpkg -m hv ${CHORDPACK}
+fpkg -m hv ${GUITARTEX}
+
+fpkg ${FFMPEG} "http://www.ffmpeg.org/releases"
+fpkg -m gnome ${GSTREAMER}
+fpkg -m gnome ${GST_PLUGINS_BASE}
+fpkg -m fd -o "gstreamer" -s "src/gst-plugins-good" ${GST_PLUGINS_GOOD}
+fpkg -m fd -o "gstreamer" -s "src/gst-plugins-bad" ${GST_PLUGINS_BAD}
+fpkg -m fd -o "gstreamer" -s "src/gst-plugins-ugly" ${GST_PLUGINS_UGLY}
+fpkg -m fd -o "gstreamer" -s "src/gst-ffmpeg" ${GST_FFMPEG}
+fpkg -m gnome ${GNOME_MEDIA}
+
+fpkg -m sf -s "wxwindows" ${WXGTK}
+fpkg ${AUDACITY} "http://audacity.googlecode.com/files"
+
+fpkg ${SYLPHEED} \
+ "http://sylpheed.sraoss.jp/sylpheed/v$(get_pkg_ver2 ${SYLPHEED})"
+
+fpkg -m gnome ${LIBNOTIFY}
+
+fpkg ${LIBVPX} "http://webm.googlecode.com/files"
+
+fpkg -e "tar.xz" ${WEBKIT} "http://webkitgtk.org/releases"
+fpkg -m gnome ${VALA}
+fpkg ${MIDORI} "http://archive.xfce.org/src/apps/midori/$(get_pkg_ver2 ${MIDORI})"
+
+fpkg -f "${FIREFOX}.source" ${FIREFOX} \
+ "http://releases.mozilla.org/pub/mozilla.org/firefox/releases/$(get_pkg_ver ${FIREFOX})/source"
+
+fpkg -e "tar.gz" ${QT} "http://get.qt.nokia.com/qt/source"
+fpkg -e "tar.gz" ${LUA} "http://www.lua.org/ftp"
+fpkg -e "tar.xz" -m sf ${VLC}
+fpkg -e "tar.gz" ${SDL} "http://www.libsdl.org/release"
+fpkg -e "tar.gz" ${AGG} "http://www.antigrain.com"
+fpkg ${GNASH} "http://ftp.gnu.org/pub/gnu/gnash/$(get_pkg_ver ${GNASH})"
+
+fpkg -e "tar.gz" ${LIBSPF2} "http://libspf2.org/spf"
+fpkg -e "tgz" ${MILTER_GREYLIST} "ftp://ftp.espci.fr/pub/milter-greylist"
+fpkg -m sf -s "smfs" ${MILTER_SPF}
+fpkg -e "tar.gz" ${PROCMAIL} "http://www.ring.gr.jp/archives/net/mail/procmail"
+fpkg ${FETCHMAIL} "http://download.berlios.de/fetchmail"
+fpkg -m sf ${CLAMAV}
+
+fpkg -m pm -s "G/GR/GRANTM" ${PERL_MOD_XML_SIMPLE}
+fpkg -m pm -s "J/JT/JTBRAUN" ${PERL_MOD_PARSE_REDESCENT}
+fpkg -m pm -s "P/PE/PETDANCE" ${PERL_MOD_HTML_TAGSET}
+fpkg -m pm -s "S/SI/SIMKIN" ${PERL_MOD_APACHE_LOGGED_AUTH_DBI}
+fpkg -m pm -s "G/GA/GAAS" ${PERL_MOD_HTML_PARSER}
+fpkg -m pm -s "G/GA/GAAS" ${PERL_MOD_DIGEST_SHA1}
+fpkg -m pm -s "G/GA/GAAS" ${PERL_MOD_URI}
+fpkg -m pm -s "G/GA/GAAS" ${PERL_MOD_LWP}
+fpkg -m pm -s "O/OL/OLAF" ${PERL_MOD_NET_DNS}
+fpkg -m pm -s "K/KM/KMCGRAIL" ${SPAMASSASSIN}
+
+fpkg -e "tar.gz" ${UW_IMAP} "ftp://ftp.cac.washington.edu/imap"
+
+fpkg -m apa ${HTTPD}
+fpkg -e "tar.bz2" ${LIGHTTPD} "http://download.lighttpd.net/lighttpd/releases-$(get_pkg_ver2 ${LIGHTTPD}).x"
+
+fpkg -e "tar.gz" ${SAMBA} "ftp://ftp.samba.org/pub/samba/old-versions"
+
+fpkg ${PHP} "http://us2.php.net/distributions"
+
+fpkg -e "tar.gz" ${MERCURIAL} "http://mercurial.selenic.com/release"
+
+fpkg -m gnu ${INDENT}
+
+fpkg -e "tgz" ${LTSP_UTILS} "http://ltsp.mirrors.tds.net/pub/ltsp/utils"
+fpkg -s "software/network/tftp/tftp-hpa" ${TFTP_HPA} ${KERNEL_URL}
+fpkg -m sf ${KVM}
+fpkg -m sf -s "bridge" ${BRIDGE_UTILS}
+fpkg -m sf ${TUNCTL}
+
+fpkg -e "tar.gz" ${LIBEVENT} "https://github.com/downloads/libevent/libevent"
+fpkg ${TRANSMISSION} "http://mirrors.m0k.org/transmission/files"
+
+fpkg -e "tar.gz" ${LIBGAMIN} "http://www.gnome.org/~veillard/gamin/sources"
+fpkg -m sf -s "lxde" ${MENU_CACHE}
+
+fpkg -m gnome ${GVFS}
+
+fpkg -m sf -e "tar.bz2" ${XARCHIVER}
+fpkg -m sf -s "pcmanfm" -e "tar.gz" ${LIBFM}
+fpkg -m sf ${PCMANFM}
+
+fpkg -m gnome ${LIBGSF}
+fpkg -m gnome ${GOFFICE}
+fpkg -m gnome ${GNUMERIC}
+fpkg -e "tar.gz" ${WV} "${ABIWORD_URL}/wv/$(get_pkg_ver ${WV})"
+fpkg -e "tar.gz" ${ABIWORD} \
+ "${ABIWORD_URL}/abiword/$(get_pkg_ver ${ABIWORD})/source"
+
+#fpkg_mis ${SPLINT} "${SPLINT}.src" "http://splint.org/downloads"
+
+#GEDA_BASE_URL=http://geda.seul.org/release/v$(get_pkg_ver2 ${LIBGEDA})/$(get_pkg_ver ${LIBGEDA})
+#fpkg ${LIBGEDA} ${GEDA_BASE_URL}
+#fpkg ${GEDA_SYMBOLS} ${GEDA_BASE_URL}
+#fpkg ${GEDA_GSCHEM} ${GEDA_BASE_URL}
+#fpkg ${GEDA_GNETLIST} ${GEDA_BASE_URL}
+#fpkg ${GEDA_SYMCHECK} ${GEDA_BASE_URL}
+#fpkg ${GEDA_GATTRIB} ${GEDA_BASE_URL}
+