Author: pierre Date: Mon Feb 27 06:09:03 2017 New Revision: 3887 Log: Merge new_feature branch r3884 to3886: - Adapt BLFS/envars.conf to modern BLFS books - Fix try order for downloading BLFS packages - Fixes to use the XORG Legacy page in BLFS
Modified: jhalfs/trunk/BLFS/envars.conf jhalfs/trunk/BLFS/gen-special.sh jhalfs/trunk/BLFS/xsl/make_book.xsl jhalfs/trunk/BLFS/xsl/scripts.xsl Modified: jhalfs/trunk/BLFS/envars.conf ============================================================================== --- jhalfs/trunk/BLFS/envars.conf Mon Feb 27 06:02:16 2017 (r3886) +++ jhalfs/trunk/BLFS/envars.conf Mon Feb 27 06:09:03 2017 (r3887) @@ -10,121 +10,39 @@ #======== Common envars ========== -#--- Set a well-known working locale when building software -export LC_ALL=C +#--- The sources directory. +# This directory contains sub directories (one for each package), where +# packages are stored, unpacked, and compiled. +export SRC_DIR=/sources #--- The local repository for packages/file # Any missing file will be downloaded and archived here, -# if the user has the right priviledges. +# if the user has the right priviledges. Can be the same as SRC_DIR export SRC_ARCHIVE=/sources -#--- Server used if the file isn't found in SRC_ARCHIVE. -# As a last resort, the file will dowloaded from upstream, if possible. +#--- Set a well-known working locale when building software +# Note that an UTF-8 locale may be needed for some packages, +# but normally it is set in the package instructions. +# Furthermore, LANG may be set in /etc/profile, which is +# sourced at the end of this file. +export LC_ALL=C + +#--- Server used if the file isn't found in SRC_ARCHIVE or SRC_DIR, +# and cannot be downloaded from upstream. # # The server path MUST be set as listed in -# http://www.linuxfromscratch.org/blfs/download.html -export FTP_SERVER=ftp://anduin.linuxfromscratch.org/BLFS/ +# http://www.linuxfromscratch.org/blfs/download.html. +# Note that despite the name of the variable, it can be an http url. +export FTP_SERVER=http://ftp.osuosl.org/pub/blfs/ +### Currently not used in scripts ### # Use a server close to you for Xorg (see http://wiki.x.org/wiki/Mirrors) -export FTP_X_SERVER=ftp://mirror.cict.fr/x.org/ - -#--- The sources directory. -# Full path to the top level directory where packages will be stored, -# unpacked, and compiled. -export SRC_DIR=/sources - - -#======== Xorg7 envars =========== - -#--- Installation prefix -export XORG_PREFIX=/usr - -#--- Configure switches -export XORG_CONFIG="--prefix=$XORG_PREFIX --sysconfdir=/etc \ - --localstatedir=/var --disable-static" - -#======== ABOUT GNOME envars ===== - -# Refer to `Chapter 30. Right now, the book hard codes --prefix=/usr -# and does not make use of the variables below. If you need another prefix, -# You'll have to modifiy the prefix in the book source and use the variables -# below. But this is not supported in this tool. - -#======== LEGACY GNOME envars ==== - -# We use envars.conf instead of /etc/profile.d. But if you -# install into a different prefix, you'll need to update ld.so.conf and -# man-db.conf, too. - -#--- Installation prefix -# export GNOME_PREFIX=/usr -# export GNOME_SYSCONFDIR=/etc/gnome/3.2.2 -# export XDG_CONFIG_DIRS=$GNOME_SYSCONFDIR/xdg -# export XDG_DATA_DIRS=/usr/share:/usr/local/share - -#--- If you want to install GNOME on a non standard prefix, uncomment -# the next export lines and edit it if needed. -# See also the GNOME Pre-installation Configuration HTML page for -# aditional required commands. -#export PATH=$PATH:$GNOME_PREFIX/bin -#export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$GNOME_PREFIX/lib/pkgconfig -#export GNOME_LIBCONFIG_PATH=/usr/lib:$GNOME_PREFIX/lib - -#======== KDE envars ============= - -# Refer to `Chapter 27. Introduction->KDE Pre-installation Configuration' -# for rationale. We use envars.conf instead of /etc/profile.d. But if you -# install into a different prefix, you'll need to update ld.so.conf and -# man-db.conf, and to create and populate the directories $KDE_PREFIX/share -# and /etc/dbus-1, as instructed. - -#--- Installation prefix -export KDE_PREFIX=/usr - -#--- If you want to install KDE on a non standard prefix, uncomment -# the next lines and edit them as needed. -#export KDE_PREFIX=/opt/kde -#export KDEDIR=$KDE_PREFIX - -#PATH=$PATH:$KDE_PREFIX/bin -#if [ -z PKG_CONFIG_PATH ]; then -#export PKG_CONFIG_PATH=$KDE_PREFIX/lib/pkgconfig:$KDE_PREFIX/share/pkgconfig -#else -# PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$KDE_PREFIX/lib/pkgconfig:$KDE_PREFIX/share/pkgconfig -#fi -# Note: there is a report that setting XDG_... vars for kde may break LXDE -#if [ -z XDG_DATA_DIRS ]; then -#export XDG_DATA_DIRS=$KDE_PREFIX/share -#else -# XDG_DATA_DIRS=$XDG_DATA_DIRS:$KDE_PREFIX/share -#fi -#if [ -z XDG_CONFIG_DIRS ]; then -#export XDG_CONFIG_DIRS=/etc/kde/xdg -#else -# XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS:/etc/kde/xdg -#fi - -#======== LXQt envars ============= - -# Refer to `Chapter 40. LXQt Desktop Pre-Install Instructions' -# We use envars.conf for LXQT_PREFIX, instead of /etc/profile.d. But if you -# install into a different prefix, you'll need to create the relevant -# directory, to create /etc/profiles.d/lxqt.sh, update /etc/ld.so.conf, and -# to create and populate the directories $LXQT_PREFIX/share/icons, as -# instructed. - -#--- Installation prefix -export LXQT_PREFIX=/usr - -#--- If you want to install LXQT on a non standard prefix, uncomment -# the next line and edit it as needed, or just use the book's -# /etc/profile.d/lxqt.sh. -# export LXQT_PREFIX=/opt/lxqt +# export FTP_X_SERVER=ftp://mirror.cict.fr/x.org/ #======== Optimizations ============= # Global optimization settings can be placed here. This settings can be -# overrided by settings in the packages build scripts. +# overriden by settings in the packages build scripts. # WARNING: The use of build optimizations may be dangerous. # You should know what you are doing and be sure that the @@ -145,8 +63,23 @@ #======== Environment settings ======== -# Since the startup files may be changed in the course -# of a build, ensure that environment variables are -# up to date +# The prefered way to setup environment variables nowadays +# is to set them in /etc/profile{,.d/*.sh}. +# It is recommended to source /etc/profile in this file +# since a package may add some new variables in there, +# which may be needed later in dependant packages. if [ -r /etc/profile ]; then source /etc/profile; fi + +#======== Package management ======== + +# We need the functions in "packInstall.sh" when installing a package, +# if package management is requested. Note that we have no way to know +# whether package management is requested for a given build. +# Furthermore, "sudo -E" exports variables, but not functions from +# the environment, and sudo needs to be called before porg, due +# to porg limitations. So we just export the location of the file +# where the functions are defined, and we'll source it just before +# installing. + +export PACK_INSTALL=/blfs_root/packInstall.sh # change as needed Modified: jhalfs/trunk/BLFS/gen-special.sh ============================================================================== --- jhalfs/trunk/BLFS/gen-special.sh Mon Feb 27 06:02:16 2017 (r3886) +++ jhalfs/trunk/BLFS/gen-special.sh Mon Feb 27 06:09:03 2017 (r3887) @@ -39,7 +39,7 @@ # Non-versioned packages: NV_LIST="cacerts xorg-env kde-pre-install-config kf5-intro lxqt-pre-install \ -ojdk-conf tex-path" +lxqt-post-install ojdk-conf tex-path" # Set PATH to be sure to find udevadm SAVPATH=$PATH @@ -146,7 +146,7 @@ # that the preceding package is a dependency of the following, # except the first. list_cat="$(sed -n '/>cat/,/EOF</p' $file | grep -v 'cat\|EOF' | - sed 's/^[^ ]*\ *\([^&]*\).*/\1/' | sed 's/-$//')" + awk '{ print $NF }' | sed 's/-&.*//')" # Rationale for the sed below: the following for breaks words at spaces (unless # we tweak IFS). So replace spaces with commas in lines so that only newlines Modified: jhalfs/trunk/BLFS/xsl/make_book.xsl ============================================================================== --- jhalfs/trunk/BLFS/xsl/make_book.xsl Mon Feb 27 06:02:16 2017 (r3886) +++ jhalfs/trunk/BLFS/xsl/make_book.xsl Mon Feb 27 06:09:03 2017 (r3887) @@ -307,6 +307,13 @@ select=".//userinput[starts-with(string(),'cat ')]"/> </xsl:call-template> </xsl:variable> + <xsl:variable name="download-dir"> + <xsl:call-template name="download-dir"> + <xsl:with-param name="package" select="concat(' ',$package,'-')"/> + <xsl:with-param name="cat-md5" + select=".//userinput[starts-with(string(),'cat ')]"/> + </xsl:call-template> + </xsl:variable> <xsl:variable name="install-instructions"> <xsl:call-template name="inst-instr"> <xsl:with-param name="inst-instr" @@ -328,6 +335,7 @@ <xsl:attribute name="url"> <xsl:value-of select=".//para[contains(string(),'(HTTP)')]/ulink/@url"/> + <xsl:value-of select="$download-dir"/> <xsl:value-of select="$tarball"/> </xsl:attribute> </xsl:element> @@ -338,6 +346,7 @@ <xsl:attribute name="url"> <xsl:value-of select=".//para[contains(string(),'(FTP)')]/ulink/@url"/> + <xsl:value-of select="$download-dir"/> <xsl:value-of select="$tarball"/> </xsl:attribute> </xsl:element> @@ -407,9 +416,43 @@ select="substring-after($cat-md5,'
')"/> </xsl:call-template> </xsl:when> + <xsl:when test="contains(substring-before($cat-md5,$package),' ')"> + <xsl:call-template name="tarball"> + <xsl:with-param name="package" select="$package"/> + <xsl:with-param name="cat-md5" + select="substring-after($cat-md5,' ')"/> + </xsl:call-template> + </xsl:when> <xsl:otherwise> <xsl:copy-of select="substring-after( - substring-before($cat-md5,'
'),' ')"/> + substring-before($cat-md5,'
'),' ')"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> +<!-- get the download dirname from the text that comes from the .md5 file --> + <xsl:template name="download-dir"> + <xsl:param name="package"/> + <xsl:param name="cat-md5"/> + <xsl:choose> + <xsl:when test="not(@id='xorg7-legacy')"> + <xsl:copy-of select="''"/> + </xsl:when> + <xsl:when test="contains(substring-before($cat-md5,$package),'
')"> + <xsl:call-template name="download-dir"> + <xsl:with-param name="package" select="$package"/> + <xsl:with-param name="cat-md5" + select="substring-after($cat-md5,'
')"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="contains(substring-before($cat-md5,$package),' ')"> + <xsl:call-template name="download-dir"> + <xsl:with-param name="package" select="$package"/> + <xsl:with-param name="cat-md5" + select="substring-after($cat-md5,' ')"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="substring-before($cat-md5,' ')"/> </xsl:otherwise> </xsl:choose> </xsl:template> Modified: jhalfs/trunk/BLFS/xsl/scripts.xsl ============================================================================== --- jhalfs/trunk/BLFS/xsl/scripts.xsl Mon Feb 27 06:02:16 2017 (r3886) +++ jhalfs/trunk/BLFS/xsl/scripts.xsl Mon Feb 27 06:09:03 2017 (r3887) @@ -215,21 +215,23 @@ <xsl:text> $</xsl:text> <xsl:value-of select="$varname"/> <xsl:text>
 else
