-Amélioré fonctions de download des packages
authorgobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Thu, 10 Mar 2011 03:02:11 +0000 (03:02 +0000)
committergobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Thu, 10 Mar 2011 03:02:11 +0000 (03:02 +0000)
-Ajout wireless-tools au stage2

101 files changed:
config/dependencies
config/packages-list
config/sysinfos.amd64
config/sysinfos.default
config/urls [new file with mode: 0644]
functions-fpkg [deleted file]
functions-ipkg [deleted file]
functions/fpkg [new file with mode: 0644]
functions/gztobz2 [new file with mode: 0644]
functions/ipkg [new file with mode: 0644]
functions/main [new file with mode: 0644]
main [deleted file]
stage0/hv-install-1
stage0/hv-install-2
stage0/packages-update
stage0/pre-install
stage1/create-config-files
stage1/create-directories
stage1/create-groups
stage1/create-logfiles
stage1/create-symlinks
stage1/create-users
stage1/hv-install-1
stage1/hv-install-2
stage1/install-bootscripts
stage1/packages-update
stage1/post-install
stage1/pre-install
stage2/compressdoc
stage2/create-config-files
stage2/hv-install-1
stage2/hv-install-2
stage2/install-bootscripts
stage2/install-hv-utilities
stage2/misc/wireless [new file with mode: 0755]
stage2/packages-update
stage2/pkg/wireless-tools [new file with mode: 0644]
stage2/pkg/wpa_supplicant [new file with mode: 0644]
stage2/post-install
stage2/pre-install
stage2/stripping
stage2/toolchain-adjust
stage2/toolchain-test
stage3/hv-install-1
stage3/packages-update
stage4/configure-fonts
stage4/configure-xorg
stage4/hv-install-1
stage4/packages-update
stage5/hv-install-1
stage5/packages-update
stage5/pkg/agg
stage5/pkg/alsa-lib
stage5/pkg/alsa-utils
stage5/pkg/apache
stage5/pkg/boost
stage5/pkg/cdrtools
stage5/pkg/ckermit
stage5/pkg/cups
stage5/pkg/cups-pdf
stage5/pkg/dvd-rw-tools
stage5/pkg/dvdfs
stage5/pkg/emacs
stage5/pkg/firefox
stage5/pkg/gconf
stage5/pkg/ghostscript
stage5/pkg/gnash
stage5/pkg/gnome
stage5/pkg/gnome-config
stage5/pkg/gnome-nobuild
stage5/pkg/iso-codes
stage5/pkg/jadetex
stage5/pkg/java [deleted file]
stage5/pkg/krb5
stage5/pkg/libid3tag
stage5/pkg/libmad
stage5/pkg/ltsp
stage5/pkg/ltsp-utils
stage5/pkg/milter-greylist
stage5/pkg/milter-spf
stage5/pkg/nss
stage5/pkg/openldap
stage5/pkg/php
stage5/pkg/pm [deleted file]
stage5/pkg/procmail
stage5/pkg/pulseaudio
stage5/pkg/samba
stage5/pkg/sane-backends
stage5/pkg/sasl2
stage5/pkg/sendmail
stage5/pkg/spamassassin
stage5/pkg/splix
stage5/pkg/squirrelmail
stage5/pkg/tetex
stage5/pkg/tftp-hpa
stage5/pkg/uml-utilities
stage5/pkg/uw-imap
stage5/pkg/xsane
stage5/pkg/xvidcore
stage5/post-install
stage6/packages-update

index b207109..728d50b 100644 (file)
@@ -112,3 +112,6 @@ ${GCONF}: ${ORBIT2} ${POLKIT} ${GTK}
 ${LIBPROXY}: ${GCONF}
 ${GNOME_KEYRING}: ${GCONF} ${LIBTASN1} ${LIBGCRYPT}
 ${LIBSOUP}: ${GNUTLS} ${GNOME_KEYRING} ${LIBPROXY} ${SQLITE} ${LIBXML2}
+
+${LTSP}: ${PERL_MOD_LWP}
+${PERL_MOD_LWP}: ${PERL_MOD_URI}
index 7a198cb..1e72de8 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # This file contains the name and version of all packages,
 # as well the corresponding patches, if needed.
@@ -9,13 +9,13 @@ ALSA_DRIVER="alsa-driver-1.0.21"
 ALSA_LIB="alsa-lib-1.0.21"
 ALSA_PLUGINS="alsa-plugins-1.0.21"
 ALSA_UTILS="alsa-utils-1.0.21"
-ALSA_OSS="alsa-oss-1.0.21"
+ALSA_OSS="alsa-oss-1.0.17"
 
 APR="apr-1.3.9"
 APR_UTIL="apr-util-1.3.9"
 AVR_GDB="gdb-6.4"
 AVRDUDE="avrdude-5.1"
-ATK="atk-1.28.0"
+ATK="atk-1.30.0"
 AUDIOFILE="audiofile-0.2.6"
 AUTOCONF="autoconf-2.67"
 AUTOMAKE="automake-1.11.1"
@@ -41,7 +41,7 @@ CLOOG_PPL="cloog-ppl-0.15.10"
 CONSOLEKIT="ConsoleKit-0.4.1"
 COREUTILS="coreutils-8.5"
 CPIO="cpio-2.11"
-CUPS="cups-1.4.2"
+CUPS="cups-1.4.5"
 CUPS_PDF="cups-pdf-2.5.0"
 CURL="curl-7.19.7"
 CVS="cvs-1.11.23"
@@ -50,7 +50,7 @@ DBUS="dbus-1.2.24"
 DBUS_GLIB="dbus-glib-0.88"
 DDCLIENT="ddclient-3.6.7"
 DEJAGNU="dejagnu-1.4.4"
-DESKTOP_FILE_UTILS="desktop-file-utils-0.15"
+DESKTOP_FILE_UTILS="desktop-file-utils-0.17"
 DHCP="dhcp-3.0.6"
 DIFFUTILS="diffutils-3.0"
 DOCBOOK_DSSSL_VER="1.79"
@@ -72,14 +72,14 @@ EGGDBUS="eggdbus-0.6"
 EGLIBC="eglibc-2.12-20100725-r11059"
 EGLIBC_PORTS="eglibc-ports-2.12-20100725-r11059"
 UCLIBC="uClibc-0.9.30.1"
-EMACS="emacs-23.1"
+EMACS="emacs-23.2"
 ESOUND="esound-0.2.37"
 EXPAT="expat-2.0.1"
 
 FCRON="fcron-3.0.6"
 FETCHMAIL="fetchmail-6.3.12"
 FFMPEG="ffmpeg-svn-20539"
-FIREFOX="firefox-3.6.source"
+FIREFOX="firefox-3.6.13"
 FILE_PKG="file-5.04"
 FINDUTILS="findutils-4.4.2"
 FLAC="flac-1.2.1"
@@ -106,30 +106,30 @@ GEDA_GATTRIB="geda-gattrib-1.2.0"
 GEGL="gegl-0.1.2"
 GETDATE="getdate_rfc868-1.2"
 GETTEXT="gettext-0.18.1.1"
-GHOSTSCRIPT="ghostscript-8.71"
+GHOSTSCRIPT="ghostscript-9.00"
 GHOSTSCRIPT_FONTS_STD="ghostscript-fonts-std-8.11"
 GHOSTSCRIPT_FONTS_OTHER="ghostscript-fonts-other-6.0"
 GNASH=" gnash-0.8.5"
 GIMP="gimp-2.6.8"
 GUTENPRINT="gutenprint-5.2.5"
 GLIB="glib-2.24.2"
-GLIBMM="glibmm-2.22.1"
+GLIBMM="glibmm-2.24.2"
 GLITZ="glitz-0.5.6"
 GPERF="gperf-3.0.4"
 
 # GNOME2 core packages
 GNOME2_VER="gnome-2.28.1"
 GNOME2_PREFIX="/opt/${GNOME2_VER}"
-ORBIT2="ORBit2-2.14.17"
+ORBIT2="ORBit2-2.14.19"
 LIBBONOBO="libbonobo-2.24.2"
-GCONF="GConf-2.28.0"
+GCONF="GConf-2.28.1"
 GNOME_MIME_DATA="gnome-mime-data-2.18.0"
 GNOME_VFS="gnome-vfs-2.24.2"
 GNOME_VFS_MONIKERS="gnome-vfs-monikers-2.15.3"
 LIBGNOME="libgnome-2.28.0"
 LIBGNOMECANVAS="libgnomecanvas-2.26.0"
 LIBBONOBOUI="libbonoboui-2.24.2"
-GNOME_KEYRING="gnome-keyring-2.28.1"
+GNOME_KEYRING="gnome-keyring-2.30.1"
 ICON_NAMING_UTILS="icon-naming-utils-0.8.90"
 GNOME_ICON_THEME="gnome-icon-theme-2.28.0"
 LIBGNOMEUI="libgnomeui-2.24.2"
@@ -187,7 +187,7 @@ GNOME_TOTEM="totem-2.28.1"
 GDM="gdm-2.28.1"
 GMP="gmp-5.0.1"
 GNOME_MOUNT="gnome-mount-0.6"
-GNUTLS="gnutls-2.8.5"
+GNUTLS="gnutls-2.10.2"
 GOBJECT_INSTROSPECTION="gobject-introspection-0.6.14"
 GOFFICE="goffice-0.2.2"
 GNUMERIC="gnumeric-1.6.3"
@@ -196,7 +196,7 @@ GREP="grep-2.6.3"
 GRIP="grip-3.3.1"
 GROFF="groff-1.20.1"
 GRUB="grub-1.98"
-GSL="gsl-1.13"
+GSL="gsl-1.14"
 GSTREAMER="gstreamer-0.10.20"
 GST_PLUGINS_BASE="gst-plugins-base-0.10.20"
 GST_PLUGINS_GOOD="gst-plugins-good-0.10.10"
@@ -204,9 +204,9 @@ GST_PLUGINS_BAD="gst-plugins-bad-0.10.8"
 GST_PLUGINS_UGLY="gst-plugins-ugly-0.10.10"
 GST_FFMPEG="gst-ffmpeg-0.10.6"
 GTK="gtk+-2.18.7"
-GTK_DOC="gtk-doc-1.12"
-GTK_ENGINES="gtk-engines-2.18.5"
-GTKMM="gtkmm-2.18.2"
+GTK_DOC="gtk-doc-1.14"
+GTK_ENGINES="gtk-engines-2.20.1"
+GTKMM="gtkmm-2.20.3"
 GUILE="guile-1.8.7"
 GZIP="gzip-1.4"
 
@@ -214,21 +214,21 @@ HAL="hal-0.5.14"
 HAL_INFO="hal-info-20091130"
 HELP2MAN="help2man-1.37.1"
 HICOLOR_ICON_THEME="hicolor-icon-theme-0.11"
-HTTPD="httpd-2.2.8" # Apache
-HVCLOCK="hvclock-1.0.0"
+HTTPD="httpd-2.2.8"
+HVCLOCK="hvclock-1.0.1"
 
 IANA="iana-etc-2.30"
-IMAGE_MAGICK="ImageMagick-6.6.0-0"
+IMAGE_MAGICK="ImageMagick-6.6.8-1"
 IMLIB2="imlib-1.4.2"
 INDENT="indent-2.2.10"
 INETUTILS="inetutils-1.7"
-INKSCAPE="inkscape-0.47"
+INKSCAPE="inkscape-0.48.1"
 INTLTOOL="intltool-0.40.6"
 IPROUTE2="iproute2-2.6.35"
 IPTABLES="iptables-1.4.7"
-ISO_CODES="iso-codes-3.11"
+ISO_CODES="iso-codes-3.23"
 
-JACK="jack-audio-connection-kit-0.118.0"
+JACK="jack-audio-connection-kit-0.120.1"
 JADETEX="jadetex-3.13"
 JASPER="jasper-1.900.1"
 JAVA="jre-1.6.0_05"
@@ -253,14 +253,14 @@ LIBEXIF="libexif-0.6.17"
 LIBFAAD2="faad2-2.7"
 LIBFAAC="faac-1.28"
 LIBFFI="libffi-3.0.8"
-LIBGAMIN="gamin-0.1.9"
-LIBGCRYPT="libgcrypt-1.4.5"
+LIBGAMIN="gamin-0.1.10"
+LIBGCRYPT="libgcrypt-1.4.6"
 LIBGEDA="libgeda-1.2.0"
 LIBGLADE="libglade-2.6.4"
-LIBGPG_ERROR="libgpg-error-1.7"
+LIBGPG_ERROR="libgpg-error-1.10"
 LIBGSF="libgsf-1.14.7"
 LIBID3TAG="libid3tag-0.15.1b"
-LIBIDL="libIDL-0.8.13"
+LIBIDL="libIDL-0.8.14"
 LIBJPEG="libjpeg-7"
 LIBMAD="libmad-0.15.1b"
 LIBMNG="libmng-1.0.10"
@@ -273,20 +273,20 @@ LIBPCAP="libpcap-1.0.0"
 LIBPNG="libpng-1.2.44"
 LIBPROXY="libproxy-0.2.3"
 LIBPTHREAD_STUBS="libpthread-stubs-0.3"
-LIBRSVG="librsvg-2.26.0"
+LIBRSVG="librsvg-2.26.3"
 LIBSAMPLERATE="libsamplerate-0.1.7"
-LIBSIGCPP="libsigc++-2.2.4.2"
-LIBSNDFILE="libsndfile-1.0.21"
-LIBSOUP="libsoup-2.28.2"
+LIBSIGCPP="libsigc++-2.2.8"
+LIBSNDFILE="libsndfile-1.0.23"
+LIBSOUP="libsoup-2.30.2"
 LIBSPF2="libspf2-1.2.5"
-LIBTASN1="libtasn1-2.3"
+LIBTASN1="libtasn1-2.8"
 LIBTHEORA="libtheora-1.1.1"
 LIBTOOL="libtool-2.2.10"
 LIBVORBIS="libvorbis-1.2.3"
 VORBIS_TOOLS="vorbis-tools-1.2.0"
 LIBUSB="libusb-1.0.2"
 LIBUSB_COMPAT="libusb-compat-0.1.3"
-LIBWNCK="libwnck-2.28.0"
+LIBWNCK="libwnck-2.30.2"
 LIBXKLAVIER="libxklavier-5.0"
 LIBXML2="libxml2-2.7.7"
 LIBXSLT="libxslt-1.1.26"
@@ -305,7 +305,7 @@ MODULE_INIT_TOOLS="module-init-tools-3.12"
 MPC="mpc-0.8.2"
 MPFR="mpfr-3.0.0"
 MUTT="mutt-1.5.20"
-MYSQL="mysql-5.1.42"
+MYSQL="mysql-5.1.52"
 
 NANO="nano-2.2.1"
 NCURSES="ncurses-5.7"
@@ -323,8 +323,8 @@ OPENSSL="openssl-1.0.0b"
 OPENSSL_ROOT_CERTS="BLFS-ca-bundle-3.12.8.0"
 
 PAM="Linux-PAM-1.1.3"
-PANGO="pango-1.26.2"
-PANGOMM="pangomm-2.26.0"
+PANGO="pango-1.28.2"
+PANGOMM="pangomm-2.26.2"
 PARTED="parted-1.9.0"
 PATCH_PACKAGE="patch-2.6"
 PCIUTILS="pciutils-3.1.4"
@@ -333,21 +333,22 @@ PCRE="pcre-8.00"
 PERL="perl-5.12.2"
 PERL_MOD_PDL="PDL-2.4.6"
 PERL_MOD_PARSE_REDESCENT="Parse-RecDescent-1.965001"
-PERL_MOD_XML_WRITER="XML-Writer-0.606"
-PERL_MOD_XML_PARSER="XML-Parser-2.36"
+PERL_MOD_XML_WRITER="XML-Writer-0.612"
+PERL_MOD_XML_PARSER="XML-Parser-2.40"
 PERL_MOD_XML_SIMPLE="XML-Simple-2.18"
 PERL_MOD_HTML_TAGSET="HTML-Tagset-3.20"
-PERL_MOD_HTML_PARSER="HTML-Parser-3.64"
+PERL_MOD_HTML_PARSER="HTML-Parser-3.68"
 PERL_MOD_APACHE_LOGGED_AUTH_DBI="Apache-LoggedAuthDBI-0.12"
-PERL_MOD_DIGEST_SHA1="Digest-SHA1-2.12"
-PERL_MOD_LWP="libwww-perl-5.834"
-PERL_MOD_URI="URI-1.52"
+PERL_MOD_DIGEST_SHA1="Digest-SHA1-2.13"
+PERL_MOD_LWP="libwww-perl-6.01"
+PERL_MOD_URI="URI-1.58"
 PERL_MOD_NET_DNS="Net-DNS-0.66"
-PHP="php-5.2.6"
+
+PHP="php-5.3.3"
 PIXMAN="pixman-0.17.8"
 POLKIT="polkit-0.96"
 POLICYKIT="PolicyKit-0.9"
-POPPLER="poppler-0.12.4"
+POPPLER="poppler-0.14.4"
 PKG_CONFIG="pkg-config-0.23"
 POPT="popt-1.15"
 PORTAUDIO="portaudio-v19_20071207"
@@ -357,9 +358,9 @@ PROCMAIL="procmail-3.22"
 PROCPS="procps-3.2.8"
 PSMISC="psmisc-22.12"
 PULSEAUDIO="pulseaudio-0.9.21"
-PYCAIRO="pycairo-1.8.8"
-PYGOBJECT="pygobject-2.20.0"
-PYGTK="pygtk-2.16.0"
+PYCAIRO="pycairo-1.8.10"
+PYGOBJECT="pygobject-2.28.0"
+PYGTK="pygtk-2.22.0"
 PYTHON="Python-2.6.4"
 
 READLINE="readline-6.1"
@@ -368,7 +369,7 @@ RHYTHMBOX="rhythmbox-0.10.1"
 RSYNC="rsync-3.0.7"
 
 SAMBA="samba-3.0.21c"
-SANE_BACKENDS="sane-backends-1.0.19"
+SANE_BACKENDS="sane-backends-1.0.22"
 XSANE="xsane-0.996"
 SASL2="cyrus-sasl-2.1.21"
 SED="sed-4.2.1"
@@ -381,17 +382,17 @@ SGML_DTD4_VER="4.5"
 SGML_DTD4="sgml-dtd-${SGML_DTD4_VER}"
 SGML_SPM="SGMLSpm-1.03ii"
 SHADOW="shadow-4.1.4.2"
-SHARED_MIME_INFO="shared-mime-info-0.60"
-SPAMASSASSIN="Mail-SpamAssassin-3.2.3"
+SHARED_MIME_INFO="shared-mime-info-0.70"
+SPAMASSASSIN="Mail-SpamAssassin-3.3.1"
 SPEEX="speex-1.2rc1"
 SPLINT="splint-3.1.1"
 SPLIX="splix-2.0.0"
 SQLITE="sqlite-3.6.22"
 SQUIRRELMAIL="squirrelmail-1.5.1"
 STARTUP_NOTIFICATION="startup-notification-0.9"
-STRACE="strace-4.5.19"
+STRACE="strace-4.5.20"
 SUBVERSION="subversion-1.6.6"
-SYLPHEED="sylpheed-2.7.1"
+SYLPHEED="sylpheed-3.1"
 SUDO="sudo-1.7.2p2"
 SYSKLOGD="sysklogd-1.5"
 SYSVINIT="sysvinit-2.86"
@@ -422,7 +423,7 @@ UNZIP="unzip-5.52"
 UPSTART="upstart-0.6.3"
 USBUTILS="usbutils-0.86"
 UTIL_LINUX_NG="util-linux-ng-2.18"
-UW_IMAP="imap-2004g"
+UW_IMAP="imap-2007e"
 
 VORBIS_TOOLS="vorbis-tools-1.1.1"
 
@@ -430,7 +431,9 @@ WGET="wget-1.11.4"
 WHICH="which-2.20"
 WINDOWMAKER="WindowMaker-0.92.0"
 WINDOWMAKER_EXTRA="WindowMaker-extra-0.1"
+WIRELESS_TOOLS="wireless_tools.29"
 WMNOTIFY="wmnotify-0.3.2"
+WPA_SUPPLICANT="wpa_supplicant-0.7.3"
 WV="wv-1.2.4"
 
 XORG_VER="7.6-1"
@@ -444,7 +447,6 @@ XORG_UTIL=util-${XORG_VER}
 LIBXAU=libXau-1.0.6
 LIBXDMCP=libXdmcp-1.1.0
 XBITMAPS=xbitmaps-1.1.1
-##LIBDRM=libdrm-2.4.23
 LIBDRM="libdrm-git-20110306"
 MESALIB=MesaLib-7.9
 XCURSOR_THEMES=xcursor-themes-1.0.3
index 149c8ab..8e13102 100644 (file)
@@ -5,15 +5,15 @@
 
 INST_TYPE="workstation"
 HVL_TARGET="x86_64"
-MAKEJOBS=2
+MAKEJOBS=10
 
 # Destination path where to install new Linux-HV system. This is usually where
 # you have mounted your new LFS partition, but it can also be any directory.
 # This is relevant only for stage 0 and 1.
-LFS="/mnt/hvlinux"
+LFS="/mnt/stockage/hvlinux-amd64-new"
 LFS_PARTITION="/dev/sdb7"
-BOOT_PARTITION="/dev/sdb1"
-SWAP_PARTITION="/dev/sdb2"
+#BOOT_PARTITION="/dev/sdb1"
+#SWAP_PARTITION="/dev/sdb2"
 
 # New user to create
 REGUSER="hugo"
index 877ec2b..88ea103 100644 (file)
@@ -97,3 +97,6 @@ SANE_SERVER=""
 TIMEZONE="America/Montreal"
 
 DEFAULT_EDITOR="nano"
+
+# Uncomment this to automatically recompress all archives to bzip2 format
+#PREFER_BZIP2_ARCHIVE=1
diff --git a/config/urls b/config/urls
new file mode 100644 (file)
index 0000000..cf1b6cd
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# List of URLs
+
+LFS_BASE_URL="http://www.linuxfromscratch.org"
+CLFS_BASE_URL="http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk"
+HV_BASE_URL="http://www.hugovil.com/hvlinux-repository"
+
+LFS_PATCHES_URL="${LFS_BASE_URL}/patches/lfs/development"
+BLFS_PATCHES_URL="${LFS_BASE_URL}/patches/blfs/svn"
+CLFS_PATCHES_URL="http://patches.cross-lfs.org/dev"
+HV_PATCHES_URL="${HV_BASE_URL}/patches"
+
+LFS_PACKAGES_URL="ftp://ftp.osuosl.org/pub/lfs/lfs-packages/conglomeration"
+HV_PACKAGES_URL="${HV_BASE_URL}/packages"
+SOURCEFORGE_URL="http://downloads.sourceforge.net"
+APACHE_URL="http://archive.apache.org/dist"
+GNOME_URL="http://ftp.gnome.org/pub/gnome/sources"
+GNU_URL="http://ftp.gnu.org/pub/gnu"
+TETEX_URL="http://www.tug.org/ftp/tex-archive/systems/unix/teTeX"
+BLFS_XORG_URL="http://anduin.linuxfromscratch.org/files/BLFS/svn/xorg"
+BLFS_SVN_SRC_URL="http://anduin.linuxfromscratch.org/sources/BLFS/svn"
+BLFS_PM_URL="${BLFS_SVN_SRC_URL}/perl-modules"
+XORG_URL="http://xorg.freedesktop.org/releases/individual"
+TCPDUMP_URL="http://www.tcpdump.org/release"
+CPAN_AUTHORS_URL="http://cpan.org/authors/id"
+GNUPG_URL="ftp://ftp.gnupg.org/gcrypt"
+WMAKER_URL="http://windowmaker.info/pub/source/release"
+CAIRO_URL="http://cairographics.org/releases"
+KERNEL_URL="http://www.kernel.org/pub"
diff --git a/functions-fpkg b/functions-fpkg
deleted file mode 100644 (file)
index a72b304..0000000
+++ /dev/null
@@ -1,556 +0,0 @@
-#!/bin/bash
-
-LFS_PKG_BASE="$(dirname $(pwd))/packages"
-LFS_PKG_DIR="${LFS_PKG_BASE}/${LFS_STAGE}"
-LFS_LOG_DIR="${LFS}/var/log/hvlinux-install/${LFS_STAGE}"
-LFS_LOG_FILE="${LFS_LOG_DIR}/pkg-update.log"
-WGET_LOG_FILE="${LFS_LOG_DIR}/pkg-wget.log"
-
-# URL
-LFS_BASE_URL="http://www.linuxfromscratch.org"
-CLFS_BASE_URL="http://svn.cross-lfs.org/svn/repos/cross-lfs/trunk"
-HV_BASE_URL="http://www.hugovil.com/hvlinux-repository"
-
-LFS_PATCHES_URL="${LFS_BASE_URL}/patches/lfs/development"
-BLFS_PATCHES_URL="${LFS_BASE_URL}/patches/blfs/svn"
-CLFS_PATCHES_URL="http://patches.cross-lfs.org/dev"
-HV_PATCHES_URL="${HV_BASE_URL}/patches"
-
-LFS_PACKAGES_URL="ftp://ftp.osuosl.org/pub/lfs/lfs-packages/conglomeration"
-HV_PACKAGES_URL="${HV_BASE_URL}/packages"
-SOURCEFORGE_URL="http://cdnetworks-us-1.dl.sourceforge.net"
-GNOME_URL="http://ftp.gnome.org/pub/gnome/sources"
-GNU_URL="http://ftp.gnu.org/pub/gnu"
-TETEX_URL="http://www.tug.org/ftp/tex-archive/systems/unix/teTeX"
-BLFS_XORG_URL="http://anduin.linuxfromscratch.org/files/BLFS/svn/xorg"
-XORG_URL="http://xorg.freedesktop.org/releases/individual"
-
-WGETCMD="wget --directory-prefix=${LFS_PKG_DIR} --timeout=15 --tries=3 -nc --continue --no-check-certificate --no-verbose --output-file=${WGET_LOG_FILE}"
-
-LFS_PATCHES_LIST=${LFS_PKG_DIR}/patches-list-lfs.html
-BLFS_PATCHES_LIST=${LFS_PKG_DIR}/patches-list-blfs.html
-CLFS_PATCHES_LIST=${LFS_PKG_DIR}/patches-list-clfs.html
-HV_PATCHES_LIST=${LFS_PKG_DIR}/patches-list-hv.html
-
-# Arg. #1: URL for patches repository.
-# Arg. #2: Destination filename.
-static_fetch_patches_list()
-{
-    PATCHES_URL=${1}
-    PATCHES_LIST_FILENAME=${2}
-
-    ${WGETCMD} "${PATCHES_URL}/" &&
-
-    # Append log to global log file
-    cat ${WGET_LOG_FILE} >> ${LFS_LOG_FILE} &&
-
-    mv ${LFS_PKG_DIR}/index.html ${PATCHES_LIST_FILENAME}
-}
-
-# Arg. #1: URL for patches repository. The trailing
-#          slash is absolutely necessary for this to work.
-update_packages_init()
-{
-    # Execute a return statement instead of exit, to be able to continue with
-    # downloading other packages
-    export RCMD_NO_EXIT=1
-
-    # First create log directory if it does not exists.
-    if [ ! -d ${LFS_LOG_DIR} ]; then
-       install -m755 -d ${LFS_LOG_DIR} || exit 1
-    fi
-
-    # Then create destination directory if it does not exists.
-    if [ ! -d ${LFS_PKG_DIR} ]; then
-       install -v -m755 -d ${LFS_PKG_DIR} 1> ${LFS_LOG_FILE} 2>&1 || exit 1
-    fi
-
-    if [ -n "${USE_LFS_PATCHES}" ]; then
-        # Getting list of all patches from LFS server.
-        rcmd "Fetching LFS patches list" static_fetch_patches_list ${LFS_PATCHES_URL} ${LFS_PATCHES_LIST}
-    fi
-
-    if [ -n "${USE_BLFS_PATCHES}" ]; then
-        # Getting list of all patches from BLFS server.
-        rcmd "Fetching BLFS patches list" static_fetch_patches_list ${BLFS_PATCHES_URL} ${BLFS_PATCHES_LIST}
-    fi
-
-    if [ -n "${USE_CLFS_PATCHES}" ]; then
-        # Getting list of all patches from CLFS server.
-        rcmd "Fetching CLFS patches list" static_fetch_patches_list ${CLFS_PATCHES_URL} ${CLFS_PATCHES_LIST}
-    fi
-
-    if [ -n "${USE_HV_PATCHES}" ]; then
-        # Getting list of all patches from hugovil.com server.
-        rcmd "Fetching hugovil.com patches list" static_fetch_patches_list ${HV_PATCHES_URL} ${HV_PATCHES_LIST}
-    fi
-}
-
-# Get patch package if it is not in the repository
-# Arg. #1: Package name and version
-# Arg. #2: Patches list file (HTML)
-# Arg. #3: Patches URL
-static_checkpatch()
-{
-    local PACK=${1}
-    local PATCHES_LIST=${2}
-    local PATCHES_URL=${3}
-
-    # Remplace les "+" par "%2B"
-    local PACK_URL=$(echo $PACK | sed s!\+!%2B!g)
-
-    local PATCHES_FOUND=$(cat ${PATCHES_LIST} | grep "${PACK_URL}-" | sed "s/.*\(${PACK_URL}-.*\.patch\).*/\1/")
-    if [ -n "${PATCHES_FOUND}" ]; then
-       for p in ${PATCHES_FOUND}; do
-            # Remplace les "%2B" par "+"
-            PATCH_NAME=$(echo ${p} | sed s!%2B!\+!g)
-
-           if [ ! -f ${LFS_PKG_DIR}/${PATCH_NAME} ]; then
-               rcmd "Fetching ${PATCH_NAME} from ${PATCHES_URL}" ${WGETCMD} ${PATCHES_URL}/${p}
-           fi
-       done
-    fi
-}
-
-# Get patch package if it is not in the repository
-# Arg. #1: Package name and version
-static_getpatch()
-{
-    PACK=${1}
-
-    # Checking for correct number of arguments
-    if [ $# -ne 1 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    if [ -n "${USE_LFS_PATCHES}" ]; then
-        # Checking if patch is available from LFS.
-        static_checkpatch ${PACK} ${LFS_PATCHES_LIST} ${LFS_PATCHES_URL}
-    fi
-
-    if [ -n "${USE_BLFS_PATCHES}" ]; then
-        # Checking if patch is available from BLFS.
-        static_checkpatch ${PACK} ${BLFS_PATCHES_LIST} ${BLFS_PATCHES_URL}
-    fi
-
-    if [ -n "${USE_CLFS_PATCHES}" ]; then
-        # Checking if patch is available from CLFS.
-        static_checkpatch ${PACK} ${CLFS_PATCHES_LIST} ${CLFS_PATCHES_URL}
-    fi
-
-    if [ -n "${USE_HV_PATCHES}" ]; then
-        # Checking if patch is available from hugovil.com.
-        static_checkpatch ${PACK} ${HV_PATCHES_LIST} ${HV_PATCHES_URL}
-    fi
-}
-
-# Convert multiple compressed gzip files to bzip2.
-# Usage: gztobz2 [FILES]
-gztobz2()
-{
-    if [ $# = 0 ]; then
-       echo "$0: -- Convert multiple compressed gzip files to bzip2."
-       echo "Usage: $0: [FILES]"
-       return 1
-    fi
-    
-    while [ $# -ne 0 ]; do
-       local ORIG_GZIPPED_FILENAME=${1}
-       
-       # Checking if input file exist.
-       if [ ! -f $1 ]; then
-           echo "$0: File ${ORIG_GZIPPED_FILENAME} not found."
-           return 1
-       fi
-       
-       # Checking if input file is a valid gzipped file.
-       gzip -t ${ORIG_GZIPPED_FILENAME}
-       if [ $? -ne 0 ] ; then
-           echo "$0: File ${ORIG_GZIPPED_FILENAME} is not a valid gzip file."
-           return 1
-       fi
-       
-       # Obtaining uncompressed name of file
-       local FILENAME=$(gunzip -l ${ORIG_GZIPPED_FILENAME} | sed '1d' | sed 's/\(.*\)% \(.*\)/\2/')
-       
-       # Decompressing file to standard output and piping result to bzip2
-       gunzip ${ORIG_GZIPPED_FILENAME} --stdout | bzip2 --best > ${FILENAME}.bz2
-       if [ $? -ne 0 ] ; then
-           echo "$0: Error converting file ${ORIG_GZIPPED_FILENAME} to bzip2."
-           return 1
-       fi
-       
-       # Keeping the original file's timestamp
-       touch --reference=${ORIG_GZIPPED_FILENAME} ${FILENAME}.bz2
-       
-       # Deleting original gzipped file
-       if [ -f ${FILENAME}.bz2 ]; then
-           rm ${ORIG_GZIPPED_FILENAME}
-       fi
-       
-       shift
-    done
-}
-
-detect_file_not_found()
-{
-    # HTTP: will return error code 404.
-    # FTP: will say "File not found"
-    if grep "404" ${WGET_LOG_FILE} 1> /dev/null 2>&1; then
-        echo "404 NOTFOUND"
-        return 0
-    elif grep "No such file" ${WGET_LOG_FILE} 1> /dev/null 2>&1; then
-        echo "No such file"
-        return 0
-    else
-        return 1
-    fi
-}
-
-# Get package if it is not in the repository
-# Arg. #1: Package name and version
-# Arg. #2: URL
-# Arg. #3: Optional extension
-static_getpkg()
-{
-    local PACK=${1}
-    local URL=${2}
-    local MY_ARCH_EXT=${3}
-
-    # Checking for correct number of arguments
-    if [ $# -ne 2 -a $# -ne 3 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    if [ -z "${MY_ARCH_EXT}" ]; then
-        # List of default archive extensions to try
-        MY_ARCH_EXT="tar.bz2 tar.gz tgz tar.Z"
-    fi
-
-    for arch_ext in ${MY_ARCH_EXT}; do
-        # Don't take any chance: remove any partially downloaded file.
-        # If we arrive here, it means the final destination file was not found
-        # so we can safely remove any file prior to trying to download it.
-        rm -f ${LFS_PKG_DIR}/${PACK}.${arch_ext}
-
-        rcmd "Fetching ${PACK}.${arch_ext}" ${WGETCMD} ${URL}/${PACK}.${arch_ext}
-        wget_status=$?
-
-        # Append log to global log file
-        cat ${WGET_LOG_FILE} >> ${LFS_LOG_FILE}
-
-        # Failure: if it was a connection timeout, don't try for other file
-        # extensions.
-        if grep "failed: Connection timed out" ${WGET_LOG_FILE} 1> /dev/null 2>&1; then
-            echo "Error, wget reported: Connection timed out"
-            return 1
-        fi
-
-        if detect_file_not_found; then
-            # Try next archive extension if web server reported that file is not
-            # found.
-            continue;
-        fi
-
-        if [ ${wget_status} -ne 0 ]; then
-            echo "Error fetching package ${PACK}.${arch_ext}"
-            return 1
-        fi
-
-        # If we are here, it means the file was successfully downloaded.
-        if [ "x${arch_ext}" = "xtar.gz" -o "x${arch_ext}" = "xtgz" \
-            -o "x${arch_ext}" = "xtar.Z" ]; then
-           gztobz2 ${LFS_PKG_DIR}/${PACK}.${arch_ext}
-        fi
-        return $?
-    done
-
-    # Failure or file not found
-    return 1
-}
-
-# Get package if it is not in the repository
-# Arg. #1: Package name and version
-# Arg. #2: URL
-# Options:
-#   -e     File extension (default is tar.bz2)
-#   -d     Fetch directory (default is LFS_PKG_DIR)
-#   -f     Filename on server (default is PACKAGE)
-#   -h     Display this help and returns
-#   -s     Subdirectory on server
-fpkg()
-{
-    local FILE_EXT=""
-    local DEST_DIR=""
-    local SRC_FILENAME=""
-    local SRC_DIR=""
-
-    while getopts "e:d:f:hs:" flag ;do
-        case ${flag} in
-           e)
-                # File extension
-                FILE_EXT=${OPTARG}
-               ;;
-           d)
-                # Fetch directory (where to put file)
-                DEST_DIR=${OPTARG}
-               ;;
-           f)
-                # Filename if different than package name
-                SRC_FILENAME=${OPTARG}
-               ;;
-           s)
-               SRC_DIR=${OPTARG}
-                ;;
-           ?)
-               echo "${FUNCNAME}(): Invalid option: ${OPTARG}."
-               return 1
-               ;;
-        esac
-    done
-    shift `expr "${OPTIND}" - 1`
-
-    unset OPTSTRING
-    unset OPTIND
-    unset OPTARG
-
-    # Checking for correct number of arguments
-    if [ $# -ne 2 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    local PACK=${1}
-    local URL=${2}
-
-    if [ -z "${SRC_FILENAME}" ]; then
-        # Default source filename = name of package
-        SRC_FILENAME=${PACK}
-    fi
-
-    if [ -z "${FILE_EXT}" -o \
-        "x${FILE_EXT}" = "xtar.gz" -o \
-        "x${FILE_EXT}" = "xtgz" -o \
-        "x${FILE_EXT}" = "xtar.Z" -o \
-        "x${FILE_EXT}" = "xtar.bz2" \
-        ]; then
-        FINAL_EXT=tar.bz2
-    else
-        FINAL_EXT=${FILE_EXT}
-    fi
-
-    if [ -z "${DEST_DIR}" ]; then
-        # Default destination directory
-        DEST_DIR=${LFS_PKG_DIR}
-    fi
-
-    mkdir -v -p ${DEST_DIR} >> ${LFS_LOG_FILE} 2>&1
-
-    if [ -z "${SRC_DIR}" ]; then
-        # Default source subdirectory on server
-        SRC_DIR=""
-    else
-        URL=${URL}/${SRC_DIR}
-    fi
-
-    DEST_FILE=${DEST_DIR}/${PACK}.${FINAL_EXT}
-
-    if [ ! -f ${DEST_FILE} ]; then
-        set +e
-        static_getpkg ${SRC_FILENAME} ${URL} ${FILE_EXT}
-        set -e
-
-        # Move file if source filename is not equal to package name and/or destination
-        # directory is not the default:
-        DOWNLOADED_FILE=${LFS_PKG_DIR}/${SRC_FILENAME}.${FINAL_EXT}
-
-        if [ "${DEST_FILE}" != "${DOWNLOADED_FILE}" ]; then
-           mv ${DOWNLOADED_FILE} ${DEST_FILE}
-       fi
-    fi
-
-    # Test integrity of archive if requested
-    if [ -f ${DEST_FILE} -a -n "${TEST_INTEGRITY}" -a "x${FINAL_EXT}" = "xtar.bz2" ]; then
-        rcmd "Testing integrity of ${PACK}.${FINAL_EXT}" bzip2 -t ${DEST_FILE}
-    fi
-
-    # Check for available patches with PACKAGE (TARGET) name.
-    static_getpatch ${PACK}
-
-    if [ ${SRC_FILENAME} != ${PACK} ]; then
-        # Check for available patches with SRC_FILENAME name.
-        static_getpatch ${SRC_FILENAME}
-
-        # Rename any patch fetched (in fpkg call) and replace SOURCE by TARGET
-        # in patch name.
-        if ls ${LFS_PKG_DIR}/${SRC_FILENAME}-*.patch 1> /dev/null 2>&1; then
-            echo "CMD=${SRC_FILENAME} ${PACK} ${LFS_PKG_DIR}/${SRC_FILENAME}-*.patch"
-           rename ${SRC_FILENAME} ${PACK} ${LFS_PKG_DIR}/${SRC_FILENAME}-*.patch
-        fi
-    fi
-}
-
-# Get package if it is not in the repository
-# Arg. #1: Package name and version
-# Arg. #2: Directory name (optional)
-fpkg_gnu()
-{
-    local PACK=${1}
-
-    if [ $# -eq 2 ]; then
-       NAME=${2}
-    else
-       NAME=$(get_pkg_name ${PACK})
-    fi
-
-    # Checking for correct number of arguments
-    if [ $# -lt 1 -o $# -gt 2 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    fpkg ${PACK} "${GNU_URL}/${NAME}"
-}
-
-# Fetch Gnome package (if it is not in the repository).
-# Arg. #1: Package name and version
-# Arg. #2: Directory name (optional)
-fpkg_gnome()
-{
-    PACK=${1}
-
-    if [ $# -eq 2 ]; then
-       NAME=${2}
-    else
-       NAME=$(get_pkg_name ${PACK})
-    fi
-
-    # Checking for correct number of arguments
-    if [ $# -lt 1 -o $# -gt 2 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    fpkg ${PACK} "${GNOME_URL}/${NAME}/$(get_pkg_ver_base ${PACK})"
-}
-
-# Get package if it is not in the repository
-# Arg. #1: Package name and version
-# Arg. #2: Directory name (optional)
-fpkg_sf()
-{
-    PACK=${1}
-
-    if [ $# -eq 2 ]; then
-       NAME=${2}
-    else
-       NAME=$(get_pkg_name ${PACK})
-    fi
-    
-    # Checking for correct number of arguments
-    if [ $# -lt 1 -o $# -gt 2 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    fpkg ${PACK} ${SOURCEFORGE_URL}/${NAME}
-}
-
-# Get package if it is not in the repository
-# Arg. #1: Package name and version
-# Arg. #2: Directory name (optional)
-fpkg_hv()
-{
-    PACK=${1}
-
-    # Checking for correct number of arguments
-    if [ $# -lt 1 -o $# -gt 2 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    if [ $# -eq 2 ]; then
-       fpkg ${PACK} "${HV_PACKAGES_URL}/${2}"
-    else
-       fpkg ${PACK} ${HV_PACKAGES_URL}
-    fi
-}
-
-# Get package if it is not in the repository
-# Arg. #1: Package name and version
-# Arg. #2: Directory name (optional)
-fpkg_lfs()
-{
-    PACK=${1}
-
-    # Checking for correct number of arguments
-    if [ $# -lt 1 -o $# -gt 2 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    if [ $# -eq 2 ]; then
-       fpkg ${PACK} "${LFS_PACKAGES_URL}/${2}"
-    else
-       fpkg ${PACK} ${LFS_PACKAGES_URL}
-    fi
-}
-
-# Get package if it is not in the repository
-# Arg. #1: Package name and version
-# Arg. #2: Subdirectory name (module name)
-fpkg_xorg()
-{
-    local PACK=${1}
-    local SUBDIR=${2}
-
-    # Checking for correct number of arguments
-    if [ $# -ne 2 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    fpkg -d ${LFS_PKG_DIR}/${SUBDIR} -s ${SUBDIR} ${PACK} ${XORG_URL}
-}
-
-# Create a symbolic link to a package that is located in another stage
-# repository (to not have the same file twice).
-# Arg. #1: Source stage number (1, 2, 3, etc)
-# Arg. #2: Package name
-lpkg()
-{
-    SRCSTAGE="stage${1}"
-    FILE="${2}.tar.bz2"
-    PACKAGE_NAME="${2}"
-
-    # Checking for correct number of arguments
-    if [ $# -ne 2 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    if [ ! -h ${LFS_PKG_DIR}/${FILE} ]; then
-       # Issue a warning if source file doesn't exist.
-       if [ ! -f ${LFS_PKG_BASE}/${SRCSTAGE}/${FILE} ]; then
-            source_link_status=" (missing source file)"
-        else
-            source_link_status=""
-       fi
-
-       # Create link if it doesn't exist
-       rcmd "Linking ${PACKAGE_NAME}${source_link_status}" ln -s ../${SRCSTAGE}/${FILE} ${LFS_PKG_DIR}/${FILE}
-    fi
-
-    # Create link for patches corresponding to that package:
-    if ls ${LFS_PKG_BASE}/${SRCSTAGE}/${PACKAGE_NAME}-*.patch 1> /dev/null 2>&1; then
-       for patch in ${LFS_PKG_BASE}/${SRCSTAGE}/${PACKAGE_NAME}-*.patch; do
-           PATCHFILE=$(basename ${patch})
-           if [ ! -h ${LFS_PKG_DIR}/${PATCHFILE} ]; then
-               # Create link if it doesn't exist
-               rcmd "Linking ${PATCHFILE}" ln -s ../${SRCSTAGE}/${PATCHFILE} ${LFS_PKG_DIR}/${PATCHFILE}
-           fi
-       done
-    fi
-}
diff --git a/functions-ipkg b/functions-ipkg
deleted file mode 100644 (file)
index 23a1e1a..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-#!/bin/bash
-
-function_exists()
-{
-    local FUNCTION_NAME=$1
-
-    [ -z "$FUNCTION_NAME" ] && return 1
-
-    declare -F "$FUNCTION_NAME" > /dev/null 2>&1
-
-    return $?
-}
-
-unset -f hvpatch_pre
-unset -f hvconfig_pre
-unset -f hvconfig_cache
-unset -f hvconfig_post
-unset -f hvbuild_post
-
-ipkg_decompress_package()
-{
-    echo "Decompressing package"
-    decompress_package ${PACKAGE}
-
-    local DECOMPRESSED_DIRNAME=$(static_decompressed_dirname ${PACKAGE})
-
-    # Rename the decompressed package as per the package name if necessary
-    if [ "x${DECOMPRESSED_DIRNAME}" != "x${PACKAGE}" ]; then
-        mv -v ${LFS_TMP}/${DECOMPRESSED_DIRNAME} ${LFS_TMP}/${PACKAGE}
-    fi
-
-    # Displaying package source size in log file
-    echo "  Source size:" $(du -h -s ${LFS_TMP}/${PACKAGE} | awk '{ print $1 }') 1>> ${LFS_LOG_FILE}
-
-    # Removing old build directory (if any)
-    if [ -d ${LFS_TMP}/${PACKAGE}-build ]; then
-        echo "Removing old build directory"
-       rm -rf ${LFS_TMP}/${PACKAGE}-build
-    fi
-
-    # Creating build directory
-    mkdir -v ${LFS_TMP}/${PACKAGE}-build
-}
-
-# Default configure function
-hvconfig()
-{
-    if [ "x${IPKG_MODE}" = "xacnb" -o "x${IPKG_MODE}" = "xpm" ]; then
-        # Broken autoconf package that must build in source dir, or Perl module.
-        cd ${LFS_TMP}/${PACKAGE}
-    else
-        # Standard autoconf mode
-        cd ${LFS_TMP}/${PACKAGE}-build
-    fi
-
-    if [ "x${IPKG_MODE}" = "xpm" ]; then
-        # Configure Perl module.
-        # The option "-n" is used to avoid having to answer a question and
-        # accept the default configuration.
-        perl Makefile.PL -n ${CONFIGURE_OPTS}
-    else
-        # Standard configure script
-        ${LFS_TMP}/${PACKAGE}/configure ${CONFIGURE_OPTS}
-    fi
-}
-
-# Default build function
-hvbuild()
-{
-    if [ "x${IPKG_MODE}" = "xacnb" -o \
-        "x${IPKG_MODE}" = "xnoac" -o \
-        "x${IPKG_MODE}" = "xpm" ]; then
-        # Broken autoconf package that must build in source dir, or Perl module.
-        cd ${LFS_TMP}/${PACKAGE}
-    fi
-
-    ${HVMAKE}
-    ${HVMAKE} install
-}
-
-# Default patch applying function
-hvpatch()
-{
-    # Applying patches (if any)
-    apply_patches ${PACKAGE}
-}
-
-ipkg_finish()
-{
-    # Make sure to return to scripts directory
-    cd ${SCRDIR}
-
-    # Displaying package build size in log file
-    BUILD_SIZE=$(du -h -s -c ${LFS_TMP}/${PACKAGE} ${LFS_TMP}/${PACKAGE}-build | grep total | awk '{ print $1 }')
-    echo "  Build size : ${BUILD_SIZE}" 1>> ${LFS_LOG_FILE}
-
-    # Some scripts need to preserve the source or build directory. They can
-    # do so by renaming them.
-    if [ -d ${LFS_TMP}/${PACKAGE} ]; then
-       # Removing source directory
-        echo "Removing source directory"
-       rm -rf ${LFS_TMP}/${PACKAGE}
-    fi
-    if [ -d ${LFS_TMP}/${PACKAGE}-build ]; then
-       # Removing build directory
-        echo "Removing build directory"
-       rm -rf ${LFS_TMP}/${PACKAGE}-build
-    fi
-}
-
-# This is the main function doing all the work
-# Arg #1: alternate script name (optional)
-ipkg_script()
-{
-    if [ $# -eq 1 ]; then
-        # Use supplied script name
-        PACKAGE_DEF=${SCRDIR}/pkg/${1}
-    else
-        # Use default script name
-        PACKAGE_DEF=${SCRDIR}/pkg/$(get_pkg_name ${PACKAGE})
-
-    fi
-
-    ipkg_decompress_package
-
-    if [ -f ${PACKAGE_DEF} ]; then
-        echo "Load custom package functions and definitions from ${PACKAGE_DEF}"
-        source ${PACKAGE_DEF}
-    fi
-
-    # Execute pre-patch function if applicable
-    if function_exists hvpatch_pre ; then
-        echo "Running patch pre-script"
-        hvpatch_pre
-    fi
-
-    hvpatch
-
-    # Execute pre-configure function if applicable
-    if function_exists hvconfig_pre ; then
-        echo "Running configure pre-script"
-        hvconfig_pre
-    fi
-
-    # Execute config-cache function if applicable
-    if function_exists hvconfig_cache ; then
-        echo "Running configure cache script"
-        hvconfig_cache
-        CONFIGURE_OPTS="\
-            ${CONFIGURE_OPTS} \
-            --cache-file=${LFS_TMP}/${PACKAGE}-build/config.cache"
-    fi
-
-    # Add option --disable-dependency-tracking if supported
-    if cat ${LFS_TMP}/${PACKAGE}/configure | \
-        grep "disable-dependency-tracking" 1> /dev/null 2>&1; then
-        CONFIGURE_OPTS="\
-            ${CONFIGURE_OPTS} \
-            --disable-dependency-tracking"
-    fi
-
-    ipkg_display_build_infos
-
-    if [ "x${IPKG_MODE}" = "xnoac" ]; then
-        echo "Not calling configure because ${PACKAGE} has no configure script"
-    else
-        hvconfig
-    fi
-
-    # Execute post-configure function if applicable
-    if function_exists hvconfig_post ; then
-        echo "Running configure post-script"
-        hvconfig_post
-    fi
-
-    hvbuild
-
-    # Execute post-build function if applicable
-    if function_exists hvbuild_post ; then
-        echo "Running build post-script"
-        hvbuild_post
-    fi
-
-    ipkg_finish
-}
diff --git a/functions/fpkg b/functions/fpkg
new file mode 100644 (file)
index 0000000..020443b
--- /dev/null
@@ -0,0 +1,573 @@
+#!/bin/bash
+
+source ../config/urls
+source ../functions/gztobz2
+
+LFS_PKG_BASE="$(dirname $(pwd))/packages"
+LFS_PKG_DIR="${LFS_PKG_BASE}/${LFS_STAGE}"
+LFS_LOG_DIR="${LFS}/var/log/hvlinux-install/${LFS_STAGE}"
+LFS_LOG_FILE="${LFS_LOG_DIR}/pkg-update.log"
+WGET_LOG_FILE="${LFS_LOG_DIR}/pkg-wget.log"
+
+WGETCMD="wget --directory-prefix=${LFS_PKG_DIR} --timeout=15 --tries=3 -nc --continue --no-check-certificate --no-verbose --output-file=${WGET_LOG_FILE}"
+
+LFS_PATCHES_LIST=${LFS_PKG_DIR}/patches-list-lfs.html
+BLFS_PATCHES_LIST=${LFS_PKG_DIR}/patches-list-blfs.html
+CLFS_PATCHES_LIST=${LFS_PKG_DIR}/patches-list-clfs.html
+HV_PATCHES_LIST=${LFS_PKG_DIR}/patches-list-hv.html
+
+# Test if the given file extension correspond to a tar/gzip archive
+is_archive_tar_gzip()
+{
+    if [ ${#} -ne 1 ]; then
+       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
+       return 1
+    fi
+
+    local EXT=${1}
+
+    for k in "tar.gz" "tgz" "tar.Z"; do
+        if [ "x${EXT}" = "x${k}" ]; then
+            return 0
+        fi
+    done
+
+    return 1
+}
+
+# Arg. #1: URL for patches repository.
+# Arg. #2: Destination filename.
+static_fetch_patches_list()
+{
+    PATCHES_URL=${1}
+    PATCHES_LIST_FILENAME=${2}
+
+    ${WGETCMD} "${PATCHES_URL}/" &&
+
+    # Append log to global log file
+    cat ${WGET_LOG_FILE} >> ${LFS_LOG_FILE} &&
+
+    mv ${LFS_PKG_DIR}/index.html ${PATCHES_LIST_FILENAME}
+}
+
+# Arg. #1: If "test" is specified, set TEST_INTEGRITY to 1
+update_packages_init()
+{
+    if [ ${#} -eq 1 -a "x${1}" = "xtest" ]; then
+        export TEST_INTEGRITY=1
+    fi
+
+    # Execute a return statement instead of exit, to be able to continue with
+    # downloading other packages
+    export RCMD_NO_EXIT=1
+
+    # First create log directory if it does not exists.
+    if [ ! -d ${LFS_LOG_DIR} ]; then
+       install -m755 -d ${LFS_LOG_DIR} || exit 1
+    fi
+
+    # Then create destination directory if it does not exists.
+    if [ ! -d ${LFS_PKG_DIR} ]; then
+       install -v -m755 -d ${LFS_PKG_DIR} 1> ${LFS_LOG_FILE} 2>&1 || exit 1
+    fi
+
+    if [ -n "${USE_LFS_PATCHES}" ]; then
+        # Getting list of all patches from LFS server.
+        rcmd "Fetching LFS patches list" static_fetch_patches_list ${LFS_PATCHES_URL} ${LFS_PATCHES_LIST}
+    fi
+
+    if [ -n "${USE_BLFS_PATCHES}" ]; then
+        # Getting list of all patches from BLFS server.
+        rcmd "Fetching BLFS patches list" static_fetch_patches_list ${BLFS_PATCHES_URL} ${BLFS_PATCHES_LIST}
+    fi
+
+    if [ -n "${USE_CLFS_PATCHES}" ]; then
+        # Getting list of all patches from CLFS server.
+        rcmd "Fetching CLFS patches list" static_fetch_patches_list ${CLFS_PATCHES_URL} ${CLFS_PATCHES_LIST}
+    fi
+
+    if [ -n "${USE_HV_PATCHES}" ]; then
+        # Getting list of all patches from hugovil.com server.
+        rcmd "Fetching hugovil.com patches list" static_fetch_patches_list ${HV_PATCHES_URL} ${HV_PATCHES_LIST}
+    fi
+}
+
+# Get patch package if it is not in the repository
+# Arg. #1: Package name and version
+# Arg. #2: Patches list file (HTML)
+# Arg. #3: Patches URL
+static_checkpatch()
+{
+    local PACK=${1}
+    local PATCHES_LIST=${2}
+    local PATCHES_URL=${3}
+
+    # Remplace les "+" par "%2B"
+    local PACK_URL=$(echo $PACK | sed s!\+!%2B!g)
+
+    local PATCHES_FOUND=$(cat ${PATCHES_LIST} | grep "${PACK_URL}-" | sed "s/.*\(${PACK_URL}-.*\.patch\).*/\1/")
+    if [ -n "${PATCHES_FOUND}" ]; then
+       for p in ${PATCHES_FOUND}; do
+            # Remplace les "%2B" par "+"
+            PATCH_NAME=$(echo ${p} | sed s!%2B!\+!g)
+
+           if [ ! -f ${LFS_PKG_DIR}/${PATCH_NAME} ]; then
+               rcmd "Fetching ${PATCH_NAME} from ${PATCHES_URL}" ${WGETCMD} ${PATCHES_URL}/${p}
+           fi
+       done
+    fi
+}
+
+# Get patch package if it is not in the repository
+# Arg. #1: Package name and version
+static_getpatch()
+{
+    PACK=${1}
+
+    # Checking for correct number of arguments
+    if [ $# -ne 1 ]; then
+       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
+       return 1
+    fi
+
+    if [ -n "${USE_LFS_PATCHES}" ]; then
+        # Checking if patch is available from LFS.
+        static_checkpatch ${PACK} ${LFS_PATCHES_LIST} ${LFS_PATCHES_URL}
+    fi
+
+    if [ -n "${USE_BLFS_PATCHES}" ]; then
+        # Checking if patch is available from BLFS.
+        static_checkpatch ${PACK} ${BLFS_PATCHES_LIST} ${BLFS_PATCHES_URL}
+    fi
+
+    if [ -n "${USE_CLFS_PATCHES}" ]; then
+        # Checking if patch is available from CLFS.
+        static_checkpatch ${PACK} ${CLFS_PATCHES_LIST} ${CLFS_PATCHES_URL}
+    fi
+
+    if [ -n "${USE_HV_PATCHES}" ]; then
+        # Checking if patch is available from hugovil.com.
+        static_checkpatch ${PACK} ${HV_PATCHES_LIST} ${HV_PATCHES_URL}
+    fi
+}
+
+detect_file_not_found()
+{
+    # HTTP: will return error code 404.
+    # FTP: will say "File not found"
+    if grep "404" ${WGET_LOG_FILE} 1> /dev/null 2>&1; then
+        #echo "404 NOTFOUND"
+        return 0
+    elif grep "No such file" ${WGET_LOG_FILE} 1> /dev/null 2>&1; then
+        #echo "No such file"
+        return 0
+    else
+        return 1
+    fi
+}
+
+# Get package if it is not in the repository
+# Arg. #1: Package name and version
+# Arg. #2: URL
+# Arg. #3: Optional extension
+static_getpkg()
+{
+    local PACK=${1}
+    local URL=${2}
+    local PREFERRED_EXT=${3}
+
+    # Checking for correct number of arguments
+    if [ $# -ne 2 -a $# -ne 3 ]; then
+       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
+       return 1
+    fi
+
+    if [ -n "${PREFERRED_EXT}" ]; then
+        # On met l'extension spécifiée en premier
+        MODLIST=$(echo ${DEFAULT_ARCH_EXT_LIST} | \
+            sed "s@${PREFERRED_EXT}@@")
+        PREFERRED_EXT="${PREFERRED_EXT} ${MODLIST}"
+    else
+        # List of default archive extensions to try
+        PREFERRED_EXT="${DEFAULT_ARCH_EXT_LIST}"
+    fi
+
+    for arch_ext in ${PREFERRED_EXT}; do
+        # Don't take any chance: remove any partially downloaded file.
+        # If we arrive here, it means the final destination file was not found
+        # so we can safely remove any file prior to trying to download it.
+        rm -f ${LFS_PKG_DIR}/${PACK}.${arch_ext}
+
+        rcmd "Fetching ${PACK}.${arch_ext}" ${WGETCMD} ${URL}/${PACK}.${arch_ext}
+        wget_status=$?
+
+        # Append log to global log file
+        cat ${WGET_LOG_FILE} >> ${LFS_LOG_FILE}
+
+        # Failure: if it was a connection timeout, don't try for other file
+        # extensions.
+        if grep "failed: Connection timed out" ${WGET_LOG_FILE} 1> /dev/null 2>&1; then
+            echo "Error, wget reported: Connection timed out"
+            return 1
+        fi
+
+        if detect_file_not_found; then
+            # Try next archive extension if file was not found.
+            continue;
+        fi
+
+        if [ ${wget_status} -ne 0 ]; then
+            return 1
+        fi
+
+        # If we are here, it means the file was successfully downloaded.
+        FINAL_EXT=${arch_ext}
+
+        # Convert to bzip2 format if requested and if it is a tar/gz archive
+        if [ -n "${PREFER_BZIP2_ARCHIVE}" ]; then
+            if is_archive_tar_gzip "${arch_ext}" ; then
+                rcmd "Converting ${PACK}.${arch_ext} to bzip2 format" \
+                    gztobz2 ${LFS_PKG_DIR}/${PACK}.${arch_ext}
+                FINAL_EXT="tar.bz2"
+            fi
+        fi
+
+        return $?
+    done
+
+    # Failure or file not found
+    return 1
+}
+
+# Test integrity of archive
+# Arg. #1: package name
+# Arg. #2: filename
+# Arg. #3: extension
+test_archive_integrity()
+{
+    if [ $# -ne 3 ]; then
+       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
+        return 1
+    fi
+
+    local PACK=${1}
+    local FILE=${2}
+    local EXT=${3}
+
+    if [ ! -f ${FILE} ]; then
+        return 1
+    fi
+
+    local TESTCMD=""
+
+    if [ "x${EXT}" = "xtar.bz2" ]; then
+        TESTCMD="bzip2 -t"
+    elif is_archive_tar_gzip "${EXT}"; then
+        TESTCMD="gunzip -t"
+    else
+        # Can only test gzip and bzip2 archives
+        return 0
+    fi
+
+    rcmd "Testing ${PACK}.${EXT}" ${TESTCMD} ${FILE}
+}
+
+# Get package if it is not in the repository
+# Arg. #1: Package name and version
+# Arg. #2: URL
+# Options:
+#   -d     Fetch directory (default is LFS_PKG_DIR)
+#   -e     File extension (default is tar.bz2)
+#   -f     Filename on server (default is PACKAGE)
+#   -m     Mode (for common package types):
+#            gnu
+#            gnome
+#            sf (sourceforge)
+#            xorg
+#            apa (apache)
+#            hv (hugovil.com)
+#            lfs
+#            pm (Perl module via CPAN)
+#            fd (freedesktop.org)
+#   -o     Option specific to mode
+#   -h     Display this help and returns
+#   -s     Subdirectory on server
+fpkg()
+{
+    local ORIG_ARGS=${*}
+    local DEST_DIR=""
+    local FILE_EXT=""
+    local SRC_FILENAME=""
+    local MODE=""
+    local MODE_OPT=""
+    local SRC_DIR=""
+    local FD_SUBDIR_FINAL=""
+
+    while getopts "d:e:f:m:o:s:" flag ;do
+        case ${flag} in
+           d)
+                # Fetch directory (where to put file)
+                DEST_DIR=${OPTARG}
+               ;;
+           e)
+                # File extension
+                FILE_EXT=${OPTARG}
+               ;;
+           f)
+                # Filename if different than package name
+                SRC_FILENAME=${OPTARG}
+               ;;
+           m)
+                MODE=${OPTARG}
+                ;;
+           o)
+                MODE_OPT=${OPTARG}
+                ;;
+           s)
+               SRC_DIR=${OPTARG}
+                ;;
+           ?)
+               echo "${FUNCNAME}(): Invalid option: ${OPTARG}."
+               return 1
+               ;;
+        esac
+    done
+    shift `expr "${OPTIND}" - 1`
+
+    unset OPTSTRING
+    unset OPTIND
+    unset OPTARG
+
+    # Checking for correct number of arguments
+    if [ $# -lt 1 -o $# -gt 2 ]; then
+       echo "${FUNCNAME}(), wrong number of arguments: ${ORIG_ARGS}"
+       return 1
+    fi
+
+    local PACK=${1}
+
+    if [ $# -eq 2 ]; then
+        local URL=${2}
+    fi
+
+    if [ -n "${MODE}" ]; then
+        case ${MODE} in
+           gnu)
+                URL=${GNU_URL}
+                if [ -z "${SRC_DIR}" ]; then
+                    # Default subdirectory on server
+                   SRC_DIR=$(get_pkg_name ${PACK})
+                fi
+                if [ -z "${FILE_EXT}" ]; then
+                    # Default file extension is tar.gz
+                    FILE_EXT="tar.gz"
+                fi
+                ;;
+            gnome)
+                URL=${GNOME_URL}
+                if [ -z "${SRC_DIR}" ]; then
+                    # Default subdirectory on server
+                   SRC_DIR=$(get_pkg_name ${PACK})
+                fi
+                SRC_DIR="${SRC_DIR}/$(get_pkg_ver_base ${PACK})"
+                ;;
+            sf)
+                URL=${SOURCEFORGE_URL}
+
+                if [ -z "${SRC_DIR}" ]; then
+                    # Default subdirectory on server
+                   SRC_DIR=$(get_pkg_name ${PACK})
+                fi
+                if [ -z "${FILE_EXT}" ]; then
+                    # Default file extension is tar.gz
+                    FILE_EXT="tar.gz"
+                fi
+                ;;
+            xorg)
+                URL=${XORG_URL}
+                if [ -z "${SRC_DIR}" ]; then
+                   echo "${FUNCNAME}(), mode 'xorg' needs '-s' option"
+                   return 1
+                fi
+                if [ -z "${DEST_DIR}" ]; then
+                    # Default fetch (write to) directory
+                    DEST_DIR=${LFS_PKG_DIR}/${SRC_DIR}
+                fi
+                ;;
+           fd)
+                # Most common layout:
+                # http://pkg-config.freedesktop.org/releases/
+
+                if [ -z "${SRC_DIR}" ]; then
+                    # Default subdirectory or module on server
+                   SRC_DIR=$(get_pkg_name ${PACK})
+                fi
+
+                if [ -z "${FILE_EXT}" ]; then
+                    # Default file extension is always tar.gz???
+                    FILE_EXT="tar.gz"
+                fi
+
+                FD_SUBDIR_FINAL="releases"
+                if [ -n "${MODE_OPT}" ]; then
+                    # Optional final subdir:
+                    #   releases (default)
+                    #   dist
+                    #   none (don't append anything)
+                    if [ "x${MODE_OPT}" = "xnone" ]; then
+                        FD_SUBDIR_FINAL=""
+                    else
+                        FD_SUBDIR_FINAL=${MODE_OPT}
+                    fi
+                fi
+
+                URL="http://${SRC_DIR}.freedesktop.org/${FD_SUBDIR_FINAL}"
+                SRC_DIR=""
+                ;;
+            apa)
+                URL=${APACHE_URL}
+                if [ -z "${SRC_DIR}" ]; then
+                    # Default subdirectory on server
+                   SRC_DIR=$(get_pkg_name ${PACK})
+                fi
+                ;;
+            hv)
+                URL=${HV_PACKAGES_URL}
+                ;;
+            pm)
+                URL=${CPAN_AUTHORS_URL}
+                if [ -z "${SRC_DIR}" ]; then
+                    # Default subdirectory on server
+                   SRC_DIR=$(get_pkg_name ${PACK})
+                fi
+                if [ -z "${FILE_EXT}" ]; then
+                    # Default file extension is tar.gz
+                    FILE_EXT="tar.gz"
+                fi
+                ;;
+           lfs)
+                URL=${LFS_PACKAGES_URL}
+                ;;
+            *)
+               echo "${FUNCNAME}(), unsupported mode ${MODE}"
+               return 1
+                ;;
+        esac
+    fi
+
+    if [ -z "${SRC_FILENAME}" ]; then
+        # Default source filename = name of package
+        SRC_FILENAME=${PACK}
+    fi
+
+    # Set FINAL_EXT to the final extension of the downloaded file
+    if [ -z "${FILE_EXT}" ]; then
+        # Default format is tar/bzip2 archive
+        FINAL_EXT=tar.bz2
+    else
+        if [ -n "${PREFER_BZIP2_ARCHIVE}" ]; then
+            # Force conversion to tar/bzip2 archive
+            FINAL_EXT=tar.bz2
+        else
+            # Do not convert
+            FINAL_EXT=${FILE_EXT}
+        fi
+    fi
+
+    if [ -z "${DEST_DIR}" ]; then
+        # Default destination directory
+        DEST_DIR=${LFS_PKG_DIR}
+    fi
+
+    mkdir -v -p ${DEST_DIR} >> ${LFS_LOG_FILE} 2>&1
+
+    if [ -z "${SRC_DIR}" ]; then
+        # Default source subdirectory on server
+        SRC_DIR=""
+    else
+        URL=${URL}/${SRC_DIR}
+    fi
+
+    # Search for any valid archive types...
+    for arch_ext in ${DEFAULT_ARCH_EXT_LIST}; do
+        if [ -f ${DEST_DIR}/${PACK}.${arch_ext} ]; then
+            FINAL_EXT=${arch_ext}
+        fi
+    done
+
+    DEST_FILE=${DEST_DIR}/${PACK}.${FINAL_EXT}
+
+    if [ ! -f ${DEST_FILE} ]; then
+        set +e
+        static_getpkg ${SRC_FILENAME} ${URL} ${FILE_EXT}
+        set -e
+
+        # Move file if source filename is not equal to package name and/or
+        # destination directory is not the default:
+        DOWNLOADED_FILE=${LFS_PKG_DIR}/${SRC_FILENAME}.${FINAL_EXT}
+        DEST_FILE=${DEST_DIR}/${PACK}.${FINAL_EXT}
+
+        if [ "${DEST_FILE}" != "${DOWNLOADED_FILE}" ]; then
+           mv ${DOWNLOADED_FILE} ${DEST_FILE}
+       fi
+    fi
+
+    if [ -n "${TEST_INTEGRITY}" ]; then
+        test_archive_integrity "${PACK}" "${DEST_FILE}" "${FINAL_EXT}"
+    fi
+
+    # Check for available patches with PACKAGE (TARGET) name.
+    static_getpatch ${PACK}
+
+    if [ ${SRC_FILENAME} != ${PACK} ]; then
+        # Check for available patches with SRC_FILENAME name.
+        static_getpatch ${SRC_FILENAME}
+
+        # Rename any patch fetched (in fpkg call) and replace SOURCE by TARGET
+        # in patch name.
+        if ls ${LFS_PKG_DIR}/${SRC_FILENAME}-*.patch 1> /dev/null 2>&1; then
+            echo "CMD=${SRC_FILENAME} ${PACK} ${LFS_PKG_DIR}/${SRC_FILENAME}-*.patch"
+           rename ${SRC_FILENAME} ${PACK} ${LFS_PKG_DIR}/${SRC_FILENAME}-*.patch
+        fi
+    fi
+}
+
+# Create a symbolic link to a package that is located in another stage
+# repository (to not have the same file twice).
+# Arg. #1: Source stage number (1, 2, 3, etc)
+# Arg. #2: Package name
+lpkg()
+{
+    SRCSTAGE="stage${1}"
+    FILE="${2}.tar.bz2"
+    PACKAGE_NAME="${2}"
+
+    # Checking for correct number of arguments
+    if [ $# -ne 2 ]; then
+       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
+       return 1
+    fi
+
+    if [ ! -h ${LFS_PKG_DIR}/${FILE} ]; then
+       # Issue a warning if source file doesn't exist.
+       if [ ! -f ${LFS_PKG_BASE}/${SRCSTAGE}/${FILE} ]; then
+            source_link_status=" (missing source file)"
+        else
+            source_link_status=""
+       fi
+
+       # Create link if it doesn't exist
+       rcmd "Linking ${PACKAGE_NAME}${source_link_status}" ln -s ../${SRCSTAGE}/${FILE} ${LFS_PKG_DIR}/${FILE}
+    fi
+
+    # Create link for patches corresponding to that package:
+    if ls ${LFS_PKG_BASE}/${SRCSTAGE}/${PACKAGE_NAME}-*.patch 1> /dev/null 2>&1; then
+       for patch in ${LFS_PKG_BASE}/${SRCSTAGE}/${PACKAGE_NAME}-*.patch; do
+           PATCHFILE=$(basename ${patch})
+           if [ ! -h ${LFS_PKG_DIR}/${PATCHFILE} ]; then
+               # Create link if it doesn't exist
+               rcmd "Linking ${PATCHFILE}" ln -s ../${SRCSTAGE}/${PATCHFILE} ${LFS_PKG_DIR}/${PATCHFILE}
+           fi
+       done
+    fi
+}
diff --git a/functions/gztobz2 b/functions/gztobz2
new file mode 100644 (file)
index 0000000..6c57f80
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+# Convert multiple compressed gzip files to bzip2.
+# Usage: gztobz2 [FILES]
+gztobz2()
+{
+    if [ $# = 0 ]; then
+       echo "$0: -- Convert multiple compressed gzip files to bzip2."
+       echo "Usage: $0: [FILES]"
+       return 1
+    fi
+    
+    while [ $# -ne 0 ]; do
+       local ORIG_GZIPPED_FILENAME=${1}
+       
+       # Checking if input file exist.
+       if [ ! -f $1 ]; then
+           echo "$0: File ${ORIG_GZIPPED_FILENAME} not found."
+           return 1
+       fi
+       
+       # Checking if input file is a valid gzipped file.
+       gzip -t ${ORIG_GZIPPED_FILENAME}
+       if [ $? -ne 0 ] ; then
+           echo "$0: File ${ORIG_GZIPPED_FILENAME} is not a valid gzip file."
+           return 1
+       fi
+       
+       # Obtaining uncompressed name of file
+       local FILENAME=$(gunzip -l ${ORIG_GZIPPED_FILENAME} | sed '1d' | sed 's/\(.*\)% \(.*\)/\2/')
+       
+       # Decompressing file to standard output and piping result to bzip2
+       gunzip ${ORIG_GZIPPED_FILENAME} --stdout | bzip2 --best > ${FILENAME}.bz2
+       if [ $? -ne 0 ] ; then
+           echo "$0: Error converting file ${ORIG_GZIPPED_FILENAME} to bzip2."
+           return 1
+       fi
+       
+       # Keeping the original file's timestamp
+       touch --reference=${ORIG_GZIPPED_FILENAME} ${FILENAME}.bz2
+       
+       # Deleting original gzipped file
+       if [ -f ${FILENAME}.bz2 ]; then
+           rm ${ORIG_GZIPPED_FILENAME}
+       fi
+       
+       shift
+    done
+}
diff --git a/functions/ipkg b/functions/ipkg
new file mode 100644 (file)
index 0000000..23a1e1a
--- /dev/null
@@ -0,0 +1,185 @@
+#!/bin/bash
+
+function_exists()
+{
+    local FUNCTION_NAME=$1
+
+    [ -z "$FUNCTION_NAME" ] && return 1
+
+    declare -F "$FUNCTION_NAME" > /dev/null 2>&1
+
+    return $?
+}
+
+unset -f hvpatch_pre
+unset -f hvconfig_pre
+unset -f hvconfig_cache
+unset -f hvconfig_post
+unset -f hvbuild_post
+
+ipkg_decompress_package()
+{
+    echo "Decompressing package"
+    decompress_package ${PACKAGE}
+
+    local DECOMPRESSED_DIRNAME=$(static_decompressed_dirname ${PACKAGE})
+
+    # Rename the decompressed package as per the package name if necessary
+    if [ "x${DECOMPRESSED_DIRNAME}" != "x${PACKAGE}" ]; then
+        mv -v ${LFS_TMP}/${DECOMPRESSED_DIRNAME} ${LFS_TMP}/${PACKAGE}
+    fi
+
+    # Displaying package source size in log file
+    echo "  Source size:" $(du -h -s ${LFS_TMP}/${PACKAGE} | awk '{ print $1 }') 1>> ${LFS_LOG_FILE}
+
+    # Removing old build directory (if any)
+    if [ -d ${LFS_TMP}/${PACKAGE}-build ]; then
+        echo "Removing old build directory"
+       rm -rf ${LFS_TMP}/${PACKAGE}-build
+    fi
+
+    # Creating build directory
+    mkdir -v ${LFS_TMP}/${PACKAGE}-build
+}
+
+# Default configure function
+hvconfig()
+{
+    if [ "x${IPKG_MODE}" = "xacnb" -o "x${IPKG_MODE}" = "xpm" ]; then
+        # Broken autoconf package that must build in source dir, or Perl module.
+        cd ${LFS_TMP}/${PACKAGE}
+    else
+        # Standard autoconf mode
+        cd ${LFS_TMP}/${PACKAGE}-build
+    fi
+
+    if [ "x${IPKG_MODE}" = "xpm" ]; then
+        # Configure Perl module.
+        # The option "-n" is used to avoid having to answer a question and
+        # accept the default configuration.
+        perl Makefile.PL -n ${CONFIGURE_OPTS}
+    else
+        # Standard configure script
+        ${LFS_TMP}/${PACKAGE}/configure ${CONFIGURE_OPTS}
+    fi
+}
+
+# Default build function
+hvbuild()
+{
+    if [ "x${IPKG_MODE}" = "xacnb" -o \
+        "x${IPKG_MODE}" = "xnoac" -o \
+        "x${IPKG_MODE}" = "xpm" ]; then
+        # Broken autoconf package that must build in source dir, or Perl module.
+        cd ${LFS_TMP}/${PACKAGE}
+    fi
+
+    ${HVMAKE}
+    ${HVMAKE} install
+}
+
+# Default patch applying function
+hvpatch()
+{
+    # Applying patches (if any)
+    apply_patches ${PACKAGE}
+}
+
+ipkg_finish()
+{
+    # Make sure to return to scripts directory
+    cd ${SCRDIR}
+
+    # Displaying package build size in log file
+    BUILD_SIZE=$(du -h -s -c ${LFS_TMP}/${PACKAGE} ${LFS_TMP}/${PACKAGE}-build | grep total | awk '{ print $1 }')
+    echo "  Build size : ${BUILD_SIZE}" 1>> ${LFS_LOG_FILE}
+
+    # Some scripts need to preserve the source or build directory. They can
+    # do so by renaming them.
+    if [ -d ${LFS_TMP}/${PACKAGE} ]; then
+       # Removing source directory
+        echo "Removing source directory"
+       rm -rf ${LFS_TMP}/${PACKAGE}
+    fi
+    if [ -d ${LFS_TMP}/${PACKAGE}-build ]; then
+       # Removing build directory
+        echo "Removing build directory"
+       rm -rf ${LFS_TMP}/${PACKAGE}-build
+    fi
+}
+
+# This is the main function doing all the work
+# Arg #1: alternate script name (optional)
+ipkg_script()
+{
+    if [ $# -eq 1 ]; then
+        # Use supplied script name
+        PACKAGE_DEF=${SCRDIR}/pkg/${1}
+    else
+        # Use default script name
+        PACKAGE_DEF=${SCRDIR}/pkg/$(get_pkg_name ${PACKAGE})
+
+    fi
+
+    ipkg_decompress_package
+
+    if [ -f ${PACKAGE_DEF} ]; then
+        echo "Load custom package functions and definitions from ${PACKAGE_DEF}"
+        source ${PACKAGE_DEF}
+    fi
+
+    # Execute pre-patch function if applicable
+    if function_exists hvpatch_pre ; then
+        echo "Running patch pre-script"
+        hvpatch_pre
+    fi
+
+    hvpatch
+
+    # Execute pre-configure function if applicable
+    if function_exists hvconfig_pre ; then
+        echo "Running configure pre-script"
+        hvconfig_pre
+    fi
+
+    # Execute config-cache function if applicable
+    if function_exists hvconfig_cache ; then
+        echo "Running configure cache script"
+        hvconfig_cache
+        CONFIGURE_OPTS="\
+            ${CONFIGURE_OPTS} \
+            --cache-file=${LFS_TMP}/${PACKAGE}-build/config.cache"
+    fi
+
+    # Add option --disable-dependency-tracking if supported
+    if cat ${LFS_TMP}/${PACKAGE}/configure | \
+        grep "disable-dependency-tracking" 1> /dev/null 2>&1; then
+        CONFIGURE_OPTS="\
+            ${CONFIGURE_OPTS} \
+            --disable-dependency-tracking"
+    fi
+
+    ipkg_display_build_infos
+
+    if [ "x${IPKG_MODE}" = "xnoac" ]; then
+        echo "Not calling configure because ${PACKAGE} has no configure script"
+    else
+        hvconfig
+    fi
+
+    # Execute post-configure function if applicable
+    if function_exists hvconfig_post ; then
+        echo "Running configure post-script"
+        hvconfig_post
+    fi
+
+    hvbuild
+
+    # Execute post-build function if applicable
+    if function_exists hvbuild_post ; then
+        echo "Running build post-script"
+        hvbuild_post
+    fi
+
+    ipkg_finish
+}
diff --git a/functions/main b/functions/main
new file mode 100644 (file)
index 0000000..c3c0e5d
--- /dev/null
@@ -0,0 +1,1128 @@
+#!/bin/bash
+set -o errtrace # Let shell functions inherit ERR trap.
+set -o errexit
+
+hvtrap_setup()
+{
+    # Setting ERR trap does implicit `set -o errexit'.
+    trap hvtrap_err ERR
+    trap hvtrap_int INT
+}
+
+hvtrap_err()
+{
+    echo
+    echo "*** An error occured during ${LFS_STAGE}"
+    exit 1
+}
+
+hvtrap_int()
+{
+    echo
+    echo "*** Installation interrupted during ${LFS_STAGE}"
+    exit 1
+}
+
+# Load default values
+source ../config/sysinfos.default
+
+if [ ! -f ../config/sysinfos ]; then
+    echo "Missing config/sysinfos configuration file."
+    return ${EXIT_FAILURE}
+fi
+
+# Load user-defined configuration values
+source ../config/sysinfos
+
+# We want hvtrap_setup called only with the first sourcing of this script.
+if [ -z "${HVTRAP_SETUP_DONE1}" ]; then
+    hvtrap_setup
+    export HVTRAP_SETUP_DONE1=1
+fi
+
+# Load stage number definition
+source ./stage.def
+
+# Load functions
+source ../functions/fpkg
+
+# Load list of packages and versions
+source ../config/packages-list
+
+# Constants for return codes
+EXIT_SUCCESS=0
+EXIT_WARNING=1
+EXIT_FAILURE=2
+
+# Position the cursor at the start of the line
+SET_CURSOR_START_LINE="\033[1G"
+# NORMAL prints text in normal color
+NORMAL="\033[0;39m"
+# SUCCESS prints text in a green colour
+SUCCESS="\033[1;32m"
+# WARNING prints text in a yellow colour
+WARNING="\033[1;33m"
+# FAILURE prints text in a red colour
+FAILURE="\033[1;31m"
+# Brackets are blue
+BRACKET="\033[1;34m"
+
+TAR_OPTS="-b8"
+
+# List of default archive extensions to try
+DEFAULT_ARCH_EXT_LIST="tar.bz2 tar.gz tgz tar.Z zip"
+
+HV_FONTS_PATH="/usr/share/fonts"
+
+DEFAULT_IPKG_SCRIPT="ipkg.def"
+
+HVMAKE="make -j ${MAKEJOBS}"
+
+case "${HVL_TARGET}" in
+    arm*)
+        CLFS_BUILDFLAGS="-mabi=aapcs-linux -mfloat-abi=soft"
+        CLFS_TARGET="arm-linux-gnueabi"
+        CLFS_ARCH=$(echo ${CLFS_TARGET} | sed -e 's/-.*//' -e 's/arm.*/arm/g')
+        CLFS_ENDIAN=$(echo ${CLFS_ARCH} | sed -e 's/armeb/BIG/' -e 's/arm/LITTLE/')
+        if [ "${CLFS_ENDIAN}" = "LITTLE" ]; then
+            CLFS_NOT_ENDIAN="BIG"
+        else
+            CLFS_NOT_ENDIAN="LITTLE"
+        fi
+       ;;
+    "x86_64")
+       CLFS_BUILDFLAGS="-m64"
+        CLFS_TARGET="${HVL_TARGET}-unknown-linux-gnu"
+        CLFS_ARCH=${HVL_TARGET}
+       ;;
+    "x86")
+        # No special flags
+       CLFS_BUILDFLAGS=""
+        CLFS_TARGET="i686-unknown-linux-gnu"
+        CLFS_ARCH=${HVL_TARGET}
+       ;;
+    *)
+       echo "Unsupported target architecture: ${HVL_TARGET}"
+       return ${EXIT_FAILURE}
+       ;;
+esac
+
+CLFS_HOST="$(echo $MACHTYPE | \
+    sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"
+
+export CLFS_BUILDFLAGS CLFS_TARGET CLFS_ARCH CLFS_HOST CLFS_ENDIAN CLFS_NOT_ENDIAN
+
+if [ -z "${LFS_STAGE}" ]; then
+    echo "LFS_STAGE is undefined (see stage.def)"
+    return ${EXIT_FAILURE}
+fi
+
+if [ "x${LFS_STAGE}" != "xstage0" -a "x${LFS_STAGE}" != "xstage1" ] ;then
+    LFS=""
+fi
+
+CLFS=${LFS}
+
+# Create log directory and log file for current stage if necessary
+# This should be done automatically...
+init_log_file()
+{
+    # Scripts directory
+    export SCRDIR=$(pwd)
+
+    export LFS_PKG_DIR="$(dirname $(pwd))/packages/${LFS_STAGE}"
+    export LFS_LOG_DIR=${LFS}/var/log/hvlinux-install/${LFS_STAGE}
+    export LFS_LOG_FILE=${LFS_LOG_DIR}/install.log
+    export LFS_TMP="${LFS}/tmp"
+
+    mkdir -p ${LFS_LOG_DIR} &&
+    if [ ! -f ${LFS_LOG_FILE} ]; then
+        touch ${LFS_LOG_FILE} || exit 1
+    fi
+}
+
+# Extracting the version number from a complete package name.
+# Arg. #1: Complete package name with version (ex: firefox-3.5.5.source will output 3.5.5)
+get_pkg_ver()
+{
+    # Checking for correct number of arguments
+    if [ $# -ne 1 ]; then
+       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
+       return 1
+    fi
+
+    echo ${1} | sed "s!.*-\([0-9].*\)!\1!g"
+}
+
+# Extracting the base version number from a complete package name.
+# Arg. #1: Complete package name with version (ex: gcc-3.4.4 will output 3.4)
+get_pkg_ver_base()
+{
+    # Checking for correct number of arguments
+    if [ $# -ne 1 ]; then
+       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
+       return 1
+    fi
+
+    echo ${1} | sed "s!^.*-\([0-9]*\.[0-9]*\).*!\1!g"
+}
+
+# Extracting the base version number from a complete package name.
+# Arg. #1: Complete package name with version (ex: gcc-3.4.4 will output 3)
+get_pkg_ver_major()
+{
+    # Checking for correct number of arguments
+    if [ $# -ne 1 ]; then
+       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
+       return 1
+    fi
+
+    echo ${1} | sed "s!^.*-\([0-9]*\)\..*!\1!g"
+}
+
+# Extracting the name from a complete package name.
+# Arg. #1: Complete package name with version (ex: gcc-3.4.4 will output gcc)
+get_pkg_name()
+{
+    # Checking for correct number of arguments
+    if [ $# -ne 1 ]; then
+       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
+       return 1
+    fi
+
+    # SED do not support non-greedy regexp:
+    # We want to match any characters preceeding a dash followed by a number
+    # (shortest match -> non-greedy)
+    echo ${1} | sed "s!\([^-][^0-9]*\)-[0-9].*!\1!"
+}
+
+# Saves the content of CFLAGS and CXXFLAGS environment variables.
+save_flags()
+{
+    export OLDCFLAGS=${CFLAGS}
+    export OLDCXXFLAGS=${CXXFLAGS}
+
+    return ${EXIT_SUCCESS}
+}
+
+# Saves the content of CFLAGS and CXXFLAGS environment variables, and then
+# set them to empty strings.
+save_flags_no_optimizations()
+{
+    export OLDCFLAGS=${CFLAGS}
+    export OLDCXXFLAGS=${CXXFLAGS}
+    export CFLAGS=""
+    export CXXFLAGS=""
+
+    return ${EXIT_SUCCESS}
+}
+
+# Restores the previous values of CFLAGS and CXXFLAGS environment variables. These
+# must have been saved first using save_flags().
+restore_flags()
+{
+    export CFLAGS=${OLDCFLAGS}
+    export CXXFLAGS=${OLDCXXFLAGS}
+
+    return ${EXIT_SUCCESS}
+}
+
+# Create symbolic links for start/stop scripts in /etc/rc.d
+#
+# Arg #1: script name
+# Arg #2: start number
+# Arg #3: stop number
+# Arg #4: level
+static_bootscript_add()
+{
+    local SCRIPTNAME=${1}
+    local START=${2}
+    local STOP=${3}
+    local RCLEVEL=${4}
+
+    local START_LEVELS=""
+    local STOP_LEVELS=""
+
+    if [ "x${RCLEVEL}" = "xsysinit" ]; then
+       START_LEVELS="sysinit"
+       STOP_LEVELS="0 6"
+    elif [ "x${RCLEVEL}" = "x3" ]; then
+       START_LEVELS="3 4 5"
+       STOP_LEVELS="0 1 2 6"
+    else
+       echo "${FUNCNAME}(), invalid level argument : ${*}"
+       return 1
+    fi
+
+    # Making sure bootscript has correct permissions
+    chmod -v 740 ${LFS}/etc/rc.d/init.d/${SCRIPTNAME}
+
+    # Removing any old links
+    for level in sysinit 0 1 2 3 4 5 6; do
+        cd ${LFS}/etc/rc.d/rc${level}.d
+       rm -v -f $(find . -name "???${SCRIPTNAME}")
+    done
+
+    if [ ${START} -ne 0 ]; then
+       # Creating new start links
+       for level in ${START_LEVELS}; do
+           cd ${LFS}/etc/rc.d/rc${level}.d
+           ln -v -s ../init.d/${SCRIPTNAME} S${START}${SCRIPTNAME}
+       done
+    fi
+
+    if [ ${STOP} -ne 0 ]; then
+       # Creating new stop links
+       for level in ${STOP_LEVELS}; do
+           cd ${LFS}/etc/rc.d/rc${level}.d
+           ln -v -s ../init.d/${SCRIPTNAME} K${STOP}${SCRIPTNAME}
+       done
+    fi
+}
+
+# Create symbolic links for start/stop scripts in /etc/rc.d
+#
+# Arg #1: level
+# Arg #2: script name
+# Arg #3: start number
+# Arg #4: stop number
+bootscript_add_manual()
+{
+    local RCLEVEL=${1}
+    local SCRIPTNAME=${2}
+    local START=${3}
+    local STOP=${4}
+
+    # Making sure bootscript has correct permissions
+    chmod 740 ${LFS}/etc/rc.d/init.d/${SCRIPTNAME}
+
+    # Removing any old links
+    cd ${LFS}/etc/rc.d/rc${RCLEVEL}.d
+    rm -v -f $(find . -name "???${SCRIPTNAME}")
+
+    if [ ${START} -ne 0 ]; then
+       # Creating new start link
+       cd ${LFS}/etc/rc.d/rc${RCLEVEL}.d
+       ln -v -s ../init.d/${SCRIPTNAME} S${START}${SCRIPTNAME}
+    fi
+
+    if [ ${STOP} -ne 0 ]; then
+       # Creating new stop link
+       cd ${LFS}/etc/rc.d/rc${RCLEVEL}.d
+       ln -v -s ../init.d/${SCRIPTNAME} K${STOP}${SCRIPTNAME}
+    fi
+}
+
+# Create symbolic links for start/stop scripts in /etc/rc.d
+#
+# Arg #1: script name
+# Arg #2: start number
+# Arg #3: stop number
+bootscript_add_rc3()
+{
+    static_bootscript_add ${*} 3
+}
+
+# Create symbolic links for start/stop scripts in /etc/rc.d
+#
+# Arg #1: script name
+# Arg #2: start number
+# Arg #3: stop number
+bootscript_add_rcsysinit()
+{
+    static_bootscript_add ${*} sysinit
+}
+
+# Add "export" before the variable name
+#
+# Arg #1: variable name
+# Arg #2: filename where the variable is located
+var_export()
+{
+    VARIABLE=${1}
+    FILE=${2}
+
+    # Checking for correct number of arguments
+    if [ $# -ne 2 ]; then
+       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
+       return 1
+    fi
+
+    # Checking if file exists
+    if [ ! -f ${FILE} ]; then
+       echo "${FUNCNAME}(), file not found: ${FILE}"
+       return 1
+    fi
+
+    # Checking if variable exists
+    if ! grep "${VARIABLE}=" ${FILE} 1> /dev/null 2>&1; then
+       echo "${FUNCNAME}(), variable not found: ${VARIABLE}"
+       return 1
+    fi
+
+    # Checking if variable is already exported when it is defined
+    if grep "${VARIABLE}=" ${FILE} | grep "export " 1> /dev/null 2>&1; then
+       echo "${FUNCNAME}(), variable already exported in definition: ${VARIABLE}"
+       return 0
+    fi
+
+    # Checking if variable is already exported, in
+    # a "export VARIABLE1 VARIABLE2..." statement
+    if grep "export " ${FILE} | grep " ${VARIABLE}" 1> /dev/null 2>&1; then
+       echo "${FUNCNAME}(), variable already exported in export list: ${VARIABLE}"
+       return 0
+    fi
+
+    sed -i "s!\(^${VARIABLE}=.*\)!export \1!" ${FILE}
+}
+
+# Adding a new environment variable to a file.
+#
+# Arg #1: variable name
+# Arg #2: filename where the variable is located
+# Arg #3: new variable value
+# Arg #4: separator string (usually a " " or ":")
+var_add()
+{
+    VARIABLE=${1}
+    FILE=${2}
+    VALUE="${3}"
+    SEP="${4}"
+
+    # Checking for correct number of arguments
+    if [ $# -ne 4 ]; then
+       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
+       return 1
+    fi
+
+    # Checking if file exists
+    if [ ! -f ${FILE} ]; then
+       echo "${FUNCNAME}(), file not found: ${FILE}"
+       return 1
+    fi
+
+    # Checking if variable exists
+    if ! grep "${VARIABLE}=" ${FILE} 1> /dev/null 2>&1; then
+       echo "${VARIABLE}=\"${VALUE}\"" >> ${FILE}
+       return $?
+    fi
+
+    # Checking if variable contains the new value
+    if grep "${VARIABLE}=" ${FILE} | grep "${VALUE}" 1> /dev/null 2>&1; then
+       echo "${FUNCNAME}(), variable ${VARIABLE} already contains value: ${VALUE}"
+       return 0
+    fi
+
+    # Adding new value to variable (case where no export before)
+    # We search for the variable name starting at the beginning of the line
+    # For example, this ensures that if the variable name is PATH, then
+    # PATH=... matches but not MANPATH=...
+    if grep "^${VARIABLE}=\"" ${FILE} 1> /dev/null 2>&1; then
+       # Variable value is enclosed by double-quotes
+       sed -i "s!\(^${VARIABLE}=\".*\)\(\"\)!\1${SEP}${VALUE}\"!" ${FILE}
+    else
+       # Variable value is NOT enclosed by double-quotes
+       sed -i "s!\(^${VARIABLE}=.*\)!\1${SEP}${VALUE}!" ${FILE}
+    fi
+
+    # Adding new value to variable (case with export before)
+    # We search for the variable name starting after an export statement,
+    # at the beginning of a line.
+    # For example, this ensures that if the variable name is PATH, then
+    # PATH=... matches but not MANPATH=...
+    if grep "^export ${VARIABLE}=\"" ${FILE} 1> /dev/null 2>&1; then
+       # Variable value is enclosed by double-quotes
+       sed -i "s!\(^export ${VARIABLE}=\".*\)\(\"\)!\1${SEP}${VALUE}\"!" ${FILE}
+    else
+       # Variable value is NOT enclosed by double-quotes
+       sed -i "s!\(^export ${VARIABLE}=.*\)!\1${SEP}${VALUE}!" ${FILE}
+    fi
+
+    return $?
+}
+
+# Adding a new path environment variable to a file.
+#
+# Arg #1: variable name
+# Arg #2: filename where the variable is located
+# Arg #3: new variable value
+var_add_path()
+{
+    var_add ${1} ${2} "${3}" ":" 1>> ${LFS_LOG_FILE} 2>&1
+}
+
+# Adding a new string environment variable to a file.
+#
+# Arg #1: variable name
+# Arg #2: filename where the variable is located
+# Arg #3: new variable value
+var_add_str()
+{
+    var_add ${1} ${2} "${3}" " "
+}
+
+# Adding a new string to a file.
+#
+# Arg #1: string
+# Arg #2: filename where the variable is located
+string_add()
+{
+    STRING="${1}"
+    FILE=${2}
+
+    # Checking for correct number of arguments
+    if [ $# -ne 2 ]; then
+       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
+       return 1
+    fi
+
+    # Checking if file exists
+    if [ ! -f ${FILE} ]; then
+       echo "${FUNCNAME}(), file not found: ${FILE}"
+       return 1
+    fi
+
+    # Checking if string exists
+    if grep "${STRING}" ${FILE} 1> /dev/null 2>&1; then
+       echo "${FUNCNAME}(), string already defined: ${STRING}"
+       return 0
+    fi
+
+    echo "${STRING}" >> ${FILE}
+}
+
+# Adding a new environment variable to a shadow password suite file (login.defs)
+#
+# Arg #1: variable name
+# Arg #2: filename where the variable is located
+# Arg #3: new variable value
+var_add_shadow()
+{
+    VARIABLE=${1}
+    FILE=${2}
+    VALUE="${3}"
+
+    # Checking for correct number of arguments
+    if [ $# -ne 3 ]; then
+       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
+       return 1
+    fi
+
+    # Checking if file exists
+    if [ ! -f ${FILE} ]; then
+       echo "${FUNCNAME}(), file not found: ${FILE}"
+       return 1
+    fi
+
+    # Checking if variable contains the new value
+    if egrep "^${VARIABLE}" ${FILE} | grep "${VALUE}" 1> /dev/null 2>&1; then
+       echo "${FUNCNAME}(), variable ${VARIABLE} already contains value: ${VALUE}"
+       return 0
+    fi
+
+    # Adding new value to variable
+    # We search for the variable name starting at the beginning of the line
+    # For example, this ensures that if the variable name is PATH, then
+    # PATH... matches but not MANPATH...
+    sed -i "s!\(^${VARIABLE}.*\)!\1:${VALUE}!" ${FILE}
+}
+
+# Adding a new group, checking if it already exist before.
+# Arguments: same arguments as for standard groupadd command.
+hv_groupadd()
+{
+    arguments=${*}
+
+    # The last argument is the group name
+    while [ $# -ne 0 ]; do
+       groupname=${*}
+       shift
+    done
+
+    if ! cat /etc/group | egrep "^${groupname}:" 1> /dev/null 2>&1; then
+        groupadd ${arguments}    
+    fi
+}
+
+# Adding a new user, checking if it already exist before
+# Arguments: same arguments as for standard useradd command.
+hv_useradd()
+{
+    arguments="${*}"
+
+    # The last argument is the user name
+    while [ $# -ne 0 ]; do
+       username=${*}
+       shift
+    done
+
+    if ! cat /etc/passwd | egrep "^${username}:" 1> /dev/null 2>&1; then
+        useradd ${arguments}
+    fi
+}
+
+# Applying patch
+# First argument is the name of the patch
+# Second argument is the package name (target dir in $LFS_TMP)
+apply_patch()
+{
+    local PATCH_FILE=${1}
+    local TARGET_DIR=${2}
+
+    if [ -z "${PATCH_FILE}" ]; then
+        echo
+       echo "apply_patch(): no patch specified."
+       return ${EXIT_FAILURE}
+    fi
+
+    if [ ! -f ${LFS_PKG_DIR}/${PATCH_FILE} ]; then
+        echo
+       echo "${FUNCNAME}(): patch file '${PATCH_FILE}' not found."
+       return ${EXIT_FAILURE}
+    fi
+
+    echo "Applying patch: ${PATCH_FILE}"
+    patch -Np1 -d ${LFS_TMP}/${TARGET_DIR} -i ${LFS_PKG_DIR}/${PATCH_FILE}
+}
+
+# Applying any patch(es) found for the current package.
+# Will work only if patches have the same base name as
+# the package, followed by a dash:
+#    ${1}-*.patch
+#
+# 1st argument: Package name
+# 2: optional target directory.
+apply_patches()
+{
+    PACKAGE=${1}
+    local TARGET_DIR=${PACKAGE}
+
+    # Checking for correct number of arguments
+    if [ $# -gt 2 ]; then
+       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
+       echo "Usage: ${FUNCNAME} PACKAGE-NAME"
+       exit ${EXIT_FAILURE}
+    fi
+
+    if [ $# -eq 2 ]; then
+       TARGET_DIR=${2}
+    else
+       TARGET_DIR=${PACKAGE}
+    fi
+
+    # Checking if we can find at least one patch.
+    if ls ${LFS_PKG_DIR}/${1}-*.patch 1> /dev/null 2>&1; then
+       cd ${LFS_PKG_DIR}
+       for patch in ${1}-*.patch; do
+            apply_patch ${patch} ${TARGET_DIR}
+       done
+    fi
+
+    return $?
+}
+
+# Obtain the name of the base directory for the decompressed package.
+# First argument: package name
+static_decompressed_dirname()
+{
+    local PACKAGE=${1}
+
+    for arch_ext in ${DEFAULT_ARCH_EXT_LIST}; do
+        if [ ! -f ${LFS_PKG_DIR}/${PACKAGE}.${arch_ext} ]; then
+            # Try next archive extension.
+            continue;
+        fi
+
+        case ${arch_ext} in
+           tar.bz2|tar.gz|tgz|tar.Z)
+                # Remove optional "./" leading component with sed
+                # and extract base directory name with awk.
+                # tar 1.23 reports an error when using pipes, so
+                # remove error message with "2> /dev/null"
+                local DIRNAME=$(tar ${TAR_OPTS} -tf ${LFS_PKG_DIR}/${PACKAGE}.tar.bz2 2> /dev/null | head -n1 | sed 's!^\./!!' | awk -F \/ '{print $1}')
+                echo ${DIRNAME}
+                ;;
+            zip)
+                # TODO
+                echo ${PACKAGE}
+                ;;
+        esac
+
+        return $?
+    done
+
+    # Failure or file not found
+    echo "${FUNCNAME}(): Missing source package for \"${PACKAGE}\"" > /dev/stderr
+    return ${EXIT_FAILURE}
+}
+
+# Decompression of a package
+# First argument: package name
+# Second argument: directory where decompressing (optional, defaults to LFS_TMP)
+decompress_package()
+{
+    # Checking for correct number of arguments
+    if [ $# -eq 1 ]; then
+       local TOPDIR=${LFS_TMP}
+    elif [ $# -eq 2 ]; then
+       local TOPDIR=${2}
+    else
+       echo "${FUNCNAME}(): Incorrect number of arguments (must be 1 or 2)" > /dev/stderr
+       return ${EXIT_FAILURE}
+    fi
+
+    local PACKAGE=${1}
+
+    for arch_ext in ${DEFAULT_ARCH_EXT_LIST}; do
+        if [ ! -f ${LFS_PKG_DIR}/${PACKAGE}.${arch_ext} ]; then
+            # Try next archive extension.
+            continue;
+        fi
+
+        if [ -d ${TOPDIR}/${PACKAGE} ]; then
+            # Removing old source directory (if any)
+           rm -rf ${TOPDIR}/${PACKAGE}
+        fi
+
+        # Decompressing package
+        case ${arch_ext} in
+           tar.bz2)
+                tar -C ${TOPDIR} ${TAR_OPTS} -jxf \
+                    ${LFS_PKG_DIR}/${PACKAGE}.${arch_ext}
+                ;;
+           tar.gz|tgz|tar.Z)
+                tar -C ${TOPDIR} ${TAR_OPTS} -zxf \
+                    ${LFS_PKG_DIR}/${PACKAGE}.${arch_ext}
+                ;;
+            zip)
+                unzip -qq -d ${TOPDIR} ${LFS_PKG_DIR}/${PACKAGE}.${arch_ext}
+                ;;
+        esac
+
+        return $?
+    done
+
+    # Failure or file not found
+    echo "${FUNCNAME}(): Missing source package for \"${PACKAGE}\"" > /dev/stderr
+    return ${EXIT_FAILURE}
+}
+
+ipkg_trap_setup()
+{
+    exec 6>&1 # Save current "value" of stdout.
+    trap ipkg_trap_handler INT TERM EXIT ERR
+}
+
+ipkg_trap_end()
+{
+    trap - INT TERM EXIT ERR
+
+    # Restore global trap
+    hvtrap_setup
+}
+
+ipkg_trap_handler()
+{
+    exec 1>&6 6>&- # Restore stdout and close file descriptor #6.
+    print_status failure
+
+    ipkg_trap_end
+    exit 1
+}
+
+ipkg_display_build_infos()
+{
+    echo "hvlinux: configure options:"
+    for opt in ${CONFIGURE_OPTS}; do
+        echo "  ${opt}"
+    done
+    echo "hvlinux: environment variables:"
+    echo "  HOST:     ${CLFS_HOST}"
+    echo "  TARGET:   ${CLFS_TARGET}"
+    echo "  BUILD64:  ${BUILD64}"
+    echo "  CFLAGS:   ${CFLAGS}"
+    echo "  CPPFLAGS: ${CPPFLAGS}"
+    echo "  CXXFLAGS: ${CFLAGS}"
+    echo "  LDFLAGS:  ${LDFLAGS}"
+    echo "  RANLIB:   ${RANLIB}"
+    echo "  CC:       ${CC}"
+    echo "  CXX:      ${CXX}"
+    echo "  AR:       ${AR}"
+    echo "  AS:       ${AS}"
+    echo "  PATH:     ${PATH}"
+
+    GCCCPUOPT=$(gcc ${MARCH_FLAGS} -E -v - </dev/null 2>&1 | \
+        sed -n 's/.* -v - //p')
+    echo "  GCC CPU OPTIONS: ${GCCCPUOPT}"
+}
+
+# Installation of a package
+# Arg. #1: Package name and version (ex: gcc-4.5.1)
+# Remaining arguments: Additional configure options
+# Options:
+#   -h     Display this help and returns
+#   -l     Unique identification label in 'install.log'
+#          (default is package name and version)
+#   -m     Installation mode:
+#            ac   Standard autoconf package, build in separate dir (default)
+#            acnb Standard autoconf package, build in source dir
+#            noac No autoconf (configure)
+#            gnome
+#            xorg
+#            pm
+#   -s     Name of script to source (default is from name of package)
+ipkg()
+{
+    START_TIME=$(echo `date +%s`)
+
+    unset ALT_SCRIPT_NAME
+    export IPKG_MODE="ac" # Default mode if not specified
+    export HVLABEL="" # Global variable
+
+    while getopts "l:m:s:" flag ;do
+        case ${flag} in
+           l)
+                # Alternate label
+                HVLABEL=${OPTARG}
+               ;;
+           m)
+                # Installation mode
+                case ${OPTARG} in
+                   ac|acnb|noac|gnome|xorg|pm)
+                        IPKG_MODE=${OPTARG}
+                       ;;
+                    *)
+                       echo "${FUNCNAME}(): Unsupported mode: ${OPTARG}."
+                       return 1
+                        ;;
+                esac
+                ;;
+           s)
+                # Alternate script name
+                ALT_SCRIPT_NAME=${OPTARG}
+               ;;
+           ?)
+               echo "${FUNCNAME}(): Invalid option: ${OPTARG}."
+               return 1
+               ;;
+        esac
+    done
+    shift `expr "${OPTIND}" - 1`
+
+    unset OPTSTRING
+    unset OPTIND
+    unset OPTARG
+
+    export PACKAGE=${1}
+
+    # Checking for correct number of arguments
+    if [ $# -lt 1 ]; then
+        echo
+       echo "${FUNCNAME}(): Missing argument"
+       echo "  command was: \"${FUNCNAME}() $*\""
+       exit ${EXIT_FAILURE}
+    fi
+
+    shift
+    export CONFIGURE_OPTS=${*}
+
+    if [ -z "${HVLABEL}" ]; then
+        # Default label = package name and version
+        HVLABEL=${PACKAGE}
+    fi
+
+    PACKAGE_LOG=${LFS_LOG_DIR}/${HVLABEL}.log
+
+    # Checking if package was previously successfully installed
+    if grep "^${HVLABEL} successfully installed" ${LFS_LOG_FILE} \
+        1> /dev/null 2>&1; then
+       return $EXIT_SUCCESS
+    fi
+
+    # Displaying label
+    MSGSTRING="Installing ${HVLABEL}"
+    display_checkbox_msg ${MSGSTRING}
+
+    ipkg_trap_setup
+
+    echo "------------------------" 1>> ${LFS_LOG_FILE}
+    echo "${MSGSTRING}" 1>> ${LFS_LOG_FILE}
+
+    exec 7>&1 # Save current "value" of stdout.
+    # All output from commands in this block sent to file $LFS_LOG_FILE.
+    exec >> ${LFS_LOG_FILE} 2>&1
+    ipkg_display_build_infos
+    exec 1>&7 7>&- # Restore stdout and close file descriptor #7.
+
+    # All output from commands in this block sent to file $PACKAGE_LOG.
+    exec > ${PACKAGE_LOG} 2>&1
+
+    # Sourcing standard ac script.
+    source ${SCRDIR}/../functions/ipkg
+    source ${SCRDIR}/${DEFAULT_IPKG_SCRIPT}
+    ipkg_script ${ALT_SCRIPT_NAME}
+
+    # Make sure we are at a known location
+    cd ${SCRDIR}
+
+    exec 1>&6 # Restore stdout.
+
+    # Writing success string to the end of the log file
+    echo "${HVLABEL} successfully installed" 1>> ${LFS_LOG_FILE}
+
+    # Displaying build time after the package name
+    print_status success
+
+    ipkg_trap_end
+
+    return $EXIT_SUCCESS
+}
+
+# Display the action name, run a command, log its output and display it's
+# status. Write to install log file when successfully completed so it
+# won't be called again after a successfull installation.
+
+# First  argument: "once" -> script is run only once
+#                  "mult" -> script can be run more than once
+# Second argument: Message to display during script
+# Third  argument: script name (will be label)
+rscr()
+{
+    START_TIME=$(echo `date +%s`)
+
+    # Checking for correct number of arguments
+    if [ $# -lt 3 ]; then
+       echo "${FUNCNAME}(): Missing argument(s)"
+       exit ${EXIT_FAILURE}
+    fi
+
+    SCRMODE=${1}
+    MSGSTRING=${2}
+    SCRIPT=${3}
+    HVLABEL=${SCRIPT}
+    shift
+    shift
+    SCRIPT_ARGS=${*}
+
+    # Make sure we are at a known location
+    cd ${SCRDIR}
+
+    # Checking script mode:
+    if [ "x${SCRMODE}" != "xonce" -a "x${SCRMODE}" != "xmult" ]; then
+       echo "${FUNCNAME}(): First argument invalid, must be \"once\" or \"mult\" (\"${SCRMODE}\" given)"
+       exit ${EXIT_FAILURE}
+    fi
+
+    # Checking if script is valid and executable
+    if [ ! -x ${SCRDIR}/${SCRIPT} ]; then
+       echo "${FUNCNAME}(): script not found: ${SCRIPT}"
+       exit ${EXIT_FAILURE}
+    fi
+
+    PACKAGE_LOG=${LFS_LOG_DIR}/${HVLABEL}.log
+
+    if [ "x${SCRMODE}" = "xonce" ]; then
+        # Checking if package was previously successfully installed
+        if grep "^${HVLABEL} successfully installed" ${LFS_LOG_FILE} 1> /dev/null 2>&1; then
+           return $EXIT_SUCCESS
+        fi
+    fi
+
+    display_checkbox_msg ${MSGSTRING}
+
+    ipkg_trap_setup
+
+    echo "------------------------" 1>> ${LFS_LOG_FILE}
+    echo ${HVLABEL} 1>> ${LFS_LOG_FILE}
+
+    # Executing script
+    ${SCRDIR}/${SCRIPT} ${SCRIPT_ARGS} 1>> ${PACKAGE_LOG} 2>&1
+
+    if [ "x${SCRMODE}" = "xonce" ]; then
+        # Writing success string to the end of the log file
+        echo "${HVLABEL} successfully installed" 1>> ${LFS_LOG_FILE}
+    fi
+
+    # Displaying build time after the package name
+    print_status success
+
+    ipkg_trap_end
+
+    return $EXIT_SUCCESS
+}
+
+rcmd_trap_setup()
+{
+    exec 6>&1 # Save current "value" of stdout.
+    trap rcmd_trap_handler INT TERM EXIT ERR
+}
+
+rcmd_trap_end()
+{
+    trap - INT TERM EXIT ERR
+
+    # We do not restore global trap
+}
+
+rcmd_trap_handler()
+{
+    exec 1>&6 6>&- # Restore stdout to fd #6, where it had been saved,
+                   # and close file descriptor #6.
+    print_status failure
+
+    rcmd_trap_end
+    if [ -n "${RCMD_NO_EXIT}" ]; then
+        return ${EXIT_FAILURE}
+    else
+        exit ${EXIT_FAILURE}
+    fi
+}
+
+# Run command, no log
+# First  argument: Message to display during script
+# Second argument: command + arguments
+rcmd()
+{
+    START_TIME=$(echo `date +%s`)
+
+    # Checking for correct number of arguments
+    if [ $# -lt 2 ]; then
+       echo "${FUNCNAME}(): Missing argument(s)"
+       exit ${EXIT_FAILURE}
+    fi
+
+    local MSGSTRING=${1}
+    local CMD=${2}
+    shift
+    local CMD_WITH_ARGS=${*}
+
+    display_checkbox_msg ${MSGSTRING}
+
+    rcmd_trap_setup
+
+    echo ${CMD_WITH_ARGS} 1>> ${LFS_LOG_FILE}
+
+    # Executing command
+    ${CMD_WITH_ARGS} 1>> ${LFS_LOG_FILE} 2>&1
+
+    if [ $? -ne 0 ]; then
+        if [ -n "${RCMD_NO_EXIT}" ]; then
+            return ${EXIT_FAILURE}
+        else
+           exit ${EXIT_FAILURE}
+        fi
+    fi
+
+    # Displaying build time after the package name
+    print_status success
+
+    rcmd_trap_end
+
+    return $EXIT_SUCCESS
+}
+
+get_total_build_time()
+{
+    INFILE=${1}
+
+    # Checking for correct number of arguments
+    if [ $# -ne 1 ]; then
+       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
+       echo "Usage: ${FUNCNAME} LOGFILE"
+       exit ${EXIT_FAILURE}
+    fi
+
+    TIMES=$(cat ${INFILE} | grep "Build time:" | sed "s!Build time: \(.*\)h!\1!g")
+
+    for time in ${TIMES}; do
+       HOURS=$(( $HOURS + $(echo ${time} | sed "s!^\([0-9]*\)\..*!\1!g") ))
+       
+       # The first SED command extracts the minutes (fractions of an hour).
+       # The second SED command removed the leading zero, if applicable.
+       MIN=$(( $MIN + $(echo ${time} | sed "s!.*\.\([0-9][0-9]\)!\1!g" | sed "s!^0\([0-9]\)!\1!g" ) ))
+    done
+    
+    HOURS=$(( ${HOURS} + ( ${MIN} / 100 ) ))
+    MIN=$(( ${MIN} % 100 ))
+    
+    echo "${HOURS}.${MIN}"
+}
+
+# Global variable: START_TIME
+display_build_time()
+{
+    END_TIME=$(echo `date +%s`)
+
+    HOURS=$(( ( ${END_TIME} - ${START_TIME} ) / 3600 ))
+    echo -n " ("${HOURS}"."
+    echo -n "  Build time: ${HOURS}." 1>> ${LFS_LOG_FILE}
+
+    # Time is inferior to 1 hour...
+    MINUTES=$(( ( ( ${END_TIME} - ${START_TIME} ) % 3600 ) / 36 ))
+
+    if [ ${MINUTES} -lt 10 ]; then
+       echo -n "0"
+       echo -n "0" 1>> ${LFS_LOG_FILE}
+    fi
+
+    if [ ${MINUTES} -eq 0 ]; then
+       echo -n "1"
+       echo -n "1" 1>> ${LFS_LOG_FILE}
+    else
+       echo -n ${MINUTES}
+       echo -n ${MINUTES} 1>> ${LFS_LOG_FILE}
+    fi
+
+    echo -n "h)"
+    echo "h" 1>> ${LFS_LOG_FILE}
+}
+
+# Global variable: MSGSTRING
+display_checkbox_msg()
+{
+    echo -en "${BRACKET}[ ${BRACKET}]${NORMAL} ${MSGSTRING}"
+}
+
+# The print_status prints a coloured "X" letter inside the checkbox to the left
+# of the screen (the checkbox is already displayed, and the cursor must have
+# been saved to where to put the mark).
+# 1st arg: status: success, warning or failure
+# Global variables: MSGSTRING and START_TIME
+print_status()
+{
+    if [ $# -ne 1 ]; then
+        # If no parameters are given to the print_status function, print usage
+        # information.
+       echo "Usage: ${FUNCNAME}() {success|warning|failure} [STRING] [TIME]"
+       return ${EXIT_FAILURE}
+    fi
+
+    local COLOR=""
+
+    case "${1}" in
+       success)
+           COLOR=$SUCCESS
+           ;;
+       warning)
+           COLOR=$WARNING
+           ;;
+       failure)
+           COLOR=$FAILURE
+           ;;
+       *)
+           echo "Usage: ${FUNCNAME}() {success|warning|failure}"
+           return ${EXIT_FAILURE}
+           ;;
+    esac
+
+    # Reposition cursor at start of line
+    echo -en "${SET_CURSOR_START_LINE}"
+    # Display colored 'X'
+    echo -en "${BRACKET}[${COLOR}X${BRACKET}]${NORMAL} ${MSGSTRING}"
+
+    if [ "x${MSGSTRING}" != "x" ]; then
+        display_build_time
+    fi
+
+    echo
+}
diff --git a/main b/main
deleted file mode 100644 (file)
index 4ba1f99..0000000
--- a/main
+++ /dev/null
@@ -1,1104 +0,0 @@
-#!/bin/bash
-set -o errtrace # Let shell functions inherit ERR trap.
-set -o errexit
-
-# Constants for return codes
-EXIT_SUCCESS=0
-EXIT_WARNING=1
-EXIT_FAILURE=2
-
-# Position the cursor at the start of the line
-SET_CURSOR_START_LINE="\033[1G"
-# NORMAL prints text in normal color
-NORMAL="\033[0;39m"
-# SUCCESS prints text in a green colour
-SUCCESS="\033[1;32m"
-# WARNING prints text in a yellow colour
-WARNING="\033[1;33m"
-# FAILURE prints text in a red colour
-FAILURE="\033[1;31m"
-# Brackets are blue
-BRACKET="\033[1;34m"
-
-TAR_OPTS="-b8"
-
-# List of default archive extensions to try
-MY_ARCH_EXT="tar.bz2 tar.gz tgz tar.Z zip"
-
-HV_FONTS_PATH="/usr/share/fonts"
-
-DEFAULT_IPKG_SCRIPT="ipkg.def"
-
-source ./stage.def
-
-HVMAKE="make -j ${MAKEJOBS}"
-
-case "${HVL_TARGET}" in
-    arm*)
-        CLFS_BUILDFLAGS="-mabi=aapcs-linux -mfloat-abi=soft"
-        CLFS_TARGET="arm-linux-gnueabi"
-        CLFS_ARCH=$(echo ${CLFS_TARGET} | sed -e 's/-.*//' -e 's/arm.*/arm/g')
-        CLFS_ENDIAN=$(echo ${CLFS_ARCH} | sed -e 's/armeb/BIG/' -e 's/arm/LITTLE/')
-        if [ "${CLFS_ENDIAN}" = "LITTLE" ]; then
-            CLFS_NOT_ENDIAN="BIG"
-        else
-            CLFS_NOT_ENDIAN="LITTLE"
-        fi
-       ;;
-    "x86_64")
-       CLFS_BUILDFLAGS="-m64"
-        CLFS_TARGET="${HVL_TARGET}-unknown-linux-gnu"
-        CLFS_ARCH=${HVL_TARGET}
-       ;;
-    "x86")
-        # No special flags
-       CLFS_BUILDFLAGS=""
-        CLFS_TARGET="i686-unknown-linux-gnu"
-        CLFS_ARCH=${HVL_TARGET}
-       ;;
-    *)
-       echo "Unsupported target architecture: ${HVL_TARGET}"
-       return ${EXIT_FAILURE}
-       ;;
-esac
-
-CLFS_HOST="$(echo $MACHTYPE | \
-    sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"
-
-export CLFS_BUILDFLAGS CLFS_TARGET CLFS_ARCH CLFS_HOST CLFS_ENDIAN CLFS_NOT_ENDIAN
-
-if [ -z "${LFS_STAGE}" ]; then
-    echo "LFS_STAGE is undefined (see stage.def)"
-    return ${EXIT_FAILURE}
-fi
-
-if [ "x${LFS_STAGE}" != "xstage0" -a "x${LFS_STAGE}" != "xstage1" ] ;then
-    LFS=""
-fi
-
-CLFS=${LFS}
-
-# Create log directory and log file for current stage if necessary
-# This should be done automatically...
-init_log_file()
-{
-    # Scripts directory
-    export SCRDIR=$(pwd)
-
-    export LFS_PKG_DIR="$(dirname $(pwd))/packages/${LFS_STAGE}"
-    export LFS_LOG_DIR=${LFS}/var/log/hvlinux-install/${LFS_STAGE}
-    export LFS_LOG_FILE=${LFS_LOG_DIR}/install.log
-    export LFS_TMP="${LFS}/tmp"
-
-    mkdir -p ${LFS_LOG_DIR} &&
-    if [ ! -f ${LFS_LOG_FILE} ]; then
-        touch ${LFS_LOG_FILE} || exit 1
-    fi
-}
-
-# Extracting the version number from a complete package name.
-# Arg. #1: Complete package name with version (ex: firefox-3.5.5.source will output 3.5.5)
-get_pkg_ver()
-{
-    # Checking for correct number of arguments
-    if [ $# -ne 1 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    echo ${1} | sed "s!.*-\([0-9].*\)!\1!g"
-}
-
-# Extracting the base version number from a complete package name.
-# Arg. #1: Complete package name with version (ex: gcc-3.4.4 will output 3.4)
-get_pkg_ver_base()
-{
-    # Checking for correct number of arguments
-    if [ $# -ne 1 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    echo ${1} | sed "s!^.*-\([0-9]*\.[0-9]*\).*!\1!g"
-}
-
-# Extracting the base version number from a complete package name.
-# Arg. #1: Complete package name with version (ex: gcc-3.4.4 will output 3)
-get_pkg_ver_major()
-{
-    # Checking for correct number of arguments
-    if [ $# -ne 1 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    echo ${1} | sed "s!^.*-\([0-9]*\)\..*!\1!g"
-}
-
-# Extracting the name from a complete package name.
-# Arg. #1: Complete package name with version (ex: gcc-3.4.4 will output gcc)
-get_pkg_name()
-{
-    # Checking for correct number of arguments
-    if [ $# -ne 1 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    # SED do not support non-greedy regexp:
-    # We want to match any characters preceeding a dash followed by a number
-    # (shortest match -> non-greedy)
-    echo ${1} | sed "s!\([^-][^0-9]*\)-[0-9].*!\1!"
-}
-
-# Saves the content of CFLAGS and CXXFLAGS environment variables.
-save_flags()
-{
-    export OLDCFLAGS=${CFLAGS}
-    export OLDCXXFLAGS=${CXXFLAGS}
-
-    return ${EXIT_SUCCESS}
-}
-
-# Saves the content of CFLAGS and CXXFLAGS environment variables, and then
-# set them to empty strings.
-save_flags_no_optimizations()
-{
-    export OLDCFLAGS=${CFLAGS}
-    export OLDCXXFLAGS=${CXXFLAGS}
-    export CFLAGS=""
-    export CXXFLAGS=""
-
-    return ${EXIT_SUCCESS}
-}
-
-# Restores the previous values of CFLAGS and CXXFLAGS environment variables. These
-# must have been saved first using save_flags().
-restore_flags()
-{
-    export CFLAGS=${OLDCFLAGS}
-    export CXXFLAGS=${OLDCXXFLAGS}
-
-    return ${EXIT_SUCCESS}
-}
-
-# Create symbolic links for start/stop scripts in /etc/rc.d
-#
-# Arg #1: script name
-# Arg #2: start number
-# Arg #3: stop number
-# Arg #4: level
-static_bootscript_add()
-{
-    local SCRIPTNAME=${1}
-    local START=${2}
-    local STOP=${3}
-    local RCLEVEL=${4}
-
-    local START_LEVELS=""
-    local STOP_LEVELS=""
-
-    if [ "x${RCLEVEL}" = "xsysinit" ]; then
-       START_LEVELS="sysinit"
-       STOP_LEVELS="0 6"
-    elif [ "x${RCLEVEL}" = "x3" ]; then
-       START_LEVELS="3 4 5"
-       STOP_LEVELS="0 1 2 6"
-    else
-       echo "${FUNCNAME}(), invalid level argument : ${*}"
-       return 1
-    fi
-
-    # Making sure bootscript has correct permissions
-    chmod -v 740 ${LFS}/etc/rc.d/init.d/${SCRIPTNAME}
-
-    # Removing any old links
-    for level in sysinit 0 1 2 3 4 5 6; do
-        cd ${LFS}/etc/rc.d/rc${level}.d
-       rm -v -f $(find . -name "???${SCRIPTNAME}")
-    done
-
-    if [ ${START} -ne 0 ]; then
-       # Creating new start links
-       for level in ${START_LEVELS}; do
-           cd ${LFS}/etc/rc.d/rc${level}.d
-           ln -v -s ../init.d/${SCRIPTNAME} S${START}${SCRIPTNAME}
-       done
-    fi
-
-    if [ ${STOP} -ne 0 ]; then
-       # Creating new stop links
-       for level in ${STOP_LEVELS}; do
-           cd ${LFS}/etc/rc.d/rc${level}.d
-           ln -v -s ../init.d/${SCRIPTNAME} K${STOP}${SCRIPTNAME}
-       done
-    fi
-}
-
-# Create symbolic links for start/stop scripts in /etc/rc.d
-#
-# Arg #1: level
-# Arg #2: script name
-# Arg #3: start number
-# Arg #4: stop number
-bootscript_add_manual()
-{
-    local RCLEVEL=${1}
-    local SCRIPTNAME=${2}
-    local START=${3}
-    local STOP=${4}
-
-    # Making sure bootscript has correct permissions
-    chmod 740 ${LFS}/etc/rc.d/init.d/${SCRIPTNAME}
-
-    # Removing any old links
-    cd ${LFS}/etc/rc.d/rc${RCLEVEL}.d
-    rm -v -f $(find . -name "???${SCRIPTNAME}")
-
-    if [ ${START} -ne 0 ]; then
-       # Creating new start link
-       cd ${LFS}/etc/rc.d/rc${RCLEVEL}.d
-       ln -v -s ../init.d/${SCRIPTNAME} S${START}${SCRIPTNAME}
-    fi
-
-    if [ ${STOP} -ne 0 ]; then
-       # Creating new stop link
-       cd ${LFS}/etc/rc.d/rc${RCLEVEL}.d
-       ln -v -s ../init.d/${SCRIPTNAME} K${STOP}${SCRIPTNAME}
-    fi
-}
-
-# Create symbolic links for start/stop scripts in /etc/rc.d
-#
-# Arg #1: script name
-# Arg #2: start number
-# Arg #3: stop number
-bootscript_add_rc3()
-{
-    static_bootscript_add ${*} 3
-}
-
-# Create symbolic links for start/stop scripts in /etc/rc.d
-#
-# Arg #1: script name
-# Arg #2: start number
-# Arg #3: stop number
-bootscript_add_rcsysinit()
-{
-    static_bootscript_add ${*} sysinit
-}
-
-# Add "export" before the variable name
-#
-# Arg #1: variable name
-# Arg #2: filename where the variable is located
-var_export()
-{
-    VARIABLE=${1}
-    FILE=${2}
-
-    # Checking for correct number of arguments
-    if [ $# -ne 2 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    # Checking if file exists
-    if [ ! -f ${FILE} ]; then
-       echo "${FUNCNAME}(), file not found: ${FILE}"
-       return 1
-    fi
-
-    # Checking if variable exists
-    if ! grep "${VARIABLE}=" ${FILE} 1> /dev/null 2>&1; then
-       echo "${FUNCNAME}(), variable not found: ${VARIABLE}"
-       return 1
-    fi
-
-    # Checking if variable is already exported when it is defined
-    if grep "${VARIABLE}=" ${FILE} | grep "export " 1> /dev/null 2>&1; then
-       echo "${FUNCNAME}(), variable already exported in definition: ${VARIABLE}"
-       return 0
-    fi
-
-    # Checking if variable is already exported, in
-    # a "export VARIABLE1 VARIABLE2..." statement
-    if grep "export " ${FILE} | grep " ${VARIABLE}" 1> /dev/null 2>&1; then
-       echo "${FUNCNAME}(), variable already exported in export list: ${VARIABLE}"
-       return 0
-    fi
-
-    sed -i "s!\(^${VARIABLE}=.*\)!export \1!" ${FILE}
-}
-
-# Adding a new environment variable to a file.
-#
-# Arg #1: variable name
-# Arg #2: filename where the variable is located
-# Arg #3: new variable value
-# Arg #4: separator string (usually a " " or ":")
-var_add()
-{
-    VARIABLE=${1}
-    FILE=${2}
-    VALUE="${3}"
-    SEP="${4}"
-
-    # Checking for correct number of arguments
-    if [ $# -ne 4 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    # Checking if file exists
-    if [ ! -f ${FILE} ]; then
-       echo "${FUNCNAME}(), file not found: ${FILE}"
-       return 1
-    fi
-
-    # Checking if variable exists
-    if ! grep "${VARIABLE}=" ${FILE} 1> /dev/null 2>&1; then
-       echo "${VARIABLE}=\"${VALUE}\"" >> ${FILE}
-       return $?
-    fi
-
-    # Checking if variable contains the new value
-    if grep "${VARIABLE}=" ${FILE} | grep "${VALUE}" 1> /dev/null 2>&1; then
-       echo "${FUNCNAME}(), variable ${VARIABLE} already contains value: ${VALUE}"
-       return 0
-    fi
-
-    # Adding new value to variable (case where no export before)
-    # We search for the variable name starting at the beginning of the line
-    # For example, this ensures that if the variable name is PATH, then
-    # PATH=... matches but not MANPATH=...
-    if grep "^${VARIABLE}=\"" ${FILE} 1> /dev/null 2>&1; then
-       # Variable value is enclosed by double-quotes
-       sed -i "s!\(^${VARIABLE}=\".*\)\(\"\)!\1${SEP}${VALUE}\"!" ${FILE}
-    else
-       # Variable value is NOT enclosed by double-quotes
-       sed -i "s!\(^${VARIABLE}=.*\)!\1${SEP}${VALUE}!" ${FILE}
-    fi
-
-    # Adding new value to variable (case with export before)
-    # We search for the variable name starting after an export statement,
-    # at the beginning of a line.
-    # For example, this ensures that if the variable name is PATH, then
-    # PATH=... matches but not MANPATH=...
-    if grep "^export ${VARIABLE}=\"" ${FILE} 1> /dev/null 2>&1; then
-       # Variable value is enclosed by double-quotes
-       sed -i "s!\(^export ${VARIABLE}=\".*\)\(\"\)!\1${SEP}${VALUE}\"!" ${FILE}
-    else
-       # Variable value is NOT enclosed by double-quotes
-       sed -i "s!\(^export ${VARIABLE}=.*\)!\1${SEP}${VALUE}!" ${FILE}
-    fi
-
-    return $?
-}
-
-# Adding a new path environment variable to a file.
-#
-# Arg #1: variable name
-# Arg #2: filename where the variable is located
-# Arg #3: new variable value
-var_add_path()
-{
-    var_add ${1} ${2} "${3}" ":" 1>> ${LFS_LOG_FILE} 2>&1
-}
-
-# Adding a new string environment variable to a file.
-#
-# Arg #1: variable name
-# Arg #2: filename where the variable is located
-# Arg #3: new variable value
-var_add_str()
-{
-    var_add ${1} ${2} "${3}" " "
-}
-
-# Adding a new string to a file.
-#
-# Arg #1: string
-# Arg #2: filename where the variable is located
-string_add()
-{
-    STRING="${1}"
-    FILE=${2}
-
-    # Checking for correct number of arguments
-    if [ $# -ne 2 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    # Checking if file exists
-    if [ ! -f ${FILE} ]; then
-       echo "${FUNCNAME}(), file not found: ${FILE}"
-       return 1
-    fi
-
-    # Checking if string exists
-    if grep "${STRING}" ${FILE} 1> /dev/null 2>&1; then
-       echo "${FUNCNAME}(), string already defined: ${STRING}"
-       return 0
-    fi
-
-    echo "${STRING}" >> ${FILE}
-}
-
-# Adding a new environment variable to a shadow password suite file (login.defs)
-#
-# Arg #1: variable name
-# Arg #2: filename where the variable is located
-# Arg #3: new variable value
-var_add_shadow()
-{
-    VARIABLE=${1}
-    FILE=${2}
-    VALUE="${3}"
-
-    # Checking for correct number of arguments
-    if [ $# -ne 3 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       return 1
-    fi
-
-    # Checking if file exists
-    if [ ! -f ${FILE} ]; then
-       echo "${FUNCNAME}(), file not found: ${FILE}"
-       return 1
-    fi
-
-    # Checking if variable contains the new value
-    if egrep "^${VARIABLE}" ${FILE} | grep "${VALUE}" 1> /dev/null 2>&1; then
-       echo "${FUNCNAME}(), variable ${VARIABLE} already contains value: ${VALUE}"
-       return 0
-    fi
-
-    # Adding new value to variable
-    # We search for the variable name starting at the beginning of the line
-    # For example, this ensures that if the variable name is PATH, then
-    # PATH... matches but not MANPATH...
-    sed -i "s!\(^${VARIABLE}.*\)!\1:${VALUE}!" ${FILE}
-}
-
-# Adding a new group, checking if it already exist before.
-# Arguments: same arguments as for standard groupadd command.
-hv_groupadd()
-{
-    arguments=${*}
-
-    # The last argument is the group name
-    while [ $# -ne 0 ]; do
-       groupname=${*}
-       shift
-    done
-
-    if ! cat /etc/group | egrep "^${groupname}:" 1> /dev/null 2>&1; then
-        groupadd ${arguments}    
-    fi
-}
-
-# Adding a new user, checking if it already exist before
-# Arguments: same arguments as for standard useradd command.
-hv_useradd()
-{
-    arguments="${*}"
-
-    # The last argument is the user name
-    while [ $# -ne 0 ]; do
-       username=${*}
-       shift
-    done
-
-    if ! cat /etc/passwd | egrep "^${username}:" 1> /dev/null 2>&1; then
-        useradd ${arguments}
-    fi
-}
-
-# Applying patch
-# First argument is the name of the patch
-# Second argument is the package name (target dir in $LFS_TMP)
-apply_patch()
-{
-    local PATCH_FILE=${1}
-    local TARGET_DIR=${2}
-
-    if [ -z "${PATCH_FILE}" ]; then
-        echo
-       echo "apply_patch(): no patch specified."
-       return ${EXIT_FAILURE}
-    fi
-
-    if [ ! -f ${LFS_PKG_DIR}/${PATCH_FILE} ]; then
-        echo
-       echo "${FUNCNAME}(): patch file '${PATCH_FILE}' not found."
-       return ${EXIT_FAILURE}
-    fi
-
-    echo "Applying patch: ${PATCH_FILE}"
-    patch -Np1 -d ${LFS_TMP}/${TARGET_DIR} -i ${LFS_PKG_DIR}/${PATCH_FILE}
-}
-
-# Applying any patch(es) found for the current package.
-# Will work only if patches have the same base name as
-# the package, followed by a dash:
-#    ${1}-*.patch
-#
-# 1st argument: Package name
-# 2: optional target directory.
-apply_patches()
-{
-    PACKAGE=${1}
-    local TARGET_DIR=${PACKAGE}
-
-    # Checking for correct number of arguments
-    if [ $# -gt 2 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       echo "Usage: ${FUNCNAME} PACKAGE-NAME"
-       exit ${EXIT_FAILURE}
-    fi
-
-    if [ $# -eq 2 ]; then
-       TARGET_DIR=${2}
-    else
-       TARGET_DIR=${PACKAGE}
-    fi
-
-    # Checking if we can find at least one patch.
-    if ls ${LFS_PKG_DIR}/${1}-*.patch 1> /dev/null 2>&1; then
-       cd ${LFS_PKG_DIR}
-       for patch in ${1}-*.patch; do
-            apply_patch ${patch} ${TARGET_DIR}
-       done
-    fi
-
-    return $?
-}
-
-# Obtain the name of the base directory for the decompressed package.
-# First argument: package name
-static_decompressed_dirname()
-{
-    local PACKAGE=${1}
-
-    for arch_ext in ${MY_ARCH_EXT}; do
-        if [ ! -f ${LFS_PKG_DIR}/${PACKAGE}.${arch_ext} ]; then
-            # Try next archive extension.
-            continue;
-        fi
-
-        case ${arch_ext} in
-           tar.bz2|tar.gz|tgz|tar.Z)
-                # Remove optional "./" leading component with sed
-                # and extract base directory name with awk.
-                # tar 1.23 reports an error when using pipes, so
-                # remove error message with "2> /dev/null"
-                local DIRNAME=$(tar ${TAR_OPTS} -tf ${LFS_PKG_DIR}/${PACKAGE}.tar.bz2 2> /dev/null | head -n1 | sed 's!^\./!!' | awk -F \/ '{print $1}')
-                echo ${DIRNAME}
-                ;;
-            zip)
-                # TODO
-                echo ${PACKAGE}
-                ;;
-        esac
-
-        return $?
-    done
-
-    # Failure or file not found
-    echo "${FUNCNAME}(): Missing source package for \"${PACKAGE}\"" > /dev/stderr
-    return ${EXIT_FAILURE}
-}
-
-# Decompression of a package
-# First argument: package name
-# Second argument: directory where decompressing (optional, defaults to LFS_TMP)
-decompress_package()
-{
-    # Checking for correct number of arguments
-    if [ $# -eq 1 ]; then
-       local TOPDIR=${LFS_TMP}
-    elif [ $# -eq 2 ]; then
-       local TOPDIR=${2}
-    else
-       echo "${FUNCNAME}(): Incorrect number of arguments (must be 1 or 2)" > /dev/stderr
-       return ${EXIT_FAILURE}
-    fi
-
-    local PACKAGE=${1}
-
-    for arch_ext in ${MY_ARCH_EXT}; do
-        if [ ! -f ${LFS_PKG_DIR}/${PACKAGE}.${arch_ext} ]; then
-            # Try next archive extension.
-            continue;
-        fi
-
-        if [ -d ${TOPDIR}/${PACKAGE} ]; then
-            # Removing old source directory (if any)
-           rm -rf ${TOPDIR}/${PACKAGE}
-        fi
-
-        # Decompressing package
-        case ${arch_ext} in
-           tar.bz2)
-                tar -C ${TOPDIR} ${TAR_OPTS} -jxf \
-                    ${LFS_PKG_DIR}/${PACKAGE}.${arch_ext}
-                ;;
-           tar.gz|tgz|tar.Z)
-                tar -C ${TOPDIR} ${TAR_OPTS} -zxf \
-                    ${LFS_PKG_DIR}/${PACKAGE}.${arch_ext}
-                ;;
-            zip)
-                unzip -qq -d ${TOPDIR} ${LFS_PKG_DIR}/${PACKAGE}.${arch_ext}
-                ;;
-        esac
-
-        return $?
-    done
-
-    # Failure or file not found
-    echo "${FUNCNAME}(): Missing source package for \"${PACKAGE}\"" > /dev/stderr
-    return ${EXIT_FAILURE}
-}
-
-hvtrap_setup()
-{
-    # Setting ERR trap does implicit `set -o errexit'.
-    trap hvtrap_err ERR
-    trap hvtrap_int INT
-}
-
-hvtrap_err()
-{
-    echo
-    echo "*** An error occured during ${LFS_STAGE}"
-    exit 1
-}
-
-hvtrap_int()
-{
-    echo
-    echo "*** Installation interrupted during ${LFS_STAGE}"
-    exit 1
-}
-
-ipkg_trap_setup()
-{
-    exec 6>&1 # Save current "value" of stdout.
-    trap ipkg_trap_handler INT TERM EXIT ERR
-}
-
-ipkg_trap_end()
-{
-    trap - INT TERM EXIT ERR
-
-    # Restore global trap
-    hvtrap_setup
-}
-
-ipkg_trap_handler()
-{
-    exec 1>&6 6>&- # Restore stdout and close file descriptor #6.
-    print_status failure
-
-    ipkg_trap_end
-    exit 1
-}
-
-ipkg_display_build_infos()
-{
-    echo "hvlinux: configure options:"
-    for opt in ${CONFIGURE_OPTS}; do
-        echo "  ${opt}"
-    done
-    echo "hvlinux: environment variables:"
-    echo "  HOST:     ${CLFS_HOST}"
-    echo "  TARGET:   ${CLFS_TARGET}"
-    echo "  BUILD64:  ${BUILD64}"
-    echo "  CFLAGS:   ${CFLAGS}"
-    echo "  CPPFLAGS: ${CPPFLAGS}"
-    echo "  CXXFLAGS: ${CFLAGS}"
-    echo "  LDFLAGS:  ${LDFLAGS}"
-    echo "  RANLIB:   ${RANLIB}"
-    echo "  CC:       ${CC}"
-    echo "  CXX:      ${CXX}"
-    echo "  AR:       ${AR}"
-    echo "  AS:       ${AS}"
-    echo "  PATH:     ${PATH}"
-
-    GCCCPUOPT=$(gcc ${MARCH_FLAGS} -E -v - </dev/null 2>&1 | \
-        sed -n 's/.* -v - //p')
-    echo "  GCC CPU OPTIONS: ${GCCCPUOPT}"
-}
-
-# Installation of a package
-# Arg. #1: Package name and version (ex: gcc-4.5.1)
-# Remaining arguments: Additional configure options
-# Options:
-#   -h     Display this help and returns
-#   -l     Unique identification label in 'install.log'
-#          (default is package name and version)
-#   -m     Installation mode:
-#            ac   Standard autoconf package, build in separate dir (default)
-#            acnb Standard autoconf package, build in source dir
-#            noac No autoconf (configure)
-#            gnome
-#            xorg
-#            pm
-#   -s     Name of script to source (default is from name of package)
-ipkg()
-{
-    START_TIME=$(echo `date +%s`)
-
-    unset ALT_SCRIPT_NAME
-    export IPKG_MODE="ac"
-    export HVLABEL="" # Global variable
-
-    while getopts "hl:m:s:" flag ;do
-        case ${flag} in
-           l)
-                # Alternate label
-                HVLABEL=${OPTARG}
-               ;;
-           m)
-                # Installation mode
-                case ${OPTARG} in
-                   ac|acnb|noac|gnome|xorg|pm)
-                        IPKG_MODE=${OPTARG}
-                       ;;
-                    *)
-                       echo "${FUNCNAME}(): Unsupported mode: ${OPTARG}."
-                       return 1
-                        ;;
-                esac
-                ;;
-           s)
-                # Alternate script name
-                ALT_SCRIPT_NAME=${OPTARG}
-               ;;
-           ?)
-               echo "${FUNCNAME}(): Invalid option: ${OPTARG}."
-               return 1
-               ;;
-        esac
-    done
-    shift `expr "${OPTIND}" - 1`
-
-    unset OPTSTRING
-    unset OPTIND
-    unset OPTARG
-
-    export PACKAGE=${1}
-
-    # Checking for correct number of arguments
-    if [ $# -lt 1 ]; then
-        echo
-       echo "${FUNCNAME}(): Missing argument"
-       echo "  command was: \"${FUNCNAME}() $*\""
-       exit ${EXIT_FAILURE}
-    fi
-
-    shift
-    export CONFIGURE_OPTS=${*}
-
-    if [ -z "${HVLABEL}" ]; then
-        # Default label = package name and version
-        HVLABEL=${PACKAGE}
-    fi
-
-    PACKAGE_LOG=${LFS_LOG_DIR}/${HVLABEL}.log
-
-    # Checking if package was previously successfully installed
-    if grep "^${HVLABEL} successfully installed" ${LFS_LOG_FILE} \
-        1> /dev/null 2>&1; then
-       return $EXIT_SUCCESS
-    fi
-
-    # Displaying label
-    MSGSTRING="Installing ${HVLABEL}"
-    display_checkbox_msg ${MSGSTRING}
-
-    ipkg_trap_setup
-
-    echo "------------------------" 1>> ${LFS_LOG_FILE}
-    echo "${MSGSTRING}" 1>> ${LFS_LOG_FILE}
-
-    exec 7>&1 # Save current "value" of stdout.
-    # All output from commands in this block sent to file $LFS_LOG_FILE.
-    exec >> ${LFS_LOG_FILE} 2>&1
-    ipkg_display_build_infos
-    exec 1>&7 7>&- # Restore stdout and close file descriptor #7.
-
-    # All output from commands in this block sent to file $PACKAGE_LOG.
-    exec > ${PACKAGE_LOG} 2>&1
-
-    # Sourcing standard ac script.
-    source ${SCRDIR}/../functions-ipkg
-    source ${SCRDIR}/${DEFAULT_IPKG_SCRIPT}
-    ipkg_script ${ALT_SCRIPT_NAME}
-
-    # Make sure we are at a known location
-    cd ${SCRDIR}
-
-    exec 1>&6 # Restore stdout.
-
-    # Writing success string to the end of the log file
-    echo "${HVLABEL} successfully installed" 1>> ${LFS_LOG_FILE}
-
-    # Displaying build time after the package name
-    print_status success
-
-    ipkg_trap_end
-
-    return $EXIT_SUCCESS
-}
-
-# Display the action name, run a command, log its output and display it's
-# status. Write to install log file when successfully completed so it
-# won't be called again after a successfull installation.
-
-# First  argument: "once" -> script is run only once
-#                  "mult" -> script can be run more than once
-# Second argument: Message to display during script
-# Third  argument: script name (will be label)
-rscr()
-{
-    START_TIME=$(echo `date +%s`)
-
-    # Checking for correct number of arguments
-    if [ $# -lt 3 ]; then
-       echo "${FUNCNAME}(): Missing argument(s)"
-       exit ${EXIT_FAILURE}
-    fi
-
-    SCRMODE=${1}
-    MSGSTRING=${2}
-    SCRIPT=${3}
-    HVLABEL=${SCRIPT}
-    shift
-    shift
-    SCRIPT_ARGS=${*}
-
-    # Make sure we are at a known location
-    cd ${SCRDIR}
-
-    # Checking script mode:
-    if [ "x${SCRMODE}" != "xonce" -a "x${SCRMODE}" != "xmult" ]; then
-       echo "${FUNCNAME}(): First argument invalid, must be \"once\" or \"mult\" (\"${SCRMODE}\" given)"
-       exit ${EXIT_FAILURE}
-    fi
-
-    # Checking if script is valid and executable
-    if [ ! -x ${SCRDIR}/${SCRIPT} ]; then
-       echo "${FUNCNAME}(): script not found: ${SCRIPT}"
-       exit ${EXIT_FAILURE}
-    fi
-
-    PACKAGE_LOG=${LFS_LOG_DIR}/${HVLABEL}.log
-
-    if [ "x${SCRMODE}" = "xonce" ]; then
-        # Checking if package was previously successfully installed
-        if grep "^${HVLABEL} successfully installed" ${LFS_LOG_FILE} 1> /dev/null 2>&1; then
-           return $EXIT_SUCCESS
-        fi
-    fi
-
-    display_checkbox_msg ${MSGSTRING}
-
-    ipkg_trap_setup
-
-    echo "------------------------" 1>> ${LFS_LOG_FILE}
-    echo ${HVLABEL} 1>> ${LFS_LOG_FILE}
-
-    # Executing script
-    ${SCRDIR}/${SCRIPT} ${SCRIPT_ARGS} 1>> ${PACKAGE_LOG} 2>&1
-
-    if [ "x${SCRMODE}" = "xonce" ]; then
-        # Writing success string to the end of the log file
-        echo "${HVLABEL} successfully installed" 1>> ${LFS_LOG_FILE}
-    fi
-
-    # Displaying build time after the package name
-    print_status success
-
-    ipkg_trap_end
-
-    return $EXIT_SUCCESS
-}
-
-rcmd_trap_setup()
-{
-    exec 6>&1 # Save current "value" of stdout.
-    trap rcmd_trap_handler INT TERM EXIT ERR
-}
-
-rcmd_trap_end()
-{
-    trap - INT TERM EXIT ERR
-
-    # We do not restore global trap
-}
-
-rcmd_trap_handler()
-{
-    exec 1>&6 6>&- # Restore stdout to fd #6, where it had been saved,
-                   # and close file descriptor #6.
-    print_status failure
-
-    rcmd_trap_end
-    if [ -n "${RCMD_NO_EXIT}" ]; then
-        return ${EXIT_FAILURE}
-    else
-        exit ${EXIT_FAILURE}
-    fi
-}
-
-# Run command, no log
-# First  argument: Message to display during script
-# Second argument: command + arguments
-rcmd()
-{
-    START_TIME=$(echo `date +%s`)
-
-    # Checking for correct number of arguments
-    if [ $# -lt 2 ]; then
-       echo "${FUNCNAME}(): Missing argument(s)"
-       exit ${EXIT_FAILURE}
-    fi
-
-    local MSGSTRING=${1}
-    local CMD=${2}
-    shift
-    local CMD_WITH_ARGS=${*}
-
-    display_checkbox_msg ${MSGSTRING}
-
-    rcmd_trap_setup
-
-    echo ${CMD_WITH_ARGS} 1>> ${LFS_LOG_FILE}
-
-    # Executing command
-    ${CMD_WITH_ARGS} 1>> ${LFS_LOG_FILE} 2>&1
-
-    if [ $? -ne 0 ]; then
-        if [ -n "${RCMD_NO_EXIT}" ]; then
-            return ${EXIT_FAILURE}
-        else
-           exit ${EXIT_FAILURE}
-        fi
-    fi
-
-    # Displaying build time after the package name
-    print_status success
-
-    rcmd_trap_end
-
-    return $EXIT_SUCCESS
-}
-
-get_total_build_time()
-{
-    INFILE=${1}
-
-    # Checking for correct number of arguments
-    if [ $# -ne 1 ]; then
-       echo "${FUNCNAME}(), wrong number of arguments: ${*}"
-       echo "Usage: ${FUNCNAME} LOGFILE"
-       exit ${EXIT_FAILURE}
-    fi
-
-    TIMES=$(cat ${INFILE} | grep "Build time:" | sed "s!Build time: \(.*\)h!\1!g")
-
-    for time in ${TIMES}; do
-       HOURS=$(( $HOURS + $(echo ${time} | sed "s!^\([0-9]*\)\..*!\1!g") ))
-       
-       # The first SED command extracts the minutes (fractions of an hour).
-       # The second SED command removed the leading zero, if applicable.
-       MIN=$(( $MIN + $(echo ${time} | sed "s!.*\.\([0-9][0-9]\)!\1!g" | sed "s!^0\([0-9]\)!\1!g" ) ))
-    done
-    
-    HOURS=$(( ${HOURS} + ( ${MIN} / 100 ) ))
-    MIN=$(( ${MIN} % 100 ))
-    
-    echo "${HOURS}.${MIN}"
-}
-
-# Global variable: START_TIME
-display_build_time()
-{
-    END_TIME=$(echo `date +%s`)
-
-    HOURS=$(( ( ${END_TIME} - ${START_TIME} ) / 3600 ))
-    echo -n " ("${HOURS}"."
-    echo -n "  Build time: ${HOURS}." 1>> ${LFS_LOG_FILE}
-
-    # Time is inferior to 1 hour...
-    MINUTES=$(( ( ( ${END_TIME} - ${START_TIME} ) % 3600 ) / 36 ))
-
-    if [ ${MINUTES} -lt 10 ]; then
-       echo -n "0"
-       echo -n "0" 1>> ${LFS_LOG_FILE}
-    fi
-
-    if [ ${MINUTES} -eq 0 ]; then
-       echo -n "1"
-       echo -n "1" 1>> ${LFS_LOG_FILE}
-    else
-       echo -n ${MINUTES}
-       echo -n ${MINUTES} 1>> ${LFS_LOG_FILE}
-    fi
-
-    echo -n "h)"
-    echo "h" 1>> ${LFS_LOG_FILE}
-}
-
-# Global variable: MSGSTRING
-display_checkbox_msg()
-{
-    echo -en "${BRACKET}[ ${BRACKET}]${NORMAL} ${MSGSTRING}"
-}
-
-# The print_status prints a coloured "X" letter inside the checkbox to the left
-# of the screen (the checkbox is already displayed, and the cursor must have
-# been saved to where to put the mark).
-# 1st arg: status: success, warning or failure
-# Global variables: MSGSTRING and START_TIME
-print_status()
-{
-    if [ $# -ne 1 ]; then
-        # If no parameters are given to the print_status function, print usage
-        # information.
-       echo "Usage: ${FUNCNAME}() {success|warning|failure} [STRING] [TIME]"
-       return ${EXIT_FAILURE}
-    fi
-
-    local COLOR=""
-
-    case "${1}" in
-       success)
-           COLOR=$SUCCESS
-           ;;
-       warning)
-           COLOR=$WARNING
-           ;;
-       failure)
-           COLOR=$FAILURE
-           ;;
-       *)
-           echo "Usage: ${FUNCNAME}() {success|warning|failure}"
-           return ${EXIT_FAILURE}
-           ;;
-    esac
-
-    # Reposition cursor at start of line
-    echo -en "${SET_CURSOR_START_LINE}"
-    # Display colored 'X'
-    echo -en "${BRACKET}[${COLOR}X${BRACKET}]${NORMAL} ${MSGSTRING}"
-
-    if [ "x${MSGSTRING}" != "x" ]; then
-        display_build_time
-    fi
-
-    echo
-}
index cb89a5b..cdd7040 100755 (executable)
@@ -1,10 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-hvtrap_setup
-source ../config/packages-list
+source ../functions/main
 
 init_log_file
 
index 8b6c069..77828c3 100755 (executable)
@@ -2,10 +2,7 @@
 
 source ~/.bashrc
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 init_log_file
 
index 4b1ad8b..c1be74b 100755 (executable)
@@ -5,30 +5,22 @@
 USE_CLFS_PATCHES=1
 USE_HV_PATCHES=1
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../functions-fpkg
-source ../config/packages-list
+source ../functions/main
 
-update_packages_init
+update_packages_init ${*}
 
-if [ ${#} -eq 1 -a "x${1}" = "xtest" ]; then
-    export TEST_INTEGRITY=1
-fi
-
-fpkg       ${KERNEL}    "http://www.kernel.org/pub/linux/kernel/v2.6"
-fpkg       ${FILE_PKG}  "ftp://ftp.astron.com/pub/file"
-fpkg_gnu   ${NCURSES}
-fpkg_gnu   ${GMP}
-fpkg_gnu   ${MPFR}
+fpkg -s "linux/kernel/v2.6" ${KERNEL} ${KERNEL_URL}
+fpkg ${FILE_PKG} "ftp://ftp.astron.com/pub/file"
+fpkg -m gnu ${NCURSES}
+fpkg -m gnu ${GMP}
+fpkg -m gnu ${MPFR}
 fpkg -e "tar.gz" ${MPC} "http://www.multiprecision.org/mpc/download"
 fpkg -s "$(get_pkg_ver ${PPL})" ${PPL} \
     "http://www.cs.unipr.it/ppl/Download/ftp/releases"
-fpkg       ${CLOOG_PPL} "ftp://gcc.gnu.org/pub/gcc/infrastructure"
-fpkg_gnu   ${BINUTILS}
-fpkg_gnu   ${GCC} "gcc/${GCC}"
-fpkg       ${EGLIBC} "http://cross-lfs.org/files/packages/svn"
-fpkg       ${EGLIBC_PORTS} "http://cross-lfs.org/files/packages/svn"
+fpkg ${CLOOG_PPL} "ftp://gcc.gnu.org/pub/gcc/infrastructure"
+fpkg -m gnu ${BINUTILS}
+fpkg -m gnu -s "gcc/${GCC}" ${GCC}
+fpkg ${EGLIBC} "http://cross-lfs.org/files/packages/svn"
+fpkg ${EGLIBC_PORTS} "http://cross-lfs.org/files/packages/svn"
 
 exit $?
index aa33684..c07c163 100755 (executable)
@@ -1,10 +1,7 @@
 #!/bin/bash
 set -o errexit
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 # Making sure that this script was executed by the root user
 if [ "x${USER}" != "xroot" ]; then
index b56c3e8..6ded32a 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 echo "Creating /etc/fstab"
 cat > ${LFS}/etc/fstab << "EOF"
index 171fd1b..9975857 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 mkdir -pv ${LFS}/{bin,boot,dev,{etc/,}opt,home,lib,mnt}
 mkdir -pv ${LFS}/{proc,media/{cdrom,dvd},sbin,srv,sys}
index d2b8a8e..3b57abc 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 # In order for root to be able to login and for the name "root" to be
 # recognized, there need to be relevant entries in the /etc/group file.
index fe4b5a7..7e950fc 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 touch ${LFS}/var/run/utmp ${LFS}/var/log/{btmp,lastlog,wtmp}
 chmod -v 664  ${LFS}/var/run/utmp ${LFS}/var/log/lastlog
index 51dba78..6116775 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 # Some programs hard-wire paths to programs which don't exist yet. In order to
 # satisfy these programs, we create a number of symbolic links which will be
index 2fc9fa2..598d9ab 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 # In order for root to be able to login and for the name "root" to be
 # recognized, there need to be relevant entries in the /etc/passwd file.
index e7c7bda..a33015d 100755 (executable)
@@ -1,10 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-hvtrap_setup
-source ../config/packages-list
+source ../functions/main
 
 init_log_file
 
index c6bc078..a62c32f 100755 (executable)
@@ -2,10 +2,7 @@
 
 source ~/.bashrc
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 init_log_file
 
index 40894e0..db4723f 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 # Clock settings
 cat > ${LFS}/etc/sysconfig/clock << "EOF"
index ca445b2..dfae254 100755 (executable)
@@ -3,57 +3,51 @@
 USE_CLFS_PATCHES=1
 USE_HV_PATCHES=1
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../functions-fpkg
-source ../config/packages-list
+source ../functions/main
 
-update_packages_init
-
-if [ ${#} -eq 1 -a "x${1}" = "xtest" ]; then
-    export TEST_INTEGRITY=1
-fi
+update_packages_init ${*}
 
 # These packages are already downloaded for stage0:
-lpkg     0 ${GMP}
-lpkg     0 ${MPFR}
-lpkg     0 ${MPC}
-lpkg     0 ${PPL}
-lpkg     0 ${CLOOG_PPL}
-lpkg     0 ${BINUTILS}
-lpkg     0 ${GCC}
-lpkg     0 ${NCURSES}
-lpkg     0 ${FILE_PKG}
-lpkg     0 ${KERNEL}
+lpkg 0 ${GMP}
+lpkg 0 ${MPFR}
+lpkg 0 ${MPC}
+lpkg 0 ${PPL}
+lpkg 0 ${CLOOG_PPL}
+lpkg 0 ${BINUTILS}
+lpkg 0 ${GCC}
+lpkg 0 ${NCURSES}
+lpkg 0 ${FILE_PKG}
+lpkg 0 ${KERNEL}
 
 # New packages for stage 1:
-fpkg       ${ZLIB} "http://www.zlib.net"
-fpkg_gnu   ${BASH}
-fpkg_gnu   ${BISON}
-fpkg       ${BZIP2} "http://www.bzip.org/$(get_pkg_ver ${BZIP2})"
-fpkg_gnu   ${COREUTILS}
-fpkg_gnu   ${DIFFUTILS}
-fpkg_gnu   ${FINDUTILS}
-fpkg_sf    ${FLEX}
-fpkg_gnu   ${GAWK}
-fpkg_gnu   ${GETTEXT}
-fpkg_gnu   ${GREP}
-fpkg_gnu   ${GZIP}
-fpkg_gnu   ${MFOUR}
-fpkg_gnu   ${MAKE_PACKAGE}
-fpkg_gnu   ${PATCH_PACKAGE}
-fpkg_gnu   ${SED}
-fpkg_gnu   ${TAR_PACKAGE}
-fpkg_gnu   ${TEXINFO}
-fpkg_gnu   ${NANO}
-fpkg       ${XZ_UTILS} "http://tukaani.org/xz"
+fpkg ${ZLIB} "http://www.zlib.net"
+fpkg -m gnu ${BASH}
+fpkg -m gnu ${BISON}
+fpkg ${BZIP2} "http://www.bzip.org/$(get_pkg_ver ${BZIP2})"
+fpkg -m gnu ${COREUTILS}
+fpkg -m gnu ${DIFFUTILS}
+fpkg -m gnu ${FINDUTILS}
+fpkg -m sf ${FLEX}
+fpkg -m gnu ${GAWK}
+fpkg -m gnu ${GETTEXT}
+fpkg -m gnu ${GREP}
+fpkg -m gnu ${GZIP}
+fpkg -m gnu ${MFOUR}
+fpkg -m gnu ${MAKE_PACKAGE}
+fpkg -m gnu ${PATCH_PACKAGE}
+fpkg -m gnu ${SED}
+fpkg -m gnu ${TAR_PACKAGE}
+fpkg -m gnu ${TEXINFO}
+fpkg -m gnu ${NANO}
+fpkg ${XZ_UTILS} "http://tukaani.org/xz"
 
 # Chapter 7
-fpkg       ${UTIL_LINUX_NG} "http://www.kernel.org/pub/linux/utils/util-linux-ng/v$(get_pkg_ver_base ${UTIL_LINUX_NG})"
-fpkg_sf    ${E2FSPROGS}
-fpkg       ${SYSVINIT} "ftp://ftp.cistron.nl/pub/people/miquels/sysvinit"
-fpkg       ${MODULE_INIT_TOOLS} "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools"
-fpkg       ${UDEV} "http://www.kernel.org/pub/linux/utils/kernel/hotplug"
+fpkg -s "linux/utils/util-linux-ng/v$(get_pkg_ver_base ${UTIL_LINUX_NG})" \
+    ${UTIL_LINUX_NG} ${KERNEL_URL}
+fpkg -m sf ${E2FSPROGS}
+fpkg ${SYSVINIT} "ftp://ftp.cistron.nl/pub/people/miquels/sysvinit"
+fpkg -s "linux/utils/kernel/module-init-tools" ${MODULE_INIT_TOOLS} \
+    ${KERNEL_URL}
+fpkg -s "linux/utils/kernel/hotplug" ${UDEV} ${KERNEL_URL}
 
 exit $?
index a8e5738..5f4755b 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 # We need /dev/null and /dev/console before udev is started.
 mkdir -pv ${LFS}/dev
index b1aeead..85ce8e8 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 # Making sure that this script was executed by the root user
 if [ "x${USER}" != "xroot" ]; then
index 764bc79..3e275aa 100755 (executable)
@@ -1,11 +1,6 @@
 #!/bin/bash
 
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 # If not already installed by previous invocation of this script:
 install -m755 ${SCRDIR}/misc/compressdoc /usr/sbin
index b207785..d1643ba 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 # Removing /tools from PATH:
 SED_REP='/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin'
index 2e3cc41..fe49fbd 100755 (executable)
@@ -1,10 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-hvtrap_setup
-source ../config/packages-list
+source ../functions/main
 source /etc/profile
 
 if [ "x${USER}" != "xroot" ]; then
index bb0079c..53184b9 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 init_log_file
 
@@ -39,6 +36,8 @@ ipkg ${UDEV}
 ipkg -m noac ${UDEV_CONFIG}
 ipkg ${GRUB}
 ipkg -m acnb ${DHCP}
+ipkg -m noac -s wireless-tools ${WIRELESS_TOOLS}
+ipkg -m noac ${WPA_SUPPLICANT}
 ipkg ${NANO}
 
 rscr once "Installing HV-utilities" install-hv-utilities
index 894c344..f0a45a3 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 DHCP_USED="no"
 
index 833fcc0..1a4d46f 100755 (executable)
@@ -1,11 +1,6 @@
 #!/bin/bash
 
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 SRCDIR="./hv-utilities"
 PREFIX="/usr/local"
diff --git a/stage2/misc/wireless b/stage2/misc/wireless
new file mode 100755 (executable)
index 0000000..c48ce2d
--- /dev/null
@@ -0,0 +1,116 @@
+#!/bin/sh
+########################################################################
+# Begin $network_devices/services/wireless
+#
+# Description : Wireless Handler
+#
+# Authors     : Joe Ciccone - joeciccone@crazyeyesoft.com
+#
+# Version     : 00.00
+#
+# Notes       :
+#
+########################################################################
+
+. /etc/sysconfig/rc 
+. ${rc_functions} 
+. ${IFCONFIG}
+
+if [ ! -d "${network_devices}/ssid" ]; then
+       boot_mesg "${network_devices}/ssid does not exist, cannot continue." ${FAILURE}
+       echo_failure
+       exit 1
+fi
+
+case "${2}" in
+       up)
+               if [ "${ESSID}" = "scan" ]; then
+                       for wnet in `iwlist ${1} scan | grep ESSID | cut -d: -f2 | cut -d'"' -f2` \
+                       `iwlist ${1} scan | grep Address | awk '{print $5}'`; do
+                               if [ -f "${network_devices}/ssid/${wnet}" ]; then
+                                       ESSID=${wnet}
+                                       break
+                               fi
+                       done
+               fi
+               
+               if [ -n "${OVERRIDE_ESSID}" ]; then
+                       ESSID=${OVERRIDE_ESSID}
+               fi
+               
+               if [ "${ESSID:-scan}" = "scan" ]; then
+                       boot_mesg "Could not find a configurable ssid for ${1}, cannot continue." ${FAILURE}
+                       echo_failure
+                       exit 1
+               else
+                       if [ ! -f "${network_devices}/ssid/${ESSID}" ]; then
+                               boot_mesg "Unable to open ${network_devices}/ssid/${ESSID}, cannot continue." ${FAIURE}
+                               echo_failure
+                               exit 1
+                       fi
+                       source ${network_devices}/ssid/${ESSID}
+               fi
+               
+               args1="essid ${ESSID}"
+               
+               if [ -n "${MODE}" ]; then
+                       args1="${args1} mode ${MODE}"
+               fi
+               
+               if [ -n "${FREQ}" ]; then
+                       args1="${args1} freq ${FREQ}"
+               fi
+               
+               if [ -n "${RATE}" ]; then
+                       args1="${args1} rate ${RATE}"
+               fi
+               
+               boot_mesg "Configuring ${1} for essid ${ESSID}"
+               iwconfig ${1} ${args1}
+               evaluate_retval
+
+               boot_mesg "Setting up ${TYPE} on ${1} ..."
+               case "${TYPE}" in
+                       wep)
+                               args2=""
+                               if [ -n "${KEY1}" ]; then
+                                       args2="key ${KEY1}"
+                               fi
+
+                               if [ -n "${KEY2}" ]; then
+                                       args2="${args2} key ${KEY2}"
+                               fi
+
+                               if [ -n "${KEY3}" ]; then
+                                       args2="${args2} key ${KEY3}"
+                               fi
+
+                               if [ -n "${KEY4}" ]; then
+                                       args2="${args2} key ${KEY4}"
+                               fi
+
+                               iwconfig ${1} ${args2}
+                               evaluate_retval
+                       ;;
+                       wpa)
+                               wpa_supplicant -Bw -c/etc/wpa_supplicant.conf -i${1}
+                       ;;
+                       *)
+                               boot_mesg "Unknown Type ${TYPE}, cannot continue." ${FAILURE}
+                               echo_failure
+                               exit 1
+                       ;;
+               esac
+               evaluate_retval
+       ;;
+       
+       down)
+       ;;
+       
+       *)
+               echo "Usage: ${0} [interface] {up|down}"
+               exit 1
+       ;;
+esac
+
+# End $network_devices/services/wireless
index 501dad4..b12affe 100755 (executable)
@@ -5,82 +5,80 @@ USE_BLFS_PATCHES=1
 USE_CLFS_PATCHES=1
 USE_HV_PATCHES=1
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../functions-fpkg
-source ../config/packages-list
+source ../functions/main
 
-update_packages_init
-
-if [ ${#} -eq 1 -a "x${1}" = "xtest" ]; then
-    export TEST_INTEGRITY=1
-fi
+update_packages_init ${*}
 
 # These packages were already downloaded for stage0:
-lpkg     0 ${KERNEL}
-lpkg     0 ${EGLIBC}
-lpkg     0 ${GMP}
-lpkg     0 ${MPFR}
-lpkg     0 ${MPC}
-lpkg     0 ${PPL}
-lpkg     0 ${CLOOG_PPL}
-lpkg     0 ${BINUTILS}
-lpkg     0 ${GCC}
+lpkg 0 ${KERNEL}
+lpkg 0 ${EGLIBC}
+lpkg 0 ${GMP}
+lpkg 0 ${MPFR}
+lpkg 0 ${MPC}
+lpkg 0 ${PPL}
+lpkg 0 ${CLOOG_PPL}
+lpkg 0 ${BINUTILS}
+lpkg 0 ${GCC}
 
 # These packages were already downloaded for stage1:
-lpkg     1 ${NANO}
+lpkg 1 ${NANO}
 
 # These packages were already downloaded for stage1:
-lpkg     1 ${ZLIB}
-lpkg     1 ${SED}
-lpkg     1 ${NCURSES}
-lpkg     1 ${UTIL_LINUX_NG}
-lpkg     1 ${E2FSPROGS}
-lpkg     1 ${COREUTILS}
-lpkg     1 ${MFOUR}
-lpkg     1 ${BISON}
-lpkg     1 ${FLEX}
-lpkg     1 ${BASH}
-lpkg     1 ${BZIP2}
-lpkg     1 ${DIFFUTILS}
-lpkg     1 ${FILE_PKG}
-lpkg     1 ${FINDUTILS}
-lpkg     1 ${GAWK}
-lpkg     1 ${GETTEXT}
-lpkg     1 ${GREP}
-lpkg     1 ${GZIP}
-lpkg     1 ${MAKE_PACKAGE}
-lpkg     1 ${MODULE_INIT_TOOLS}
-lpkg     1 ${PATCH_PACKAGE}
-lpkg     1 ${SYSVINIT}
-lpkg     1 ${TAR_PACKAGE}
-lpkg     1 ${TEXINFO}
-lpkg     1 ${UDEV}
-lpkg     1 ${XZ_UTILS}
+lpkg 1 ${ZLIB}
+lpkg 1 ${SED}
+lpkg 1 ${NCURSES}
+lpkg 1 ${UTIL_LINUX_NG}
+lpkg 1 ${E2FSPROGS}
+lpkg 1 ${COREUTILS}
+lpkg 1 ${MFOUR}
+lpkg 1 ${BISON}
+lpkg 1 ${FLEX}
+lpkg 1 ${BASH}
+lpkg 1 ${BZIP2}
+lpkg 1 ${DIFFUTILS}
+lpkg 1 ${FILE_PKG}
+lpkg 1 ${FINDUTILS}
+lpkg 1 ${GAWK}
+lpkg 1 ${GETTEXT}
+lpkg 1 ${GREP}
+lpkg 1 ${GZIP}
+lpkg 1 ${MAKE_PACKAGE}
+lpkg 1 ${MODULE_INIT_TOOLS}
+lpkg 1 ${PATCH_PACKAGE}
+lpkg 1 ${SYSVINIT}
+lpkg 1 ${TAR_PACKAGE}
+lpkg 1 ${TEXINFO}
+lpkg 1 ${UDEV}
+lpkg 1 ${XZ_UTILS}
 
 # These packages are only for stage2
-fpkg -e tar.gz ${PERL} http://www.cpan.org/src/5.0
-fpkg       ${MANPAGES} http://www.kernel.org/pub/linux/docs/manpages
-fpkg       ${PKG_CONFIG} http://pkgconfig.freedesktop.org/releases
-fpkg       ${IANA} http://www.sethwklein.net/projects/iana-etc/downloads
-fpkg       ${PROCPS} http://procps.sourceforge.net
-fpkg_gnu   ${READLINE}
-fpkg_gnu   ${LIBTOOL}
-fpkg_gnu   ${GDBM}
-fpkg_gnu   ${INETUTILS}
-fpkg_gnu   ${AUTOCONF}
-fpkg_gnu   ${AUTOMAKE}
-fpkg_gnu   ${GROFF}
-fpkg       ${IPROUTE2} http://devresources.linux-foundation.org/dev/iproute2/download
-fpkg       ${KBD} http://www.kernel.org/pub/linux/utils/kbd
-fpkg       ${LESS} http://www.greenwoodsoftware.com/less
-fpkg       ${MAN_DB} http://download.savannah.gnu.org/releases/man-db
-fpkg_sf    ${PSMISC}
-fpkg_hv    ${SHADOW}
-fpkg       ${SYSKLOGD} http://www.infodrom.org/projects/sysklogd/download
-fpkg       ${UDEV_CONFIG} http://www.linuxfromscratch.org/lfs/downloads/development
-fpkg       ${GRUB} ftp://alpha.gnu.org/gnu/grub
-fpkg       ${DHCP} ftp://ftp.isc.org/isc/dhcp/dhcp-3.0-history
+fpkg -e "tar.gz" ${PERL} "http://www.cpan.org/src/5.0"
+fpkg -s "linux/docs/manpages" ${MANPAGES} ${KERNEL_URL}
+fpkg -m fd ${PKG_CONFIG}
+fpkg ${IANA} "http://www.sethwklein.net"
+fpkg -e "tar.gz" ${PROCPS} "http://procps.sourceforge.net"
+fpkg -m gnu ${READLINE}
+fpkg -m gnu ${LIBTOOL}
+fpkg -m gnu ${GDBM}
+fpkg -m gnu ${INETUTILS}
+fpkg -m gnu ${AUTOCONF}
+fpkg -m gnu ${AUTOMAKE}
+fpkg -m gnu ${GROFF}
+fpkg ${IPROUTE2} \
+    "http://devresources.linux-foundation.org/dev/iproute2/download"
+fpkg -e "tar.gz" ${WIRELESS_TOOLS} \
+    "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux"
+fpkg -e "tar.gz" ${WPA_SUPPLICANT} "http://hostap.epitest.fi/releases"
+
+fpkg -s "linux/utils/kbd" ${KBD} ${KERNEL_URL}
+fpkg -e "tar.gz" ${LESS} "http://www.greenwoodsoftware.com/less"
+fpkg -e "tar.gz" ${MAN_DB} "http://download.savannah.gnu.org/releases/man-db"
+fpkg -m sf ${PSMISC}
+fpkg -m hv ${SHADOW}
+fpkg -e "tar.gz" ${SYSKLOGD} \
+    "http://www.infodrom.org/projects/sysklogd/download"
+fpkg ${UDEV_CONFIG} "http://www.linuxfromscratch.org/lfs/downloads/development"
+fpkg -e "tar.gz" ${GRUB} "ftp://alpha.gnu.org/gnu/grub"
+fpkg -e "tar.gz" ${DHCP} "ftp://ftp.isc.org/isc/dhcp/dhcp-3.0-history"
 
 exit $?
diff --git a/stage2/pkg/wireless-tools b/stage2/pkg/wireless-tools
new file mode 100644 (file)
index 0000000..ce6b039
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+hvbuild()
+{
+    make
+    make PREFIX=/usr install
+}
+
+hvbuild_post()
+{
+    install -d -m755 /etc/sysconfig/network/ssid
+
+    #install -d -m755 /etc/sysconfig/network-devices/ifconfig.ath0 &&
+    #cat > /etc/sysconfig/network-devices/ifconfig.ath0/01-wireless << "EOF"
+#ONBOOT=yes
+#SERVICE=wireless
+#ESSID=scan
+#TYPE=wep
+#EOF
+
+#cat > /etc/sysconfig/network/ssid/[ssid] << "EOF"
+#MODE=Managed
+#KEY1=""
+#KEY2=""
+#KEY3=""
+#KEY4=""
+#EOF
+
+    install -v -m740 ${SCRDIR}/misc/wireless /etc/rc.d/init.d
+}
diff --git a/stage2/pkg/wpa_supplicant b/stage2/pkg/wpa_supplicant
new file mode 100644 (file)
index 0000000..5fb368b
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+hvbuild()
+{
+    cd ${LFS_TMP}/${PACKAGE}/wpa_supplicant
+
+    cat > .config << "EOF"
+CONFIG_DRIVER_WEXT=y
+CONFIG_CTRL_IFACE=y
+CONFIG_BACKEND=file
+EOF
+
+    make
+    install -m 755 wpa_cli wpa_supplicant wpa_passphrase /sbin
+    install -m 644 doc/docbook/*8 /usr/man/man8
+    install -m 644 doc/docbook/wpa_supplicant.conf.5 /usr/man/man5
+}
index fba81f2..86f919a 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 cat > /etc/default/useradd << "EOF"
 # useradd defaults file
index 672666e..cb0185b 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 # Removing /cross-tools directory
 if [ -d /cross-tools ]; then
index d78c2fc..d92fd34 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 /tools/bin/find /{,usr/}{bin,lib,sbin} -type f \
     -exec /tools/bin/strip --strip-debug '{}' ';'
index 300fc17..5b6d3ff 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 # Amend the GCC specs file so that it points to the new dynamic linker, and so
 # that GCC knows where to find its start files.
index 2b0a729..588ec94 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 # Testing toolchain
 cd /tmp
index 665f23a..4c090db 100755 (executable)
@@ -1,10 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-hvtrap_setup
-source ../config/packages-list
+source ../functions/main
 source /etc/profile
 
 if [ "x${USER}" != "xroot" ]; then
index 5b0ffe4..179b95c 100755 (executable)
@@ -4,110 +4,108 @@ USE_LFS_PATCHES=1
 USE_BLFS_PATCHES=1
 USE_HV_PATCHES=1
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../functions-fpkg
-source ../config/packages-list
+source ../functions/main
 
-update_packages_init
-
-if [ ${#} -eq 1 -a "x${1}" = "xtest" ]; then
-    export TEST_INTEGRITY=1
-fi
+update_packages_init ${*}
 
 # 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       ${POPT} http://rpm5.org/files/popt
-fpkg       ${PAM} http://www.kernel.org/pub/linux/libs/pam/library
-fpkg -e "tar.gz" -f "${FCRON}.src" ${FCRON} http://fcron.free.fr/archives
-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       ${LYNX} http://lynx.isc.org/current
-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       ${XINETD} "http://www.xinetd.org"
-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_hv    ${GETDATE}
+fpkg -m gnu ${WHICH}
+fpkg -s "utils/pciutils" ${PCIUTILS} ${KERNEL_URL}
+fpkg -m sf -e "tar.bz2" ${LIBUSB}
+fpkg -m sf -e "tar.bz2" -s "libusb" ${LIBUSB_COMPAT}
+fpkg -m sf -s "linux-usb/usbutils" ${USBUTILS}
+fpkg -s "linux/utils/fs/reiserfs" ${REISERFSPROGS} ${KERNEL_URL}
+fpkg -e "tar.gz" ${POPT} "http://rpm5.org/files/popt"
+fpkg -s "linux/libs/pam/library" ${PAM} ${KERNEL_URL}
+fpkg -e "tar.gz" -f "${FCRON}.src" ${FCRON} "http://fcron.free.fr/archives"
+fpkg -e "tar.gz" ${OPENSSL} "ftp://ftp.openssl.org/source"
+fpkg ${OPENSSL_ROOT_CERTS} "http://anduin.linuxfromscratch.org/files/BLFS"
+fpkg -e "tar.gz" ${OPENSSH} "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable"
+fpkg ${LYNX} "http://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"
+fpkg ${SUBVERSION} "http://subversion.tigris.org/downloads"
+fpkg ${SUDO} "http://www.sudo.ws/sudo/dist"
+fpkg -m sf -e "tar.bz2" ${STRACE} 
+fpkg -m sf ${PCRE}
 
-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 -m gnu ${WGET}
+fpkg ${TCPWRAPPERS} "ftp://ftp.porcupine.org/pub/security"
+fpkg ${PORTMAP} "http://neil.brown.name/portmap"
+fpkg -s "linux/utils/nfs" ${NFS_UTILS} ${KERNEL_URL}
+fpkg -e "tar.gz" ${XINETD} "http://www.xinetd.org"
+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" -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 -m hv ${GETDATE}
+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" ${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 -m 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"
+fpkg -m gnu ${PARTED}
+fpkg -m gnu ${ED}
+fpkg -m gnu ${BC}
+fpkg -m sf ${FUSE}
+fpkg ${DOSFSTOOLS} "http://www.daniel-baumann.ch/software/dosfstools"
+fpkg -s "pub/software/scm/git" ${GIT} ${KERNEL_URL}
+fpkg -s "software/scm/git" ${GIT_MANPAGES} ${KERNEL_URL}
 
 # 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 -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}
+
+fpkg -m gnome ${INTLTOOL}
+fpkg ${PYTHON} "http://www.python.org/ftp/python/$(get_pkg_ver ${PYTHON})"
 
-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 -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} \
+    "http://sources-redhat.mirrors.redwire.net/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 -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})" -e "tar.gz" ${LIBJPEG} \
+    "http://www.ijg.org/files"
+fpkg -f "openjpeg_v$(get_pkg_ver ${LIBOPENJPEG} | sed 's!\.!_!g')" \
+    ${LIBOPENJPEG} "http://www.openjpeg.org"
+fpkg -m sf ${LIBPNG}
+fpkg -m gnome ${LIBART}
+fpkg -m sf ${LIBEXIF}
+fpkg -e "tar.gz" ${FRIBIDI} "http://fribidi.org/download"
+fpkg -m fd -s "icon-theme" ${HICOLOR_ICON_THEME}
+fpkg ${TIFF} "http://download.osgeo.org/libtiff"
+fpkg -m sf ${GIFLIB}
+fpkg -m sf ${LCMS}
 
-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://download.osgeo.org/libtiff"
-fpkg_sf    ${GIFLIB}
-fpkg       ${LCMS}    "http://www.littlecms.com"
-fpkg_sf    ${LIBMNG}
+fpkg -m sf ${LIBMNG}
 
-fpkg_sf    ${FREETYPE}
-fpkg       ${FONTCONFIG} "http://fontconfig.org/release"
+fpkg -m sf ${FREETYPE}
+fpkg -e "tar.gz" ${FONTCONFIG} "http://fontconfig.org/release"
 
 exit $?
index 9b0caf4..cfc35b3 100755 (executable)
@@ -1,8 +1,6 @@
 #!/bin/bash
 
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 # When all of the fonts have been installed, the system must be configured so
 # that Fontconfig can find the TrueType fonts since they are outside of the
index d54a806..0bbb39c 100755 (executable)
@@ -1,8 +1,6 @@
 #!/bin/bash
 
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 # Used by startx
 cat > /etc/skel/.xinitrc << "EOF"
index 798e25d..25c5ffd 100755 (executable)
@@ -1,10 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-hvtrap_setup
-source ../config/packages-list
+source ../functions/main
 source /etc/profile
 
 if [ "x${USER}" != "xroot" ]; then
index dac089b..65b82de 100755 (executable)
@@ -4,17 +4,9 @@ USE_LFS_PATCHES=1
 USE_BLFS_PATCHES=1
 USE_HV_PATCHES=1
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../functions-fpkg
-source ../config/packages-list
+source ../functions/main
 
-update_packages_init
-
-if [ ${#} -eq 1 -a "x${1}" = "xtest" ]; then
-    export TEST_INTEGRITY=1
-fi
+update_packages_init ${*}
 
 lpkg     3 ${PYTHON}
 
@@ -53,7 +45,7 @@ for module in ${XORG_MODULES_LIST}; do
     SUBMODS="$(grep -v '^#' ${LFS_PKG_DIR}/${MOD_NAME}/${module}.wget | sed 's!\.tar\.bz2$!!')"
 
     for submod in ${SUBMODS}; do
-        fpkg_xorg ${submod} ${MOD_NAME}
+        fpkg -m xorg -s ${MOD_NAME} ${submod}
     done
 
     pushd ${DEST_DIR} >> ${LFS_LOG_FILE}
@@ -67,45 +59,48 @@ for module in ${XORG_MODULES_LIST}; do
     popd >> ${LFS_LOG_FILE}
 done
 
-fpkg_xorg  ${LIBXAU} lib
-fpkg_xorg  ${LIBXDMCP} lib
-fpkg_sf    ${LESSTIF}
-fpkg_xorg  ${XBITMAPS} data
-fpkg       ${LIBPTHREAD_STUBS} "http://xcb.freedesktop.org/dist"
-fpkg       ${XCB_PROTO} "http://xcb.freedesktop.org/dist"
-fpkg_gnu   ${GPERF}
-fpkg       ${XCB_UTIL} "http://xcb.freedesktop.org/dist"
+fpkg -m xorg -s lib ${LIBXAU}
+fpkg -m xorg -s lib ${LIBXDMCP}
+fpkg -m sf ${LESSTIF}
+fpkg -m xorg -s data ${XBITMAPS}
+
+fpkg -m fd -o "dist" -s "xcb" ${LIBPTHREAD_STUBS}
+fpkg -m fd -o "dist" -s "xcb" ${XCB_PROTO}
+fpkg -m fd -o "dist" -s "xcb" ${XCB_UTIL}
+fpkg -m gnu ${GPERF}
 
-fpkg_hv    ${LIBDRM}
+fpkg -m hv ${LIBDRM}
 fpkg -e "tar.gz" ${TALLOC} "http://samba.org/ftp/talloc"
-fpkg -s "$(get_pkg_ver ${MESALIB})" ${MESALIB} ftp://ftp.freedesktop.org/pub/mesa
-fpkg_xorg  ${XCURSOR_THEMES} data
-fpkg       ${XKEYBOARD_CONFIG} "http://xlibs.freedesktop.org/xkbdesc"
-fpkg_xorg  ${LUIT} app
-fpkg -e "tar.gz" ${PIXMAN} "http://cairographics.org/releases"
+fpkg -s "$(get_pkg_ver ${MESALIB})" ${MESALIB} \
+    ftp://ftp.freedesktop.org/pub/mesa
+fpkg -m xorg -s data ${XCURSOR_THEMES}
+fpkg -m fd -o "xlibs" -s "xkbdesc" ${XKEYBOARD_CONFIG}
+
+fpkg -m xorg -s app ${LUIT}
+fpkg -e "tar.gz" ${PIXMAN} ${CAIRO_URL}
 fpkg -e "tar.gz" ${LIBFFI} "ftp://sourceware.org/pub/libffi"
-fpkg       ${DBUS} "http://dbus.freedesktop.org/releases/dbus"
-fpkg_gnome ${GLIB}
-fpkg_gnome ${GOBJECT_INSTROSPECTION}
-fpkg -e "tar.gz" ${DBUS_GLIB} "http://dbus.freedesktop.org/releases/dbus-glib"
-fpkg -e "tar.gz" ${EGGDBUS} "http://hal.freedesktop.org/releases"
-fpkg -e "tar.gz" ${POLKIT} "http://hal.freedesktop.org/releases"
-fpkg       ${CONSOLEKIT} "http://www.freedesktop.org/software/ConsoleKit/dist"
-fpkg -e "tar.gz" ${POLICYKIT} "http://hal.freedesktop.org/releases"
-fpkg       ${HAL} "http://hal.freedesktop.org/releases"
-fpkg       ${HAL_INFO} "http://hal.freedesktop.org/releases"
-
-fpkg_hv    ${XORG_VIDEO_NOUVEAU}
-fpkg_xorg  ${XORG_SERVER} xserver
-fpkg_xorg  ${XDM} app
 
-fpkg -e "tgz" ${XTERM} "ftp://invisible-island.net/xterm"
+fpkg -m fd -o "releases/dbus" ${DBUS}
+fpkg -m gnome ${GLIB}
+fpkg -m gnome ${GOBJECT_INSTROSPECTION}
+fpkg -m fd -o "dbus" ${DBUS_GLIB}
+fpkg -m fd -o "hal" ${EGGDBUS}
+fpkg -m fd -o "hal" ${POLKIT}
+fpkg ${CONSOLEKIT} "http://www.freedesktop.org/software/ConsoleKit/dist"
+fpkg -m fd -o "hal" ${POLICYKIT}
+fpkg -m fd ${HAL}
+fpkg -m fd -o "hal" ${HAL_INFO}
+
+fpkg -m hv ${XORG_VIDEO_NOUVEAU}
+fpkg -m xorg -s xserver ${XORG_SERVER}
+fpkg -m xorg -s app ${XDM}
 
+fpkg -e "tgz" ${XTERM} "ftp://invisible-island.net/xterm"
 fpkg -e "tar.gz" ${T1LIB} "http://www.ibiblio.org/pub/Linux/libs/graphics"
 
-fpkg_sf ${TK} tcl
-fpkg_gnu ${EMACS}
-fpkg ${WINDOWMAKER} "http://windowmaker.info/pub/source/release"
-fpkg -e "tar.gz" ${WINDOWMAKER_EXTRA} "http://windowmaker.info/pub/source/release"
+fpkg -m sf -s "tcl" ${TK}
+fpkg -m gnu ${EMACS}
+fpkg ${WINDOWMAKER} ${WMAKER_URL}
+fpkg -e "tar.gz" ${WINDOWMAKER_EXTRA} ${WMAKER_URL}
 
 exit $?
index d93cddb..6320665 100755 (executable)
@@ -1,10 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-hvtrap_setup
-source ../config/packages-list
+source ../functions/main
 source /etc/profile
 
 if [ "x${USER}" != "xroot" ]; then
@@ -70,8 +66,8 @@ fi
 
 ipkg ${HELP2MAN}
 ipkg ${GSL}
-ipkg ${CUPS}
-ipkg ${CUPS_PDF}
+ipkg -m acnb ${CUPS}
+ipkg -m noac ${CUPS_PDF}
 ipkg ${SPLIX}
 ipkg ${GHOSTSCRIPT}
 
@@ -84,7 +80,7 @@ if [ "x${INST_TYPE}" = "xworkstation" -o "x${INST_TYPE}" = "xltsp-server" ]; the
     ipkg ${GEGL}
     ipkg ${GIMP} "--disable-print"
     ipkg -m acnb ${GUTENPRINT}
-    ipkg ${BOOST} cis-boost
+    ipkg -m noac ${BOOST}
     # inkscape-0.47 has a problem with poppler >= 0.12.2
     # Try 0.48.1
     ipkg ${INKSCAPE} "CFLAGS=\"-DPOPPLER_NEW_GFXFONT\""
@@ -94,7 +90,7 @@ ipkg ${CDRTOOLS}
 ipkg ${DVDRWTOOLS}
 ipkg ${LIBDVDCSS}
 ipkg ${LIBDVDREAD} "--with-libdvdcss"
-ipkg ${DVDFS}
+ipkg -m noac ${DVDFS}
 
 if [ "x${INST_TYPE}" = "xworkstation" -o "x${INST_TYPE}" = "xltsp-server" ]; then
     ipkg ${TETEX_SRC} cis-tetex
@@ -172,7 +168,6 @@ if [ "x${INST_TYPE}" = "xworkstation" -o "x${INST_TYPE}" = "xltsp-server" ]; the
     ipkg ${FIREFOX}
 
     # Plugins for Firefox
-    ipkg ${JAVA}
     ipkg ${AGG}
     ipkg ${GNASH}
 fi
@@ -186,11 +181,11 @@ if [ "x${INST_TYPE}" = "xserver" -o "x${INST_TYPE}" = "xltsp-server" ]; then
     ipkg ${OPENLDAP}
 fi
 ipkg ${KERBEROS5}
-ipkg ${SENDMAIL} # Replace by SSMTP for workstation...
+ipkg -m noac ${SENDMAIL} # Replace by SSMTP for workstation...
 
 if [ "x${INST_TYPE}" = "xserver" -o "x${INST_TYPE}" = "xltsp-server" ]; then
-    ipkg ${PROCMAIL}
-    ipkg ${LIBSPF2}
+    ipkg -m noac ${PROCMAIL}
+    ipkg -m noac ${LIBSPF2}
     ipkg ${MILTER_SPF}
     ipkg ${MILTER_GREYLIST}
     ipkg ${CLAMAV}
@@ -199,33 +194,19 @@ if [ "x${INST_TYPE}" = "xserver" -o "x${INST_TYPE}" = "xltsp-server" ]; then
     ipkg -m pm ${PERL_MOD_HTML_TAGSET}
     ipkg -m pm ${PERL_MOD_HTML_PARSER}
     ipkg -m pm ${PERL_MOD_APACHE_LOGGED_AUTH_DBI}
-    ############ipkg -m pm ${PERL_MOD_DB_FILE}
-# Berkeley DB n'est plus installé...
-########PERL_MOD_DB_FILE="DB_File-1.814"
     ipkg -m pm ${PERL_MOD_DIGEST_SHA1}
     ipkg -m pm ${PERL_MOD_URI}
     ipkg -m pm ${PERL_MOD_LWP}
     ipkg -m pm ${PERL_MOD_NET_DNS} "--no-online-tests"
-
-    # Needed by OpenOffice ???
-    #ipkg -m pm ${PERL_MOD_ARCHIVE_ZIP}
-    #ipkg -m pm ${PERL_MOD_COMPRESS_ZLIB}
-    #ipkg -m pm ${PERL_MOD_IO_COMPRESS_BASE}
-    #ipkg -m pm ${PERL_MOD_COMPRESS_RAW_ZLIB}
-    #ipkg -m pm ${PERL_MOD_IO_COMPRESS_ZLIB}
-PERL_MOD_ARCHIVE_ZIP="Archive-Zip-1.30"
-PERL_MOD_COMPRESS_ZLIB="Compress-Zlib-2.015"
-PERL_MOD_IO_COMPRESS_BASE="IO-Compress-Base-2.024"
-PERL_MOD_IO_COMPRESS_ZLIB="IO-Compress-Zlib-2.024"
-PERL_MOD_COMPRESS_RAW_ZLIB="Compress-Raw-Zlib-2.024"
-
+    ipkg -m pm ${PERL_MOD_COMPRESS_ZLIB}
     ipkg -m pm ${SPAMASSASSIN}
+
     ipkg ${UW_IMAP}
 
     ipkg ${HTTPD} # Apache
     ipkg ${PHP}
 
-    ipkg ${SQUIRRELMAIL}
+    ipkg -m noac ${SQUIRRELMAIL}
     ipkg ${FETCHMAIL} "--with-ssl"
     ipkg ${MUTT} "--enable-imap --with-ssl"
 
index d9c8c48..5573119 100755 (executable)
@@ -4,222 +4,206 @@ USE_LFS_PATCHES=1
 USE_BLFS_PATCHES=1
 USE_HV_PATCHES=1
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../functions-fpkg
-source ../config/packages-list
+source ../functions/main
 
-update_packages_init
+update_packages_init ${*}
 
-if [ ${#} -eq 1 -a "x${1}" = "xtest" ]; then
-    export TEST_INTEGRITY=1
-fi
-
-GNUPG_URL="ftp://ftp.gnupg.org/gcrypt"
-
-fpkg_gnome ${LIBSIGCPP}
+fpkg -m gnome ${LIBSIGCPP}
 fpkg -e zip ${JASPER} "http://www.ece.uvic.ca/~mdadams/jasper/software"
-fpkg_gnome ${GTK_DOC}
-fpkg_gnome ${GLIBMM}
-fpkg       ${CAIRO} "http://cairographics.org/releases"
-fpkg       ${CAIROMM} "http://cairographics.org/releases"
-fpkg_gnome ${PANGO}
-fpkg_gnome ${PANGOMM}
-fpkg_gnome ${ATK}
-fpkg_gnome ${GTK}
-fpkg_gnome ${GTKMM}
-fpkg_gnome ${GTK_ENGINES}
-fpkg_gnome ${PYGOBJECT}
-fpkg       ${PYCAIRO} "http://cairographics.org/releases"
-fpkg_gnome ${PYGTK}
-fpkg       ${GC} " http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source"
-
-fpkg_gnu   ${EMACS}
-fpkg_hv    ${HVCLOCK}
-fpkg_hv    ${WMNOTIFY}
-
-fpkg       ${DESKTOP_FILE_UTILS} "http://freedesktop.org/software/desktop-file-utils/releases"
-fpkg       ${SHARED_MIME_INFO} "http://people.freedesktop.org/~hadess"
-fpkg_gnome ${STARTUP_NOTIFICATION}
-fpkg_gnome ${LIBWNCK}
-fpkg       ${ISO_CODES} ftp://pkg-isocodes.alioth.debian.org/pub/pkg-isocodes
-fpkg_sf    ${LIBXKLAVIER} gswitchit
-fpkg_gnome ${LIBGLADE}
-fpkg_gnu   ${LIBTASN1}
-fpkg_gnu   ${GUILE}
+fpkg -m gnome ${GTK_DOC}
+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 ${GTK}
+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 -e "tar.gz" ${GC} "http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source"
+
+fpkg -m gnu ${EMACS}
+fpkg -m hv ${HVCLOCK}
+fpkg -m hv ${WMNOTIFY}
+
+fpkg -e "tar.bz2" ${DESKTOP_FILE_UTILS} \
+    "http://freedesktop.org/software/desktop-file-utils/releases"
+fpkg ${SHARED_MIME_INFO} "http://people.freedesktop.org/~hadess"
+fpkg -m gnome ${STARTUP_NOTIFICATION}
+fpkg -m gnome ${LIBWNCK}
+fpkg ${ISO_CODES} "ftp://pkg-isocodes.alioth.debian.org/pub/pkg-isocodes"
+fpkg -m sf -s "gswitchit" ${LIBXKLAVIER}
+fpkg -m gnome ${LIBGLADE}
+fpkg -m gnu ${LIBTASN1}
+fpkg -m gnu ${GUILE}
 fpkg -s "libgpg-error" ${LIBGPG_ERROR} ${GNUPG_URL}
 fpkg -s "libgcrypt"    ${LIBGCRYPT}    ${GNUPG_URL}
 fpkg -s "gnutls"       ${GNUTLS}       ${GNUPG_URL}
-fpkg_gnome ${LIBIDL}
-fpkg_gnome ${ORBIT2}
-fpkg_gnome ${GCONF}
-fpkg       ${LIBPROXY} "http://libproxy.googlecode.com/files"
-fpkg_gnome ${GNOME_KEYRING}
-fpkg_gnome ${LIBSOUP}
-
-fpkg_gnu   ${HELP2MAN}
-fpkg_gnu   ${GSL}
-fpkg -s "$(get_pkg_ver ${CUPS})" -f "${CUPS}-source" ${CUPS} "http://ftp.easysw.com/pub/cups"
-fpkg -f "$(get_pkg_name ${CUPS_PDF})_$(get_pkg_ver ${CUPS_PDF})" ${CUPS_PDF} http://www.cups-pdf.de/src
-fpkg_sf    ${SPLIX}
-fpkg_sf    ${GHOSTSCRIPT}
-fpkg_sf    ${GHOSTSCRIPT_FONTS_STD} "ghostscript"
-fpkg_sf    ${GHOSTSCRIPT_FONTS_OTHER} "ghostscript"
-
-fpkg_sf    ${IMAGE_MAGICK} "imagemagick"
-fpkg       ${POPPLER} "http://poppler.freedesktop.org"
-fpkg_gnome ${LIBRSVG}
-fpkg       ${BABL} "ftp://ftp.gtk.org/pub/babl/$(get_pkg_ver_base ${BABL})"
-fpkg       ${GEGL} "ftp://ftp.gimp.org/pub/gegl/$(get_pkg_ver_base ${BABL})"
-fpkg       ${GIMP} "ftp://ftp.gimp.org/pub/gimp/v$(get_pkg_ver_base ${GIMP})"
-fpkg_sf    ${GUTENPRINT} "gimp-print"
-fpkg_sf    ${BOOST} "boost"
-fpkg_sf    ${INKSCAPE}
-
-fpkg       ${CDRTOOLS} "ftp://ftp.berlios.de/pub/cdrecord"
-fpkg       ${DVDRWTOOLS} "http://fy.chalmers.se/~appro/linux/DVD+RW/tools"
-fpkg -s "$(get_pkg_ver ${LIBDVDCSS})"  ${LIBDVDCSS} "http://www.videolan.org/pub/libdvdcss"
-fpkg       ${LIBDVDREAD} "http://www.dtek.chalmers.se/groups/dvd/dist"
-fpkg       ${DVDFS} "http://jspenguin.org:81/dvdfs"
-
-fpkg_hv    ${TETEX_SRC}
-fpkg_hv    ${TETEX_TEXMF}
-fpkg_hv    ${TETEX_TEXMFSRC}
-fpkg       ${TETEX_CM_SUPER} "http://anduin.linuxfromscratch.org/sources/BLFS/svn/t"
+fpkg -m gnome ${LIBIDL}
+fpkg -m gnome ${ORBIT2}
+fpkg -m gnome ${GCONF}
+fpkg -e "tar.gz" ${LIBPROXY} "http://libproxy.googlecode.com/files"
+fpkg -m gnome ${GNOME_KEYRING}
+fpkg -m gnome ${LIBSOUP}
+
+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 -m sf ${GHOSTSCRIPT}
+fpkg -m sf -s "ghostscript" ${GHOSTSCRIPT_FONTS_STD}
+fpkg -m sf -s "ghostscript" ${GHOSTSCRIPT_FONTS_OTHER}
+
+fpkg -m sf -s "imagemagick" ${IMAGE_MAGICK}
+fpkg -m fd -o "none" ${POPPLER}
+fpkg -m gnome ${LIBRSVG}
+fpkg ${BABL} "ftp://ftp.gtk.org/pub/babl/$(get_pkg_ver_base ${BABL})"
+fpkg ${GEGL} "ftp://ftp.gimp.org/pub/gegl/$(get_pkg_ver_base ${BABL})"
+fpkg ${GIMP} "ftp://ftp.gimp.org/pub/gimp/v$(get_pkg_ver_base ${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.gz" ${LIBDVDREAD} "http://www.dtek.chalmers.se/groups/dvd/dist"
+fpkg -e "tar.gz" ${DVDFS} "http://jspenguin.org:81/dvdfs"
+
+fpkg -e "tar.gz" ${TETEX_SRC} "${BLFS_SVN_SRC_URL}/t"
+fpkg -e "tar.gz" ${TETEX_TEXMF} "${BLFS_SVN_SRC_URL}/t"
+fpkg -e "tar.gz" ${TETEX_TEXMFSRC} "${BLFS_SVN_SRC_URL}/t"
+fpkg ${TETEX_CM_SUPER} "http://anduin.linuxfromscratch.org/sources/BLFS/svn/t"
 # For re-generating fontconfig documentation.
-fpkg_sf    ${JADETEX}
-
-fpkg -e tar.gz -s "${SANE_BACKENDS}" ${SANE_BACKENDS} "ftp://ftp.sane-project.org/pub/sane"
-fpkg -e tar.gz -s "xsane"            ${XSANE}         "ftp://ftp.sane-project.org/pub/sane"
-
-fpkg       ${PERL_MOD_XML_SIMPLE} "http://www.cpan.org/modules/by-module/XML"
-fpkg       ${PERL_MOD_PARSE_REDESCENT} "http://search.cpan.org/CPAN/authors/id/D/DC/DCONWAY"
-fpkg       ${ICON_NAMING_UTILS}       "http://tango.freedesktop.org/releases"
-fpkg       ${TANGO_ICON_THEME}        "http://tango.freedesktop.org/releases"
-fpkg       ${TANGO_ICON_THEME_EXTRAS} "http://tango.freedesktop.org/releases"
+fpkg -m sf ${JADETEX}
 
-fpkg       ${LIBOIL} "http://liboil.freedesktop.org/download"
+fpkg -e "tar.gz" ${SANE_BACKENDS} "http://alioth.debian.org/download.php/2318"
+fpkg -e "tar.gz" ${XSANE} "ftp://ftp2.sane-project.org/pub/sane/xsane"
 
-fpkg       ${ALSA_LIB}     "ftp://ftp.alsa-project.org/pub/lib"
-fpkg       ${ALSA_UTILS}   "ftp://ftp.alsa-project.org/pub/utils"
-fpkg       ${ALSA_OSS}     "ftp://ftp.alsa-project.org/pub/oss-lib"
+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       ${LIBSAMPLERATE} "http://www.mega-nerd.com/SRC"
+fpkg -e "tar.gz" ${LIBOIL} "http://liboil.freedesktop.org/download"
 
-fpkg       ${LIBOGG}    "http://downloads.xiph.org/releases/ogg"
-fpkg       ${LIBVORBIS} "http://downloads.xiph.org/releases/vorbis"
-fpkg_hv    ${FLAC}
-fpkg_sf    ${LAME}
-fpkg_hv    ${LIBA52}
-fpkg_hv    ${LIBID3TAG}
-fpkg       ${LIBMAD} "ftp://ftp.mars.org/pub/mpeg"
+fpkg ${ALSA_LIB}   "ftp://ftp.alsa-project.org/pub/lib"
+fpkg ${ALSA_UTILS} "ftp://ftp.alsa-project.org/pub/utils"
+fpkg ${ALSA_OSS}   "ftp://ftp.alsa-project.org/pub/oss-lib"
 
-fpkg_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 -e "tar.gz" ${LIBSAMPLERATE} "http://www.mega-nerd.com/SRC"
 
-fpkg       ${AUDIOFILE} "http://www.68k.org/~michael/audiofile"
-fpkg_hv    ${PORTAUDIO}
-fpkg       ${LIBSNDFILE} "http://www.mega-nerd.com/libsndfile"
+fpkg -e "tar.gz" ${LIBOGG} "http://downloads.xiph.org/releases/ogg"
+fpkg ${LIBVORBIS} "http://downloads.xiph.org/releases/vorbis"
+fpkg -m hv ${FLAC}
+fpkg -m sf ${LAME}
+fpkg -m hv ${LIBA52}
+fpkg -m hv ${LIBID3TAG}
+fpkg -e "tar.gz" ${LIBMAD} "ftp://ftp.mars.org/pub/mpeg"
 
-#fpkg_gnome ${ESOUND}
-fpkg       ${SPEEX} "http://downloads.xiph.org/releases/speex"
-###fpkg       ${PULSEAUDIO} "http://0pointer.de/lennart/projects/pulseaudio"
-fpkg_sf    ${JACK} "jackit"
+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       ${ALSA_PLUGINS} "ftp://ftp.alsa-project.org/pub/plugins"
-fpkg       ${VORBIS_TOOLS} "http://downloads.xiph.org/releases/vorbis"
+fpkg -e "tar.gz" ${AUDIOFILE} "http://www.68k.org/~michael/audiofile"
+fpkg -e "tar.gz" -f "pa_stable_v19_20071207" ${PORTAUDIO} \
+    "http://www.portaudio.com/archives"
+fpkg -e "tar.gz" ${LIBSNDFILE} "http://www.mega-nerd.com/libsndfile/files"
 
-fpkg_sf    ${GRIP}
-fpkg_sf    ${CDRDAO}
-fpkg_sf    ${EASYTAG}
-fpkg       ${LILYPOND} "http://lilypond.org/download/sources/v$(get_pkg_ver_base ${LILYPOND})"
+fpkg -e "tar.gz" ${SPEEX} "http://downloads.xiph.org/releases/speex"
+#fpkg -m gnome ${ESOUND}
+###fpkg ${PULSEAUDIO} "http://0pointer.de/lennart/projects/pulseaudio"
+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_hv    ${FFMPEG}
+fpkg -m sf ${GRIP}
+fpkg -m sf -e "tar.bz2" ${CDRDAO}
+fpkg -m sf -e "tar.bz2" ${EASYTAG}
+fpkg -e "tar.gz" ${LILYPOND} \
+    "http://lilypond.org/download/sources/v$(get_pkg_ver_base ${LILYPOND})"
+fpkg -m hv ${FFMPEG}
 
-exit 1
+fpkg ${SYLPHEED} "http://sylpheed.good-day.net/sylpheed/v$(get_pkg_ver_base ${SYLPHEED})"
 
-fpkg       ${SYLPHEED} "http://sylpheed.good-day.net/sylpheed/v$(get_pkg_ver_base ${SYLPHEED})"
+fpkg -m hv ${NSS}
+fpkg -f "${FIREFOX}.source" ${FIREFOX} \
+    "http://releases.mozilla.org/pub/mozilla.org/firefox/releases/$(get_pkg_ver ${FIREFOX})/source"
 
-fpkg_hv    ${NSS}
-fpkg       ${FIREFOX} "http://releases.mozilla.org/pub/mozilla.org/firefox/releases/$(get_pkg_ver ${FIREFOX})/source"
+fpkg -m hv ${AGG}
+fpkg ${GNASH} "http://ftp.gnu.org/pub/gnu/gnash/$(get_pkg_ver ${GNASH})"
 
-fpkg_hv    ${JAVA}
-fpkg_hv    ${AGG}
-fpkg       ${GNASH} "http://ftp.gnu.org/pub/gnu/gnash/$(get_pkg_ver ${GNASH})"
+fpkg -e "tar.gz" ${SASL2} "ftp://ftp.andrew.cmu.edu/pub/cyrus-mail"
+fpkg -e "tgz" -f "openldap-stable-20070831" ${OPENLDAP} "ftp://ftp.openldap.org/pub/OpenLDAP/openldap-stable"
+fpkg -m hv ${KERBEROS5}
 
-fpkg       ${SASL2} "ftp://ftp.andrew.cmu.edu/pub/cyrus-mail"
-fpkg -f "openldap-stable-20070831" ${OPENLDAP} "ftp://ftp.openldap.org/pub/OpenLDAP/openldap-stable"
-fpkg_hv    ${KERBEROS5}
+fpkg -e "tar.gz" -f "sendmail.$(get_pkg_ver ${SENDMAIL})" ${SENDMAIL} "ftp://ftp.sendmail.org/pub/sendmail"
+fpkg -e "tar.gz" ${LIBSPF2} "http://libspf2.org/spf"
+fpkg -e "tgz" ${MILTER_GREYLIST} "ftp://ftp.espci.fr/pub/milter-greylist"
+fpkg -m hv ${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 ${MUTT}
+fpkg -m sf ${CLAMAV}
 
-fpkg -f "sendmail.$(get_pkg_ver ${SENDMAIL})" ${SENDMAIL} "ftp://ftp.sendmail.org/pub/sendmail"
-fpkg       ${LIBSPF2} "http://libspf2.org/spf"
-fpkg       ${MILTER_GREYLIST} "ftp://ftp.espci.fr/pub/milter-greylist"
-fpkg_hv    ${MILTER_SPF}
-fpkg       ${PROCMAIL} "http://www.procmail.org"
-fpkg       ${FETCHMAIL} "http://download.berlios.de/fetchmail"
-fpkg_sf    ${MUTT}
-fpkg_sf    ${CLAMAV}
+fpkg -m pm -s "G/GR/GRANTM"   ${PERL_MOD_XML_SIMPLE}
+fpkg -m pm -s "D/DC/DCONWAY"  ${PERL_MOD_PARSE_REDESCENT}
 
-fpkg       ${PERL_MOD_HTML_TAGSET} "http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules"
-fpkg       ${PERL_MOD_HTML_PARSER} "http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules"
-fpkg       ${PERL_MOD_APACHE_LOGGED_AUTH_DBI} "http://search.cpan.org/CPAN/authors/id/S/SI/SIMKIN"
-fpkg       ${PERL_MOD_DB_FILE} "http://search.cpan.org/CPAN/authors/id/P/PM/PMQS"
-fpkg       ${PERL_MOD_DIGEST_SHA1} "http://anduin.linuxfromscratch.org/sources/BLFS/svn/perl-modules"
-# URI is needed by LWP
-fpkg       ${PERL_MOD_URI} "http://search.cpan.org/CPAN/authors/id/G/GA/GAAS"
-# LWP is Needed by LTSP
-fpkg       ${PERL_MOD_LWP} "http://www.linpro.no/lwp"
+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 "J/JM/JMASON"   ${SPAMASSASSIN}
 
-# ZIP is Needed by OO
-fpkg       ${PERL_MOD_ARCHIVE_ZIP} "http://search.cpan.org/CPAN/authors/id/A/AD/ADAMK"
-fpkg       ${PERL_MOD_COMPRESS_ZLIB} "http://search.cpan.org/CPAN/authors/id/P/PM/PMQS"
-fpkg       ${PERL_MOD_IO_COMPRESS_BASE} "http://search.cpan.org/CPAN/authors/id/P/PM/PMQS"
-fpkg       ${PERL_MOD_IO_COMPRESS_ZLIB} "http://search.cpan.org/CPAN/authors/id/P/PM/PMQS"
-fpkg       ${PERL_MOD_COMPRESS_RAW_ZLIB} "http://search.cpan.org/CPAN/authors/id/P/PM/PMQS"
-fpkg       ${PERL_MOD_NET_DNS} "http://search.cpan.org/CPAN/authors/id/O/OL/OLAF"
+fpkg -e "tar.gz" ${UW_IMAP} "ftp://ftp.cac.washington.edu/imap"
 
-fpkg       ${SPAMASSASSIN} "http://apache.sunsite.ualberta.ca/spamassassin/source"
-fpkg       ${UW_IMAP} "ftp://ftp.cac.washington.edu/imap"
+fpkg -m apa ${HTTPD}
 
-fpkg       ${HTTPD} "http://www.apache.org/dist/httpd"
+fpkg -e "tar.gz" ${SAMBA} "ftp://ftp.samba.org/pub/samba/old-versions"
 
-fpkg       ${SAMBA} "ftp://ftp.samba.org/pub/samba/old-versions"
+fpkg ${PHP}   "http://us2.php.net/distributions"
 
-fpkg       ${PHP}   "http://us2.php.net/distributions"
+#####lpkg 2 ${SUBVERSION} # Déja installé au stage 3 ?? Module webdav?
+fpkg -m gnu ${INDENT}
 
-lpkg     2 ${SUBVERSION}
-fpkg_gnu   ${INDENT}
+fpkg -e "tgz" ${LTSP_UTILS} "http://ltsp.mirrors.tds.net/pub/ltsp/utils"
+fpkg -s "software/network/tftp" ${TFTP_HPA} ${KERNEL_URL}
 
-fpkg       ${LTSP_UTILS} "http://ltsp.mirrors.tds.net/pub/ltsp/utils"
-fpkg       ${TFTP_HPA} "http://www.kernel.org/pub/software/network/tftp"
+fpkg -m sf ${KVM}
+fpkg -m hv ${BRIDGE_UTILS}
+fpkg -m hv ${UML_UTILITIES}
 
-fpkg_sf    ${KVM}
-fpkg_hv    ${BRIDGE_UTILS}
-fpkg_hv    ${UML_UTILITIES}
+fpkg ${TRANSMISSION} "http://mirrors.m0k.org/transmission/files"
 
-fpkg       ${TRANSMISSION} "http://mirrors.m0k.org/transmission/files"
+fpkg -m hv ${CKERMIT}
 
-fpkg_hv    ${CKERMIT}
+fpkg -e "tar.gz" ${LIBGAMIN} "http://www.gnome.org/~veillard/gamin/sources"
 
-fpkg       ${LIBGAMIN} "ftp://ftp.linux.ee/pub/gentoo/distfiles/distfiles"
-fpkg_sf    ${PCMANFM}
+fpkg -m sf ${PCMANFM}
 
 fpkg -s "gnupg" ${GNUPG} "ftp://ftp.gnupg.org/gcrypt"
 
-#fpkg_gnu   ${AVR_GDB}
-#fpkg       ${AVRDUDE} "http://download.savannah.gnu.org/releases/avrdude"
 #fpkg_mis   ${SPLINT} "${SPLINT}.src" "http://splint.org/downloads"
 
 GEDA_BASE_URL=http://geda.seul.org/release/v$(get_pkg_ver_base ${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}
+#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}
 
 exit $?
index 2cf3c93..1fb83b1 100644 (file)
@@ -1,31 +1,13 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}
-sh autogen.sh
-./configure \
-    --prefix=/usr \
-    --disable-static \
-    --enable-ctrl \
-    --enable-gpc \
-    ${CONFIGURE_OPTS}
-make
-make install
-ldconfig
-
-exit $?
+#!/bin/bash
+
+hvconfig_pre()
+{
+    cd ${LFS_TMP}/${PACKAGE}
+    sh autogen.sh
+
+    CONFIGURE_OPTS=" \
+        ${CONFIGURE_OPTS} \
+        --disable-static \
+        --enable-ctrl \
+        --enable-gpc"
+}
index 81d877c..029138b 100644 (file)
@@ -1,23 +1,12 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-./configure \
-    --enable-static
-make
-make install
-install -v -m644 -D doc/asoundrc.txt /usr/share/doc/${1}/asoundrc.txt
-
-ldconfig
-
-exit $?
+#!/bin/bash
+
+hvconfig_pre()
+{
+    CONFIGURE_OPTS=" \
+        --enable-static"
+}
+
+hvbuild_post()
+{
+    install -v -m644 -D doc/asoundrc.txt /usr/share/doc/${PACKAGE}/asoundrc.txt
+}
index 9ec4264..8d3bf8a 100644 (file)
@@ -1,29 +1,19 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
-# First argument of this script is the package name
+hvconfig_pre()
+{
+    CONFIGURE_OPTS=""
+}
 
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
+hvbuild_post()
+{
+    # The first time the alsa bootscript is run, it will complain that there is
+    # no state in /etc/asound.state. You can prevent this by running the
+    # following commands after installing alsa-utils:
+    touch /etc/asound.state
 
-# Applying patches (if any)
-apply_patches ${1}
+    install -v -m740 ${SCRDIR}/bootscripts/alsa /etc/rc.d/init.d
 
-cd ${LFS_TMP}/${1}
-./configure
-make
-make install
-
-# The first time the alsa bootscript is run, it will complain that there is no state in
-# /etc/asound.state. You can prevent this by running the following commands after
-# installing alsa-utils:
-touch /etc/asound.state
-
-install -v -m740 ${SCRDIR}/bootscripts/alsa /etc/rc.d/init.d
-
-# script-name start stop
-bootscript_add_rcsysinit alsa 95 85
-
-exit $?
+    # script-name start stop
+    bootscript_add_rcsysinit alsa 95 85
+}
index 2aa25e1..ab03860 100644 (file)
@@ -1,54 +1,51 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-groupadd -f ${APACHE_USER}
-hv_useradd -c WebServer -d /dev/null -g ${APACHE_USER} -s /bin/false ${APACHE_USER}
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
-    --enable-layout=FHS \
-    --enable-mods-shared=all \
-    --enable-ssl \
-    --with-z
-#    --enable-rewrite \
-#    --enable-deflate \
-#    --enable-dav \
-make
-make install
-
-# There's a problem with the ISAPI DSO module caused from compiling with GCC-4.1.2.
-# Commenting out the module from the configuration:
-if grep "LoadModule isapi_module" /etc/apache/httpd.conf 1> /dev/null 2>&1; then
-    sed -i -e "s/^LoadModule isapi_module/# &/" /etc/apache/httpd.conf
-fi
-
-# Modifying the listening port if an alternate one is specified.
-if [ -n "${HTTPD_PORT}" ]; then
-    if ! grep "Listen ${HTTPD_PORT}" /etc/apache/httpd.conf 1> /dev/null 2>&1; then
-       # Adding alternate port to default port of 80
-       sed -i -e "s%\(Listen 80\)%\1\nListen ${HTTPD_PORT}%" /etc/apache/httpd.conf
+#!/bin/bash
+
+hvconfig_pre()
+{
+    groupadd -f ${APACHE_USER}
+    hv_useradd -c WebServer -d /dev/null -g ${APACHE_USER} -s /bin/false \
+        ${APACHE_USER}
+
+    CONFIGURE_OPTS=" \
+        ${CONFIGURE_OPTS} \
+        --enable-layout=FHS \
+        --enable-mods-shared=all \
+        --enable-ssl \
+        --with-z"
+    #    --enable-rewrite \
+    #    --enable-deflate \
+    #    --enable-dav \
+}
+
+hvbuild_post()
+{
+    # There's a problem with the ISAPI DSO module caused from compiling with
+    # GCC-4.1.2.
+    # Commenting out the module from the configuration:
+    if grep "LoadModule isapi_module" /etc/apache/httpd.conf \
+        1> /dev/null 2>&1; then
+        sed -i -e "s/^LoadModule isapi_module/# &/" /etc/apache/httpd.conf
     fi
-fi
 
-# Modifying the configuration file to run the server as a dedicated user:
-sed -i \
-    -e "s!^\(User\).*!\1 ${APACHE_USER}!g" \
-    -e "s!^\(Group\).*!\1 ${APACHE_USER}!g" \
-    /etc/apache/httpd.conf
+    # Modifying the listening port if an alternate one is specified.
+    if [ -n "${HTTPD_PORT}" ]; then
+        if ! grep "Listen ${HTTPD_PORT}" /etc/apache/httpd.conf \
+            1> /dev/null 2>&1; then
+            # Adding alternate port to default port of 80
+           sed -i -e "s%\(Listen 80\)%\1\nListen ${HTTPD_PORT}%" \
+                /etc/apache/httpd.conf
+        fi
+    fi
+
+    # Modifying the configuration file to run the server as a dedicated user:
+    sed -i \
+        -e "s!^\(User\).*!\1 ${APACHE_USER}!g" \
+        -e "s!^\(Group\).*!\1 ${APACHE_USER}!g" \
+        /etc/apache/httpd.conf
 
-# SSL Certificates generation script
-cat > /etc/apache/generate-ssl-certs << "EOF"
-#!/bin/sh
+    # SSL Certificates generation script
+    cat > /etc/apache/generate-ssl-certs << "EOF"
+#!/bin/bash
 
 # Creation of SSL directories for Apache
 cd /etc/apache
@@ -99,25 +96,24 @@ openssl x509 -req -days 10000 -in server.csr -signkey server.key -out server.crt
 exit $?
 EOF
 
-chmod 740 /etc/apache/generate-ssl-certs
+    chmod 740 /etc/apache/generate-ssl-certs
 
-mkdir -p /etc/apache/ssl
-cp /etc/apache/extra/httpd-ssl.conf /etc/apache/ssl/ssl.conf
+    mkdir -p /etc/apache/ssl
+    cp /etc/apache/extra/httpd-ssl.conf /etc/apache/ssl/ssl.conf
 
-sed -i -e "s!^<IfModule ssl_module>!<IfModule ssl_module>\n  Include /etc/apache/ssl/ssl.conf!" /etc/apache/httpd.conf
+    sed -i -e "s!^<IfModule ssl_module>!<IfModule ssl_module>\n  Include /etc/apache/ssl/ssl.conf!" /etc/apache/httpd.conf
 
-mkdir -p /srv/www/htdocs/ssl
-chown apache:apache /srv/www/htdocs/ssl
+    mkdir -p /srv/www/htdocs/ssl
+    chown apache:apache /srv/www/htdocs/ssl
 
-sed -i -e "s!^DocumentRoot .*!DocumentRoot /srv/www/htdocs/ssl!" /etc/apache/ssl/ssl.conf
-sed -i -e "s!^ServerName .*:443!ServerName www.${DOMAIN}:443!" /etc/apache/ssl/ssl.conf
-sed -i -e "s!^ServerAdmin .*!ServerAdmin webmaster@${DOMAIN}!" /etc/apache/ssl/ssl.conf
-sed -i -e "s!/etc/apache!/etc/apache/ssl!" /etc/apache/ssl/ssl.conf
+    sed -i -e "s!^DocumentRoot .*!DocumentRoot /srv/www/htdocs/ssl!" /etc/apache/ssl/ssl.conf
+    sed -i -e "s!^ServerName .*:443!ServerName www.${DOMAIN}:443!" /etc/apache/ssl/ssl.conf
+    sed -i -e "s!^ServerAdmin .*!ServerAdmin webmaster@${DOMAIN}!" /etc/apache/ssl/ssl.conf
+    sed -i -e "s!/etc/apache!/etc/apache/ssl!" /etc/apache/ssl/ssl.conf
 
-# Bootscript
-install -v -m740 ${SCRDIR}/bootscripts/apache /etc/rc.d/init.d
+    # Bootscript
+    install -v -m740 ${SCRDIR}/bootscripts/apache /etc/rc.d/init.d
 
-# script-name start stop
-bootscript_add_rc3 apache 70 20
-
-exit $?
+    # script-name start stop
+    bootscript_add_rc3 apache 70 20
+}
index cb215ad..d8efd98 100644 (file)
@@ -1,23 +1,9 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}
-./bootstrap.sh
-./bjam --prefix=/usr
-./bjam install
-ldconfig
-
-exit $?
+#!/bin/bash
+
+hvbuild()
+{
+    cd ${LFS_TMP}/${PACKAGE}
+    ./bootstrap.sh
+    ./bjam --prefix=/usr
+    ./bjam install
+}
index 50df063..37228ad 100644 (file)
@@ -1,22 +1,13 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
-# First argument of this script is the package name
+hvbuild()
+{
+    cd ${LFS_TMP}/${PACKAGE}
+    make INS_BASE=/usr DEFINSUSR=root DEFINSGRP=root
+    make INS_BASE=/usr DEFINSUSR=root DEFINSGRP=root install
 
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-make INS_BASE=/usr DEFINSUSR=root DEFINSGRP=root
-make INS_BASE=/usr DEFINSUSR=root DEFINSGRP=root install
-
-cat > /etc/sysconfig/cdrecord << "EOF"
-#!/bin/sh
+    cat > /etc/sysconfig/cdrecord << "EOF"
+#!/bin/bash
 
 # If you know exactly the device to use with cdrecord,
 # enter it in this variable. If this variable is empty,
@@ -31,5 +22,4 @@ cat > /etc/sysconfig/cdrecord << "EOF"
 CDREC_DEVICE_DESC="CD-Writer+ 8200"
 CDROM_DEVICE_DESC="CDR-8235"
 EOF
-
-exit $?
+}
index 5bd062b..480a63f 100644 (file)
@@ -1,26 +1,15 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
+hvbuild()
+{
+    cd ${LFS_TMP}/${PACKAGE}
+    make linux
+    make prefix=/usr install
+}
 
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}
-make linux
-make prefix=/usr install
-
-cat > /etc/skel/.kermrc << "EOF"
+hvbuild_post()
+{
+    cat > /etc/skel/.kermrc << "EOF"
 set line /dev/ttyUSB0
 set speed 115200
 set carrier-watch off
@@ -34,5 +23,4 @@ set send pack 1000
 set window 5
 xecho \27[32m\27[40m
 EOF
-
-exit $?
+}
index 667abfe..52e5a54 100644 (file)
@@ -1,30 +1,17 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
-# First argument of this script is the package name
+hvconfig_pre()
+{
+    hv_useradd -c "Print_Service_User" -d /dev/null -g lp -s /bin/false -u 9 lp
 
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
+    CONFIGURE_OPTS=""
+}
 
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-hv_useradd -c "Print_Service_User" -d /dev/null -g lp -s /bin/false -u 9 lp
-
-cd ${LFS_TMP}/${PACKAGE}
-./configure
-make
-make install
-
-if [ -n "${CUPS_SERVER}" ]; then
-    # Configuring for connection to a remote CUPS print server
-    cat > /etc/cups/client.conf << "EOF"
+hvbuild_pre()
+{
+    if [ -n "${CUPS_SERVER}" ]; then
+        # Configuring for connection to a remote CUPS print server
+        cat > /etc/cups/client.conf << "EOF"
 ########################################################################
 #                                                                      #
 # This is the CUPS client configuration file.  This file is used to    #
@@ -41,15 +28,14 @@ if [ -n "${CUPS_SERVER}" ]; then
 # and possibly polling.
 #
 EOF
-    echo "ServerName ${CUPS_SERVER}" >> /etc/cups/client.conf
-else
-    # Configuring for a CUPS print server
-    sed -i -e 's@Listen localhost:631@Listen \*:631@' /etc/cups/cupsd.conf
-fi
-
-install -v -m740 ${SCRDIR}/bootscripts/cups /etc/rc.d/init.d
+        echo "ServerName ${CUPS_SERVER}" >> /etc/cups/client.conf
+    else
+        # Configuring for a CUPS print server
+        sed -i -e 's@Listen localhost:631@Listen \*:631@' /etc/cups/cupsd.conf
+    fi
 
-# script-name start stop
-bootscript_add_rc3 cups 40 50
+    install -v -m740 ${SCRDIR}/bootscripts/cups /etc/rc.d/init.d
 
-exit $?
+    # script-name start stop
+    bootscript_add_rc3 cups 40 50
+}
index 6a6bec3..18d5079 100644 (file)
@@ -1,27 +1,12 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}/src
-gcc -O9 -s -o cups-pdf cups-pdf.c
-install -m 0700 cups-pdf /usr/lib/cups/backend
-
-cd ${LFS_TMP}/${PACKAGE}
-cp extra/cups-pdf.conf /etc/cups
-cp extra/CUPS-PDF.ppd /usr/share/cups/model
-
-exit $?
+#!/bin/bash
+
+hvbuild()
+{
+    cd ${LFS_TMP}/${PACKAGE}/src
+    gcc -O9 -s -o cups-pdf cups-pdf.c
+    install -m 0700 cups-pdf /usr/lib/cups/backend
+
+    cd ${LFS_TMP}/${PACKAGE}
+    cp extra/cups-pdf.conf /etc/cups
+    cp extra/CUPS-PDF.ppd /usr/share/cups/model
+}
index 4cd607b..c29ee3b 100644 (file)
@@ -1,20 +1,9 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-make all rpl8 btcflash
-make prefix=/usr install
-install -v -m644 -D index.html /usr/share/doc/${1}/index.html
-ldconfig
-
-exit $?
+#!/bin/bash
+
+hvbuild()
+{
+    cd ${LFS_TMP}/${PACKAGE}
+    make all rpl8 btcflash
+    make prefix=/usr install
+    install -v -m644 -D index.html /usr/share/doc/${PACKAGE}/index.html
+}
index b7829f0..140ec04 100644 (file)
@@ -1,26 +1,7 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}
-make
-make install
-
-# Mount script
-install -v -m755 ${SCRDIR}/misc/mount.fusedvdfs /sbin
-
-exit $?
+hvbuild_post()
+{
+    # Mount script
+    install -v -m755 ${SCRDIR}/misc/mount.fusedvdfs /sbin
+}
index 7d39c59..1593df7 100644 (file)
@@ -1,34 +1,29 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
-    --prefix=/usr \
-    --libexecdir=/usr/sbin \
-    --with-x-toolkit=gtk
-make bootstrap
-make install
-ldconfig
-
-install -m644 ${SCRDIR}/misc/emacs/emacsrc /etc/skel/.emacs
-install -m644 ${SCRDIR}/misc/emacs/emacsrc /root/.emacs
-
-LOCAL_SITE_LIST=/usr/local/share/emacs/site-lisp
-
-install -v -m644 -d ${LOCAL_SITE_LIST}
-install -m644 ${SCRDIR}/misc/emacs/buffer-cycle.el ${LOCAL_SITE_LIST}
-
-# Set Emacs as default editor
-sed -i -e "s!^\(EDITOR=\).*!\1emacs!" /etc/profile
-
-exit $?
+#!/bin/bash
+
+hvconfig_pre()
+{
+    CONFIGURE_OPTS=" \
+        ${CONFIGURE_OPTS} \
+        --libexecdir=/usr/sbin \
+        --with-x-toolkit=gtk"
+}
+
+hvbuild()
+{
+    make bootstrap
+    make install
+}
+
+hvbuild_post()
+{
+    install -m644 ${SCRDIR}/misc/emacs/emacsrc /etc/skel/.emacs
+    install -m644 ${SCRDIR}/misc/emacs/emacsrc /root/.emacs
+
+    LOCAL_SITE_LIST=/usr/local/share/emacs/site-lisp
+
+    install -v -m644 -d ${LOCAL_SITE_LIST}
+    install -m644 ${SCRDIR}/misc/emacs/buffer-cycle.el ${LOCAL_SITE_LIST}
+
+    # Set Emacs as default editor
+    sed -i -e "s!^\(EDITOR=\).*!\1emacs!" /etc/profile
+}
index e42e0be..119fc8d 100644 (file)
@@ -1,23 +1,12 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
-# First argument of this script is the package name
+hvbuild()
+{
+    FIREFOX_BUILD_DIR="${PACKAGE}-build"
+    FIREFOX_PKG_VERSION="firefox-$(get_pkg_ver ${PACKAGE})"
 
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-FIREFOX_BUILD_DIR="${1}-build"
-FIREFOX_PKG_VERSION="firefox-$(get_pkg_ver ${PACKAGE})"
-
-cd ${LFS_TMP}/${PACKAGE}
-cat > .mozconfig << "EOF"
+    cd ${LFS_TMP}/${PACKAGE}
+    cat > .mozconfig << "EOF"
 # This file contains the options used in the Firefox build.
 
 # Use the default settings specified in the source tree
@@ -121,28 +110,23 @@ ac_add_options --enable-strip
 
 EOF
 
-sed -i -e "s!_FIREFOX_BUILD_DIR_!${FIREFOX_BUILD_DIR}!g" .mozconfig
-
-make -f client.mk build
-make -f client.mk install
-
-# Many applications look for netscape when they need to open a browser...
-ln -v -sf firefox /usr/bin/netscape
+    sed -i -e "s!_FIREFOX_BUILD_DIR_!${FIREFOX_BUILD_DIR}!g" .mozconfig
 
-# Remove old links
-rm -f /usr/lib/mozilla
-rm -f /usr/lib/firefox
-rm -f /usr/lib/${FIREFOX_PKG_VERSION}/plugins/libjavaplugin_oji.so
+    make -f client.mk build
+    make -f client.mk install
 
-ln -v -sf ${FIREFOX_PKG_VERSION} /usr/lib/mozilla
-ln -v -sf ${FIREFOX_PKG_VERSION} /usr/lib/firefox
-# To use the installed Java plugin.
-ln -v -s ${JAVA_HOME}/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/${FIREFOX_PKG_VERSION}/plugins
+    # Many applications look for netscape when they need to open a browser...
+    ln -v -sf firefox /usr/bin/netscape
 
-# Addition to /etc/ld.so.conf
-# This is necessary for shared library libmozjs.so (needed by gxine)
-string_add "/usr/lib/${FIREFOX_PKG_VERSION}" /etc/ld.so.conf
+    # Remove old links
+    rm -f /usr/lib/mozilla
+    rm -f /usr/lib/firefox
+    rm -f /usr/lib/${FIREFOX_PKG_VERSION}/plugins/libjavaplugin_oji.so
 
-ldconfig
+    ln -v -sf ${FIREFOX_PKG_VERSION} /usr/lib/mozilla
+    ln -v -sf ${FIREFOX_PKG_VERSION} /usr/lib/firefox
 
-exit $?
+    # Addition to /etc/ld.so.conf
+    # This is necessary for shared library libmozjs.so (needed by gxine)
+    string_add "/usr/lib/${FIREFOX_PKG_VERSION}" /etc/ld.so.conf
+}
index 7c56b07..81e999e 100644 (file)
@@ -1,9 +1,4 @@
-#!/bin/sh
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
+#!/bin/bash
 
 # Common installation script
 ./cis-gnome ${*}
index bc26a6c..242d9a3 100644 (file)
@@ -1,64 +1,58 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-GS_FONTS_PATH="${HV_FONTS_PATH}/ghostscript"
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}
-
-# To use the system-installed version of JasPer:
-rm -rf jasper
-
-# To use the system-installed copies of libjpeg and libpng:
-rm -rf jpeg
-rm -rf libpng
-
-# To use the system-installed copy of libtiff:
-rm -rf tiff
-
-./configure \
-    --prefix=/usr \
-    --enable-dynamic \
-    --with-system-libtiff \
-    --with-fontpath=${GS_FONTS_PATH}
-make
-make install docdir=/usr/share/doc/${PACKAGE}
-
-# To install the shared library libgs.so (needed by libspectre)
-make so
-make soinstall docdir=/usr/share/doc/${PACKAGE}
-install -v -m644 base/*.h /usr/include/ghostscript
-ln -v -s ghostscript /usr/include/ps
-
-# Unpack all the fonts to ${GS_FONTS_PATH}
-install -v -m755 -d ${GS_FONTS_PATH}
-decompress_package ${GHOSTSCRIPT_FONTS_STD}
-decompress_package ${GHOSTSCRIPT_FONTS_OTHER}
-mv ${LFS_TMP}/fonts/* ${GS_FONTS_PATH}
-rmdir ${LFS_TMP}/fonts
-chown -v -R root:root ${GS_FONTS_PATH}
-
-if ! grep "${GS_FONTS_PATH}" /etc/fonts/local.conf 1> /dev/null 2>&1; then
-    # Adding Ghostscript fonts directory to local configuration file
-    sed -i -e "s!\(</fontconfig>\)!    <dir>${GS_FONTS_PATH}</dir>\n\1!" /etc/fonts/local.conf
-fi
-
-# Updating cache database.
-fc-cache -f
-
-ldconfig
-
-exit $?
+#!/bin/bash
+
+hvconfig_pre()
+{
+    export GS_FONTS_PATH="${HV_FONTS_PATH}/ghostscript"
+
+    cd ${LFS_TMP}/${PACKAGE}
+
+    # To use the system-installed version of JasPer:
+    rm -rf jasper
+    
+    # To use the system-installed copies of libjpeg and libpng:
+    rm -rf jpeg
+    rm -rf libpng
+
+    # To use the system-installed copy of libtiff:
+    rm -rf tiff
+
+    CONFIGURE_OPTS=" \
+        ${CONFIGURE_OPTS} \
+        --enable-dynamic \
+        --with-system-libtiff \
+        --with-fontpath=${GS_FONTS_PATH}"
+}
+
+hvbuil()
+{
+    make
+    make install docdir=/usr/share/doc/${PACKAGE}
+}
+
+hvbuil_post()
+{
+    # To install the shared library libgs.so (needed by libspectre)
+    make so
+    make soinstall docdir=/usr/share/doc/${PACKAGE}
+    install -v -m644 base/*.h /usr/include/ghostscript
+    ln -v -s ghostscript /usr/include/ps
+
+    # Unpack all the fonts to ${GS_FONTS_PATH}
+    install -v -m755 -d ${GS_FONTS_PATH}
+    decompress_package ${GHOSTSCRIPT_FONTS_STD}
+    decompress_package ${GHOSTSCRIPT_FONTS_OTHER}
+    mv ${LFS_TMP}/fonts/* ${GS_FONTS_PATH}
+    rmdir ${LFS_TMP}/fonts
+    chown -v -R root:root ${GS_FONTS_PATH}
+    
+    if ! grep "${GS_FONTS_PATH}" /etc/fonts/local.conf 1> /dev/null 2>&1; then
+        # Adding Ghostscript fonts directory to local configuration file
+        sed -i -e "s!\(</fontconfig>\)!    <dir>${GS_FONTS_PATH}</dir>\n\1!" \
+            /etc/fonts/local.conf
+    fi
+
+    # Updating cache database.
+    fc-cache -f
+
+    unset GS_FONTS_PATH
+}
index d80ac37..971baa8 100644 (file)
@@ -1,31 +1,13 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}-build
-../${PACKAGE}/configure \
-    --prefix=/usr \
-    --sysconfdir=/etc \
-    --enable-gui=gtk \
-    ${CONFIGURE_OPTS}
-make
-make install
-ldconfig
-
-install -m 755 plugin/.libs/libgnashplugin.so /usr/lib/firefox/plugins
-
-exit $?
+#!/bin/bash
+
+hvconfig_pre()
+{
+    CONFIGURE_OPTS=" \
+        ${CONFIGURE_OPTS} \
+        --enable-gui=gtk"
+}
+
+hvconfig_post()
+{
+    install -m 755 plugin/.libs/libgnashplugin.so /usr/lib/firefox/plugins
+}
index b381577..a5c103e 100644 (file)
@@ -1,28 +1,11 @@
-#!/bin/sh
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE} &&
-
-cd ${LFS_TMP}/${PACKAGE}-build &&
-../${PACKAGE}/configure \
-    --prefix=${GNOME2_PREFIX} \
-    --libexecdir=${GNOME2_PREFIX}/sbin \
-    --sysconfdir=/etc/gnome/${GNOME2_VER} \
-    --localstatedir=/var/lib \
-    ${CONFIGURE_OPTS} &&
-make &&
-make install &&
-ldconfig
-
-exit $?
+#!/bin/bash
+
+hvconfig_pre()
+{
+    CONFIGURE_OPTS=" \
+        --prefix=${GNOME2_PREFIX} \
+        --libexecdir=${GNOME2_PREFIX}/sbin \
+        --sysconfdir=/etc/gnome/${GNOME2_VER} \
+        --localstatedir=/var/lib \
+        --infodir=${GNOME2_PREFIX}/share/info"
+}
index fd88e27..a8d18e8 100644 (file)
@@ -1,43 +1,35 @@
-#!/bin/sh
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# For Gnome 2 variables
-var_add_path "PATH" /etc/profile "/opt/${GNOME2_VER}/bin" &&
-var_export   "PATH" /etc/profile &&
-var_add_path "PKG_CONFIG_PATH" /etc/profile "/opt/${GNOME2_VER}/lib/pkgconfig" &&
-var_add_path "PKG_CONFIG_PATH" /etc/profile "/opt/${GNOME2_VER}/share/pkgconfig" &&
-var_export   "PKG_CONFIG_PATH" /etc/profile &&
-var_add_path "LIBGLADE_MODULE_PATH" /etc/profile "${GNOME2_PREFIX}/lib/libglade/2.0" &&
-var_export   "LIBGLADE_MODULE_PATH" /etc/profile &&
-var_add_path "XDG_CONFIG_DIRS" /etc/profile "/etc/gnome/${GNOME2_VER}/xdg" &&
-var_export   "XDG_CONFIG_DIRS" /etc/profile &&
-
-# For Gnome 1 and 2 common variable
-var_add_path "GNOME_LIBCONFIG_PATH" /etc/profile "/usr/lib" &&
-var_export   "GNOME_LIBCONFIG_PATH" /etc/profile &&
-
-string_add "/opt/${GNOME2_VER}/lib" /etc/ld.so.conf &&
-
-var_add_path "MANPATH" /etc/profile "/opt/${GNOME2_VER}/man" &&
-var_export   "MANPATH" /etc/profile &&
-
-# There is a third mechanism for customizing the search path. If a
-# `dirlist' file exists in acdir, then that file is assumed to contain a
-# list of directories, one per line, to be added to the search list. These
-# directories are searched after all other directories.
-touch /usr/share/aclocal/dirlist &&
-string_add "/opt/${GNOME2_VER}/share/aclocal" /usr/share/aclocal/dirlist &&
-
-cat > /etc/skel/.gtkrc-2.0 << "EOF" &&
+#!/bin/bash
+
+hvbuild()
+{
+    # For Gnome 2 variables
+    var_add_path "PATH" /etc/profile "/opt/${GNOME2_VER}/bin"
+    var_export   "PATH" /etc/profile
+    var_add_path "PKG_CONFIG_PATH" /etc/profile "/opt/${GNOME2_VER}/lib/pkgconfig"
+    var_add_path "PKG_CONFIG_PATH" /etc/profile "/opt/${GNOME2_VER}/share/pkgconfig"
+    var_export   "PKG_CONFIG_PATH" /etc/profile
+    var_add_path "LIBGLADE_MODULE_PATH" /etc/profile "${GNOME2_PREFIX}/lib/libglade/2.0"
+    var_export   "LIBGLADE_MODULE_PATH" /etc/profile
+    var_add_path "XDG_CONFIG_DIRS" /etc/profile "/etc/gnome/${GNOME2_VER}/xdg"
+    var_export   "XDG_CONFIG_DIRS" /etc/profile
+
+    # For Gnome 1 and 2 common variable
+    var_add_path "GNOME_LIBCONFIG_PATH" /etc/profile "/usr/lib"
+    var_export   "GNOME_LIBCONFIG_PATH" /etc/profile
+
+    string_add "/opt/${GNOME2_VER}/lib" /etc/ld.so.conf
+
+    var_add_path "MANPATH" /etc/profile "/opt/${GNOME2_VER}/man"
+    var_export   "MANPATH" /etc/profile
+
+    # There is a third mechanism for customizing the search path. If a
+    # `dirlist' file exists in acdir, then that file is assumed to contain a
+    # list of directories, one per line, to be added to the search list. These
+    # directories are searched after all other directories.
+    touch /usr/share/aclocal/dirlist
+    string_add "/opt/${GNOME2_VER}/share/aclocal" /usr/share/aclocal/dirlist
+
+    cat > /etc/skel/.gtkrc-2.0 << "EOF"
 gtk-icon-theme-name="Tango"
 EOF
-
-ldconfig
-
-# Return last error
-exit $?
+}
index 98db036..9a9d293 100644 (file)
@@ -1,24 +1,11 @@
-#!/bin/sh
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1} &&
-
-cd ${LFS_TMP}/${1} &&
-./configure \
-    --prefix=${GNOME2_PREFIX} \
-    --libexecdir=${GNOME2_PREFIX}/sbin \
-    --infodir=${GNOME2_PREFIX}/share/info \
-    --localstatedir=/var/lib \
-    --sysconfdir=/etc/gnome/${GNOME2_VER} &&
-make &&
-make install &&
-ldconfig
-
-# Return last error
-exit $?
+#!/bin/bash
+
+hvconfig_pre()
+{
+    CONFIGURE_OPTS=" \
+        --prefix=${GNOME2_PREFIX} \
+        --libexecdir=${GNOME2_PREFIX}/sbin \
+        --infodir=${GNOME2_PREFIX}/share/info \
+        --localstatedir=/var/lib \
+        --sysconfdir=/etc/gnome/${GNOME2_VER}"
+}
index 1e62131..59da3bc 100644 (file)
@@ -1,27 +1,7 @@
-#!/bin/sh
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
+#!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE} &&
-
-cd ${LFS_TMP}/${PACKAGE}-build &&
-../${PACKAGE}/configure \
-    --prefix=/usr \
-    --sysconfdir=/etc \
-    ${CONFIGURE_OPTS} &&
-make &&
-make pkgconfigdir=/usr/lib/pkgconfig install &&
-ldconfig
-
-# Return last error
-exit $?
+hvbuild()
+{
+    make
+    make pkgconfigdir=/usr/lib/pkgconfig install
+}
index b981a71..63e63d7 100644 (file)
@@ -1,21 +1,12 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-sed -i.orig -e "s/original texmf.cnf/modified texmf.cnf/" \
-    -e "s/memory hog.../&\npool_size.context = 750000/" \
-    $(kpsewhich texmf.cnf)
-cat >> $(kpsewhich texmf.cnf) << "EOF"
+hvbuild()
+{
+    cd ${LFS_TMP}/${PACKAGE}
+    sed -i.orig -e "s/original texmf.cnf/modified texmf.cnf/" \
+        -e "s/memory hog.../&\npool_size.context = 750000/" \
+        $(kpsewhich texmf.cnf)
+    cat >> $(kpsewhich texmf.cnf) << "EOF"
 
 % The following 3 sections added for JadeTeX
 
@@ -58,43 +49,40 @@ max_strings.pdfjadetex = 55000
 
 EOF
 
-LATEX_FMT_DIR="$(kpsewhich -expand-var '$TEXMFSYSVAR')/web2c"
+    LATEX_FMT_DIR="$(kpsewhich -expand-var '$TEXMFSYSVAR')/web2c"
 
-mv -v $(kpsewhich latex.fmt) $(kpsewhich latex.fmt).orig
-mv -v $LATEX_FMT_DIR/latex.log $LATEX_FMT_DIR/latex.log.orig
-fmtutil-sys --byfmt latex
+    mv -v $(kpsewhich latex.fmt) $(kpsewhich latex.fmt).orig
+    mv -v $LATEX_FMT_DIR/latex.log $LATEX_FMT_DIR/latex.log.orig
+    fmtutil-sys --byfmt latex
 
-make
+    make
 
-install -v -m755 -d \
-    $(kpsewhich -expand-var '$TEXMFLOCAL')/tex/jadetex/config
-install -v -m644 dsssl.def jadetex.ltx *.sty \
-    $(kpsewhich -expand-var '$TEXMFLOCAL')/tex/jadetex
-install -v -m644 {,pdf}jadetex.ini \
-    $(kpsewhich -expand-var '$TEXMFLOCAL')/tex/jadetex/config
-FMTUTIL_CNF="$(kpsewhich fmtutil.cnf)"
-mv $FMTUTIL_CNF $FMTUTIL_CNF.orig
-cat $FMTUTIL_CNF.orig - >> $FMTUTIL_CNF << "EOF"
+    install -v -m755 -d \
+        $(kpsewhich -expand-var '$TEXMFLOCAL')/tex/jadetex/config
+    install -v -m644 dsssl.def jadetex.ltx *.sty \
+        $(kpsewhich -expand-var '$TEXMFLOCAL')/tex/jadetex
+    install -v -m644 {,pdf}jadetex.ini \
+        $(kpsewhich -expand-var '$TEXMFLOCAL')/tex/jadetex/config
+    FMTUTIL_CNF="$(kpsewhich fmtutil.cnf)"
+    mv $FMTUTIL_CNF $FMTUTIL_CNF.orig
+    cat $FMTUTIL_CNF.orig - >> $FMTUTIL_CNF << "EOF"
 
 # JadeTeX formats:
 jadetex         etex            -               "&latex"     jadetex.ini
 pdfjadetex      pdfetex         -               "&pdflatex"  pdfjadetex.ini
 
 EOF
-mv -v $(kpsewhich -expand-var '$TEXMFMAIN')/ls-R \
-    $(kpsewhich -expand-var '$TEXMFMAIN')/ls-R.orig
-mv -v $(kpsewhich -expand-var '$TEXMFSYSVAR')/ls-R \
-    $(kpsewhich -expand-var '$TEXMFSYSVAR')/ls-R.orig
-mktexlsr
-fmtutil-sys --byfmt jadetex
-fmtutil-sys --byfmt pdfjadetex
-mktexlsr
-ln -v -sf etex /usr/bin/jadetex
-ln -v -sf pdfetex /usr/bin/pdfjadetex
-install -v -m644 -D index.html \
-    /usr/share/doc/${1}/index.html
-install -v -m644 *.1 /usr/share/man/man1
-
-ldconfig
-
-exit $?
+    mv -v $(kpsewhich -expand-var '$TEXMFMAIN')/ls-R \
+        $(kpsewhich -expand-var '$TEXMFMAIN')/ls-R.orig
+    mv -v $(kpsewhich -expand-var '$TEXMFSYSVAR')/ls-R \
+        $(kpsewhich -expand-var '$TEXMFSYSVAR')/ls-R.orig
+    mktexlsr
+    fmtutil-sys --byfmt jadetex
+    fmtutil-sys --byfmt pdfjadetex
+    mktexlsr
+    ln -v -sf etex /usr/bin/jadetex
+    ln -v -sf pdfetex /usr/bin/pdfjadetex
+    install -v -m644 -D index.html \
+        /usr/share/doc/${PACKAGE}/index.html
+    install -v -m644 *.1 /usr/share/man/man1
+}
diff --git a/stage5/pkg/java b/stage5/pkg/java
deleted file mode 100644 (file)
index a81c6df..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-install -v -d /usr/java
-cp -a ${LFS_TMP}/${1}/* /usr/java
-
-ln -svf ../java/bin/java /usr/bin/java
-
-var_add_path JAVA_HOME /etc/profile "/usr/java"
-var_export   JAVA_HOME /etc/profile
-
-exit $?
index 8e27d37..064c505 100644 (file)
@@ -1,40 +1,32 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}/src
-./configure \
-    --prefix=/usr \
-    --sysconfdir=/etc \
-    --localstatedir=/var/lib \
-    --mandir=/usr/share/man \
-    --enable-dns \
-    --enable-static
-make
-make install
-mv -v /usr/bin/ksu /bin
-mv -v /usr/lib/libkrb5.so.3* /lib
-mv -v /usr/lib/libkrb4.so.2* /lib
-mv -v /usr/lib/libdes425.so.3* /lib
-mv -v /usr/lib/libk5crypto.so.3* /lib
-mv -v /usr/lib/libcom_err.so.3* /lib
-ln -v -sf ../../lib/libkrb5.so.3 /usr/lib/libkrb5.so
-ln -v -sf ../../lib/libkrb4.so.2 /usr/lib/libkrb4.so
-ln -v -sf ../../lib/libdes425.so.3 /usr/lib/libdes425.so
-ln -v -sf ../../lib/libk5crypto.so.3 /usr/lib/libk5crypto.so
-ln -v -sf ../../lib/libcom_err.so.3 /usr/lib/libcom_err.so
-ldconfig
-
-cat > /etc/krb5.conf << EOF
+#!/bin/bash
+
+hvconfig()
+{
+    cd ${LFS_TMP}/${PACKAGE}/src
+    ./configure \
+        --prefix=/usr \
+        --sysconfdir=/etc \
+        --localstatedir=/var/lib \
+        --mandir=/usr/share/man \
+        --enable-dns \
+        --enable-static
+}
+
+hvbuild_post()
+{
+    mv -v /usr/bin/ksu /bin
+    mv -v /usr/lib/libkrb5.so.3* /lib
+    mv -v /usr/lib/libkrb4.so.2* /lib
+    mv -v /usr/lib/libdes425.so.3* /lib
+    mv -v /usr/lib/libk5crypto.so.3* /lib
+    mv -v /usr/lib/libcom_err.so.3* /lib
+    ln -v -sf ../../lib/libkrb5.so.3 /usr/lib/libkrb5.so
+    ln -v -sf ../../lib/libkrb4.so.2 /usr/lib/libkrb4.so
+    ln -v -sf ../../lib/libdes425.so.3 /usr/lib/libdes425.so
+    ln -v -sf ../../lib/libk5crypto.so.3 /usr/lib/libk5crypto.so
+    ln -v -sf ../../lib/libcom_err.so.3 /usr/lib/libcom_err.so
+
+    cat > /etc/krb5.conf << EOF
 [libdefaults]
     default_realm = <LFS.ORG>
     encrypt = true
@@ -53,5 +45,4 @@ cat > /etc/krb5.conf << EOF
     admin_server = SYSLOG[INFO[:AUTH]]
     default = SYSLOG[[:SYS]]
 EOF
-
-exit $?
+}
index 4275204..b489162 100644 (file)
@@ -1,27 +1,11 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
-    --prefix=/usr \
-    --sysconfdir=/etc
-make
-make install
-
-# Some packages check for the pkg-config file for libid3tag.
-# This file is particularly needed so that gst-plugins-ugly can
-# recognize the installed libid3tag.
-cat > /usr/lib/pkgconfig/id3tag.pc << "EOF"
+#!/bin/bash
+
+hvbuild_post()
+{
+    # Some packages check for the pkg-config file for libid3tag.
+    # This file is particularly needed so that gst-plugins-ugly can
+    # recognize the installed libid3tag.
+    cat > /usr/lib/pkgconfig/id3tag.pc << "EOF"
 prefix=/usr
 exec_prefix=${prefix}
 libdir=${exec_prefix}/lib
@@ -35,8 +19,6 @@ Libs: -L${libdir} -lid3tag -lz
 Cflags: -I${includedir}
 EOF
 
-sed -i -e "s!_LIBID3TAG_VERSION_!$(get_pkg_ver ${1})!g" /usr/lib/pkgconfig/id3tag.pc
-
-ldconfig
-
-exit $?
+    sed -i -e "s!_LIBID3TAG_VERSION_!$(get_pkg_ver ${PACKAGE})!g" \
+        /usr/lib/pkgconfig/id3tag.pc
+}
index ef83338..adf4045 100644 (file)
@@ -1,27 +1,10 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
-    --prefix=/usr \
-    --sysconfdir=/etc
-make
-make install
-
-# Some packages check for the pkg-config file for libmad.
-# This file is particularly needed so that Cdrdao can
-# recognize the installed libmad.
-cat > /usr/lib/pkgconfig/mad.pc << "EOF"
+hvbuild_post()
+{
+    # Some packages check for the pkg-config file for libmad. This file is
+    # particularly needed so that Cdrdao can recognize the installed libmad.
+    cat > /usr/lib/pkgconfig/mad.pc << "EOF"
 prefix=/usr
 exec_prefix=${prefix}
 libdir=${exec_prefix}/lib
@@ -35,8 +18,6 @@ Libs: -L${libdir} -lmad
 Cflags: -I${includedir}
 EOF
 
-sed -i -e "s!_LIBMAD_VERSION_!$(get_pkg_ver ${1})!g" /usr/lib/pkgconfig/mad.pc
-
-ldconfig
-
-exit $?
+    sed -i -e "s!_LIBMAD_VERSION_!$(get_pkg_ver ${PACKAGE})!g" \
+        /usr/lib/pkgconfig/mad.pc
+}
index 30ed74c..d976c8a 100644 (file)
@@ -1,28 +1,24 @@
-#!/bin/sh
-set -o errexit
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-LTSROOT="/opt/ltsp/i386"
-MAC_ADDRESS="01-00-40-63-c0-35-8f"
-LTSP_KERNEL="2.6.17.8-ltsp-1"
-LTSP_SERVER="192.168.0.4"
-
-if [ -d /tftpboot ]; then
-    if [ -d /srv/tftpboot ]; then
-       rm -v -rf /srv/tftpboot
-    fi
+#!/bin/bash
+
+hvbuild()
+{
+    LTSROOT="/opt/ltsp/i386"
+    MAC_ADDRESS="01-00-40-63-c0-35-8f"
+    LTSP_KERNEL="2.6.17.8-ltsp-1"
+    LTSP_SERVER="192.168.0.4"
 
-    mv -v /tftpboot /srv/tftpboot
-fi
+    if [ -d /tftpboot ]; then
+        if [ -d /srv/tftpboot ]; then
+           rm -v -rf /srv/tftpboot
+        fi
 
-cd /srv/tftpboot/lts/${LTSP_KERNEL}/pxelinux.cfg
-ln -v -s -f default ${MAC_ADDRESS}
+        mv -v /tftpboot /srv/tftpboot
+    fi
 
-cat > ${LTSROOT}/etc/lts.conf << "EOF"
+    cd /srv/tftpboot/lts/${LTSP_KERNEL}/pxelinux.cfg
+    ln -v -s -f default ${MAC_ADDRESS}
+
+    cat > ${LTSROOT}/etc/lts.conf << "EOF"
 [Default]
   # Uncomment to use custom XF86Config:
   ### XF86CONFIG_FILE = /tmp/XF86Config.1
@@ -60,21 +56,24 @@ cat > ${LTSROOT}/etc/lts.conf << "EOF"
   SOUND_DAEMON = esd
 EOF
 
-sed -i -e "s!_LTSP_SERVER_!${LTSP_SERVER}!g" ${LTSROOT}/etc/lts.conf
-
-# LTSP-4.2 update 4: The "-public" option is absolutely necessary...
-sed -i -e "s!\( */bin/esd -nobeeps -tcp -port 16001\)\( -as 1 &\)!\1 -public\2!g" \
-    ${LTSROOT}/etc/rc.sound
+    sed -i -e "s!_LTSP_SERVER_!${LTSP_SERVER}!g" ${LTSROOT}/etc/lts.conf
 
-string_add "${LTSROOT}   192.168.0.0/24(rw,sync,no_root_squash)" /etc/exports
+    # LTSP-4.2 update 4: The "-public" option is absolutely necessary...
+    sed -i -e \
+        "s!\( */bin/esd -nobeeps -tcp -port 16001\)\( -as 1 &\)!\1 -public\2!g"\
+        ${LTSROOT}/etc/rc.sound
 
-string_add "option root-path  \"${LTSP_SERVER}:${LTSROOT}\";" /etc/dhcpd.conf
+    string_add "${LTSROOT}   192.168.0.0/24(rw,sync,no_root_squash)" \
+        /etc/exports
 
-# no spaces but tabs to separate items.
-sed -i -e "s!^#\*\(.*#any host.*\)!\*\1!g" /etc/X11/xdm/Xaccess
+    string_add "option root-path  \"${LTSP_SERVER}:${LTSROOT}\";" \
+        /etc/dhcpd.conf
 
-# By default this line is set, so that it is not listening to XDMCP connection.
-# This is for security reasons.
-sed -i -e "s%\(^DisplayManager\.requestPort:.*\)%!\1%g" /etc/X11/xdm/xdm-config
+    # no spaces but tabs to separate items.
+    sed -i -e "s!^#\*\(.*#any host.*\)!\*\1!g" /etc/X11/xdm/Xaccess
 
-exit $?
+    # By default this line is set, so that it is not listening to XDMCP
+    # connection. This is for security reasons.
+    sed -i -e "s%\(^DisplayManager\.requestPort:.*\)%!\1%g" \
+        /etc/X11/xdm/xdm-config
+}
index b5e6381..da7159c 100644 (file)
@@ -1,17 +1,7 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/ltsp-utils
-./install.sh
-
-exit $?
+hvbuild()
+{
+    cd ${LFS_TMP}/${PACKAGE}
+    ./install.sh
+}
index 4bc471a..3e679ce 100644 (file)
@@ -1,26 +1,16 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-./configure \
-    --prefix=/usr \
-    --sysconfdir=/etc \
-    --localstatedir=/var/run
-make
-make install
+hvconfig_pre()
+{
+    CONFIGURE_OPTS=" \
+        ${CONFIGURE_OPTS} \
+        --localstatedir=/var/run"
+}
 
-# Configuration file
-cat > /etc/mail/greylist.conf << EOF
+hvbuild_post()
+{
+    # Configuration file
+    cat > /etc/mail/greylist.conf << EOF
 # greylist.conf
 
 pidfile "/var/run/milter-greylist/milter-greylist.pid"
@@ -123,12 +113,9 @@ acl whitelist list "white users"
 acl whitelist default
 EOF
 
-# Bootscript
-install -v -m740 ${SCRDIR}/bootscripts/milter-greylist /etc/rc.d/init.d
+    # Bootscript
+    install -v -m740 ${SCRDIR}/bootscripts/milter-greylist /etc/rc.d/init.d
 
-# script-name start stop
-bootscript_add_rc3 milter-greylist 57 33
-
-ldconfig
-
-exit $?
+    # script-name start stop
+    bootscript_add_rc3 milter-greylist 57 33
+}
index 4ff7ac3..e5de87f 100644 (file)
@@ -1,25 +1,17 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
-# First argument of this script is the package name.
+hvbuil()
+{
+    cd ${LFS_TMP}/${PACKAGE}
+    make
+    make PREFIX=/usr install
+}
 
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
+hvbuil_post()
+{
+    # Bootscript
+    install -v -m740 ${SCRDIR}/bootscripts/milter-spf /etc/rc.d/init.d
 
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-make
-make PREFIX=/usr install
-
-# Bootscript
-install -v -m740 ${SCRDIR}/bootscripts/milter-spf /etc/rc.d/init.d
-
-# script-name start stop
-bootscript_add_rc3 milter-spf 56 34
-
-exit $?
+    # script-name start stop
+    bootscript_add_rc3 milter-spf 56 34
+}
index 41f8a9c..e81e231 100644 (file)
@@ -1,63 +1,50 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-# Define to 1 to test this package.
-RUN_TESTS=0
-
-cd ${LFS_TMP}/${1}
-export WORKINGDIR=${PWD}
-
-# Non-debug optimized build
-export BUILD_OPT=1
-
-cd mozilla/security/nss
-make nss_build_all
-
-cd ../..
-
-export NSS_LINUXDIR=$(basename `ls -d $WORKINGDIR/mozilla/dist/Linux*`)
-
-if [ ${RUN_TESTS} -eq 1 ]; then
-    # Running tests
-    export DOMSUF="${DOMAIN}"
-    export PATH=$PATH:$WORKINGDIR/mozilla/dist/$NSS_LINUXDIR/bin
-    export TEST_RESULTSDIR=$WORKINGDIR/mozilla/tests_results/security
-    cd security/nss/tests
-    sed -i 's/gmake/make/' common/init.sh
-    ./all.sh
-    TEST_RESULTS=$(grep Passed $TEST_RESULTSDIR/$(hostname --short).1/results.html | wc -l)
-    if [ ${TEST_RESULTS} -ne 770 ]; then
-       echo "Number of tests that passed: ${TEST_RESULTS}"
-       echo "Number of tests expected to pass: 770"
-       exit 1
+#!/bin/bash
+
+hvbuild()
+{
+    # Define to 1 to test this package.
+    local RUN_TESTS=0
+
+    export WORKINGDIR=${LFS_TMP}/${PACKAGE}
+
+    # Non-debug optimized build
+    export BUILD_OPT=1
+
+    cd ${LFS_TMP}/${PACKAGE}/mozilla/security/nss
+    make nss_build_all
+
+    cd ${LFS_TMP}/${PACKAGE}/mozilla
+
+    export NSS_LINUXDIR=$(basename `ls -d $WORKINGDIR/mozilla/dist/Linux*`)
+
+    if [ ${RUN_TESTS} -eq 1 ]; then
+        # Running tests
+        export DOMSUF="${DOMAIN}"
+        export PATH=$PATH:$WORKINGDIR/mozilla/dist/$NSS_LINUXDIR/bin
+        export TEST_RESULTSDIR=$WORKINGDIR/mozilla/tests_results/security
+        cd security/nss/tests
+        sed -i 's/gmake/make/' common/init.sh
+        ./all.sh
+        TEST_RESULTS=$(grep Passed $TEST_RESULTSDIR/$(hostname --short).1/results.html | wc -l)
+        if [ ${TEST_RESULTS} -ne 770 ]; then
+           echo "Number of tests that passed: ${TEST_RESULTS}"
+           echo "Number of tests expected to pass: 770"
+           exit 1
+        fi
     fi
-fi
 
-cd ${LFS_TMP}/${1}/mozilla
-install -v -m755 nsprpub/$NSS_LINUXDIR/config/nspr-config /usr/bin
+    cd ${LFS_TMP}/${PACKAGE}/mozilla
+    install -v -m755 nsprpub/$NSS_LINUXDIR/config/nspr-config /usr/bin
 #install -v -m755 -d /usr/lib/pkgconfig
 #install -v -m644 nsprpub/lib/pkgconfig/nspr.pc \
 #    security/nss/lib/pkgconfig/nss.pc \
 #   /usr/lib/pkgconfig
 
-cd dist
-install -v -m755 $NSS_LINUXDIR/lib/*.so /usr/lib
-install -v -m644 $NSS_LINUXDIR/lib/{*.chk,libcrmf.a} /usr/lib
-install -v -m755 -d /usr/include/{nss,nspr}
-install -v -m644 {public,private}/nss/* /usr/include/nss
-cp -v -RL $NSS_LINUXDIR/include/* /usr/include/nspr
-chmod -v 644 /usr/include/nspr/prvrsion.h
-
-ldconfig
-
-exit $?
+    cd dist
+    install -v -m755 $NSS_LINUXDIR/lib/*.so /usr/lib
+    install -v -m644 $NSS_LINUXDIR/lib/{*.chk,libcrmf.a} /usr/lib
+    install -v -m755 -d /usr/include/{nss,nspr}
+    install -v -m644 {public,private}/nss/* /usr/include/nss
+    cp -v -RL $NSS_LINUXDIR/include/* /usr/include/nspr
+    chmod -v 644 /usr/include/nspr/prvrsion.h
+}
index eebb006..45a4e04 100644 (file)
@@ -1,51 +1,45 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
-    --prefix=/usr \
-    --libexecdir=/usr/sbin \
-    --sysconfdir=/etc \
-    --localstatedir=/srv/ldap \
-    --disable-debug \
-    --enable-dynamic \
-    --enable-crypt \
-    --enable-modules \
-    --enable-rlookups \
-    --enable-backends \
-    --enable-overlays
-make depend
-make
-make install
-
-for LINK in lber ldap ldap_r; do
-    chmod -v 0755 /usr/lib/$(readlink /usr/lib/lib${LINK}.so)
-done
-
-cd ${LFS_TMP}/${1}
-install -v -m755 -d /usr/share/doc/${1}/{drafts,guide,rfc}
-install -v -m644 doc/drafts/* /usr/share/doc/${1}/drafts
-install -v -m644 doc/rfc/*    /usr/share/doc/${1}/rfc
-cp -v -R doc/guide/*          /usr/share/doc/${1}/guide
-
-# Only the slapd daemon is needed.
-# The slurpd daemon is used for coordinating multiple LDAP servers so they
-# cooperate in a hierarchy, much like DNS servers.
-
-# Bootscript
-install -v -m740 ${SCRDIR}/bootscripts/openldap /etc/rc.d/init.d
-
-# script-name start stop
-bootscript_add_rc3 openldap 60 30
-
-exit $?
+#!/bin/bash
+
+hvconfig_pre()
+{
+    CONFIGURE_OPTS=" \
+        ${CONFIGURE_OPTS} \
+        --libexecdir=/usr/sbin \
+        --sysconfdir=/etc \
+        --localstatedir=/srv/ldap \
+        --disable-debug \
+        --enable-dynamic \
+        --enable-crypt \
+        --enable-modules \
+        --enable-rlookups \
+        --enable-backends \
+        --enable-overlays"
+}
+
+hvconfig_post()
+{
+    make depend
+}
+
+hvbuild_post()
+{
+    for LINK in lber ldap ldap_r; do
+        chmod -v 0755 /usr/lib/$(readlink /usr/lib/lib${LINK}.so)
+    done
+
+    cd ${LFS_TMP}/${PACKAGE}
+    install -v -m755 -d /usr/share/doc/${PACKAGE}/{drafts,guide,rfc}
+    install -v -m644 doc/drafts/* /usr/share/doc/${PACKAGE}/drafts
+    install -v -m644 doc/rfc/*    /usr/share/doc/${PACKAGE}/rfc
+    cp -v -R doc/guide/*          /usr/share/doc/${PACKAGE}/guide
+
+    # Only the slapd daemon is needed.
+    # The slurpd daemon is used for coordinating multiple LDAP servers so they
+    # cooperate in a hierarchy, much like DNS servers.
+
+    # Bootscript
+    install -v -m740 ${SCRDIR}/bootscripts/openldap /etc/rc.d/init.d
+
+    # script-name start stop
+    bootscript_add_rc3 openldap 60 30
+}
index 2ff7172..ad91548 100644 (file)
@@ -1,67 +1,61 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-sed -i 's/const char \*errpfx,/const DB_ENV *dbenv, & const/' ext/dba/dba_db4.c
-
-# Since PHP 5, you need to explicitly bundle PHP with MySQL by --with-mysql directive
-# (make sure you specified path to where MySQL is installed on your system).
-
-# Build directory doesn't work:
-# gcc: Zend/zend_language_scanner.c: No such file or directory
-./configure \
-    --prefix=/usr \
-    --sysconfdir=/etc \
-    --with-apxs2=/usr/sbin/apxs \
-    --enable-force-cgi-redirect \
-    --enable-discard-path \
-    --with-config-file-path=/etc \
-    --with-zlib \
-    --enable-bcmath \
-    --with-bz2 \
-    --with-gd \
-    --with-freetype-dir=/usr \
-    --with-t1lib \
-    --enable-gd-native-ttf \
-    --enable-calendar \
-    --enable-dba \
-    --enable-exif \
-    --enable-ftp \
-    --with-gettext \
-    --enable-mbstring \
-    --with-ncurses \
-    --with-readline \
-    --with-openssl=/usr \
-    --with-ldap \
-    --with-mysql=/usr \
-    --with-imap=/usr/lib/uw-imap \
-    --with-imap-ssl=/usr/include/openssl
-make
-make install
-
-if [ -f /etc/php.ini ]; then
-    cp /etc/php.ini /etc/php.ini.old
-fi
-cp ../${1}/php.ini-dist /etc/php.ini
-
-# To enable PHP support in the Apache web server, a new AddType directive
-# must be added to the httpd.conf file.
-if ! grep "application/x-httpd-php" /etc/apache/httpd.conf 1> /dev/null 2>&1; then
-    echo "AddType application/x-httpd-php .php" >> /etc/apache/httpd.conf
-fi
-
-if ! grep "DirectoryIndex" /etc/apache/httpd.conf | grep "index.php" 1> /dev/null 2>&1; then
-    sed -i -e "s!\(^DirectoryIndex index.html.*\)!\1 index.php!g" /etc/apache/httpd.conf
-fi
-
-exit $?
+#!/bin/bash
+
+hvconfig_pre()
+{
+    sed -i 's/const char \*errpfx,/const DB_ENV *dbenv, & const/' \
+       ${LFS_TMP}/${PACKAGE}/ext/dba/dba_db4.c
+
+    # Since PHP 5, you need to explicitly bundle PHP with MySQL by --with-mysql
+    # directive (make sure you specified path to where MySQL is installed on
+    # your system).
+
+    # Build directory doesn't work:
+    # gcc: Zend/zend_language_scanner.c: No such file or directory
+    CONFIGURE_OPTS=" \
+        ${CONFIGURE_OPTS} \
+        --with-apxs2=/usr/sbin/apxs \
+        --enable-force-cgi-redirect \
+        --enable-discard-path \
+        --with-config-file-path=/etc \
+        --with-zlib \
+        --enable-bcmath \
+        --with-bz2 \
+        --with-gd \
+        --with-freetype-dir=/usr \
+        --with-t1lib \
+        --enable-gd-native-ttf \
+        --enable-calendar \
+        --enable-dba \
+        --enable-exif \
+        --enable-ftp \
+        --with-gettext \
+        --enable-mbstring \
+        --with-ncurses \
+        --with-readline \
+        --with-openssl=/usr \
+        --with-ldap \
+        --with-mysql=/usr \
+        --with-imap=/usr/lib/uw-imap \
+        --with-imap-ssl=/usr/include/openssl"
+}
+
+hvbuild_post()
+{
+    if [ -f /etc/php.ini ]; then
+        cp /etc/php.ini /etc/php.ini.old
+    fi
+    cp ${LFS_TMP}/${PACKAGE}/php.ini-dist /etc/php.ini
+
+    # To enable PHP support in the Apache web server, a new AddType directive
+    # must be added to the httpd.conf file.
+    if ! grep "application/x-httpd-php" /etc/apache/httpd.conf \
+        1> /dev/null 2>&1; then
+        echo "AddType application/x-httpd-php .php" >> /etc/apache/httpd.conf
+    fi
+
+    if ! grep "DirectoryIndex" /etc/apache/httpd.conf | grep "index.php" \
+        1> /dev/null 2>&1; then
+        sed -i -e "s!\(^DirectoryIndex index.html.*\)!\1 index.php!g" \
+            /etc/apache/httpd.conf
+    fi
+}
diff --git a/stage5/pkg/pm b/stage5/pkg/pm
deleted file mode 100644 (file)
index ace1555..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}
-# The option "-n" is used to avoid having to answer a question and accept the
-# default configuration.
-perl Makefile.PL -n ${CONFIGURE_OPTS}
-make
-make install
-ldconfig
-
-exit $?
index 7e72d39..15a8075 100644 (file)
@@ -1,24 +1,18 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
-# First argument of this script is the package name
+hvbuild()
+{
+    cd ${LFS_TMP}/${PACKAGE}
+    make \
+        BASENAME=/usr \
+        LOCKINGTEST=/tmp \
+        install
+    make install-suid
+}
 
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-make \
-    BASENAME=/usr \
-    LOCKINGTEST=/tmp \
-    install
-make install-suid
-
-cat > /etc/procmailrc << "EOF"
+hvbuild_post()
+{
+    cat > /etc/procmailrc << "EOF"
 # /etc/procmailrc
 #
 SHELL=/bin/sh
@@ -80,8 +74,7 @@ spam
 ${DEFAULT}
 EOF
 
-DOMAIN1=$(echo ${DOMAIN} | sed "s!\(.*\)\.\(.*\)!\1!")
-DOMAIN2=$(echo ${DOMAIN} | sed "s!\(.*\)\.\(.*\)!\2!")
-sed -i -e "s!_DOMAIN_!${DOMAIN1}\\\.${DOMAIN2}!g" /etc/procmailrc
-
-exit $?
+    DOMAIN1=$(echo ${DOMAIN} | sed "s!\(.*\)\.\(.*\)!\1!")
+    DOMAIN2=$(echo ${DOMAIN} | sed "s!\(.*\)\.\(.*\)!\2!")
+    sed -i -e "s!_DOMAIN_!${DOMAIN1}\\\.${DOMAIN2}!g" /etc/procmailrc
+}
index 2dd8a07..25be81c 100644 (file)
@@ -1,39 +1,31 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-groupadd -f pulse
-groupadd -f pulse-access
-hv_useradd -g pulse -d /var/run/pulse pulse
-
-gpasswd -a hugo pulse-access
-
-# Il faut ajouter l'usager pulse au groupe audio.
-gpasswd -a pulse audio
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
-    --prefix=/usr \
-    --sysconfdir=/etc \
-    --localstatedir=/var
-# Workaround pour Ã©liminer les messages de warning
-# reliés Ã  SHM...
-sed -i -e "s!\(#define HAVE_SHM_OPEN 1\)!/* \1 */!g" config.h
-
-make
-make install
-ldconfig
-
-cat > /etc/pulse/daemon.conf << "EOF"
+#!/bin/bash
+
+hvconfig_pre()
+{
+    groupadd -f pulse
+    groupadd -f pulse-access
+    hv_useradd -g pulse -d /var/run/pulse pulse
+
+    gpasswd -a ${REGUSER} pulse-access
+
+    # Il faut ajouter l'usager pulse au groupe audio.
+    gpasswd -a pulse audio
+
+    CONFIGURE_OPTS=" \
+        ${CONFIGURE_OPTS} \
+        --localstatedir=/var"
+}
+
+hvconfig_post()
+{
+    # Workaround pour Ã©liminer les messages de warning
+    # reliés Ã  SHM...
+    sed -i -e "s!\(#define HAVE_SHM_OPEN 1\)!/* \1 */!g" config.h
+}
+
+hvbuild_post()
+{
+    cat > /etc/pulse/daemon.conf << "EOF"
 ## Extra verbositiy
 verbose = debug
 
@@ -78,7 +70,7 @@ system-instance = 1
 disable-shm = 1
 EOF
 
-cat > /etc/pulse/default.pa << "EOF"
+    cat > /etc/pulse/default.pa << "EOF"
 #!/usr/bin/pulseaudio -nF 
 
 #            ----------------
@@ -109,9 +101,8 @@ load-module module-volume-restore
 load-module module-rescue-streams
 EOF
 
-install -v -m740 ${SCRDIR}/bootscripts/pulseaudio /etc/rc.d/init.d
-
-# script-name start stop
-bootscript_add_rc3 pulseaudio 95 16
+    install -v -m740 ${SCRDIR}/bootscripts/pulseaudio /etc/rc.d/init.d
 
-exit $?
+    # script-name start stop
+    bootscript_add_rc3 pulseaudio 95 16
+}
index 24ab9e9..a37bce8 100644 (file)
@@ -1,58 +1,48 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-install -d /var/cache/samba
-
-cd ${LFS_TMP}/${1}/source
-./configure \
-    --prefix=/usr \
-    --sysconfdir=/etc \
-    --localstatedir=/var \
-    --with-piddir=/var/run \
-    --with-fhs \
-    --with-smbmount
-make
-make install
-mv /usr/lib/samba/libsmbclient.so /usr/lib
-ln -sf ../libsmbclient.so /usr/lib/samba
-
-mkdir -p /var/log/samba
-
-# libsmbclient.a doesn't seem to be installed...
-#chmod 644 /usr/include/libsmbclient.h /usr/lib/samba/libsmbclient.a
-chmod 644 /usr/include/libsmbclient.h
-
-install -m755 nsswitch/libnss_win{s,bind}.so /lib
-ln -sf libnss_winbind.so /lib/libnss_winbind.so.2
-ln -sf libnss_wins.so /lib/libnss_wins.so.2
-cp ../examples/smb.conf.default /etc/samba
-install -m644 ../docs/*.pdf /usr/share/samba
-
-if [ -f nsswitch/pam_winbind.so ]; then 
-    install -m755 nsswitch/pam_winbind.so /lib/security
-fi
-
-ldconfig
-
-# Configuring SWAT
-string_add "swat            901/tcp" /etc/services
-string_add "swat_tunnel     902/tcp" /etc/services
-string_add "swat stream tcp nowait.400 root /usr/sbin/swat swat" /etc/inetd.conf
-
-# Bootscript
-install -v -m740 ${SCRDIR}/bootscripts/samba /etc/rc.d/init.d
-
-# script-name start stop
-bootscript_add_rc3 samba 85 10
-
-exit $?
+#!/bin/bash
+
+hvconfig_pre()
+{
+    install -d /var/cache/samba
+
+    cd ${LFS_TMP}/${PACKAGE}/source
+    ./configure \
+        ${CONFIGURE_OPTS} \
+        --localstatedir=/var \
+        --with-piddir=/var/run \
+        --with-fhs \
+        --with-smbmount
+}
+
+hvbuild_post()
+{
+    mv /usr/lib/samba/libsmbclient.so /usr/lib
+    ln -sf ../libsmbclient.so /usr/lib/samba
+
+    mkdir -p /var/log/samba
+
+    # libsmbclient.a doesn't seem to be installed...
+    #chmod 644 /usr/include/libsmbclient.h /usr/lib/samba/libsmbclient.a
+    chmod 644 /usr/include/libsmbclient.h
+
+    install -m755 nsswitch/libnss_win{s,bind}.so /lib
+    ln -sf libnss_winbind.so /lib/libnss_winbind.so.2
+    ln -sf libnss_wins.so /lib/libnss_wins.so.2
+    cp ../examples/smb.conf.default /etc/samba
+    install -m644 ../docs/*.pdf /usr/share/samba
+
+    if [ -f nsswitch/pam_winbind.so ]; then 
+        install -m755 nsswitch/pam_winbind.so /lib/security
+    fi
+
+    # Configuring SWAT
+    string_add "swat            901/tcp" /etc/services
+    string_add "swat_tunnel     902/tcp" /etc/services
+    string_add "swat stream tcp nowait.400 root /usr/sbin/swat swat" \
+        /etc/inetd.conf
+
+    # Bootscript
+    install -v -m740 ${SCRDIR}/bootscripts/samba /etc/rc.d/init.d
+
+    # script-name start stop
+    bootscript_add_rc3 samba 85 10
+}
index 09bc97c..b12df7c 100644 (file)
@@ -1,63 +1,54 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
-# First argument of this script is the package name
+hvconfig_pre()
+{
+    local USE_X_OPTION
 
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
+    if [ x${INST_TYPE} = "xworkstation" ]; then
+        USE_X_OPTION="yes"
+    else
+        USE_X_OPTION="no"
+    fi
 
-# Applying patches (if any)
-apply_patches ${1}
+    hv_groupadd saned
+    hv_useradd -c saned -d /dev/null -g saned -s /bin/false saned
 
-if [ x${INST_TYPE} = "xworkstation" ]; then
-    USE_X_OPTION="yes"
-else
-    USE_X_OPTION="no"
-fi
+    # Fixes an obsolete udev parameter:
+    sed -i 's/SYSFS/ATTRS/g' ${LFS_TMP}/${PACKAGE}/tools/sane-desc.c
 
-hv_groupadd saned
-hv_useradd -c saned -d /dev/null -g saned -s /bin/false saned
+    CONFIGURE_OPTS=" \
+        ${CONFIGURE_OPTS} \
+        --with-x=${USE_X_OPTION}"
+}
 
-# Problem with build directory
-cd ${LFS_TMP}/${1}
+hvbuild_post()
+{
+    install -m 644 -v tools/udev/libsane.rules \
+        /etc/udev/rules.d/65-scanner.rules
 
-# Fixes an obsolete udev parameter:
-sed -i 's/SYSFS/ATTRS/g' tools/sane-desc.c
+    # Addition to /etc/services (for both the client and server)
+    string_add "sane      6566/tcp   saned # SANE Network Scanner Daemon" \
+        /etc/services
 
-./configure \
-    --prefix=/usr \
-    --sysconfdir=/etc \
-    --with-x=${USE_X_OPTION}
-make
-make install
-install -m 644 -v tools/udev/libsane.rules /etc/udev/rules.d/65-scanner.rules
+    # Creating '/etc/sane.d/dll.conf' and adding entry 'net'
+    echo "net" > /etc/sane.d/dll.conf
 
-# Addition to /etc/services (for both the client and server)
-string_add "sane      6566/tcp   saned # SANE Network Scanner Daemon" \
-    /etc/services
-
-# Creating '/etc/sane.d/dll.conf' and adding entry 'net'
-echo "net" > /etc/sane.d/dll.conf
-
-if [ -z "${SANE_SERVER}" ]; then
-    # If 'SANE_SERVER' is not defined, then we automatically configure for
-    # the SANE Network Daemon.
+    if [ -z "${SANE_SERVER}" ]; then
+        # If 'SANE_SERVER' is not defined, then we automatically configure for
+        # the SANE Network Daemon.
     
-    # Adding entry to '/etc/sane.d/dll.conf'
-    #######echo "${SANE_DRIVER}" >> /etc/sane.d/dll.conf
+        # Adding entry to '/etc/sane.d/dll.conf'
+        #######echo "${SANE_DRIVER}" >> /etc/sane.d/dll.conf
 
-    # Creating '/etc/sane.d/saned.conf'
-    echo "${LAN_NETWORK_MASK}" > /etc/sane.d/saned.conf
+        # Creating '/etc/sane.d/saned.conf'
+        echo "${LAN_NETWORK_MASK}" > /etc/sane.d/saned.conf
     
-    # Addition to /etc/inetd.conf
-    string_add "sane  stream tcp nowait saned /usr/sbin/tcpd saned" \
-       /etc/inetd.conf
-else
-    # If 'SANE_SERVER' is defined, then we must specify the address of the
-    # remote SANE server to use.
-    echo "${SANE_SERVER}" > /etc/sane.d/net.conf
-fi
-
-exit $?
+        # Addition to /etc/inetd.conf
+        string_add "sane  stream tcp nowait saned /usr/sbin/tcpd saned" \
+           /etc/inetd.conf
+    else
+        # If 'SANE_SERVER' is defined, then we must specify the address of the
+        # remote SANE server to use.
+        echo "${SANE_SERVER}" > /etc/sane.d/net.conf
+    fi
+}
index abda5e6..8478861 100644 (file)
@@ -1,50 +1,35 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-
-# Fixes an issue when compiling Cyrus SASL with GCC-4:
-sed -i '/sasl_global/s/^static //' lib/client.c
-
-# Puts the saslauthd man page in a more standard location:
-sed -i 's/cat8/man8/' saslauthd/Makefile.in
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
-    --prefix=/usr \
-    --sysconfdir=/etc \
-    --with-dbpath=/var/lib/sasl/sasldb2 \
-    --with-saslauthd=/var/run
-make
-make install
-
-cd ${LFS_TMP}/${1}
-install -v -m755 -d /usr/share/doc/${1}
-install -v -m644 doc/{*.{html,txt,fig},ONEWS,TODO} \
-    saslauthd/LDAP_SASLAUTHD /usr/share/doc/${1}
-install -v -m700 -d /var/lib/sasl
-
-# Creating SASL configuration file for Sendmail:
-cat > /usr/lib/sasl2/Sendmail.conf << "EOF"
+#!/bin/bash
+
+hvconfig_pre()
+{
+    # Fixes an issue when compiling Cyrus SASL with GCC-4:
+    sed -i '/sasl_global/s/^static //' ${LFS_TMP}/${PACKAGE}/lib/client.c
+
+    # Puts the saslauthd man page in a more standard location:
+    sed -i 's/cat8/man8/' ${LFS_TMP}/${PACKAGE}/saslauthd/Makefile.in
+
+    CONFIGURE_OPTS=" \
+        ${CONFIGURE_OPTS} \
+        --with-dbpath=/var/lib/sasl/sasldb2 \
+        --with-saslauthd=/var/run"
+}
+
+hvbuild_post()
+{
+    cd ${LFS_TMP}/${PACKAGE}
+    install -v -m755 -d /usr/share/doc/${PACKAGE}
+    install -v -m644 doc/{*.{html,txt,fig},ONEWS,TODO} \
+        saslauthd/LDAP_SASLAUTHD /usr/share/doc/${PACKAGE}
+    install -v -m700 -d /var/lib/sasl
+
+    # Creating SASL configuration file for Sendmail:
+    cat > /usr/lib/sasl2/Sendmail.conf << "EOF"
 pwcheck_method:saslauthd
 EOF
 
-ldconfig
-
-# Bootscript
-install -v -m740 ${SCRDIR}/bootscripts/saslauthd /etc/rc.d/init.d
-
-# script-name start stop
-bootscript_add_rc3 saslauthd 50 40
+    # Bootscript
+    install -v -m740 ${SCRDIR}/bootscripts/saslauthd /etc/rc.d/init.d
 
-exit $?
+    # script-name start stop
+    bootscript_add_rc3 saslauthd 50 40
+}
index 3009964..808be79 100644 (file)
@@ -1,25 +1,16 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-groupadd -f smmsp
-groupadd -f mail
-hv_useradd -g smmsp -G mail smmsp
-chmod 1777 /var/mail
-mkdir -p /var/spool/mqueue
-mkdir -p /etc/mail
-
-cd ${LFS_TMP}/${1}
-cat > devtools/Site/site.config.m4 << "EOF"
+#!/bin/bash
+
+hvbuild()
+{
+    groupadd -f smmsp
+    groupadd -f mail
+    hv_useradd -g smmsp -G mail smmsp
+    chmod 1777 /var/mail
+    mkdir -p /var/spool/mqueue
+    mkdir -p /etc/mail
+
+    cd ${LFS_TMP}/${PACKAGE}
+    cat > devtools/Site/site.config.m4 << "EOF"
 define(`confMANGRP',`root')
 define(`confMANOWN',`root')
 define(`confSBINGRP',`root')
@@ -27,38 +18,38 @@ define(`confUBINGRP',`root')
 define(`confUBINOWN',`root')
 EOF
 
-if [ "x${INST_TYPE}" = "xserver" -o "x${INST_TYPE}" = "xltsp-server" ]; then
-    # Adding support for SASL2 and MILTER
-    cat >> devtools/Site/site.config.m4 << "EOF"
+    if [ "x${INST_TYPE}" = "xserver" -o "x${INST_TYPE}" = "xltsp-server" ]; then
+        # Adding support for SASL2 and MILTER
+        cat >> devtools/Site/site.config.m4 << "EOF"
 APPENDDEF(`conf_sendmail_ENVDEF', `-DSASL=2')
 APPENDDEF(`conf_sendmail_LIBS', `-lsasl2')
 APPENDDEF(`conf_sendmail_ENVDEF', `-DMILTER')
 EOF
-    
-    # Configuration file for SASL2
-    echo "pwcheck_method: saslauthd" /usr/lib/sasl2/Sendmail.conf
-fi
 
-cd sendmail
-sh Build
-cd ../
+        # Configuration file for SASL2
+        echo "pwcheck_method: saslauthd" /usr/lib/sasl2/Sendmail.conf
+    fi
 
-if [ "x${INST_TYPE}" = "xserver" -o "x${INST_TYPE}" = "xltsp-server" ]; then
-    cd libmilter
-    sh Build install
+    cd sendmail
+    sh Build
     cd ../
-fi
 
-cd cf/cf
-cp generic-linux.mc sendmail.mc
-sh Build sendmail.mc
-sh Build install-cf
-cd ../../
-sh Build install
+    if [ "x${INST_TYPE}" = "xserver" -o "x${INST_TYPE}" = "xltsp-server" ]; then
+        cd libmilter
+        sh Build install
+        cd ../
+    fi
+
+    cd cf/cf
+    cp generic-linux.mc sendmail.mc
+    sh Build sendmail.mc
+    sh Build install-cf
+    cd ../../
+    sh Build install
 
-if [ "x${INST_TYPE}" = "xserver" -o "x${INST_TYPE}" = "xltsp-server" ]; then
-    # Configuration Information
-    cat > /etc/mail/sendmail.mc << "EOF"
+    if [ "x${INST_TYPE}" = "xserver" -o "x${INST_TYPE}" = "xltsp-server" ]; then
+        # Configuration Information
+        cat > /etc/mail/sendmail.mc << "EOF"
 dnl
 include(`./m4/cf.m4')
 VERSIONID(`sendmail.mc    Hugo Villeneuve   2003/10/06')
@@ -80,102 +71,103 @@ dnl   "noreceipts": To disable sending DSN receipts.
 dnl   "goaway": Disable all SMTP status queries.
 dnl   "authwarnings": Adds x-authentication-warning.
 dnl   "restrictmailq": mqueue group can see queue.
-dnl   "restrictqrun": mqueue owner to run queue.
-dnl   "nobodyreturn": Does not return mail body
-define(`confPRIVACY_FLAGS', `goaway authwarnings restrictmailq restrictqrun nobodyreturn novrfy noexpn noreceipts')
+        dnl   "restrictqrun": mqueue owner to run queue.
+        dnl   "nobodyreturn": Does not return mail body
+        define(`confPRIVACY_FLAGS', `goaway authwarnings restrictmailq restrictqrun nobodyreturn novrfy noexpn noreceipts')
 dnl
 dnl ---------- Maximum message size (in bytes) ----------
-define(`confMAX_MESSAGE_SIZE',10000000)
-dnl
-define(`confMAX_DAEMON_CHILDREN',`30')
-define(`confCONNECTION_RATE_THROTTLE',`10')
-define(`confMAX_RCPTS_PER_MESSAGE',`50')
-dnl
-dnl ---------- MILTER support ----------
-define(`confINPUT_MAIL_FILTERS',`clmilter')
-dnl
-dnl ---------- SMTP Authorization options ----------
-define(`confAUTH_OPTIONS', `A')
-define(`confAUTH_MECHANISMS', `LOGIN PLAIN')
-TRUST_AUTH_MECH(`LOGIN PLAIN')
-dnl
-dnl ---------- Don't send the version number of sendmail ----------
-define(`confSMTP_LOGIN_MSG',`_HOSTNAME_')
-MASQUERADE_AS(_DOMAIN_)
-dnl Uncomment the following line to use a non-standard port
-dnl DAEMON_OPTIONS(`Port=_ALTERNATE_PORT_NUMBER_,Name=MTA')
-dnl
-dnl This is necessary for the local Sendmail to work, when using
-dnl an alternate port number:
-DAEMON_OPTIONS('Port=25','Name=MTA')
-dnl
-FEATURE(nouucp, nospecial)
-FEATURE(use_cw_file)
-FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')
-FEATURE(virtusertable, `hash -o /etc/mail/virtusertable')
-FEATURE(`local_procmail')
-FEATURE(`mailertable')
-MAILER(procmail)
-INPUT_MAIL_FILTER(`clmilter',`S=local:/var/clamav/clmilter.sock, F=, T=S:4m;R:4m')dnl
-dnl INPUT_MAIL_FILTER(`smf-spf', `S=local:/var/run/smfs/smf-spf.sock, T=S:30s;R:1m')
-dnl INPUT_MAIL_FILTER(`greylist',`S=local:/var/run/milter-greylist/milter-greylist.sock')
-MAILER(smtp)
-EOF
-
-    sed -i -e "s!_HOSTNAME_!${MACHINE_NAME}\.${DOMAIN}!g" /etc/mail/sendmail.mc
-    sed -i -e "s!_DOMAIN_!${DOMAIN}!g" /etc/mail/sendmail.mc
-    
-    if [ -n "${SENDMAIL_INCOMING_PORT}" ]; then
+    define(`confMAX_MESSAGE_SIZE',10000000)
+        dnl
+        define(`confMAX_DAEMON_CHILDREN',`30')
+    define(`confCONNECTION_RATE_THROTTLE',`10')
+    define(`confMAX_RCPTS_PER_MESSAGE',`50')
+        dnl
+        dnl ---------- MILTER support ----------
+        define(`confINPUT_MAIL_FILTERS',`clmilter')
+    dnl
+    dnl ---------- SMTP Authorization options ----------
+    define(`confAUTH_OPTIONS', `A')
+    define(`confAUTH_MECHANISMS', `LOGIN PLAIN')
+        TRUST_AUTH_MECH(`LOGIN PLAIN')
+    dnl
+    dnl ---------- Don't send the version number of sendmail ----------
+        define(`confSMTP_LOGIN_MSG',`_HOSTNAME_')
+        MASQUERADE_AS(_DOMAIN_)
+        dnl Uncomment the following line to use a non-standard port
+        dnl DAEMON_OPTIONS(`Port=_ALTERNATE_PORT_NUMBER_,Name=MTA')
+        dnl
+        dnl This is necessary for the local Sendmail to work, when using
+        dnl an alternate port number:
+        DAEMON_OPTIONS('Port=25','Name=MTA')
+        dnl
+        FEATURE(nouucp, nospecial)
+        FEATURE(use_cw_file)
+        FEATURE(`access_db', `hash -T<TMPF> /etc/mail/access')
+        FEATURE(virtusertable, `hash -o /etc/mail/virtusertable')
+        FEATURE(`local_procmail')
+        FEATURE(`mailertable')
+        MAILER(procmail)
+        INPUT_MAIL_FILTER(`clmilter',`S=local:/var/clamav/clmilter.sock, F=, T=S:4m;R:4m')dnl
+        dnl INPUT_MAIL_FILTER(`smf-spf', `S=local:/var/run/smfs/smf-spf.sock, T=S:30s;R:1m')
+        dnl INPUT_MAIL_FILTER(`greylist',`S=local:/var/run/milter-greylist/milter-greylist.sock')
+        MAILER(smtp)
+        EOF
+
+sed -i -e "s!_HOSTNAME_!${MACHINE_NAME}\.${DOMAIN}!g" /etc/mail/sendmail.mc
+sed -i -e "s!_DOMAIN_!${DOMAIN}!g" /etc/mail/sendmail.mc
+
+if [ -n "${SENDMAIL_INCOMING_PORT}" ]; then
        # Uncommenting the alternate port line
-       sed -i -e "s!\(dnl \)\(.*_ALTERNATE_PORT_NUMBER_.*\)!\2!g" /etc/mail/sendmail.mc
+    sed -i -e "s!\(dnl \)\(.*_ALTERNATE_PORT_NUMBER_.*\)!\2!g" /etc/mail/sendmail.mc
        # Replacing the port number
-       sed -i -e "s!_ALTERNATE_PORT_NUMBER_!${SENDMAIL_INCOMING_PORT}!g" /etc/mail/sendmail.mc
-    fi
-    
+    sed -i -e "s!_ALTERNATE_PORT_NUMBER_!${SENDMAIL_INCOMING_PORT}!g" /etc/mail/sendmail.mc
+fi
+
     # We must put the domain name, and not the hostname in local-host-names
-    echo "${DOMAIN}" > /etc/mail/local-host-names
-    
-    if [ -n "${MAIL_ADMIN}" ]; then
-       echo "postmaster: ${MAIL_ADMIN}" > /etc/mail/aliases
-    else
-       exit 1
-    fi
-    cat >> /etc/mail/aliases << "EOF"
+echo "${DOMAIN}" > /etc/mail/local-host-names
+
+if [ -n "${MAIL_ADMIN}" ]; then
+    echo "postmaster: ${MAIL_ADMIN}" > /etc/mail/aliases
+else
+    exit 1
+fi
+cat >> /etc/mail/aliases << "EOF"
 mailer-daemon: postmaster
 abuse: postmaster
 root: postmaster
 EOF
     
-    cat > /etc/mail/access << "EOF"
+        cat > /etc/mail/access << "EOF"
 # This is absolutely needed for each 192.168.0.x computer to send mail...
 Connect:192.168.0 RELAY
 EOF
     
-    cd /etc/mail
-    cp -R ${LFS_TMP}/${1}/cf/* .
+        cd /etc/mail
+        cp -R ${LFS_TMP}/${PACKAGE}/cf/* .
 
-    cat > /etc/mail/submit.mc << "EOF"
+        cat > /etc/mail/submit.mc << "EOF"
 dnl
 include(`./m4/cf.m4')dnl
-dnl
-EOF
-    cat ${LFS_TMP}/${1}/cf/cf/submit.mc >> /etc/mail/submit.mc
+        dnl
+        EOF
+    cat ${LFS_TMP}/${PACKAGE}/cf/cf/submit.mc >> /etc/mail/submit.mc
     sed -i "s!\(^FEATURE.*\)127.0.0.1\(.*\)!\1${MACHINE_NAME}\.${DOMAIN}\2!" /etc/mail/submit.mc
     newaliases -v
-   
+    
     cat > /etc/mail/virtusertable << "EOF"
 # MAKE SURE ALL ENTRIES ARE SEPARATED WITH <TAB>
 #
 EOF
 
-    if [ -n "${SENDMAIL_ALT_MAILER}" ]; then
-       echo ".     ${SENDMAIL_ALT_MAILER}" > /etc/mail/mailertable
-    else
-       echo "# Define alternate mailer in this file" > /etc/mail/mailertable
-    fi
+        if [ -n "${SENDMAIL_ALT_MAILER}" ]; then
+            echo ".     ${SENDMAIL_ALT_MAILER}" > /etc/mail/mailertable
+        else
+            echo "# Define alternate mailer in this file" \
+                > /etc/mail/mailertable
+        fi
 
-    cat > /etc/mail/configure << "EOF"
-#!/bin/sh
+        cat > /etc/mail/configure << "EOF"
+#!/bin/bash
 
 PID_FILE="/var/run/sendmail.pid"
 
@@ -197,16 +189,16 @@ fi
 
 exit $?
 EOF
-    chmod 740 /etc/mail/configure
+        chmod 740 /etc/mail/configure
 
-    # Bootscript
-    install -v -m740 ${SCRDIR}/bootscripts/sendmail /etc/rc.d/init.d
+        # Bootscript
+        install -v -m740 ${SCRDIR}/bootscripts/sendmail /etc/rc.d/init.d
 
-    # script-name start stop
-    bootscript_add_rc3 sendmail 65 25
+        # script-name start stop
+        bootscript_add_rc3 sendmail 65 25
 
-    cat > /usr/local/bin/mail-if-fail << "EOF"
-#!/bin/sh
+        cat > /usr/local/bin/mail-if-fail << "EOF"
+#!/bin/bash
 
 # This script is used to run a command. If the command failed,
 # an email is sent to the address specified by MAILTO.
@@ -242,14 +234,13 @@ rm -f ${LOGFILE}
 exit ${ERROR_CODE}
 EOF
 
-    sed -i -e "s!_DOMAIN_!${DOMAIN}!g" /usr/local/bin/mail-if-fail
-    chmod 755 /usr/local/bin/mail-if-fail
+        sed -i -e "s!_DOMAIN_!${DOMAIN}!g" /usr/local/bin/mail-if-fail
+        chmod 755 /usr/local/bin/mail-if-fail
 
-    cp ${SCRDIR}/misc/mail-files.sh /usr/local/bin
-    chmod 755 /usr/local/bin/mail-files.sh
+        cp ${SCRDIR}/misc/mail-files.sh /usr/local/bin
+        chmod 755 /usr/local/bin/mail-files.sh
 
-    # Executing configure script.
-    /etc/mail/configure
-fi
-
-exit $?
+         # Executing configure script.
+        /etc/mail/configure
+    fi
+}
index 66ddce6..4811bd8 100644 (file)
@@ -10,7 +10,7 @@ hvconfig_pre()
 hvbuild_post()
 {
     cat > /usr/local/bin/hv-sa-learn << "EOF"
-#!/bin/sh
+#!/bin/bash
 
 SA_LEARN="/usr/bin/sa-learn"
 SA_LEARN_FLAGS="--showdots --mbox"
index b1d18df..52f68b0 100644 (file)
@@ -1,31 +1,10 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
 # Drivers Samsung pour CUPS
 
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}
-make DISABLE_JBIG=1
-make install
-ldconfig
-
-exit $?
+hvbuild()
+{
+    cd ${LFS_TMP}/${PACKAGE}
+    make DISABLE_JBIG=1
+    make install
+}
index aa699e2..3047596 100644 (file)
@@ -1,28 +1,20 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
-# First argument of this script is the package name
+hvbuild()
+{
+    mv ${LFS_TMP}/${PACKAGE} /srv/www/htdocs/squirrelmail
+    chown -v -R ${APACHE_USER}:${APACHE_USER} /srv/www/htdocs/squirrelmail
 
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
+    mkdir -v -p /srv/squirrelmail/{data,attach}
+    chown -v -R ${APACHE_USER}:${APACHE_USER} /srv/squirrelmail
+    chmod -v 0730 /srv/squirrelmail/attach
 
-# Applying patches (if any)
-apply_patches ${1}
+    cp /srv/www/htdocs/squirrelmail/config/config_default.php \
+        /srv/www/htdocs/squirrelmail/config/config.php
 
-mv ${LFS_TMP}/${1} /srv/www/htdocs/squirrelmail
-chown -v -R ${APACHE_USER}:${APACHE_USER} /srv/www/htdocs/squirrelmail
-
-mkdir -v -p /srv/squirrelmail/{data,attach}
-chown -v -R ${APACHE_USER}:${APACHE_USER} /srv/squirrelmail
-chmod -v 0730 /srv/squirrelmail/attach
-
-cp /srv/www/htdocs/squirrelmail/config/config_default.php /srv/www/htdocs/squirrelmail/config/config.php
-
-sed -i -e "s!\(\$data_dir .* =\).*!\1 \'/srv/squirrelmail/data/\';!g" \
-    /srv/www/htdocs/squirrelmail/config/config.php
-sed -i -e "s!\(\$attachment_dir .* =\).*!\1 \'/srv/squirrelmail/attach/\';!g" \
-    /srv/www/htdocs/squirrelmail/config/config.php
-exit $?
+    sed -i -e "s!\(\$data_dir .* =\).*!\1 \'/srv/squirrelmail/data/\';!g" \
+        /srv/www/htdocs/squirrelmail/config/config.php
+    sed -i -e \
+        "s!\(\$attachment_dir .* =\).*!\1 \'/srv/squirrelmail/attach/\';!g" \
+        /srv/www/htdocs/squirrelmail/config/config.php
+}
index bd8ddb3..284d1f0 100644 (file)
@@ -1,63 +1,58 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Removing any older directory from earlier attempt...
-rm -rf ${LFS_TMP}/cm-super
-
-install -v -m755 -d /usr/share/texmf
-decompress_package ${TETEX_TEXMF}    /usr/share/texmf
-decompress_package ${TETEX_TEXMFSRC} /usr/share/texmf
-decompress_package ${TETEX_CM_SUPER}
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}-build
-../${1}/configure \
-    --prefix=/usr \
-    --exec-prefix=/usr \
-    --bindir=/usr/bin \
-    --with-x=yes \
-    --without-texinfo \
-    --with-system-ncurses \
-    --with-system-zlib \
-    --with-system-t1lib \
-    --with-system-pnglib \
-    --with-system-gd \
-    --disable-a4
-make all
-make install
-
-texconfig-sys dvips paper letter
-texconfig-sys font rw
-
-install -v -d -m755 /usr/local/share/texmf/tex/latex
-var_add_path "TEXMFLOCAL" /etc/profile "/usr/local/share/texmf"
-var_export   "TEXMFLOCAL" /etc/profile
-
-# To install the optional cm-super fonts:
-FONTDIR=$(kpsewhich --expand-var '$TEXMFMAIN')
-mkdir -v -p ${FONTDIR}/fonts/afm/public/cm-super   \
-    ${FONTDIR}/fonts/type1/public/cm-super \
-    ${FONTDIR}/fonts/enc/dvips/cm-super    \
-    ${FONTDIR}/fonts/map/dvips/cm-super  
-
-cp -v ${LFS_TMP}/cm-super/pfb/*.pfb ${FONTDIR}/fonts/type1/public/cm-super/
-
-gunzip ${LFS_TMP}/cm-super/afm/*
-cp -v ${LFS_TMP}/cm-super/afm/*.afm ${FONTDIR}/fonts/afm/public/cm-super/
-
-cp -v ${LFS_TMP}/cm-super/dvips/*.enc ${FONTDIR}/fonts/enc/dvips/cm-super/
-cp -v ${LFS_TMP}/cm-super/dvips/*.map ${FONTDIR}/fonts/map/dvips/cm-super/
+hvpatch_pre()
+{
+    # Removing any older directory from earlier attempt...
+    rm -rf ${LFS_TMP}/cm-super
 
-cat >> ${FONTDIR}/web2c/updmap.cfg << "EOF"
+    install -v -m755 -d /usr/share/texmf
+
+    decompress_package ${TETEX_TEXMF}    /usr/share/texmf
+    decompress_package ${TETEX_TEXMFSRC} /usr/share/texmf
+    decompress_package ${TETEX_CM_SUPER}
+}
+
+hvconfig_pre()
+{
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --exec-prefix=/usr \
+        --bindir=/usr/bin \
+        --with-x=yes \
+        --without-texinfo \
+        --with-system-ncurses \
+        --with-system-zlib \
+        --with-system-t1lib \
+        --with-system-pnglib \
+        --with-system-gd \
+        --disable-a4"
+}
+
+hvbuild_post()
+{
+    texconfig-sys dvips paper letter
+    texconfig-sys font rw
+
+    install -v -d -m755 /usr/local/share/texmf/tex/latex
+    var_add_path "TEXMFLOCAL" /etc/profile "/usr/local/share/texmf"
+    var_export   "TEXMFLOCAL" /etc/profile
+
+    # To install the optional cm-super fonts:
+    FONTDIR=$(kpsewhich --expand-var '$TEXMFMAIN')
+    mkdir -v -p ${FONTDIR}/fonts/afm/public/cm-super   \
+        ${FONTDIR}/fonts/type1/public/cm-super \
+        ${FONTDIR}/fonts/enc/dvips/cm-super    \
+        ${FONTDIR}/fonts/map/dvips/cm-super  
+
+    cp -v ${LFS_TMP}/cm-super/pfb/*.pfb ${FONTDIR}/fonts/type1/public/cm-super/
+
+    gunzip ${LFS_TMP}/cm-super/afm/*
+    cp -v ${LFS_TMP}/cm-super/afm/*.afm ${FONTDIR}/fonts/afm/public/cm-super/
+
+    cp -v ${LFS_TMP}/cm-super/dvips/*.enc ${FONTDIR}/fonts/enc/dvips/cm-super/
+    cp -v ${LFS_TMP}/cm-super/dvips/*.map ${FONTDIR}/fonts/map/dvips/cm-super/
+
+    cat >> ${FONTDIR}/web2c/updmap.cfg << "EOF"
 MixedMap cm-super-t1.map
 MixedMap cm-super-t2a.map
 MixedMap cm-super-t2b.map
@@ -66,11 +61,10 @@ MixedMap cm-super-ts1.map
 MixedMap cm-super-x2.map
 EOF
 
-mktexlsr
-updmap-sys
-
-if [ ${?} -eq 0 ]; then
-    rm -rf ${LFS_TMP}/cm-super
-fi
+    mktexlsr
+    updmap-sys
 
-exit $?
+    if [ ${?} -eq 0 ]; then
+        rm -rf ${LFS_TMP}/cm-super
+    fi
+}
index 4fe70ce..14a4f15 100644 (file)
@@ -1,36 +1,18 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-shift
-CONFIGURE_OPTS=${*}
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-# Need to specify mandir manually because of a stupid programming error in tftpd sources...
-cd ${LFS_TMP}/${PACKAGE}
-./configure \
-    --prefix=/usr \
-    --sysconfdir=/etc \
-    --mandir=/usr/man \
-    --without-tcpwrappers \
-    ${CONFIGURE_OPTS}
-make
-make install
-ldconfig
-
-mkdir -v -p /srv/tftpboot
-
-# Addition to /etc/inetd.conf
-string_add "tftp  dgram  udp wait       root  /usr/sbin/in.tftpd in.tftpd -s /srv/tftpboot -v -v -v -v -v" /etc/inetd.conf
-
-exit $?
+#!/bin/bash
+
+hvconfig_pre()
+{
+    # Need to specify mandir manually because of a stupid programming error.
+    CONFIGURE_OPTS="\
+        ${CONFIGURE_OPTS} \
+        --mandir=/usr/man \
+        --without-tcpwrappers"
+}
+
+hvbuild_post()
+{
+    mkdir -v -p /srv/tftpboot
+
+    # Addition to /etc/inetd.conf
+    string_add "tftp  dgram  udp wait       root  /usr/sbin/in.tftpd in.tftpd -s /srv/tftpboot -v -v -v -v -v" /etc/inetd.conf
+}
index 0034151..a6345d8 100644 (file)
@@ -1,25 +1,6 @@
-#!/bin/sh
-set -o errexit
+#!/bin/bash
 
-# First argument of this script is the package name.
-# Remaining arguments are additional configure options.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-PACKAGE=${1}
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${PACKAGE}
-
-cd ${LFS_TMP}/${PACKAGE}
-make -C tunctl install
-
-exit $?
+hvbuild()
+{
+    make -C ${LFS_TMP}/${PACKAGE}/tunctl install
+}
index 1124c95..8f10d49 100644 (file)
@@ -1,59 +1,53 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# This server is configured to use SSL only, no plain-text passwords.
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-
-# Setting default mailbox format for imapd
-sed -i -e "s!^\(CREATEPROTO=\)unixproto!\1${MAILBOX_FORMAT}proto!" src/osdep/unix/Makefile
-
-make lnp
-
-# Installing imapd
-install -m 755 imapd/imapd /usr/bin
-install -m 644 src/imapd/imapd.8 /usr/man/man8/imapd.8
-
-# Installing mailutil
-install -m 755 mailutil/mailutil /usr/bin
-install -m 644 src/mailutil/mailutil.1 /usr/man/man1/mailutil.1
-
-# Installing dmail
-install -m 755 dmail/dmail /usr/bin
-install -m 644 src/dmail/dmail.1 /usr/man/man1/dmail.1
-
-# Installing C-library
-mkdir -p /usr/lib/uw-imap/{include,lib}
-install -m 644 c-client/c-client.a /usr/lib/uw-imap/lib
-ln -sf /usr/lib/uw-imap/lib/c-client.a /usr/lib/uw-imap/lib/libc-client.a
-install -m 644 c-client/*.h /usr/lib/uw-imap/include
-install -m 644 src/osdep/tops-20/shortsym.h /usr/lib/uw-imap/include
-
-# Addition to /etc/inetd.conf
-string_add "imaps stream tcp nowait.400 root /usr/bin/imapd imapd" /etc/inetd.conf
-
-# Addition to /etc/services
-string_add "imaps     993/tcp " /etc/services
-
-# Addition to /etc/pam.conf
-string_add "# IMAP server"                                             /etc/pam.conf
-string_add "imap   auth       required   pam_unix.so   nullok"         /etc/pam.conf
-string_add "imap   account    required   pam_unix.so   try_first_pass" /etc/pam.conf
-string_add "imap   session    required   pam_deny.so"                  /etc/pam.conf
-
-# SSL Certificates generation script
-cat > /etc/mail/imap-ssl-certs << "EOF"
-#!/bin/sh
+#!/bin/bash
+
+hvbuild()
+{
+    cd ${LFS_TMP}/${PACKAGE}
+
+    # Setting default mailbox format for imapd
+    sed -i -e "s!^\(CREATEPROTO=\)unixproto!\1${MAILBOX_FORMAT}proto!" \
+        src/osdep/unix/Makefile
+    make lnp
+
+    # Installing imapd
+    install -m 755 imapd/imapd /usr/bin
+    install -m 644 src/imapd/imapd.8 /usr/man/man8/imapd.8
+
+    # Installing mailutil
+    install -m 755 mailutil/mailutil /usr/bin
+    install -m 644 src/mailutil/mailutil.1 /usr/man/man1/mailutil.1
+
+    # Installing dmail
+    install -m 755 dmail/dmail /usr/bin
+    install -m 644 src/dmail/dmail.1 /usr/man/man1/dmail.1
+
+    # Installing C-library
+    mkdir -p /usr/lib/uw-imap/{include,lib}
+    install -m 644 c-client/c-client.a /usr/lib/uw-imap/lib
+    ln -sf /usr/lib/uw-imap/lib/c-client.a /usr/lib/uw-imap/lib/libc-client.a
+    install -m 644 c-client/*.h /usr/lib/uw-imap/include
+    install -m 644 src/osdep/tops-20/shortsym.h /usr/lib/uw-imap/include
+
+    # Addition to /etc/inetd.conf
+    string_add "imaps stream tcp nowait.400 root /usr/bin/imapd imapd" \
+        /etc/inetd.conf
+
+    # Addition to /etc/services
+    string_add "imaps     993/tcp " /etc/services
+
+    # Addition to /etc/pam.conf
+    string_add "# IMAP server" \
+        /etc/pam.conf
+    string_add "imap   auth       required   pam_unix.so   nullok" \
+        /etc/pam.conf
+    string_add "imap   account    required   pam_unix.so   try_first_pass" \
+        /etc/pam.conf
+    string_add "imap   session    required   pam_deny.so" \
+        /etc/pam.conf
+
+    # SSL Certificates generation script
+    cat > /etc/mail/imap-ssl-certs << "EOF"
+#!/bin/bash
 
 echo "-------------------------------------------------"
 echo "Generation of a Certificate Signing Request (CSR)"
@@ -82,19 +76,18 @@ openssl req -new -x509 -nodes -out imapd.pem -keyout imapd.pem -days 10000
 exit $?
 EOF
 
-chmod 740 /etc/mail/imap-ssl-certs
-
-# Making sure cram-md5.pwd is created.
-if [ ! -f /etc/cram-md5.pwd ]; then
-    echo "# CRAM-MD5 authentication database" > /etc/cram-md5.pwd
-    echo "# Entries are in the form:" >> /etc/cram-md5.pwd
-    echo "#   USERNAME <SINGLE-TAB> PASSWORD" >> /etc/cram-md5.pwd
-    echo "# Its mandatory that there is a single tab" >> /etc/cram-md5.pwd
-    echo "# between the usernasme and password." >> /etc/cram-md5.pwd
-    echo "# Lines starting with \"#\" are comments." >> /etc/cram-md5.pwd
-    echo "" >> /etc/cram-md5.pwd
-
-    chmod 600 /etc/cram-md5.pwd
-fi
-
-exit $?
+    chmod 740 /etc/mail/imap-ssl-certs
+
+    # Making sure cram-md5.pwd is created.
+    if [ ! -f /etc/cram-md5.pwd ]; then
+        echo "# CRAM-MD5 authentication database" > /etc/cram-md5.pwd
+        echo "# Entries are in the form:" >> /etc/cram-md5.pwd
+        echo "#   USERNAME <SINGLE-TAB> PASSWORD" >> /etc/cram-md5.pwd
+        echo "# Its mandatory that there is a single tab" >> /etc/cram-md5.pwd
+        echo "# between the usernasme and password." >> /etc/cram-md5.pwd
+        echo "# Lines starting with \"#\" are comments." >> /etc/cram-md5.pwd
+        echo "" >> /etc/cram-md5.pwd
+
+        chmod 600 /etc/cram-md5.pwd
+    fi
+}
index 2616f35..fd57226 100644 (file)
@@ -1,24 +1,14 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}
-./configure \
-    --prefix=/usr
-make
-make install
-ldconfig
-
-# Adding link for GIMP plugin (Base GIMP version hardcoded for now)
-ln -v -sf /usr/bin/xsane /usr/lib/gimp/2.0/plug-ins/
-
-exit $?
+#!/bin/bash
+
+hvconfig()
+{
+    cd ${LFS_TMP}/${PACKAGE}
+    ./configure \
+        --prefix=/usr
+}
+
+hvbuild_post()
+{
+    # Adding link for GIMP plugin (Base GIMP version hardcoded for now)
+    ln -v -s ../../../../bin/xscanimage /usr/lib/gimp/2.0/plug-ins
+}
index 841455e..987d97c 100644 (file)
@@ -1,23 +1,15 @@
-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-cd ${LFS_TMP}/${1}/build/generic
-./configure \
-    --prefix=/usr
-make 
-make install
-ln -sf libxvidcore.so.4.0 /usr/lib/libxvidcore.so.4
-ln -sf libxvidcore.so.4 /usr/lib/libxvidcore.so
-ldconfig
-
-exit $?
+#!/bin/bash
+
+hvconfig()
+{
+    cd ${LFS_TMP}/${PACKAGE}/build/generic
+    ./configure \
+        --prefix=/usr
+}
+
+hvbuild_post()
+{
+    chmod -v 755 /usr/lib/libxvidcore.so.4.2
+    ln -v -sf libxvidcore.so.4.2 /usr/lib/libxvidcore.so.4
+    ln -v -sf libxvidcore.so.4   /usr/lib/libxvidcore.so
+}
index 92fa4b4..f9dbdb3 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../config/sysinfos
-source ../functions
-source ../config/packages-list
+source ../functions/main
 
 if [ "x${INST_TYPE}" = "xserver" -o "x${INST_TYPE}" = "xltsp-server" ]; then
     
index 1ca8aed..d56ebdc 100755 (executable)
@@ -1,12 +1,12 @@
 #!/bin/bash
 
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../functions-fpkg
-source ../packages-list
+USE_LFS_PATCHES=1
+USE_BLFS_PATCHES=1
+USE_HV_PATCHES=1
 
-update_packages_init
+source ../functions/main
+
+update_packages_init ${*}
 
 # Gnome 2 core packages
 fpkg_gnome ${ORBIT2}