</xsl:text> - <!-- The FTP_SERVER mirror --> - <xsl:text> wget -T 30 -t 5 ${FTP_SERVER}svn/</xsl:text> - <xsl:value-of select="$first_letter"/> - <xsl:text>/$</xsl:text> - <xsl:value-of select="$varname"/> + <!-- Download from upstream http --> <xsl:if test="string-length($httpurl) > 10"> - <xsl:text> || - wget -T 30 -t 5 </xsl:text> + <xsl:text> wget -T 30 -t 5 </xsl:text> <xsl:value-of select="$httpurl"/> + <xsl:text> ||
</xsl:text> </xsl:if> + <!-- Download from upstream ftp --> <xsl:if test="string-length($ftpurl) > 10"> - <xsl:text> || - wget -T 30 -t 5 </xsl:text> + <xsl:text> wget -T 30 -t 5 </xsl:text> <xsl:value-of select="$ftpurl"/> + <xsl:text> ||
</xsl:text> </xsl:if> + <!-- The FTP_SERVER mirror as a last resort --> + <xsl:text> wget -T 30 -t 5 ${FTP_SERVER}svn/</xsl:text> + <xsl:value-of select="$first_letter"/> + <xsl:text>/$</xsl:text> + <xsl:value-of select="$varname"/> <xsl:text> cp $</xsl:text> <xsl:value-of select="$varname"/> -- http://lists.linuxfromscratch.org/listinfo/alfs-log Unsubscribe: See the above information page