Merge ablfs branch. Normally, jhalfs should not perform differently

for building LFS
This commit is contained in:
Pierre Labastie 2013-10-29 15:42:03 +00:00
parent 2e64c47d0b
commit e576789367
50 changed files with 3097 additions and 3474 deletions

View file

@ -1,40 +1,122 @@
# From the Build Scripts Written By: Jim Gifford <lfs@jg555.com> # From the Build Scripts Written By: Jim Gifford <lfs@jg555.com>
# Modified By: Joe Ciccone <jciccone@linuxfromscratch.org # Modified By: Joe Ciccone <jciccone@linuxfromscratch.org
# Additional changes: George Boudreau <georgeb@linuxfromscratch.org> # Additional changes: George Boudreau <georgeb@linuxfromscratch.org>
# Pierre Labastie <pierre.labastie at neuf.fr>
# $Id$ # $Id: Makefile 36 2012-02-22 13:01:46Z labastie $
ifdef V
Q =
else
Q = @
endif
# Known behavior
LANG=C LANG=C
LC_ALL=C LC_ALL=C
# The right-hand side is updated by jhalfs
TRACKING_DIR = tracking-dir
TOPDIR=$(shell pwd) TOPDIR=$(shell pwd)
CONFIG_CONFIG_IN = Config.in BLFS_XML = $(TOPDIR)/blfs-xml
CONFIG = menu XSLDIR = $(TOPDIR)/xsl
all: menuconfig RENDERTMP = $(BLFS_XML)/tmp
BLFS_FULL = $(RENDERTMP)/blfs-full.xml
PACK_LIST = $(TOPDIR)/packages.xml
MENU = $(TOPDIR)/menu
CONFIG_CONFIG_IN = $(TOPDIR)/Config.in
CONFIG_OUT = $(TOPDIR)/configuration
BOOK_XML = $(TOPDIR)/book.xml
TRACKFILE = $(TRACKING_DIR)/instpkg.xml
$(CONFIG)/conf: define INITIAL_TRACK
$(MAKE) -B -C $(CONFIG) conf <?xml version="1.0" encoding="ISO-8859-1"?>\n\
\n\
<!DOCTYPE sublist SYSTEM "$(TOPDIR)/packdesc.dtd">\n\
<sublist>\n\
<name>Installed</name>\n\
</sublist>
endef
$(CONFIG)/mconf: SVN = svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK
$(MAKE) -B -C $(CONFIG) ncurses conf mconf
menuconfig: $(CONFIG)/mconf ALLXML := $(filter-out $(RENDERTMP)/%, \
@./update_book.sh none $(wildcard $(BLFS_XML)/*.xml $(BLFS_XML)/*/*.xml $(BLFS_XML)/*/*/*.xml $(BLFS_XML)/*/*/*/*.xml $(BLFS_XML)/*/*/*/*/*.xml))
@./gen_config.sh ALLXSL := $(filter-out $(RENDERTMP)/%, \
@$(CONFIG)/mconf $(CONFIG_CONFIG_IN) $(wildcard $(BLFS_XML)/*.xsl $(BLFS_XML)/*/*.xsl $(BLFS_XML)/*/*/*.xsl $(BLFS_XML)/*/*/*/*.xsl $(BLFS_XML)/*/*/*/*/*.xsl))
@./gen_pkg_book.sh
config: $(CONFIG)/conf $(BOOK_XML): $(CONFIG_OUT)
@$(CONFIG)/conf $(CONFIG_CONFIG_IN) $(Q)$(TOPDIR)/gen_pkg_book.sh $(TOPDIR) $(BLFS_FULL)
$(CONFIG_OUT): $(CONFIG_CONFIG_IN) $(MENU)/mconf
$(Q)$(MENU)/mconf $(CONFIG_CONFIG_IN)
$(MENU)/mconf:
$(Q)$(MAKE) -C $(MENU) ncurses conf mconf
$(CONFIG_CONFIG_IN): $(PACK_LIST) $(XSLDIR)/gen_config.xsl
$(Q)xsltproc --nonet -o $@ $(XSLDIR)/gen_config.xsl $(PACK_LIST)
$(PACK_LIST): $(XSLDIR)/gen_pkg_list.xsl $(XSLDIR)/specialCases.xsl $(TRACKFILE)
$(Q)xsltproc --stringparam installed-packages $(TRACKFILE) \
-o $@.tmp $(XSLDIR)/gen_pkg_list.xsl $(BLFS_FULL)
$(Q)xmllint --postvalid --format -o $@ $@.tmp
$(Q)rm $@.tmp
# Beware of the echo '$(INITIAL_TRACK)' command below:
# if shell is bash or sh linked to bash, needs echo -e
# if shell is dash or sh linked to dash: echo is enough
# Don't ask me why
# So use /bin/echo (needs -e)
$(TRACKFILE): $(TRACKING_DIR)
$(Q)if ! [ -f $@ ]; then \
echo Initializing $(TRACKFILE) && \
/bin/echo -e '$(INITIAL_TRACK)' > $@ && \
$(MAKE) $(PACK_LIST); \
fi
$(Q)for track in $(TRACKING_DIR)/*-*; do \
if [ -f $$track ]; then \
pack=$$(echo $$track | sed 's@.*/\(.*\)-[0-9c].*@\1@') && \
version=$$(echo $$track | sed 's@.*-\([0-9c].*\)@\1@') && \
xsltproc --stringparam packages $(PACK_LIST) \
--stringparam package $$pack \
--stringparam version $$version \
-o track.tmp $(XSLDIR)/bump.xsl $@ && \
sed -i 's@PACKDESC@$(TOPDIR)/packdesc.dtd@' track.tmp && \
xmllint --format --postvalid track.tmp > $@; \
fi; \
done; \
rm -f track.tmp
$(TRACKING_DIR):
@echo Creating $(TRACKING_DIR)
$(Q)mkdir -p $@
$(XSLDIR)/specialCases.xsl: $(TOPDIR)/gen-special.sh $(BLFS_FULL)
$(Q)$(TOPDIR)/gen-special.sh $(BLFS_FULL) $@
$(BLFS_FULL): $(BLFS_XML) $(BLFS_XML)/general.ent $(ALLXML) $(ALLXSL)
@echo "Validating the book..."
$(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
$(Q)xmllint --nonet --noent --xinclude --postvalid \
-o $@ $(BLFS_XML)/index.xml
all: update $(BOOK_XML)
update: $(BLFS_XML)
@echo Updating the book sources
$(Q)cd $(BLFS_XML) && svn up
$(BLFS_XML):
@echo Getting the book sources...
$(Q)svn co $(SVN) $@
# Clean up # Clean up
clean: clean:
rm -f configuration configuration.old error rm -f $(CONFIG_OUT) $(CONFIG_OUT).old $(TOPDIR)/packages.xml $(XSLDIR)/specialCases.xsl $(CONFIG_CONFIG_IN) book.xml
- $(MAKE) -C $(CONFIG) clean rm -rf $(TOPDIR)/dependencies $(TOPDIR)/book-html $(TOPDIR)/scripts
- $(MAKE) -C $(MENU) clean
clean-target: .PHONY: clean all update $(CONFIG_OUT)
rm -f error
- $(MAKE) -C $(CONFIG) clean
.PHONY: all menuconfig config clean clean-target $(CONFIG)/conf $(CONFIG)/mconf

View file

@ -16,7 +16,7 @@ export LC_ALL=C
#--- The local repository for packages/file #--- The local repository for packages/file
# Any missing file will be downloaded and archived here, # Any missing file will be downloaded and archived here,
# if the user has the right priviledges. # if the user has the right priviledges.
export SRC_ARCHIVE=$SRC_ARCHIVE export SRC_ARCHIVE=/sources
#--- Server used if the file isn't found in SRC_ARCHIVE. #--- Server used if the file isn't found in SRC_ARCHIVE.
# As a last resort, the file will dowloaded from upstream, if possible. # As a last resort, the file will dowloaded from upstream, if possible.
@ -25,11 +25,13 @@ export SRC_ARCHIVE=$SRC_ARCHIVE
# http://www.linuxfromscratch.org/blfs/download.html # http://www.linuxfromscratch.org/blfs/download.html
export FTP_SERVER=ftp://anduin.linuxfromscratch.org/BLFS/ export FTP_SERVER=ftp://anduin.linuxfromscratch.org/BLFS/
# 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. #--- The sources directory.
# Full path to the top level directory where packages will be stored, # Full path to the top level directory where packages will be stored,
# unpacked, and compiled. # unpacked, and compiled.
export SRC_DIR=$HOME/sources export SRC_DIR=/sources
#======== Xorg7 envars =========== #======== Xorg7 envars ===========
@ -38,14 +40,29 @@ export SRC_DIR=$HOME/sources
export XORG_PREFIX=/usr export XORG_PREFIX=/usr
#--- Configure switches #--- Configure switches
export XORG_CONFIG="--prefix=$XORG_PREFIX --sysconfdir=/etc --mandir=$XORG_PREFIX/share/man --localstatedir=/var" export XORG_CONFIG="--prefix=$XORG_PREFIX --sysconfdir=/etc \
--localstatedir=/var --disable-static"
#======== GNOME envars =========== #======== 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 #--- Installation prefix
export GNOME_PREFIX=/usr # 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 standart prefix, uncomment #--- If you want to install GNOME on a non standard prefix, uncomment
# the next export lines and edit it if needed. # the next export lines and edit it if needed.
# See also the GNOME Pre-installation Configuration HTML page for # See also the GNOME Pre-installation Configuration HTML page for
# aditional required commands. # aditional required commands.
@ -55,17 +72,36 @@ export GNOME_PREFIX=/usr
#======== KDE envars ============= #======== 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 #--- Installation prefix
export KDE_PREFIX=/usr export KDE_PREFIX=/usr
#--- If you want to install KDE on a non standart prefix, uncomment #--- If you want to install KDE on a non standard prefix, uncomment
# the next export lines and edit it if needed. # the next lines and edit them as needed.
# See also the KDE Pre-installation Configuration HTML page for #export KDE_PREFIX=/opt/kde
# aditional required commands. #export KDEDIR=$KDE_PREFIX
#export PATH=$PATH:$KDE_PREFIX/bin
#export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$KDE_PREFIX/lib/pkgconfig
#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
#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
#======== Optimizations ============= #======== Optimizations =============
@ -79,7 +115,7 @@ export KDE_PREFIX=/usr
# expected, please rebuild without optimizations before # expected, please rebuild without optimizations before
# asking for support. # asking for support.
#export MAKEFLAGS="-j3" export MAKEFLAGS="-j5"
#export CFLAGS="-O3 -pipe" #export CFLAGS="-O3 -pipe"
#export CXXFLAGS=$CFLAGS #export CXXFLAGS=$CFLAGS
@ -89,3 +125,10 @@ export KDE_PREFIX=/usr
#export OTHER_CXXFLAGS=$CXXFLAGS #export OTHER_CXXFLAGS=$CXXFLAGS
#export OTHER_LDFLAGS=$LDFLAGS #export OTHER_LDFLAGS=$LDFLAGS
#======== Environment settings ========
# Since the startup files may be changed in the course
# of a build, ensure that environment variables are
# up to date
if [ -r /etc/profile ]; then source /etc/profile; fi

View file

@ -4,11 +4,15 @@
# #
set -e set -e
# TEMPORARY VARIABLES.. development use only declare TOPDIR='..'
declare ATOPDIR=`cd $TOPDIR; pwd`
declare MKFILE=Makefile declare MKFILE=Makefile
declare PREV_PACKAGE="" declare PREV_PACKAGE=""
declare BUILD_SCRIPTS=scripts declare BUILD_SCRIPTS=${TOPDIR}/scripts
declare TRACKING_DIR=tracking-dir declare TRACKING_FILE=tracking-dir/instpkg.xml
declare XSLDIR=${TOPDIR}/xsl
declare PACK_FILE=${TOPDIR}/packages.xml
declare BUMP=${XSLDIR}/bump.xsl
HEADER="# This file is automatically generated by gen-makefile.sh HEADER="# This file is automatically generated by gen-makefile.sh
# YOU MAY NEED TO EDIT THIS FILE MANUALLY # YOU MAY NEED TO EDIT THIS FILE MANUALLY
@ -38,7 +42,7 @@ __write_build_cmd() { #
#----------------------------------# #----------------------------------#
( (
cat << EOF cat << EOF
@source ../envars.conf && ${BUILD_SCRIPTS}/\$@ >logs/\$@ 2>&1 @source ${TOPDIR}/envars.conf && ${BUILD_SCRIPTS}/\$@ >logs/\$@ 2>&1
EOF EOF
) >> $MKFILE.tmp ) >> $MKFILE.tmp
} }
@ -47,50 +51,17 @@ EOF
__wrt_touch() { # __wrt_touch() { #
#----------------------------------# #----------------------------------#
local pkg_name=$1 local pkg_name=$1
local pkg_ver=$2
local alsa_ver=$(grep "^alsa[[:space:]]" ../packages | cut -f3)
local kde_core_ver=$(grep "^kde-core[[:space:]]" ../packages | cut -f3)
local xorg7_ver=$(grep "^xorg7[[:space:]]" ../packages | cut -f3)
if [[ -n "$pkg_ver" ]] ; then
(
cat << EOF
@rm -f \$(TRACKING_DIR)/${pkg_name#*-?-}-{0..9}* && \\
touch \$(TRACKING_DIR)/${pkg_name#*-?-}-${pkg_ver}
EOF
) >> $MKFILE.tmp
fi
case $pkg_name in
*-alsa-lib ) #this the unique mandatory package for ALSA support.
(
cat << EOF
@rm -f \$(TRACKING_DIR)/alsa-{0..9}* && \\
touch \$(TRACKING_DIR)/alsa-${alsa_ver}
EOF
) >> $MKFILE.tmp
;;
*-kdebase )
(
cat << EOF
@rm -f \$(TRACKING_DIR)/kde-core-{0..9}* && \\
touch \$(TRACKING_DIR)/kde-core-${kde_core_ver}
EOF
) >> $MKFILE.tmp
;;
*-xorg7-driver ) # xtrerm2 and rman are optional
(
cat << EOF
@rm -f \$(TRACKING_DIR)/xorg7-{0..9}* && \\
touch \$(TRACKING_DIR)/xorg7-${xorg7_ver}
EOF
) >> $MKFILE.tmp
;;
esac
( (
cat << EOF cat << EOF
@touch \$@ && \\ @xsltproc --stringparam packages ${PACK_FILE} \\
--stringparam package ${pkg_name#*-?-} \\
-o track.tmp \\
${BUMP} \$(TRACKING_FILE) && \\
sed -i 's@PACKDESC@${ATOPDIR}/packdesc.dtd@' track.tmp && \\
xmllint --format --postvalid track.tmp > \$(TRACKING_FILE) && \\
rm track.tmp && \\
touch \$@ && \\
sleep .25 && \\ sleep .25 && \\
echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\ echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE) echo --------------------------------------------------------------------------------\$(WHITE)
@ -103,7 +74,6 @@ EOF
__write_entry() { # __write_entry() { #
#----------------------------# #----------------------------#
local script_name=$1 local script_name=$1
local pkg_ver=$2
echo -n "${tab_}${tab_} entry for <$script_name>" echo -n "${tab_}${tab_} entry for <$script_name>"
@ -118,7 +88,7 @@ __write_entry() { #
# Include a touch of the target name so make can check # Include a touch of the target name so make can check
# if it's already been made. # if it's already been made.
__wrt_touch "${script_name}" "${pkg_ver}" __wrt_touch "${script_name}"
# #
#--------------------------------------------------------------------# #--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< # # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -126,50 +96,6 @@ __write_entry() { #
echo " .. OK" echo " .. OK"
} }
#----------------------------#
__write_meta_pkg_touch() { #
#----------------------------#
local meta_pkg=$1
local pkg_ver=$(grep "^${meta_pkg}[[:space:]]" ../packages | cut -f3)
local gnome_core_ver=$(grep "^gnome-core[[:space:]]" ../packages | cut -f3)
local kde_full_ver=$(grep "^kde-full[[:space:]]" ../packages | cut -f3)
(
cat << EOF
999-z-$meta_pkg: $PREV_PACKAGE
@rm -f \$(TRACKING_DIR)/${meta_pkg}-{0..9}* && \\
touch \$(TRACKING_DIR)/${meta_pkg}-${pkg_ver}
EOF
) >> $MKFILE.tmp
case $meta_pkg in
gnome-full )
(
cat << EOF
@rm -f \$(TRACKING_DIR)/gnome-core-{0..9}* && \\
touch \$(TRACKING_DIR)/gnome-core-${gnome_core_ver}
EOF
) >> $MKFILE.tmp
;;
kde-koffice )
(
cat << EOF
@rm -f \$(TRACKING_DIR)/kde-full-{0..9}* && \\
touch \$(TRACKING_DIR)/kde-full-${kde_full_ver}
EOF
) >> $MKFILE.tmp
;;
esac
(
cat << EOF
@touch \$@
EOF
) >> $MKFILE.tmp
}
#----------------------------# #----------------------------#
generate_Makefile () { # generate_Makefile () { #
#----------------------------# #----------------------------#
@ -182,36 +108,18 @@ generate_Makefile () { #
>$MKFILE.tmp >$MKFILE.tmp
for package_script in scripts/* ; do for package_script in ${BUILD_SCRIPTS}/* ; do
this_script=`basename $package_script` this_script=`basename $package_script`
pkg_ver=$(grep "^${this_script#*-?-}[[:space:]]" ../packages | cut -f3)
pkg_list="$pkg_list ${this_script}" pkg_list="$pkg_list ${this_script}"
__write_entry "${this_script}" "${pkg_ver}" __write_entry "${this_script}"
PREV_PACKAGE=${this_script} PREV_PACKAGE=${this_script}
done done
PACKAGE=$(basename $PWD)
# alsa, kde-core and xorg7 are also available dependencies, thus handled
# in another way.
case $PACKAGE in
gnome-core | \
gnome-full | \
kde-full | \
kde-koffice ) pkg_list="$pkg_list 999-z-${PACKAGE}"
__write_meta_pkg_touch "${PACKAGE}"
;;
esac
# Add a header, some variables and include the function file
# to the top of the real Makefile.
( (
cat << EOF cat << EOF
$HEADER $HEADER
PACKAGE= $PACKAGE TRACKING_FILE= $TRACKING_FILE
TRACKING_DIR= $TRACKING_DIR
BOLD= "" BOLD= ""
RED= "" RED= ""
@ -228,7 +136,7 @@ define echo_message
endef endef
define fin_message define end_message
@echo \$(BOLD) @echo \$(BOLD)
@echo -------------------------------------------------------------------------------- @echo --------------------------------------------------------------------------------
@echo \$(BOLD) Build complete for the package \$(BLUE)\$(PACKAGE)\$(BOLD) and its dependencies @echo \$(BOLD) Build complete for the package \$(BLUE)\$(PACKAGE)\$(BOLD) and its dependencies
@ -236,7 +144,7 @@ define fin_message
endef endef
all : $pkg_list all : $pkg_list
@\$(call fin_message ) @\$(call end_message )
EOF EOF
) > $MKFILE ) > $MKFILE
@ -247,18 +155,16 @@ EOF
} }
if [[ -e Config.in ]] ; then if [[ ! -d ${BUILD_SCRIPTS} ]] ; then
echo -e "\n\tThis script must be run from inside a target package directory.\n" echo -e "\n\tThe \'${BUILD_SCRIPTS}\' directory has not been found.\n"
exit 1 exit 1
fi fi
if [[ ! -d scripts ]] ; then # Let us make a clean base:
echo -e "\n\tNo ./scripts/ directory has been found.\n" rm -rf *
exit 1
fi
generate_Makefile generate_Makefile
cp ../progress_bar.sh . cp ${TOPDIR}/progress_bar.sh .
mkdir -p logs mkdir -p logs

230
BLFS/gen-special.sh Executable file
View file

@ -0,0 +1,230 @@
#!/bin/bash
# $Id: gen-special.sh 21 2012-02-16 15:06:19Z labastie $
#-------------------------------------------------------------------------
# generates an xsl stylesheet containing a template for special
# cases in the book:
# - If the version does not begin with a number, it is impossible to know
# where the package name ends and where the version begins. We therefore
# use the ENTITY at the beginning of the validated full-xml.
# - If a package is part of a group of xorg packages (proto, fonts, etc)
# there is no easy way to extract it from the xml. We use the ENTITY at
# the top of each file x7*.xml
# - If a pacakge is versioned but the version is not mentioned in the book
# (currently only udev), we retrieve the version by other means
#-------------------------------------------------------------------------
# Arguments:
# $1 contains the name of the validated xml book
# $2 contains the name of the ouput xsl file
# $3 contains the name of the book sources directory
#-------------------------------------------------------------------------
BLFS_XML=$1
if ! test -f ${BLFS_XML}; then
echo File \`${BLFS_XML}\' does not exist
exit 1
fi
SPECIAL_FILE=$2
if test -z "${SPECIAL_FILE}"; then SPECIAL_FILE=specialCases.xsl;fi
BLFS_DIR=$3
if test -z "${BLFS_DIR}"; then BLFS_DIR=$(cd $(dirname ${BLFS_XML})/.. ; pwd);fi
# Packages whose version does not begin with a number
EXCEPTIONS=$(grep 'ENTITY.*version[ ]*"[^0-9"&.].*[0-9]' $BLFS_XML |
sed 's@^[^"]*"\([^"]*\)".*@\1@')
# Set PATH to be sure to find udevadm
SAVPATH=$PATH
PATH=/bin:/sbin:/usr/bin:/usr/sbin
UDEVVERSION=$(udevadm --version)
cat >$SPECIAL_FILE << EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match='*' mode="special">
<xsl:choose>
<xsl:when test="contains(@id,'udev')">
<xsl:text> </xsl:text>
<package><xsl:text>&#xA; </xsl:text>
<xsl:element name="name"><xsl:value-of select="@id"/></xsl:element>
<xsl:text>&#xA; </xsl:text>
<xsl:element name="version">$UDEVVERSION</xsl:element>
<xsl:if
test="document(\$installed-packages)//package[name=current()/@id]">
<xsl:text>&#xA; </xsl:text>
<xsl:element name="inst-version">
<xsl:value-of
select="document(\$installed-packages
)//package[name=current()/@id]/version"/>
</xsl:element>
</xsl:if>
<!-- Dependencies -->
<xsl:apply-templates select=".//para[@role='required' or
@role='recommended' or
@role='optional']"
mode="dependency"/>
<!-- End dependencies -->
<xsl:text>&#xA; </xsl:text>
</package><xsl:text>&#xA;</xsl:text>
</xsl:when>
<!-- Although versioned, this page is not a package -->
<xsl:when test="@id='xorg7'"/>
EOF
# Taking packages inside x7proto etc, as versionned modules.
# We also write a dependency expansion when a dep is of the form
# xorg7-something. Since that is another template, we need
# a temporary file, which we shall concatenate at the end
cat >tmpfile << EOF
<xsl:template name="expand-deps">
<xsl:param name="section"/>
<xsl:param name="status"/>
<xsl:choose>
EOF
for file in $(ls ${BLFS_DIR}/x/installing/x7* | grep -v x7driver); do
id=$(grep xreflabel $file | sed 's@.*id="\([^"]*\).*@\1@')
cat >>$SPECIAL_FILE << EOF
<xsl:when test="@id='$id'">
<xsl:text> </xsl:text>
<package><xsl:text>&#xA; </xsl:text>
<xsl:element name="name">$id</xsl:element>
<xsl:text>&#xA; </xsl:text>
EOF
cat >> tmpfile << EOF
<xsl:when test="\$section='$id'">
EOF
# We extract the list of packages for an xorg page from
# the version part of the .xml file. Seems that
# the order is not always the same as in the "cat" command.
# So we have to read that command too, since it may be assumed
# 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/-$//')"
# 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
# are separators.
for pack in \
$(grep 'ENTITY.*version' $file | sed 's/[ ]\+/,/g'); do
packname=$(echo $pack | sed s'@.*ENTITY,\(.*\)-version.*@\1@')
packversion=$(echo $pack | sed 's@[^"]*"\([^"]*\).*@\1@')
precpack=NONE
for i in $list_cat; do
if [ "$i" = "$packname" ]; then break; fi
precpack=$i
done
cat >>$SPECIAL_FILE << EOF
<module><xsl:text>&#xA; </xsl:text>
<xsl:element name="name">$packname</xsl:element>
<xsl:element name="version">$packversion</xsl:element>
<xsl:if test="document(\$installed-packages)//package[name='$packname']">
<xsl:element name="inst-version">
<xsl:value-of
select="document(\$installed-packages
)//package[name='$packname']/version"/>
</xsl:element>
</xsl:if>
<!-- Dependencies -->
EOF
if test $precpack != NONE; then
cat >>$SPECIAL_FILE << EOF
<xsl:element name="dependency">
<xsl:attribute name="status">required</xsl:attribute>
<xsl:attribute name="name">$precpack</xsl:attribute>
<xsl:attribute name="type">ref</xsl:attribute>
</xsl:element>
EOF
else
cat >>$SPECIAL_FILE << EOF
<xsl:apply-templates select=".//para[@role='required' or
@role='recommended' or
@role='optional']"
mode="dependency"/>
EOF
fi
cat >>$SPECIAL_FILE << EOF
<!-- End dependencies -->
</module>
EOF
cat >> tmpfile << EOF
<xsl:element name="dependency">
<xsl:attribute name="status">
<xsl:value-of select="\$status"/>
</xsl:attribute>
<xsl:attribute name="name">$packname</xsl:attribute>
<xsl:attribute name="type">ref</xsl:attribute>
</xsl:element>
EOF
done
cat >>$SPECIAL_FILE << EOF
</package>
</xsl:when>
EOF
cat >> tmpfile << EOF
</xsl:when>
EOF
done
for ver_ent in $EXCEPTIONS; do
id=$(grep 'xreflabel=".*'$ver_ent $BLFS_XML | sed 's@.*id="\([^"]*\)".*@\1@')
[[ -z $id ]] && continue
cat >>$SPECIAL_FILE << EOF
<xsl:when test="@id='$id'">
<xsl:text> </xsl:text>
<package><xsl:text>&#xA; </xsl:text>
<xsl:element name="name">$id</xsl:element>
<xsl:text>&#xA; </xsl:text>
<xsl:element name="version">$ver_ent</xsl:element>
<xsl:if
test="document(\$installed-packages)//package[name=current()/@id]">
<xsl:text>&#xA; </xsl:text>
<xsl:element name="inst-version">
<xsl:value-of
select="document(\$installed-packages
)//package[name=current()/@id]/version"/>
</xsl:element>
</xsl:if>
<!-- Dependencies -->
<xsl:apply-templates select=".//para[@role='required' or
@role='recommended' or
@role='optional']"
mode="dependency"/>
<!-- End dependencies -->
<xsl:text>&#xA; </xsl:text>
</package><xsl:text>&#xA;</xsl:text>
</xsl:when>
EOF
done
cat >>$SPECIAL_FILE << EOF
<xsl:otherwise>
<xsl:apply-templates
select="self::node()[contains(translate(@xreflabel,
'123456789',
'000000000'),
'-0')
]"
mode="normal"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
EOF
cat $SPECIAL_FILE tmpfile > tmpfile1
mv tmpfile1 $SPECIAL_FILE
rm tmpfile
cat >> $SPECIAL_FILE << EOF
<xsl:otherwise>
<xsl:message>
<xsl:text>You should not be seeing this</xsl:text>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
EOF

View file

@ -1,288 +0,0 @@
#!/bin/bash
#
# $Id$
#
export outFile=Config.in # file for reading and writing to.
export inFile=packages # file for reading and writing to.
declare PKG_NAME
declare PKG_XML_FILE
declare PKG_DIR
declare PKG_VER
declare INST_VER
declare INST_STRING
declare SAVE_IFS=${IFS}
declare -a DIR_TREE
declare PREV_DIR1="none"
declare PREV_DIR2="none"
declare MENU_SET1="n"
declare MENU_SET2="n"
> $outFile
#---------------------#
# MAIN #
#---------------------#
: <<enddoc
This script will create a Config.in file from the contents
of the file <packages>.
Packages previously installed will not be included.
enddoc
echo -en "\tGenerating Config.in from package data ..."
while [ 0 ]
do
# read -r || break 1
read || break 1
set -- $REPLY
PKG_NAME=$1
PKG_XML_FILE=$(basename $2)
PKG_DIR=$(dirname $2)
PKG_VER=$3
INST_VER=$4
# These are the META packages.
if [ $PKG_DIR = "." ]; then
SET_COMMENT=y
# Do not include previously installed packages
if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" = "x${INST_VER}" ]]; then
continue
fi
# Do not include installed packages newer than the book ones
if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" < "x${INST_VER}" ]]; then
continue
fi
# Set installed version for updated meta-packages
[ -n "${INST_VER}" ] && INST_STRING="[installed ${INST_VER}]"
META_PKG=$(echo ${PKG_NAME} | tr [a-z] [A-Z])
(
cat << EOF
config CONFIG_$META_PKG
bool "$META_PKG $PKG_VER $INST_STRING"
default n
menu "$(echo ${PKG_NAME} | tr [a-z] [A-Z]) components"
depends CONFIG_$META_PKG
EOF
) >> $outFile
unset INST_STRING
# Include the dependency data for this meta package
while [ 0 ]; do
read || break 1
PKG_NAME=${REPLY}
PKG_VER=$(grep "^${PKG_NAME}[[:space:]]" $inFile | cut -f3)
INST_VER=$(grep "^${PKG_NAME}[[:space:]]" $inFile | cut -f4)
# Skip installed meta-package components
if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" = "x${INST_VER}" ]]; then
continue
fi
# Do not include installed packages newer than the book ones
if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" < "x${INST_VER}" ]]; then
continue
fi
# Set installed version for updated meta-packages components
[ -n "${INST_VER}" ] && INST_STRING="[installed ${INST_VER}]"
(
cat << EOF
config DEP_${META_PKG}_${PKG_NAME}
bool "$PKG_NAME ${PKG_VER} ${INST_STRING}"
default y
EOF
) >> $outFile
unset INST_STRING
done <./libs/${PKG_NAME}.dep
echo -e "endmenu" >> $outFile
continue
fi
[[ "${SET_COMMENT}" = "y" ]] && echo "comment \"\"" >>$outFile; unset SET_COMMENT
# Deal with targets that are part of a meta-package but that are in the same
# directory that non meta-package targets
case ${PKG_NAME} in
alsa-* | \
xorg7-* | \
x-config | \
x-setup | \
libXau | \
libxcb | \
libXdmcp | \
luit | \
xbitmaps | \
xcb-proto | \
xkeyboard-config | \
mesalib | \
libdrm ) continue ;;
esac
# Skip installed packages
if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" = "x${INST_VER}" ]]; then
continue
fi
# Do not include installed packages newer than the book ones
if [ -n "${PKG_VER}" ] && [[ "x${PKG_VER}" < "x${INST_VER}" ]]; then
continue
fi
# Set installed version for updated packages
[ -n "${INST_VER}" ] && INST_STRING="[installed ${INST_VER}]"
IFS="/"
DIR_TREE=(${PKG_DIR})
IFS="$SAVE_IFS"
# Define a top level menu
if [ "$PREV_DIR1" != "${DIR_TREE[1]}" ]; then
[[ "${DIR_TREE[1]}" = "kde" ]] && continue
[[ "${DIR_TREE[1]}" = "gnome" ]] && continue
if [ $MENU_SET1 = "y" ]; then
# Close out any open secondary menu
if [ $MENU_SET2 = "y" ]; then
echo -e "\tendmenu" >> $outFile
# Reset 'menu open' flag
MENU_SET2="n"
fi
# Close the current top level menu
echo -e "endmenu\n" >> $outFile
fi
# Open a new top level menu
echo -e "menu "$(echo ${DIR_TREE[1]:0:1} | tr [a-z] [A-Z])${DIR_TREE[1]:1}"" >> $outFile
MENU_SET1="y"
fi
# Define a secondary menu
if [ "$PREV_DIR2" != "${DIR_TREE[2]}" ]; then
# Close out the previous open menu structure
if [ $MENU_SET2 = "y" ]; then
echo -e "\tendmenu\n" >> $outFile
fi
# Initialize a new 2nd level menu structure.
echo -e "\tmenu "$(echo ${DIR_TREE[2]:0:1} | tr [a-z] [A-Z])${DIR_TREE[2]:1}"" >> $outFile
MENU_SET2="y"
fi
(
cat << EOF
config CONFIG_$PKG_NAME
bool "$PKG_NAME ${PKG_VER} ${INST_STRING}"
default n
EOF
) >> $outFile
unset INST_STRING
PREV_DIR1=${DIR_TREE[1]}
PREV_DIR2=${DIR_TREE[2]}
done <"$inFile"
if [ $MENU_SET2 = "y" ]; then echo -e "\tendmenu" >> $outFile; fi
if [ $MENU_SET1 = "y" ]; then echo "endmenu" >> $outFile; fi
(
cat << EOF
comment ""
menu "Default packages for resolving dependencies"
choice
prompt "Default print server"
config PS_cups
bool "cups"
config PS_LPRng
bool "LPRng"
endchoice
config PRINT_SERVER
string
default cups if PS_cups
default LPRng if PS_LPRng
choice
prompt "Mail server"
config MS_sendmail
bool "sendmail"
config MS_postfix
bool "postfix"
config MS_exim
bool "exim"
endchoice
config MAIL_SERVER
string
default sendmail if MS_sendmail
default postfix if MS_postfix
default exim if MS_exim
choice
prompt "Postscript package"
config GS_espgs
bool "espgs"
config GS_ghostscript
bool "ghostscript"
endchoice
config GHOSTSCRIPT
string
default espgs if GS_espgs
default ghostscript if GS_ghostscript
choice
prompt "Kerberos 5"
config KER_mitkrb
bool "mitkrb"
config KER_heimdal
bool "heimdal"
endchoice
config KBR5
string
default heimdal if KER_heimdal
default mitkrb if KER_mitkrb
choice
prompt "Window package"
config WIN_xorg7
bool "Xorg7"
config WIN_xfree86
bool "xfree86"
endchoice
config X11
string
default xorg7 if WIN_xorg7
default xfree86 if WIN_xfree86
endmenu
choice
prompt "Dependency level"
default DEPLVL_2
config DEPLVL_1
bool "Required dependencies only"
config DEPLVL_2
bool "Required and recommended dependencies"
config DEPLVL_3
bool "Required, recommended and optional dependencies"
endchoice
config optDependency
int
default 1 if DEPLVL_1
default 2 if DEPLVL_2
default 3 if DEPLVL_3
config SUDO
bool "Build as User"
default y
help
Select if sudo will be used (you want build as a normal user)
otherwise sudo is not needed (you want build as root)
EOF
) >> $outFile
echo "done"

View file

@ -6,22 +6,34 @@
# #
set -e set -e
declare -r ConfigFile="configuration" TOPDIR=$1
declare TARGET if test -z "$TOPDIR"; then
TOPDIR=$(pwd)
fi
BLFS_FULL=$2
if test -z "$BLFS_FULL"; then
BLFS_FULL=${TOPDIR}/blfs-xml/tmp/blfs-full.xml
fi
declare -r ConfigFile="${TOPDIR}/configuration"
declare DepDir="${TOPDIR}/dependencies"
declare LibDir="${TOPDIR}/libs"
declare PackFile="${TOPDIR}/packages.xml"
declare BookXml="${TOPDIR}/book.xml"
declare MakeBook="${TOPDIR}/xsl/make_book.xsl"
declare MakeScripts="${TOPDIR}/xsl/scripts.xsl"
declare BookHtml="${TOPDIR}/book-html"
declare BLFS_XML="${TOPDIR}/blfs-xml"
declare -a TARGET
declare DEP_LEVEL declare DEP_LEVEL
declare SUDO declare SUDO
declare PKGXML
declare BLFS_XML
declare VERBOSITY=1
#--------------------------# #--------------------------#
parse_configuration() { # parse_configuration() { #
#--------------------------# #--------------------------#
local cntr local -i cntr=0
local optTARGET local -a optTARGET
while [ 0 ]; do while read; do
read || break 1
# Garbage collection # Garbage collection
case ${REPLY} in case ${REPLY} in
@ -29,51 +41,25 @@ parse_configuration() { #
esac esac
case "${REPLY}" in case "${REPLY}" in
CONFIG_ALSA=* | \
CONFIG_GNOME-CORE=* | \
CONFIG_GNOME-FULL=* | \
CONFIG_KDE-CORE=* | \
CONFIG_KDE-FULL=* | \
CONFIG_KDE-KOFFICE=* | \
CONFIG_XORG7=* ) REPLY=${REPLY%=*} # Strip the trailing '=y' test.. unecessary
echo -n "${REPLY}"
if [[ $((++cntr)) > 1 ]]; then
echo " <<-- ERROR:: SELECT ONLY 1 PACKAGE AT A TIME, META-PACKAGE NOT SELECTED"
else
echo ""
optTARGET=$(echo $REPLY | cut -d "_" -f2 | tr [A-Z] [a-z])
fi
continue ;;
# Create global variables for these parameters. # Create global variables for these parameters.
optDependency=* | \ optDependency=* | \
PRINT_SERVER=* | \
MAIL_SERVER=* | \ MAIL_SERVER=* | \
GHOSTSCRIPT=* | \
KBR5=* | \
X11=* | \
SUDO=* ) eval ${REPLY} # Define/set a global variable.. SUDO=* ) eval ${REPLY} # Define/set a global variable..
continue ;; continue ;;
esac esac
if [[ "${REPLY}" =~ ^CONFIG_ ]]; then if [[ "${REPLY}" =~ ^CONFIG_ ]]; then
echo -n "$REPLY" echo "$REPLY"
if [[ $((++cntr)) > 1 ]]; then optTARGET[$((cntr++))]=$( echo $REPLY | sed -e 's@CONFIG_@@' -e 's@=y@@' )
echo " <<-- ERROR SELECT ONLY 1 PACKAGE AT A TIME, WILL NOT BUILD"
else
echo ""
optTARGET=$( echo $REPLY | sed -e 's@CONFIG_@@' -e 's@=y@@' )
fi
fi fi
done <$ConfigFile done < $ConfigFile
if [[ $optTARGET = "" ]]; then if (( $cntr == 0 )); then
echo -e "\n>>> NO TARGET SELECTED.. applicaton terminated" echo -e "\n>>> NO TARGET SELECTED.. application terminated"
echo -e " Run <make> again and select a package to build\n" echo -e " Run <make> again and select (a) package(s) to build\n"
exit 0 exit 0
fi fi
TARGET=(${optTARGET[*]})
TARGET=$optTARGET
DEP_LEVEL=$optDependency DEP_LEVEL=$optDependency
SUDO=${SUDO:-n} SUDO=${SUDO:-n}
} }
@ -82,43 +68,32 @@ parse_configuration() { #
validate_configuration() { # validate_configuration() { #
#--------------------------# #--------------------------#
local -r dotSTR=".................." local -r dotSTR=".................."
local -r PARAM_LIST="TARGET DEP_LEVEL SUDO PRINT_SERVER MAIL_SERVER GHOSTSCRIPT KBR5 X11" local -r PARAM_LIST="DEP_LEVEL SUDO MAIL_SERVER"
local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}' local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}'
local config_param local config_param
local -i index
for config_param in ${PARAM_LIST}; do for config_param in ${PARAM_LIST}; do
echo -e "`eval echo $PARAM_VALS`" echo -e "`eval echo $PARAM_VALS`"
done done
for (( index=0 ; index < ${#TARGET[*]} ; index ++ )); do
echo -e "TARGET${index}${dotSTR:6} ${L_arrow}${BOLD}${TARGET[${index}]}${OFF}${R_arrow}"
done
} }
# #
# Regenerate the META-package dependencies from the configuration file # Generates the root of the dependency tree
# #
#--------------------------# #--------------------------#
regenerate_deps() { # generate_deps() { #
#--------------------------# #--------------------------#
rm -f libs/*.dep-MOD local -i index
while [ 0 ]; do local DepDir=$1
read || break 1 rm -f $DepDir/*.dep
case ${REPLY} in echo 1 > $DepDir/root.dep
\#* | '') continue ;; for (( index=0 ; index < ${#TARGET[*]} ; index ++ )); do
esac echo ${TARGET[${index}]} >> $DepDir/root.dep
# Drop the "=y"
REPLY=${REPLY%=*}
if [[ "${REPLY}" =~ ^DEP_ ]]; then
META_PACKAGE=$(echo $REPLY | cut -d "_" -f2 | tr [A-Z] [a-z])
DEP_FNAME=$(echo $REPLY | cut -d "_" -f3)
echo "${DEP_FNAME}" >>libs/${META_PACKAGE}.dep-MOD
fi
done <$ConfigFile
#
# Replace to 'old' dependency file with a new one.
#
for dst in `ls ./libs/*.dep-MOD 2>/dev/null`; do
cp -vf $dst ${dst%-MOD}
done done
} }
@ -131,29 +106,23 @@ regenerate_deps() { #
clean_configuration() { # clean_configuration() { #
#--------------------------# #--------------------------#
tail -n 29 configuration > configuration.tmp tail -n 15 ${ConfigFile} > ${ConfigFile}.tmp
mv configuration.tmp configuration mv ${ConfigFile}.tmp ${ConfigFile}
} }
#--------------------- #---------------------
# Constants # Constants
source libs/constants.inc source ${LibDir}/constants.inc
[[ $? > 0 ]] && echo -e "\n\tERROR: constants.inc did not load..\n" && exit [[ $? > 0 ]] && echo -e "\n\tERROR: constants.inc did not load..\n" && exit
#--------------------- #---------------------
# Dependencies module # Dependencies module
source libs/func_dependencies source ${LibDir}/func_dependencies
[[ $? > 0 ]] && echo -e "\n\tERROR: func_dependencies did not load..\n" && exit [[ $? > 0 ]] && echo -e "\n\tERROR: func_dependencies did not load..\n" && exit
#---------------------
# parser module
source libs/func_parser
[[ $? > 0 ]] && echo -e "\n\tERROR: func_parser did not load..\n" && exit
#------- MAIN -------- #------- MAIN --------
if [[ ! -f packages ]] ; then if [[ ! -f ${PackFile} ]] ; then
echo -e "\tNo packages file has been found.\n" echo -e "\tNo packages file has been found.\n"
echo -e "\tExecution aborted.\n" echo -e "\tExecution aborted.\n"
exit 1 exit 1
@ -170,9 +139,48 @@ if [ x$ANSWER != "xyes" ] ; then
exit 1 exit 1
fi fi
echo "${nl_}${SD_BORDER}${nl_}" echo "${nl_}${SD_BORDER}${nl_}"
regenerate_deps
generate_dependency_tree rm -rf $DepDir
generate_TARGET_xml mkdir $DepDir
generate_target_book generate_deps $DepDir
create_build_scripts "${SUDO}" pushd $DepDir > /dev/null
clean_configuration set +e
generate_dependency_tree root.dep
echo
LIST="$(tree_browse root.dep)"
set -e
popd > /dev/null
rm -f ${BookXml}
echo Making XML book
xsltproc --stringparam list "$LIST" \
-o ${BookXml} \
${MakeBook} \
$BLFS_FULL
echo "making HTML book (may take some time...)"
xsltproc -o ${BookHtml}/ \
-stringparam chunk.quietly 1 \
${BLFS_XML}/stylesheets/blfs-chunked.xsl \
${BookXml}
if [ ! -d ${BookHtml}/stylesheets ]
then mkdir -p ${BookHtml}/stylesheets
cp ${BLFS_XML}/stylesheets/lfs-xsl/*.css ${BookHtml}/stylesheets
fi
if [ ! -d ${BookHtml}/images ]
then mkdir -p ${BookHtml}/images
cp ${BLFS_XML}/images/*.png ${BookHtml}/images
fi
for ht in ${BookHtml}/*.html
do sed -i 's@../stylesheets@stylesheets@' $ht
sed -i 's@../images@images@' $ht
done
echo -en "\n\tGenerating the build scripts ...\n"
rm -rf scripts
xsltproc --xinclude --nonet \
--stringparam sudo $SUDO \
-o ./scripts/ ${MakeScripts} \
${BookXml}
# Make the scripts executable.
chmod -R +x scripts
echo -e "done\n"
#clean_configuration

View file

@ -1,105 +0,0 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
version="1.0">
<!-- $Id$ -->
<!-- NOTE: the base dir (blfs-xml) is set to the proper dir
via a sed in ./blfs -->
<xsl:import href="../blfs-xml/stylesheets/blfs-chunked.xsl"/>
<xsl:param name="mail_server" select="sendmail"/>
<xsl:param name="xwindow" select="xorg7"/>
<!-- Template from BLFS_XML/stylesheets/xhtml/lfs-xref.xsl.-->
<xsl:template match="xref" name="xref">
<!-- IDs that need be remaped to the proper file -->
<xsl:variable name="linkend">
<xsl:choose>
<xsl:when test="@linkend = 'alsa'">
<xsl:text>alsa-lib</xsl:text>
</xsl:when>
<xsl:when test="@linkend = 'arts'">
<xsl:text>aRts</xsl:text>
</xsl:when>
<xsl:when test="@linkend = 'kde'">
<xsl:text>kdelibs</xsl:text>
</xsl:when>
<xsl:when test="@linkend = 'server-mail'">
<xsl:value-of select="$mail_server"/>
</xsl:when>
<xsl:when test="@linkend = 'x-window-system'">
<xsl:value-of select="$xwindow"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@linkend"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="targets" select="key('id',$linkend)"/>
<!-- -->
<xsl:variable name="target" select="$targets[1]"/>
<xsl:variable name="refelem" select="local-name($target)"/>
<xsl:variable name="role" select="@role"/>
<xsl:call-template name="check.id.unique">
<xsl:with-param name="linkend" select="$linkend"/>
</xsl:call-template>
<xsl:call-template name="anchor"/>
<xsl:choose>
<!-- Dead links -->
<xsl:when test="count($target) = 0">
<b>
<xsl:value-of select="@linkend"/>
</b>
<tt>
<xsl:text> (in the full book)</xsl:text>
</tt>
</xsl:when>
<!-- -->
<xsl:when test="$target/@xreflabel">
<a>
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:attribute>
<xsl:call-template name="xref.xreflabel">
<xsl:with-param name="target" select="$target"/>
</xsl:call-template>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$target"/>
</xsl:call-template>
</xsl:variable>
<xsl:apply-templates select="$target" mode="xref-to-prefix"/>
<a href="{$href}">
<xsl:if test="$target/title or $target/*/title">
<xsl:attribute name="title">
<xsl:apply-templates select="$target" mode="xref-title"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="$target" mode="xref-to">
<xsl:with-param name="referrer" select="."/>
<xsl:with-param name="role" select="$role"/>
<xsl:with-param name="xrefstyle">
<xsl:value-of select="@xrefstyle"/>
</xsl:with-param>
</xsl:apply-templates>
</a>
<xsl:apply-templates select="$target" mode="xref-to-suffix"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View file

@ -1,47 +0,0 @@
<?xml version="1.0"?>
<!-- $Id$ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>
<xsl:param name="dependencies" select="2"/>
<xsl:template match="/">
<xsl:apply-templates select="//para[@role='optional']"/>
<xsl:apply-templates select="//para[@role='recommended']"/>
<xsl:apply-templates select="//para[@role='required']"/>
</xsl:template>
<xsl:template match="//text()"/>
<xsl:template match="para[@role='required']">
<xsl:apply-templates select="xref">
<xsl:sort select="position()" data-type="number" order="descending"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="para[@role='recommended']">
<xsl:if test="$dependencies != '1'">
<xsl:apply-templates select="xref">
<xsl:sort select="position()" data-type="number" order="descending"/>
</xsl:apply-templates>
</xsl:if>
</xsl:template>
<xsl:template match="para[@role='optional']">
<xsl:if test="$dependencies = '3'">
<xsl:apply-templates select="xref">
<xsl:sort select="position()" data-type="number" order="descending"/>
</xsl:apply-templates>
</xsl:if>
</xsl:template>
<xsl:template match="xref">
<xsl:value-of select="@linkend"/>
<xsl:text>&#xA;</xsl:text>
</xsl:template>
</xsl:stylesheet>

View file

@ -2,436 +2,195 @@
# #
# $Id$ # $Id$
# #
set -e
declare -i cntr=0 # A string of spaces for indenting:
declare -a spaceSTR=" " declare -a spaceSTR=" "
declare -a exchange_triplet
# In case we find a cirdular dependency, it has the form :
# parent->dependency_0->...->dependency_n->dependency_0
# If we want to build dependency_n before dependency_0,
# no problem: we just prune the tree at dependency_n.
# If we want to build first dependency_0, we need to
# put dependency_n as a dependency of parent. The triplet
# above shall contain (parent dependency_0 dependency_n)
#----------------------------# #----------------------------#
generate_dependency_tree() { # generate_dependency_tree() { #
#----------------------------# #----------------------------#
: <<inline_doc : <<inline_doc
function: Create a dependency tree for the TARGET function: Create a subtree of the dependency tree
input vars: none (recursive function)
externals: vars: TARGET input vars: $1 : file with a list of targets
PKGXML the first line of the file is an array
of links
externals: vars: BLFS_XML
DEP_LEVEL DEP_LEVEL
func: do_dependencies modifies: vars: none
modifies: vars: PKGXML
BLFS_XML
returns: nothing returns: nothing
output: files: $TARGET.dep output: files: for each pkg with dependencies in $1,
$TARGET-index.xml.tmp a file pkg.dep and its dependencies
depure.txt
on error: nothing on error: nothing
on success: nothing on success: nothing
inline_doc inline_doc
local ENTRY_START local DepFile=$1
local ENTRY_END local -a rootlink
local -a otherlink
local -i depth
local -i count=0
local id_of_dep
local parent
local lines_to_remove=
local srootlink
local dep_level
#--------------------- {
# Create the working directory and cd into it # BEWARE : the order of options matters : read -a -u6 rootlink hangs forever
if [[ -d $TARGET ]] ; then # (actually, the doc says -a array -u fd)
echo -e "\tERROR: Looks like $TARGET has been already processed." # We use fd number 6 for input from DepFile, because we need 0 for user input
echo -e "\tPlease delete or rename the $TARGET directory.\n" read -u6 -a rootlink
exit 1 depth=${#rootlink[*]}
else dep_level=$DEP_LEVEL
mkdir $TARGET && cd $TARGET if (( $DEP_LEVEL > 2 )) && (( $depth > 1 )); then dep_level=2; fi
srootlink="${rootlink[*]} "
# start of Depfile
echo -en "\nNode: $depth${spaceSTR:0:$depth}${RED}$DepFile${OFF}"
while read -u6 id_of_dep; do
# count entries in file
(( count++ ))
# Has this entry already been seen?
if [ -f ${id_of_dep}.dep ]; then # found ${id_of_dep}.dep already in tree
otherlink=($(head -n 1 ${id_of_dep}.dep))
if [ -z "${otherlink[*]}" ]
then echo otherlink empty for $id_of_dep.dep
echo This should not happen, but happens to happen...
exit 1
fi
# Do not use "${rootlink[*]}" =~ "${otherlink[*]}": case rootlink=(1 11)
# and otherlink=(1 1)
if [[ ${srootlink#"${otherlink[*]} "} != ${srootlink} ]]; then # circular dep
# First look for the other parent of this dependency.
# The parent has the same link without the last entry.
# We do not need otherlink anymore so just destroy the last element
unset otherlink[${#otherlink[*]}-1]
parent=$(grep ^"${otherlink[*]}"\$ -l *)
parent=${parent%.dep}
echo -en "\nCirc: $depth${spaceSTR:0:$depth}${BLUE}Circular dependency detected:${OFF}"
echo -en "\nCirc: $depth${spaceSTR:0:$depth}${BOLD}${id_of_dep}${OFF} is a dependency \
of ${BOLD}${parent}${OFF}"
echo -en "\nCirc: $depth${spaceSTR:0:$depth}${BOLD}${DepFile%.dep}${OFF} is a dependency \
of ${BOLD}${id_of_dep}${OFF}"
echo -en "\nCirc: $depth${spaceSTR:0:$depth}${BOLD}${id_of_dep}${OFF} is a dependency \
of ${BOLD}${DepFile%.dep}${OFF}"
# If idofdep is the parent of DepFile, we can exchange them if required
# if grep -q ${DepFile%.dep} ${id_of_dep}.dep; then
# we propose exchange always
echo -en "\nCirc: $depth${spaceSTR:0:$depth}Do you want to build ${id_of_dep} first? yes/no (no):"
read ANSWER
if [ x$ANSWER = "xyes" ] ; then # exchange:
# set triplet and return 1
exchange_triplet=($parent $id_of_dep ${DepFile%.dep})
return 1
else # no exchange: prune
lines_to_remove="$lines_to_remove $id_of_dep"
fi
# else
# lines_to_remove="$lines_to_remove $id_of_dep"
# fi
else # not circular: prune
lines_to_remove="$lines_to_remove $id_of_dep"
fi
continue
fi fi
flag=true
while [ $flag = true ]; do
flag=false
xsltproc --stringparam dependencies ${dep_level} \
--stringparam idofdep $id_of_dep \
-o ${id_of_dep}.dep \
../xsl/dependencies.xsl ../packages.xml
#--------------------- if [[ -f ${id_of_dep}.dep ]]; then
# XML file of the target package sed -i "1i${rootlink[*]} $count" ${id_of_dep}.dep
PKGXML=`grep "^$TARGET[[:space:]]" ../packages | cut -f2` generate_dependency_tree ${id_of_dep}.dep
# Test return value, in case we exchange dependencies
#--------------------- case $? in
# The BLFS sources directory. 0) # Normal return
BLFS_XML=`echo $PKGXML | sed -e 's,/.*,,'` ;;
1) # We are backing up to parent
if [[ ! -d ../$BLFS_XML ]] ; then if [[ ${exchange_triplet} == ${DepFile%.dep} ]]
echo -e "\tThe BLFS book sources directory is missing.\n" then tree_erase ${id_of_dep}.dep
echo -e "\tExecution aborted.\n" # Just doing a sed -i "s@${id_of_dep}@${exchange_triplet[2]}@" $DepFile
cd .. && rmdir $TARGET # is not good if $DepFile contains several times the same line
exit 1 # so first find the first line and then sed
fi lineno=$(sed -n /${id_of_dep}/= $DepFile | head -n1)
sed -i "${lineno}s@${id_of_dep}@${exchange_triplet[2]}@" $DepFile
#--------------------- id_of_dep=${exchange_triplet[2]}
# XInclude stuff flag=true
ENTRY_START="<xi:include xmlns:xi=\"http://www.w3.org/2003/XInclude\" href=\"../" else
ENTRY_END="\"/>" # echo backing up to ${exchange_triplet} at ${DepFile%.dep}
return 1
echo -e "\tGenerating $TARGET dependencies tree ..." fi
;;
mkdir dependencies
#---------------------
# Create target package dependencies list
case $TARGET in
# Skip the creation when all dependencies are circular.
alsa-lib | cracklib | libexif | unixodbc ) ;;
# Meta-packages at target level
alsa )
cp ../libs/alsa.dep dependencies/
;;
gnome-core )
cp ../libs/gnome-core.dep dependencies/
;;
gnome-full )
cp ../libs/gnome-{core,full}.dep dependencies/
;;
kde-core )
cp ../libs/kde-core.dep dependencies/
;;
kde-full )
cp ../libs/kde-{core,full}.dep dependencies/
;;
kde-koffice )
cp ../libs/kde-{core,full,koffice}.dep dependencies/
;;
xorg7 )
cp ../libs/xorg7.dep dependencies/
;;
* ) # Default
xsltproc --stringparam dependencies $DEP_LEVEL \
-o dependencies/$TARGET.dep \
../libs/dependencies.xsl ../$PKGXML
;;
esac
#---------------------
# Start with a clean $TARGET-index.xml.tmp file
> $TARGET-index.xml.tmp
#---------------------
# Write the XInclude
case $TARGET in
# If there is no usefull XML page, skip it.
alsa | gnome-core | gnome-full | kde-core | kde-full | kde-koffice | xorg7) ;;
* )
echo -e " $ENTRY_START$PKGXML$ENTRY_END" >> $TARGET-index.xml.tmp
;;
esac
#---------------------
# If have dependencies, write its XInclude and find sub-dependencies
if [[ -f dependencies/$TARGET.dep ]]; then
mkdir xincludes && do_dependencies $TARGET
fi
echo -e "\n\t... done"
}
#-----------------------#
do_dependencies() { # Loop to find sub-dependencies :::WARNING::: THIS IS A RECURVISE FUNCTION
#-----------------------#
: <<inline_doc
function: Loop through all the packages and create a sub-dependency tree
input vars: $1, package name
externals: vars: $DEP_LEVEL
$TARGET
$PRINT_SERVER
$KBR5
$GHOSTSCRIPT
$MAILSERVER
file: depure.txt
$TARGET-index.xml.tmp
$PKG.dep
$PKG.inc
modifies: files
returns: nothing
output: file: $PKG-xinc.tmp
depure.txt
$TARGET-index.xml.tmp
on error: exit
on success:
inline_doc
set -e
local PKG=$1
local saveIFS=$IFS
local DEP_LV=$DEP_LEVEL
local line line2 DEP pkg_ver inst_ver
#------------------
# If a premade xinclude file exists, use it. If not, create one
if [[ -f xincludes/$PKG.xinc ]] ; then
IFS=$'\x0A'
for line in `cat xincludes/$PKG.xinc` ; do
IFS=$saveIFS
# Remove the Xinclude entry if found. We want the most newer one.
# Using double quotes to let bash expand variables.
# Remove also the empty line created. Can not be done in one step
# due that d requires the pattner between /, but we have a lot of /
# inside the pattner.
sed -e "s,^[[:space:]]*$line,," -e '/./!d' -i $TARGET-index.xml.tmp
# Write the XInclude
echo -e "$line" >> $TARGET-index.xml.tmp
done
return
fi
#------------------
# Start with a clean $PKG.xinc.tmp file
> xincludes/$PKG.xinc.tmp
for DEP in `cat dependencies/$PKG.dep`; do
# Special packages that need be remaped
case $DEP in
db ) continue ;; # The proper version of DB is installed in LFS
# Don't have their own XML file
hal-requirements | hal-runtime-dependencies ) continue ;;
perl-* | tk-perl ) DEP=perl-modules ;;
dbus-* ) DEP=dbus-bindings ;;
pyxml | pycairo | pygobject | pygtk | pyorbit | \
gnome-python | gnome-python-desktop ) DEP=python-modules ;;
# Orphan links (proper link must be created when generating the book)
arts ) DEP=aRts ;;
kde ) DEP=kde-core ;;
# Set values for alternative packages
LPRng | cups ) DEP=$PRINT_SERVER ;;
mitkrb | heimdal ) DEP=$KBR5 ;;
gs | espgs ) DEP=$GHOSTSCRIPT ;;
server-mail ) DEP=$MAIL_SERVER ;;
x-window-system )
case $X11 in
xorg7 ) DEP=xorg7 ;;
* )
pkg_ver=$(grep "^${X11}[[:space:]]" ../packages | cut -f3)
inst_ver=$(grep "^${X11}[[:space:]]" ../packages | cut -f4)
[ -n "${pkg_ver}" ] && [[ "x${pkg_ver}" = "x${inst_ver}" ]] && continue
[ -n "${pkg_ver}" ] && [[ "x${pkg_ver}" < "x${inst_ver}" ]] && continue
;;
esac
;;
esac
# If DEP has been previouly installed, skip it
pkg_ver=$(grep "^${DEP}[[:space:]]" ../packages | cut -f3)
inst_ver=$(grep "^${DEP}[[:space:]]" ../packages | cut -f4)
[ -n "${pkg_ver}" ] && [[ "x${pkg_ver}" = "x${inst_ver}" ]] && continue
[ -n "${pkg_ver}" ] && [[ "x${pkg_ver}" < "x${inst_ver}" ]] && continue
#------------------
# Prevent circular dependencies
# If all dependencies are circular, the creation of the *.dep file
# must be skipped, not placed here, to avoid that the script will bomb
# due empty *.xinc files
case $DEP in
akode )
# Both are in the same page
[[ "$PKG" = "kdemultimedia" ]] && continue
;;
aRts )
# esound-->aRts-->esound
[[ "$PKG" = "esound" ]] && continue
;;
dbus-bindings )
# True circular dependecy
[[ "$PKG" = "dbus-bindings" ]] && continue
;;
DocBook )
# Used to rebuild the documentation
[[ "$PKG" = "linux-pam" ]] && continue
;;
docbook-xsl )
# Used to rebuild the documentation
[[ "$PKG" = "linux-pam" ]] && continue
;;
doxygen )
# Used to rebuild the documentation
[[ "$PKG" = "dbus" ]] && continue
[[ "$PKG" = "libdvdcss" ]] && continue
[[ "$PKG" = "libusb" ]] && continue
[[ "$PKG" = "libxcb" ]] && continue
;;
espgs )
# Used to rebuild the documentation
[[ "$PKG" = "$MAIL_SERVER" ]] && continue
;;
ffmpeg )
# alsa-plugins-->ffmpeg-->several-->alsa-plugins
[[ "$PKG" = "alsa-plugins" ]] && continue
;;
fop )
# Used to rebuild the documentation
[[ "$PKG" = "linux-pam" ]] && continue
;;
graphviz )
# Used to build the API documentation
[[ "$PKG" = "libusb" ]] && continue
;;
GTK )
# deprecated GTK version
[[ "$PKG" = "alsa-tools" ]] && continue
;;
gtk2 )
# Testsuite only
[[ "$PKG" = "cairo" ]] && continue
;;
jadetex )
# Runtime only
[[ "$PKG" = "docbook-utils" ]] && continue
;;
$KBR5 )
# cyrus-sasl-->postgresql-->$KBR5-->openldap-->cyrus-sasl
[[ "$PKG" = "cyrus-sasl" ]] && continue
;;
librsvg )
# Testsuite only
[[ "$PKG" = "cairo" ]] && continue
;;
libxslt )
# libxml2-->libxslt-->libxml2
[[ "$PKG" = "libxml2" ]] && continue
;;
Links )
# Runtime only
[[ "$PKG" = "docbook-utils" ]] && continue
;;
lynx )
# Runtime only
[[ "$PKG" = "docbook-utils" ]] && continue
;;
openldap )
# cyrus-sasl-->postgresql-->$KBR5-->openldap-->cyrus-sasl
[[ "$PKG" = "cyrus-sasl" ]] && continue
;;
poppler )
# Testsuite only
[[ "$PKG" = "cairo" ]] && continue
;;
postgresql )
# cyrus-sasl-->postgresql-->$KBR5-->openldap-->cyrus-sasl
[[ "$PKG" = "cyrus-sasl" ]] && continue
;;
python-modules )
# True circular dependecy
[[ "$PKG" = "python-modules" ]] && continue
# libgsf-->python-modules-->several combinations-->libgsf
[[ "$PKG" = "libgsf" ]] && continue
# gimp-->python-modules-->several combinations-->gimp
[[ "$PKG" = "gimp" ]] && continue
# Used to rebuild the documentation
[[ "$PKG" = "gstreamer" ]] && continue
[[ "$PKG" = "gst-plugins-base" ]] && continue
[[ "$PKG" = "gst-plugins-good" ]] && continue
;;
tk )
# python-->tk-->xorg7-->several combinations-->libxslt-->python
[[ "$PKG" = "python" ]] && continue
;;
w3m )
# Runtime only
[[ "$PKG" = "docbook-utils" ]] && continue
# Used to rebuild the documentation
[[ "$PKG" = "linux-pam" ]] && continue
;;
esac
#------------------
# XML file of dependency package
DEP_XML=`grep "^$DEP[[:space:]]" ../packages | cut -f2`
case $DEP in
x-window-system | alsa ) ;; # No page for that (proper link must be created when generating the book)
xorg7 ) ;; # This page will be dump in the xorg7.xinc file
gnome-core | kde-core | kde-full ) ;; # Invented packages
* )
# Remove the Xinclude entry if found
sed -e "s,^[[:space:]]*$ENTRY_START$DEP_XML$ENTRY_END,," \
-e '/./!d' -i xincludes/$PKG.xinc.tmp
# Write the XInclude
echo -e " $ENTRY_START$DEP_XML$ENTRY_END" >> xincludes/$PKG.xinc.tmp
;;
esac
#------------------
# If not already created, create its dependencies list
if [[ ! -f dependencies/$DEP.dep ]] ; then
case $DEP in
# Skip the creation when all dependencies are circular.
alsa-lib | cracklib | libexif | unixodbc ) ;;
# Meta-packages at dependency level
alsa )
cp ../libs/alsa.dep dependencies/
;;
kde-core )
cp ../libs/kde-core.dep dependencies/
;;
x-window-system ) # When X11 is not Xorg7
echo -e "x-config\nx-setup\n$X11" > dependencies/x-window-system.dep
;;
xorg7 )
cp ../libs/xorg7.dep dependencies/
;;
* ) xsltproc --stringparam dependencies $DEP_LV \
-o dependencies/$DEP.dep ../libs/dependencies.xsl ../$DEP_XML
;;
esac esac
fi else
echo "${rootlink[*]} $count" > ${id_of_dep}.dep
#------------------
# If needed, process its dependencies
if [[ -f dependencies/$DEP.dep ]] ; then
# If a premade xinclude file esist, include it
if [[ -f xincludes/$DEP.xinc ]] ; then
IFS=$'\x0A'
for line2 in `cat xincludes/$DEP.xinc` ; do
IFS=$saveIFS
# Remove the Xinclude entry if found
sed -e "s,^[[:space:]]*$line2,," -e '/./!d' -i xincludes/$PKG.xinc.tmp
# Write the XInclude
echo -e "$line2" >> xincludes/$PKG.xinc.tmp
done
#------------------
# Create the xinclude file
else
#
# >>>>>> THIS IS A RECURSIVE FUNCTION CALL.. BEWARE OF GREMLINS. <<<<<<
#
# If the recursion depth is not too great this is an acceptable methodology for a script language
# However, uncontrolled recursion will cause a seg-fault due to stack issues with local variables.
#
set +e
[[ "${VERBOSITY}" > 0 ]] && echo -ne "\ncall: $((++cntr))${spaceSTR:0:$cntr}${RED}$DEP${OFF}"
do_dependencies $DEP
[[ "${VERBOSITY}" > 0 ]] && echo -ne "\n ret: $cntr${spaceSTR:0:$((cntr--))}${GREEN}$DEP${OFF} Using $DEP Xinc to solve $PKG"
set -e
# Include it when done
IFS=$'\x0A'
for line2 in `cat xincludes/$DEP.xinc` ; do
IFS=$saveIFS
# Remove the Xinclude entry if found
sed -e "s,^[[:space:]]*$line2,," -e '/./!d' -i xincludes/$PKG.xinc.tmp
# Write the XInclude
echo -e "$line2" >> xincludes/$PKG.xinc.tmp
done
fi
fi fi
done done
done
#------------------ echo -en "\n End: $depth${spaceSTR:0:$depth}${GREEN}$DepFile${OFF}"
if [[ "$PKG" = "xorg7" ]] ; then } 6<$DepFile
# Add their XInclude # It may happen that a file is created with several times
PKG_XML=${BLFS_XML}/x/installing/xorg7.xml # the same line. Normally, all those lines but one
echo -e " $ENTRY_START$PKG_XML$ENTRY_END" >> xincludes/$PKG.xinc.tmp # would be flagged to be removed (or all of them if
fi # the dependency appeared before). a simple sed /$line/d
# destroys all the lines. We should instead remove
#------------------ # only one for each appearance of it in lines_to_remove.
mv xincludes/$PKG.xinc.tmp xincludes/$PKG.xinc # so first get the number of first line and then delete
IFS=$'\x0A' # that line
for line in `cat xincludes/$PKG.xinc` ; do for line in $lines_to_remove
IFS=$saveIFS do lineno=$(sed -n /^$line\$/= $DepFile | head -n1)
# Remove the Xinclude entry if found. sed -i ${lineno}d $DepFile
sed -e "s,^[[:space:]]*$line,," -e '/./!d' -i $TARGET-index.xml.tmp done
# Write the XInclude return 0
echo -e "$line" >> $TARGET-index.xml.tmp }
done
#---------------#
tree_browse() { #
#---------------#
local file=$1
local f
#echo file=$file
for f in $(grep '[^0-9 ]' $file); do
# echo f=$f
if grep -q '[^0-9 ]' ${f}.dep ; then
tree_browse ${f}.dep
fi
echo $f
done
}
#--------------#
tree_erase() { #
#--------------#
local file=$1
local f
local -a rootlink
local -a rootlink2
#echo file=$file
rootlink=($(head -n1 $file))
for f in $(grep '[^0-9 ]' $file); do
# echo " f"=$f
if [ -f ${f}.dep ]; then
rootlink2=($(head -n1 ${f}.dep))
if [[ "${rootlink2[*]}" =~ "${rootlink[*]}" ]] ; then
tree_erase ${f}.dep
fi
fi
done
rm -f $file
} }

View file

@ -1,231 +0,0 @@
#!/bin/bash
#
# $Id$
#
set -e
#-----------------------#
get_pkg_ver() { # Find package version for a given package ID
#-----------------------#
local pkg_id=$1
case ${pkg_id} in
# ALSA packages version
alsa* ) pkg_id=alsa ;;
# KDE packages version
kdevelop ) : ;;
kde*config ) : ;;
kde* ) pkg_id=kde ;;
# Xorg7 packages version
xorg7-server ) pkg_id=xorg-server ;;
xterm2 ) pkg_id=xterm ;;
xorg7* ) pkg_id=xorg7 ;;
# Others (ID value don't match entity name)
wireless_tools ) pkg_id=wireless-tools ;;
bind-utils ) pkg_id=bind ;;
html-tidy ) pkg_id=tidy ;;
reiserfs ) pkg_id=reiser ;;
xfs ) pkg_id=xfsprogs ;;
esac
xmllint --noent ./${BLFS_XML}/book/bookinfo.xml 2>/dev/null | \
grep -i " ${pkg_id}-version " | cut -d "\"" -f2 | sed "s/ /_/g"
}
#-----------------------#
get_installed_ver() { # Find installed package version for a given package ID
#-----------------------#
local pkg_id=$1
case ${pkg_id} in
html-tidy )
find $TRACKING_DIR -name "${pkg_id}-cvs_[[:digit:]]*" | sed "s/.*${pkg_id}-//"
;;
cdparanoia )
find $TRACKING_DIR -name "${pkg_id}-III-[[:digit:]]*" | sed "s/.*${pkg_id}-//"
;;
ffmpeg )
find $TRACKING_DIR -name "${pkg_id}-svn_[[:digit:]]*" | sed "s/.*${pkg_id}-//"
;;
psutils )
find $TRACKING_DIR -name "${pkg_id}-p[[:digit:]]*" | sed "s/.*${pkg_id}-//"
;;
* )
find $TRACKING_DIR -name "${pkg_id}-[[:digit:]]*" | sed "s/.*${pkg_id}-//" | sed "s/ /_/g"
;;
esac
}
#-----------------------#
generate_packages() { # Master packages file
#-----------------------#
local pkg_id file pkg_ver
local ALSA_VER GNOME_VER GNOME_MINOR_VER KDE_VER KDE_KOFFICE_VER XORG7_VER
> packages.tmp
# Extract Id and path for sect1 files
for file in `find $BLFS_XML -name "*.xml"` ; do
pkg_id=$(grep "sect1 id" $file | sed -e 's/<sect1 id="//;s/".*//')
case ${pkg_id} in
dbus-bindings | \
perl-modules | \
python-modules ) pkg_ver=0.no_version ;;
* ) pkg_ver=$(get_pkg_ver $pkg_id) ;;
esac
installed_ver=$(get_installed_ver $pkg_id)
[[ ! -z "$pkg_id" ]] && echo -e "$pkg_id\t$file\t$pkg_ver\t$installed_ver" >> packages.tmp
done
# IDs clean-up (unuseful pages or commented-out packages, could be more)
sed -i '/template/d;/ntroduction/d;/preface/d;/alsa.xml/d;/xorg.xml/d' packages.tmp
sed -i '/obsolete/d;/ispell\t/d;/postlfs-/d;/-client.xml/d;/xorg7.xml/d' packages.tmp
sed -i '/courier.xml/d;/-other\t/d;/others-/d;/other-/d;/^ash\t/d' packages.tmp
sed -i '/fw-firewall\t/d;/gcc2\t/d;/cvsserver\t/d;/svnserver\t/d' packages.tmp
sed -i '/fam\t/d;/libungif\t/d;/ncpfs\t/d;/slrn\t/d;/konq\t/d;/arts\t/d' packages.tmp
sed -i '/gst-plugins\t/d;/gimp-print\t/d;/openquicktime\t/d;/compressdoc\t/d' packages.tmp
sed -i '/errata\t/d;/foreword\t/d;/organization\t/d;/whoread\t/d' packages.tmp
# Meta-packages version
ALSA_VER=$(get_pkg_ver alsa)
GNOME_VER=$(get_pkg_ver gnome)
GNOME_MINOR_VER=$(get_pkg_ver gnome-minor)
KDE_VER=$(get_pkg_ver kde)
KDE_INST_VER=$(get_installed_ver kde)
KDE_KOFFICE_VER=$(get_pkg_ver koffice)
XORG7_VER=$(get_pkg_ver xorg7)
# Meta-packages installed version
ALSA_INST_VER=$(get_installed_ver alsa)
GNOME_CORE_INST_VER=$(get_installed_ver gnome-core)
GNOME_FULL_INST_VER=$(get_installed_ver gnome-full)
KDE_CORE_INST_VER=$(get_installed_ver kde-core)
KDE_FULL_INST_VER=$(get_installed_ver kde-full)
KDE_KOFFICE_INST_VER=$(get_installed_ver kde-koffice)
XORG7_INST_VER=$(get_installed_ver xorg7)
# Add header with meta-packages pseudo Id
{
cat << EOF
alsa $BLFS_XML $ALSA_VER $ALSA_INST_VER
gnome-core $BLFS_XML $GNOME_VER$GNOME_MINOR_VER $GNOME_CORE_INST_VER
gnome-full $BLFS_XML $GNOME_VER$GNOME_MINOR_VER $GNOME_FULL_INST_VER
kde-core $BLFS_XML $KDE_VER $KDE_CORE_INST_VER
kde-full $BLFS_XML $KDE_VER $KDE_FULL_INST_VER
kde-koffice $BLFS_XML $KDE_KOFFICE_VER $KDE_KOFFICE_INST_VER
xorg7 $BLFS_XML $XORG7_VER $XORG7_INST_VER
EOF
} >> packages.tmp
# Dump packages list
sort packages.tmp -b --key=2 --field-separator=/ --output=packages
# Clean up
rm packages.tmp
}
# Pre-made *.dep files for meta-packages
#--------------------------#
generate_gnome_core() { # GNOME core
#--------------------------#
local line base_xml package
> gnome-core.dep.tmp
for line in `grep "xi:include" $BLFS_XML/gnome/core/core.xml` ; do
base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
package=`grep "gnome/core/$base_xml" packages | cut -f1`
[[ -n "$package" ]] && echo $package >> gnome-core.dep.tmp
done
# Replace dummy packages with the proper ones
sed -i 's/GNOME-//g' gnome-core.dep.tmp
tac gnome-core.dep.tmp > libs/gnome-core.dep
rm gnome-core.dep.tmp
}
#--------------------------#
generate_gnome_full() { # GNOME full
#--------------------------#
local line base_xml package
echo "gnome-core" > gnome-full.dep.tmp
for line in `grep "xi:include" $BLFS_XML/gnome/add/add.xml` ; do
base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
package=`grep "gnome/add/$base_xml" packages | cut -f1`
[[ -n "$package" ]] && echo $package >> gnome-full.dep.tmp
done
tac gnome-full.dep.tmp > libs/gnome-full.dep
rm gnome-full.dep.tmp
}
#--------------------------#
generate_kde_core() { # KDE core
#--------------------------#
local line base_xml package
> kde-core.dep.tmp
for line in `grep "xi:include" $BLFS_XML/kde/core/core.xml` ; do
base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
package=`grep "kde/core/$base_xml" packages | cut -f1`
[[ -n "$package" ]] && echo $package >> kde-core.dep.tmp
done
tac kde-core.dep.tmp > libs/kde-core.dep
rm kde-core.dep.tmp
}
#--------------------------#
generate_kde_full() { # KDE full
#--------------------------#
local line base_xml package
echo "kde-core" > kde-full.dep.tmp
for line in `grep "xi:include" $BLFS_XML/kde/add/add.xml` ; do
base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
package=`grep "kde/add/$base_xml" packages | cut -f1`
[[ -n "$package" ]] && echo $package >> kde-full.dep.tmp
done
for line in `grep "xi:include" $BLFS_XML/kde/devel/devel.xml` ; do
base_xml=`echo $line | sed 's/^.*href="//;s/".*//'`
package=`grep "kde/devel/$base_xml" packages | cut -f1`
[[ -n "$package" ]] && echo $package >> kde-full.dep.tmp
done
tac kde-full.dep.tmp > libs/kde-full.dep
rm kde-full.dep.tmp
}
#--------------------------#
generate_kde_koffice() { # KDE full + Koffice
#--------------------------#
echo -e "koffice\nkde-full\nkde-core" > libs/kde-koffice.dep
}
#--------------------------#
generate_alsa() { # ALSA packages
#--------------------------#
echo -e "alsa-oss\nalsa-firmware\nalsa-tools\nalsa-utils\n\
alsa-plugins\nalsa-lib" > libs/alsa.dep
}
#--------------------------#
generate_xorg7() { # Xorg7 packages
#--------------------------#
echo -e "x-config\nx-setup\nrman\nxterm2\nxorg7-driver\nxorg7-server\nluit\n\
xkeyboard-config\nxorg7-font\nxorg7-data\nxorg7-app\nmesalib\nlibdrm\nxbitmaps\n\
xorg7-lib\nlibxcb\nxcb-proto\nlibXdmcp\nlibXau\nxorg7-util\nxorg7-proto" > libs/xorg7.dep
}

View file

@ -1,151 +0,0 @@
#!/bin/bash
#####
#
# Parse the XML documents to create a 'package' book
#
# $Id$
#####
#----------------------------#
generate_TARGET_xml() { #
#----------------------------#
: <<inline_doc
function: Generate the XML document for the TARGET package
input vars: nothing
externals: vars: TARGET
modifies: nothing
returns: nothing
output: file: $TARGET-index.xml
on error: nothing
on success: nothing
inline_doc
local
echo -en "\n\tGenerating $TARGET-index.xml ..."
#---------------------
# Header to $TARGET-index.xml
{
cat << EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" >
<book>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/book/bookinfo.xml"/>
<preface>
<?dbhtml filename="preface.html" dir="preface"?>
<title>Preface</title>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/introduction/important/locale-issues.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/introduction/important/bootscripts.xml"/>
</preface>
<chapter>
<?dbhtml filename="chapter.html" dir="installing"?>
<title>Installing $TARGET in Dependencies Build Order</title>
EOF
} > $TARGET-index.xml
#---------------------
# Dump $TARGET-index.xml.tmp in reverse order.
tac $TARGET-index.xml.tmp >> $TARGET-index.xml
rm $TARGET-index.xml.tmp
#---------------------
# Footer of $TARGET-index.xml
{
cat << EOF
</chapter>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/appendices/creat-comm.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="../$BLFS_XML/appendices/ac-free-lic.xml"/>
<index/>
</book>
EOF
} >> $TARGET-index.xml
echo "done"
}
#-------------------------#
generate_target_book() { #
#-------------------------#
: <<inline_doc
function: Create an HTML document of the requested TARGET.
input vars: nothing
externals: vars: TARGET
BLFS_XML
MAIL_SERVER
X11
modifies: nothing
returns: nothing
output: file: NUMEROUS FILES
on error: nothing
on success: nothing
inline_doc
local filename # output filename
echo -en "\n\tGenerating <$TARGET> HTML book from <$BLFS_XML> xml files ..."
xsltproc --xinclude --nonet \
--stringparam mail_server $MAIL_SERVER \
--stringparam xwindow $X11 \
--stringparam base.dir HTML/ \
../libs/book.xsl \
$TARGET-index.xml > xsltproc.log 2>&1
mkdir HTML/{stylesheets,images}
cp ../$BLFS_XML/stylesheets/lfs-xsl/*.css HTML/stylesheets
cp ../$BLFS_XML/images/*.png HTML/images
cd HTML
sed -i -e "s@../stylesheets@stylesheets@g" *.html
sed -i -e "s@../images@images@g" *.html
for filename in `find . -name "*.html"` ; do
tidy -config ../../$BLFS_XML/tidy.conf $filename || true
sh ../../$BLFS_XML/obfuscate.sh $filename
sed -i -e "s@text/html@application/xhtml+xml@g" $filename
done
cd ..
echo "done"
}
#-------------------------#
create_build_scripts() { #
#-------------------------#
: <<inline_doc
function: Create shell scripts of the requested TARGET.
input vars: $1 use sudo n/y
externals: TARGET
modifies: nothing
returns: nothing
output: file: NUMEROUS FILES
on error: nothing
on success: nothing
inline_doc
# Log separator
echo -e "\n\tScripts generation depuration and errors:\n" >> xsltproc.log
echo -en "\n\tGenerating the build scripts ..."
xsltproc --xinclude --nonet \
--stringparam sudo $SUDO \
-o ./scripts/ ../libs/scripts.xsl \
$TARGET-index.xml >> xsltproc.log 2>&1
# Make the scripts executable.
chmod -R +x scripts
cd ..
echo -e "done\n"
}

View file

@ -1,496 +0,0 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl"
version="1.0">
<!-- $Id$ -->
<!-- XSLT stylesheet to create shell scripts from "linear build" BLFS books. -->
<!-- Build as user (y) or as root (n)? -->
<xsl:param name="sudo" select="y"/>
<xsl:template match="/">
<xsl:apply-templates select="//sect1"/>
</xsl:template>
<!--=================== Master chunks code ======================-->
<xsl:template match="sect1">
<xsl:if test="(count(descendant::screen/userinput) &gt; 0 and
count(descendant::screen/userinput) &gt;
count(descendant::screen[@role='nodump'])) and
@id != 'locale-issues' and @id != 'xorg7' and
@id != 'x-setup'">
<!-- The file names -->
<xsl:variable name="filename" select="@id"/>
<!-- Package name (use "Download FTP" by default. If empty, use "Download HTTP" -->
<xsl:variable name="package">
<xsl:choose>
<xsl:when
test="string-length(sect2[@role='package']/itemizedlist/listitem[2]/para/ulink/@url)
&gt; '10'">
<xsl:call-template name="package_name">
<xsl:with-param name="url"
select="sect2[@role='package']/itemizedlist/listitem[2]/para/ulink/@url"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="package_name">
<xsl:with-param name="url"
select="sect2[@role='package']/itemizedlist/listitem[1]/para/ulink/@url"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- FTP dir name -->
<xsl:variable name="ftpdir">
<xsl:call-template name="ftp_dir">
<xsl:with-param name="package" select="$package"/>
</xsl:call-template>
</xsl:variable>
<!-- The build order -->
<xsl:variable name="position" select="position()"/>
<xsl:variable name="order">
<xsl:choose>
<xsl:when test="string-length($position) = 1">
<xsl:text>00</xsl:text>
<xsl:value-of select="$position"/>
</xsl:when>
<xsl:when test="string-length($position) = 2">
<xsl:text>0</xsl:text>
<xsl:value-of select="$position"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$position"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Depuration code -->
<xsl:message>
<xsl:text>SCRIPT is </xsl:text>
<xsl:value-of select="concat($order,'-',$filename)"/>
<xsl:text>&#xA; PACKAGE is </xsl:text>
<xsl:value-of select="$package"/>
<xsl:text>&#xA; FTPDIR is </xsl:text>
<xsl:value-of select="$ftpdir"/>
<xsl:text>&#xA;&#xA;</xsl:text>
</xsl:message>
<!-- Creating the scripts -->
<exsl:document href="{$order}-z-{$filename}" method="text">
<xsl:text>#!/bin/bash&#xA;set -e&#xA;&#xA;</xsl:text>
<xsl:choose>
<!-- Package page -->
<xsl:when test="sect2[@role='package'] and not(@id = 'xorg7-app' or
@id = 'xorg7-data' or @id = 'xorg7-driver' or
@id = 'xorg7-font' or @id = 'xorg7-lib' or
@id = 'xorg7-proto' or @id = 'xorg7-util')">
<!-- Variables -->
<xsl:text>SRC_ARCHIVE=$SRC_ARCHIVE&#xA;</xsl:text>
<xsl:text>FTP_SERVER=$FTP_SERVER&#xA;&#xA;PACKAGE=</xsl:text>
<xsl:value-of select="$package"/>
<xsl:text>&#xA;PKG_DIR=</xsl:text>
<xsl:value-of select="$ftpdir"/>
<xsl:text>&#xA;SRC_DIR=$SRC_DIR&#xA;&#xA;</xsl:text>
<!-- Download code and build commands -->
<xsl:apply-templates select="sect2">
<xsl:with-param name="package" select="$package"/>
<xsl:with-param name="ftpdir" select="$ftpdir"/>
</xsl:apply-templates>
<!-- Clean-up -->
<xsl:if test="not(@id='mesalib')">
<xsl:text>cd $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
<xsl:text>rm -rf $UNPACKDIR unpacked&#xA;&#xA;</xsl:text>
</xsl:if>
<xsl:if test="@id='xorg7-server'">
<xsl:text>cd $SRC_DIR/MesaLib
UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
rm -rf $UNPACKDIR unpacked&#xA;&#xA;</xsl:text>
</xsl:if>
</xsl:when>
<!-- Xorg7 pseudo-packages -->
<xsl:when test="contains(@id,'xorg7') and not(@id = 'xorg7-server')">
<xsl:text>SRC_DIR=$SRC_DIR
cd $SRC_DIR
mkdir -p xc
cd xc&#xA;</xsl:text>
<xsl:apply-templates select="sect2" mode="xorg7"/>
</xsl:when>
<!-- Non-package page -->
<xsl:otherwise>
<xsl:apply-templates select=".//screen"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>exit</xsl:text>
</exsl:document>
</xsl:if>
</xsl:template>
<!--======================= Sub-sections code =======================-->
<xsl:template match="sect2">
<xsl:param name="package" select="foo"/>
<xsl:param name="ftpdir" select="foo"/>
<xsl:choose>
<xsl:when test="@role = 'package'">
<xsl:text>mkdir -p $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
<xsl:text>cd $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
<xsl:apply-templates select="itemizedlist/listitem/para">
<xsl:with-param name="package" select="$package"/>
<xsl:with-param name="ftpdir" select="$ftpdir"/>
</xsl:apply-templates>
<xsl:text>&#xA;</xsl:text>
</xsl:when>
<xsl:when test="@role = 'installation'">
<xsl:text>
if [[ -e unpacked ]] ; then
UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
[[ -n $UNPACKDIR ]] &amp;&amp; [[ -d $UNPACKDIR ]] &amp;&amp; rm -rf $UNPACKDIR
fi
tar -xvf $PACKAGE > unpacked
UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
cd $UNPACKDIR&#xA;</xsl:text>
<xsl:apply-templates select=".//screen | .//para/command"/>
<xsl:if test="$sudo = 'y'">
<xsl:text>sudo /sbin/</xsl:text>
</xsl:if>
<xsl:text>ldconfig&#xA;&#xA;</xsl:text>
</xsl:when>
<xsl:when test="@role = 'configuration'">
<xsl:apply-templates select=".//screen"/>
<xsl:text>&#xA;</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="sect2" mode="xorg7">
<xsl:choose>
<xsl:when test="@role = 'package'">
<xsl:apply-templates select="itemizedlist/listitem/para" mode="xorg7"/>
</xsl:when>
<xsl:when test="not(@role)">
<xsl:text>SRC_ARCHIVE=$SRC_ARCHIVE
FTP_SERVER=$FTP_SERVER&#xA;</xsl:text>
<xsl:apply-templates select=".//screen" mode="sect-ver"/>
<xsl:text>mkdir -p ${section}&#xA;cd ${section}&#xA;</xsl:text>
<xsl:apply-templates select="../sect2[@role='package']/itemizedlist/listitem/para" mode="xorg7-patch"/>
<xsl:text>for line in $(grep -v '^#' ../${sect_ver}.wget) ; do
if [[ ! -f ${line} ]] ; then
if [[ -f $SRC_ARCHIVE/Xorg/${section}/${line} ]] ; then
cp $SRC_ARCHIVE/Xorg/${section}/${line} ${line}
elif [[ -f $SRC_ARCHIVE/Xorg/${line} ]] ; then
cp $SRC_ARCHIVE/Xorg/${line} ${line}
elif [[ -f $SRC_ARCHIVE/${section}/${line} ]] ; then
cp $SRC_ARCHIVE/${section}/${line} ${line}
elif [[ -f $SRC_ARCHIVE/${line} ]] ; then
cp $SRC_ARCHIVE/${line} ${line}
else
wget ${FTP_SERVER}conglomeration/Xorg/${line} || \
wget http://xorg.freedesktop.org/releases/individual/${section}/${line}
fi
fi
done
md5sum -c ../${sect_ver}.md5
cp ../${sect_ver}.wget ../${sect_ver}.wget.orig
cp ../${sect_ver}.md5 ../${sect_ver}.md5.orig&#xA;</xsl:text>
</xsl:when>
<xsl:when test="@role = 'installation'">
<xsl:text>for package in $(grep -v '^#' ../${sect_ver}.wget) ; do
packagedir=$(echo $package | sed 's/.tar.bz2//')
tar -xf ${package}
cd ${packagedir}&#xA;</xsl:text>
<xsl:apply-templates select=".//screen | .//para/command"/>
<xsl:text> cd ..
rm -rf ${packagedir}
sed -i "/${package}/d" ../${sect_ver}.wget
sed -i "/${package}/d" ../${sect_ver}.md5
done
mv ../${sect_ver}.wget.orig ../${sect_ver}.wget
mv ../${sect_ver}.md5.orig ../${sect_ver}.md5&#xA;</xsl:text>
<xsl:if test="$sudo = 'y'">
<xsl:text>sudo /sbin/</xsl:text>
</xsl:if>
<xsl:text>ldconfig&#xA;&#xA;</xsl:text>
</xsl:when>
<xsl:when test="@role = 'configuration'">
<xsl:apply-templates select=".//screen"/>
<xsl:text>&#xA;</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
<!--==================== Download code =======================-->
<xsl:template name="package_name">
<xsl:param name="url" select="foo"/>
<xsl:param name="sub-url" select="substring-after($url,'/')"/>
<xsl:choose>
<xsl:when test="contains($sub-url,'/')">
<xsl:call-template name="package_name">
<xsl:with-param name="url" select="$sub-url"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="contains($sub-url,'?')">
<xsl:value-of select="substring-before($sub-url,'?')"/>
</xsl:when>
<xsl:when test="contains($sub-url,'.patch')"/>
<xsl:otherwise>
<xsl:value-of select="$sub-url"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="ftp_dir">
<xsl:param name="package" select="foo"/>
<!-- A lot of hardcoded dir names. Not full revised yet. -->
<xsl:choose>
<!-- cdparanoia -->
<xsl:when test="contains($package, '-III')">
<xsl:text>cdparanoia</xsl:text>
</xsl:when>
<!-- DobBook 3.1 -->
<xsl:when test="contains($package, 'docbk31')">
<xsl:text>docbk</xsl:text>
</xsl:when>
<!-- gc -->
<xsl:when test="contains($package, 'gc6')">
<xsl:text>gc</xsl:text>
</xsl:when>
<!-- ISO-codes -->
<xsl:when test="contains($package, 'iso-codes')">
<xsl:text>iso-codes</xsl:text>
</xsl:when>
<!-- JPEG -->
<xsl:when test="contains($package, 'jpegsrc')">
<xsl:text>jpeg</xsl:text>
</xsl:when>
<!-- lynx -->
<xsl:when test="contains($package, 'lynx')">
<xsl:text>lynx</xsl:text>
</xsl:when>
<!-- ntp -->
<xsl:when test="contains($package, 'ntp')">
<xsl:text>ntp</xsl:text>
</xsl:when>
<!-- OpenLDAP -->
<xsl:when test="contains($package, 'openldap')">
<xsl:text>openldap</xsl:text>
</xsl:when>
<!-- Open Office -->
<xsl:when test="contains($package, 'OOo')">
<xsl:text>OOo</xsl:text>
</xsl:when>
<!-- pine -->
<xsl:when test="contains($package, 'pine')">
<xsl:text>pine</xsl:text>
</xsl:when>
<!-- portmap -->
<xsl:when test="contains($package, 'portmap')">
<xsl:text>portmap</xsl:text>
</xsl:when>
<!-- psutils -->
<xsl:when test="contains($package, 'psutils')">
<xsl:text>psutils</xsl:text>
</xsl:when>
<!-- qpopper -->
<xsl:when test="contains($package, 'qpopper')">
<xsl:text>qpopper</xsl:text>
</xsl:when>
<!-- QT -->
<xsl:when test="contains($package, 'qt-x')">
<xsl:text>qt-x11-free</xsl:text>
</xsl:when>
<!-- sendmail -->
<xsl:when test="contains($package, 'sendmail')">
<xsl:text>sendmail</xsl:text>
</xsl:when>
<!-- Slib -->
<xsl:when test="contains($package, 'slib')">
<xsl:text>slib</xsl:text>
</xsl:when>
<!-- TCL -->
<xsl:when test="contains($package, 'tcl')">
<xsl:text>tcl</xsl:text>
</xsl:when>
<!-- tcpwrappers -->
<xsl:when test="contains($package, 'tcp_wrappers')">
<xsl:text>tcp_wrappers</xsl:text>
</xsl:when>
<!-- TeTeX -->
<xsl:when test="contains($package, 'tetex')">
<xsl:text>tetex</xsl:text>
</xsl:when>
<!-- Tidy -->
<xsl:when test="contains($package, 'tidy')">
<xsl:text>tidy</xsl:text>
</xsl:when>
<!-- Tk -->
<xsl:when test="contains($package, 'tk8')">
<xsl:text>tk</xsl:text>
</xsl:when>
<!-- unzip -->
<xsl:when test="contains($package, 'unzip')">
<xsl:text>unzip</xsl:text>
</xsl:when>
<!-- wireless_tools -->
<xsl:when test="contains($package, 'wireless_tools')">
<xsl:text>wireless_tools</xsl:text>
</xsl:when>
<!-- whois -->
<xsl:when test="contains($package, 'whois')">
<xsl:text>whois</xsl:text>
</xsl:when>
<!-- XOrg -->
<xsl:when test="contains($package, 'X11R6')">
<xsl:text>Xorg</xsl:text>
</xsl:when>
<!-- zip -->
<xsl:when test="contains($package, 'zip2')">
<xsl:text>zip</xsl:text>
</xsl:when>
<!-- General rule -->
<xsl:otherwise>
<xsl:variable name="cut"
select="translate(substring-after($package, '-'), '0123456789', '0000000000')"/>
<xsl:variable name="package2">
<xsl:value-of select="substring-before($package, '-')"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="$cut"/>
</xsl:variable>
<xsl:value-of select="substring-before($package2, '-0')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="itemizedlist/listitem/para">
<xsl:param name="package" select="foo"/>
<xsl:param name="ftpdir" select="foo"/>
<xsl:choose>
<!-- This depend on all package pages having both "Download HTTP" and "Download FTP" lines -->
<xsl:when test="contains(string(),'HTTP')">
<xsl:text>if [[ ! -f $PACKAGE ]] ; then&#xA;</xsl:text>
<!-- SRC_ARCHIVE may have subdirectories or not -->
<xsl:text> if [[ -f $SRC_ARCHIVE/$PKG_DIR/$PACKAGE ]] ; then&#xA;</xsl:text>
<xsl:text> cp $SRC_ARCHIVE/$PKG_DIR/$PACKAGE $PACKAGE&#xA;</xsl:text>
<xsl:text> elif [[ -f $SRC_ARCHIVE/$PACKAGE ]] ; then&#xA;</xsl:text>
<xsl:text> cp $SRC_ARCHIVE/$PACKAGE $PACKAGE&#xA; else&#xA;</xsl:text>
<!-- The FTP_SERVER mirror -->
<xsl:text> wget ${FTP_SERVER}conglomeration/$PKG_DIR/$PACKAGE</xsl:text>
<!-- Upstream HTTP URL -->
<xsl:if test="string-length(ulink/@url) &gt; '10'">
<xsl:text> || \&#xA; wget </xsl:text>
<xsl:choose>
<xsl:when test="contains(ulink/@url,'?')">
<xsl:value-of select="substring-before(ulink/@url,'?')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="ulink/@url"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:when>
<xsl:when test="contains(string(),'FTP')">
<!-- Upstream FTP URL -->
<xsl:if test="string-length(ulink/@url) &gt; '10'">
<xsl:text> || \&#xA; wget </xsl:text>
<xsl:value-of select="ulink/@url"/>
</xsl:if>
<xsl:text>&#xA; fi&#xA;fi&#xA;</xsl:text>
</xsl:when>
<xsl:when test="contains(string(),'MD5')">
<xsl:text>echo "</xsl:text>
<xsl:value-of select="substring-after(string(),'sum: ')"/>
<xsl:text>&#x20;&#x20;$PACKAGE" | md5sum -c -&#xA;</xsl:text>
</xsl:when>
<!-- Patches -->
<xsl:when test="contains(string(ulink/@url),'.patch')">
<xsl:text>wget </xsl:text>
<xsl:value-of select="ulink/@url"/>
<xsl:text>&#xA;</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="itemizedlist/listitem/para" mode="xorg7">
<xsl:if test="contains(string(ulink/@url),'.md5') or
contains(string(ulink/@url),'.wget')">
<xsl:text>wget </xsl:text>
<xsl:value-of select="ulink/@url"/>
<xsl:text>&#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="itemizedlist/listitem/para" mode="xorg7-patch">
<xsl:if test="contains(string(ulink/@url),'.patch')">
<xsl:text>wget </xsl:text>
<xsl:value-of select="ulink/@url"/>
<xsl:text>&#xA;</xsl:text>
</xsl:if>
</xsl:template>
<!--======================== Commands code ==========================-->
<xsl:template match="screen">
<xsl:if test="child::* = userinput and not(@role = 'nodump')">
<xsl:if test="@role = 'root' and $sudo = 'y'">
<xsl:text>sudo sh -c '</xsl:text>
</xsl:if>
<xsl:apply-templates select="userinput"/>
<xsl:if test="@role = 'root' and $sudo = 'y'">
<xsl:text>'</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="screen" mode="sect-ver">
<xsl:text>section=</xsl:text>
<xsl:value-of select="substring-before(substring-after(string(),'mkdir '),' &amp;')"/>
<xsl:text>&#xA;sect_ver=</xsl:text>
<xsl:value-of select="substring-before(substring-after(string(),'-c ../'),'.md5')"/>
<xsl:text>&#xA;</xsl:text>
</xsl:template>
<xsl:template match="para/command">
<xsl:if test="(contains(string(),'test') or
contains(string(),'check'))">
<xsl:text>#</xsl:text>
<xsl:value-of select="substring-before(string(),'make')"/>
<xsl:text>make -k</xsl:text>
<xsl:value-of select="substring-after(string(),'make')"/>
<xsl:text> || true&#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="userinput">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="replaceable">
<xsl:choose>
<xsl:when test="ancestor::sect1[@id='xorg7-server']">
<xsl:text>$SRC_DIR/MesaLib</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>**EDITME</xsl:text>
<xsl:apply-templates/>
<xsl:text>EDITME**</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

22
BLFS/packdesc.dtd Normal file
View file

@ -0,0 +1,22 @@
<!-- Top level element -->
<!ELEMENT princList (list+)>
<!-- list corresponds to parts of the book -->
<!ELEMENT list (name,sublist+)>
<!ATTLIST list id ID #IMPLIED>
<!-- sublist corresponds to chapters of the book -->
<!ELEMENT sublist (name,package*)>
<!ATTLIST sublist id ID #IMPLIED>
<!-- information on package -->
<!ELEMENT package (name,((version,inst-version?,dependency*)|module+))>
<!ELEMENT name (#PCDATA)>
<!ELEMENT version (#PCDATA)>
<!ELEMENT inst-version (#PCDATA)>
<!-- Modules -->
<!ELEMENT module (name,version,inst-version?,dependency*)>
<!-- dependencies -->
<!ELEMENT dependency (dependency*)>
<!-- subdependencies of a dependency are defined for example in Perl
modules -->
<!ATTLIST dependency status (required|recommended|optional) "recommended"
name CDATA #REQUIRED
type (ref|link) "ref">

View file

@ -1,108 +0,0 @@
#!/bin/bash
#
# $Id$
#
set -e
declare -r SVN="svn://svn.linuxfromscratch.org"
DOC_MODE=$1 # Action to take, update, get or none
BLFS_XML=$2 # Book directory
TREE=$3 # SVN tree for the BLFS book version
[[ -z $BLFS_XML ]] && BLFS_XML=blfs-xml
[[ -z $DOC_MODE ]] && DOC_MODE=update
[[ -z $TREE ]] && TREE=trunk/BOOK
TRACKING_DIR=tracking-dir
#---------------------
# packages module
source libs/func_packages
[[ $? > 0 ]] && echo -e "\n\tERROR: func_packages did not load..\n" && exit
#----------------------------#
BOOK_Source() { #
#----------------------------#
: <<inline_doc
function: Retrieve or upate a copy of the BLFS book
input vars: $1 BLFS_XML book sources directory
$2 DOC_MODE action get/update
$3 TREE SVN tree when $2=get
externals: none
modifies: $BLFS_XML directory tree
returns: nothing
output:
on error: exit
on success: text messages
inline_doc
case $DOC_MODE in
update )
if [[ ! -d $BLFS_XML ]] ; then
echo -e "\n\t$BLFS_XML is not a directory\n"
exit 1
fi
if [[ ! -f $BLFS_XML/x/x.xml ]] ; then
echo -e "\n\tLooks like $BLFS_XML is not a BLFS book sources directory\n"
exit 1
fi
if [[ -d $BLFS_XML/.svn ]] ; then
echo -e "\n\tUpdating the $BLFS_XML book sources ...\n"
pushd $BLFS_XML 1> /dev/null
svn up
popd 1> /dev/null
echo -e "\n\tBook sources updated."
else
echo -e "\n\tLooks like $BLFS_XML is not a svn working copy."
echo -e "\tSkipping BLFS sources update.\n"
fi
;;
get )
[[ ! -d $BLFS_XML ]] && mkdir -pv $BLFS_XML
svn co $SVN/BLFS/$TREE $BLFS_XML 2>&1
;;
* )
echo -e "\n\tUnknown option ${DOC_MODE} ignored.\n"
;;
esac
}
[ "${DOC_MODE}" != "none" ] && BOOK_Source
if [ "${DOC_MODE}" = "none" ] ; then
echo -en "\n\tGenerating packages database file ..."
generate_packages
echo "done."
echo -en "\tGenerating alsa dependencies list ..."
generate_alsa
echo "done."
echo -en "\tGenerating gnome-core dependencies list ..."
generate_gnome_core
echo "done."
echo -en "\tGenerating gnome-full dependencies list ..."
generate_gnome_full
echo "done."
echo -en "\tGenerating kde-core dependencies list ..."
generate_kde_core
echo "done."
echo -en "\tGenerating kde-full dependencies list ..."
generate_kde_full
echo -e "done."
echo -en "\tGenerating kde-koffice dependencies list ..."
generate_kde_koffice
echo -e "done."
echo -en "\tGenerating xorg7 dependencies list ..."
generate_xorg7
echo "done."
fi

57
BLFS/xsl/bump.xsl Normal file
View file

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id: bump.xsl 21 2012-02-16 15:06:19Z labastie $ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name="packages" select="'packages.xml'"/>
<xsl:param name="package" select="''"/>
<xsl:param name="version" select="'N'"/>
<xsl:variable name="vers">
<xsl:choose>
<xsl:when test="$version='N'">
<xsl:value-of select=
"document($packages)//*[self::package or self::module]
[string(name)=$package]/version"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$version"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:output
method="xml"
encoding="ISO-8859-1"
doctype-system="PACKDESC"/>
<xsl:template match="/">
<sublist>
<xsl:copy-of select="./sublist/name"/>
<xsl:apply-templates select=".//package"/>
<xsl:if test="not(.//package[string(name)=$package])">
<package>
<name><xsl:value-of select="$package"/></name>
<version><xsl:value-of select="$vers"/></version>
</package>
</xsl:if>
</sublist>
</xsl:template>
<xsl:template match="package">
<xsl:choose>
<xsl:when test="string(name)=$package">
<package>
<name><xsl:value-of select="name"/></name>
<version><xsl:value-of select="$vers"/></version>
</package>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select='.'/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

154
BLFS/xsl/dependencies.xsl Normal file
View file

@ -0,0 +1,154 @@
<?xml version="1.0"?>
<!-- $Id: dependencies.xsl 24 2012-02-16 15:26:15Z labastie $ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>
<xsl:param name="MTA" select="'sendmail'"/>
<xsl:param name="dependencies" select="2"/>
<xsl:param name="idofdep" select="'dbus'"/>
<xsl:key name="depnode"
match="package|module"
use="name"/>
<xsl:template match="/">
<xsl:apply-templates select="key('depnode',$idofdep)"/>
</xsl:template>
<xsl:template match="package">
<xsl:apply-templates select="./dependency[@status='required']"/>
<xsl:if test="$dependencies &gt; '1'">
<xsl:apply-templates select="./dependency[@status='recommended']"/>
<xsl:if test="$dependencies = '3'">
<xsl:apply-templates select="./dependency[@status='optional']"/>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="module">
<xsl:apply-templates select="./dependency[@status='required']"/>
<xsl:if test="$dependencies &gt; '1'">
<xsl:apply-templates select="./dependency[@status='recommended']"/>
<xsl:if test="$dependencies = '3'">
<xsl:apply-templates select="./dependency[@status='optional']"/>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template match="dependency">
<xsl:variable name="depname">
<xsl:choose>
<xsl:when test="@name='x-window-system'">xinit</xsl:when>
<xsl:when test="@name='xorg7'">xinit</xsl:when>
<xsl:when test="@name='server-mail'">
<xsl:value-of select="$MTA"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="install_it">
<xsl:choose>
<xsl:when test="@type='link'">
<!-- No way to track versions: install ! -->
1
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="compare-versions">
<xsl:with-param name="version" select="key('depnode',$depname)/version"/>
<xsl:with-param name="inst-version" select="key('depnode',$depname)/inst-version"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:apply-templates select="dependency"/>
<xsl:if test="number($install_it)">
<xsl:value-of select="$depname"/>
<xsl:text>&#xA;</xsl:text>
</xsl:if>
</xsl:template>
<!-- lexicographic Comparison of strings. There is no way to directly
compare strings in XPath. So find the position of the character
in the following string. On the other hand, for numeric form style
xx.yy.zz, we have to compare xx and x'x', which is not always
lexicographic: think of 2.2 vs 2.10 -->
<xsl:variable name="char-table" select="' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
<xsl:variable name= "dot-table" select="'.....................................................'"/>
<xsl:template name="compare-versions">
<!-- returns non-zero if version is greater than inst-version -->
<xsl:param name="version"/>
<xsl:param name="inst-version"/>
<!-- first make all separators (-_) into dots -->
<xsl:variable name="mod-ver" select="translate($version,'-_','..')"/>
<xsl:variable name="mod-inst-ver" select="translate($inst-version,'-_','..')"/>
<!-- Then let us find the position of the first chars in char-table (0 if numeric or dot) -->
<xsl:variable name="pos-ver" select="string-length(substring-before($char-table,substring($version,1,1)))"/>
<xsl:variable name="pos-inst-ver" select="string-length(substring-before($char-table,substring($inst-version,1,1)))"/>
<xsl:choose>
<xsl:when test="string-length($inst-version)=0">
<xsl:value-of select="string-length($version)"/>
</xsl:when>
<xsl:when test="string-length($version)=0">
0
</xsl:when>
<xsl:when test="$pos-ver != 0">
<xsl:choose>
<xsl:when test="$pos-ver = $pos-inst-ver">
<xsl:call-template name="compare-versions">
<xsl:with-param name="version" select="substring($version,2)"/>
<xsl:with-param name="inst-version" select="substring($inst-version,2)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="number($pos-ver &gt; $pos-inst-ver)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="substring($mod-ver,1,1)='.'">
<xsl:choose>
<xsl:when test="substring($mod-inst-ver,1,1)='.'">
<xsl:call-template name="compare-versions">
<xsl:with-param name="version" select="substring($version,2)"/>
<xsl:with-param name="inst-version" select="substring($inst-version,2)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
0
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$pos-inst-ver &gt; 0 or substring($mod-inst-ver,1,1)='.'">
<!-- do not know what to do: do not install -->
0
</xsl:when>
<xsl:otherwise>
<xsl:variable name="tok" select="substring-before(concat(translate($mod-ver,$char-table,$dot-table),'.'),'.')"/>
<xsl:variable name="inst-tok" select="substring-before(concat(translate($mod-inst-ver,$char-table,$dot-table),'.'),'.')"/>
<xsl:choose>
<xsl:when test="number($tok)=number($inst-tok)">
<xsl:call-template name="compare-versions">
<xsl:with-param name="version" select="substring($version,string-length($tok)+1)"/>
<xsl:with-param name="inst-version" select="substring($inst-version,string-length($inst-tok)+1)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="number(number($tok) &gt; number($inst-tok))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

200
BLFS/xsl/gen_config.xsl Normal file
View file

@ -0,0 +1,200 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id: gen_config.xsl 21 2012-02-16 15:06:19Z labastie $ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"
encoding='ISO-8859-1'/>
<xsl:template match="/">
<xsl:apply-templates select="//list"/>
<xsl:text>comment ""
menu "Default package for resolving MTA dependency"
choice
prompt "Mail server"
config MS_sendmail
bool "sendmail"
config MS_postfix
bool "postfix"
config MS_exim
bool "exim"
endchoice
config MAIL_SERVER
string
default sendmail if MS_sendmail
default postfix if MS_postfix
default exim if MS_exim
endmenu
choice
prompt "Dependency level"
default DEPLVL_2
config DEPLVL_1
bool "Required dependencies only"
config DEPLVL_2
bool "Required and recommended dependencies"
config DEPLVL_3
bool "Required, recommended and optional dependencies"
endchoice
config optDependency
int
default 1 if DEPLVL_1
default 2 if DEPLVL_2
default 3 if DEPLVL_3
config SUDO
bool "Build as User"
default y
help
Select if sudo will be used (you build as a normal user)
otherwise sudo is not needed (you build as root)
</xsl:text>
</xsl:template>
<xsl:template match="list">
<xsl:if
test=".//*[self::package or self::module]
[(version and not(inst-version)) or
string(version) != string(inst-version)]">
<xsl:text>config&#9;MENU_</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>
bool&#9;"</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>"
default&#9;n
menu "</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>"
depends MENU_</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="sublist"/>
<xsl:text>endmenu
</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="sublist">
<xsl:if
test=".//*[self::package or self::module]
[(version and not(inst-version)) or
string(version) != string(inst-version)]">
<xsl:text>&#9;config&#9;MENU_</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>
&#9;bool&#9;"</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>"
&#9;default&#9;n
&#9;menu "</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>"
&#9;depends MENU_</xsl:text>
<xsl:value-of select="@id"/>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="package"/>
<xsl:text>&#9;endmenu
</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="package">
<xsl:if
test="(version and not(inst-version)) or
string(version) != string(inst-version)">
<xsl:text>&#9;&#9;config&#9;CONFIG_</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>
&#9;&#9;bool&#9;"</xsl:text>
<xsl:value-of select="name"/>
<xsl:text> </xsl:text>
<xsl:value-of select="version"/>
<xsl:if test="inst-version">
<xsl:text> [Installed </xsl:text>
<xsl:value-of select="inst-version"/>
<xsl:text>]</xsl:text>
</xsl:if>
<xsl:text>"
&#9;&#9;default&#9;n
</xsl:text>
</xsl:if>
<xsl:if
test="not(version) and ./module[not(inst-version) or
string(version) != string(inst-version)]">
<xsl:text>&#9;&#9;config&#9;MENU_</xsl:text>
<xsl:value-of select="translate(name,' ','_')"/>
<xsl:text>
&#9;&#9;bool&#9;"</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>"
&#9;&#9;default&#9;n
&#9;&#9;menu "</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>"
&#9;&#9;depends MENU_</xsl:text>
<xsl:value-of select="translate(name,' ','_')"/>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="module"/>
<xsl:text>&#9;&#9;endmenu
</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="module">
<xsl:if
test="not(inst-version) or
string(version) != string(inst-version)">
<xsl:text>&#9;&#9;&#9;config&#9;CONFIG_</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>
&#9;&#9;&#9;bool&#9;"</xsl:text>
<xsl:value-of select="name"/>
<xsl:text> </xsl:text>
<xsl:value-of select="version"/>
<xsl:if test="inst-version">
<xsl:text> [Installed </xsl:text>
<xsl:value-of select="inst-version"/>
<xsl:text>]</xsl:text>
</xsl:if>
<xsl:text>"
&#9;&#9;&#9;default&#9;</xsl:text>
<xsl:choose>
<xsl:when test="contains(../name,'xorg')">
<xsl:text>y
</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>n
</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

364
BLFS/xsl/gen_pkg_list.xsl Normal file
View file

@ -0,0 +1,364 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id: gen_pkg_list.xsl 21 2012-02-16 15:06:19Z labastie $ -->
<!-- Takes the blfs-full.xml file and extract a list
of packages obeying packdesc.dtd + looks for already
installed packages in the tracking file (stringparam
'installed-packages') -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name="installed-packages" select="'../lib/instpkg.xml'"/>
<xsl:output method="xml"
encoding='ISO-8859-1'
doctype-system="./packdesc.dtd"/>
<!-- specialCases.xsl is generated by a shell script:
allows for cases where version begins with a letter
and when there is no version (such as xorg7 packages) -->
<xsl:include href="./specialCases.xsl"/>
<xsl:template match="/">
<princList>
<xsl:text>&#xA;&#xA;</xsl:text>
<!-- How to have blfs-bootscripts versionned? Do not know, so
avoid it (TODO ?) -->
<xsl:apply-templates select="//part[not(@id='introduction')]"/>
</princList>
</xsl:template>
<xsl:template match="part">
<xsl:if test="count(.//*[contains(translate(@xreflabel,
'123456789',
'000000000'),
'-0')
]) &gt; 0">
<xsl:text> </xsl:text>
<list>
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
<xsl:text>&#xA; </xsl:text>
<xsl:element name="name">
<xsl:value-of select="title"/>
</xsl:element>
<xsl:text>&#xA;&#xA;</xsl:text>
<xsl:apply-templates select="chapter"/>
<xsl:text> </xsl:text>
</list>
<xsl:text>&#xA;&#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="chapter">
<xsl:if test="count(.//*[contains(translate(@xreflabel,
'123456789',
'000000000'),
'-0')
]) &gt; 0">
<xsl:text> </xsl:text>
<sublist>
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
<xsl:text>&#xA; </xsl:text>
<xsl:element name="name">
<xsl:value-of select="title"/>
</xsl:element>
<xsl:text>&#xA;</xsl:text>
<xsl:apply-templates select=".//sect1[@xreflabel]">
<xsl:sort select="@id"/>
</xsl:apply-templates>
<xsl:text> </xsl:text>
</sublist><xsl:text>&#xA;&#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="sect1">
<xsl:choose>
<!-- This test is to find sections containing modules (PERL, Python
DBus,...) -->
<xsl:when
test="not(contains(translate(@xreflabel,
'123456789',
'000000000'),
'-0')) and
count(descendant::node()[contains(translate(@xreflabel,
'123456789',
'000000000'),
'-0')
]) &gt; 0">
<xsl:text> </xsl:text>
<package><xsl:text>&#xA; </xsl:text>
<xsl:element name="name">
<xsl:value-of select="title"/>
</xsl:element>
<xsl:text>&#xA;</xsl:text>
<!-- Do not use .//*, which would include self.
Calls the template of specialCases.xsl,
which calls the "normal" template when the
case is normal. -->
<xsl:apply-templates
select="descendant::node()[contains(translate(@xreflabel,
'123456789',
'000000000'),
'-0')
]"
mode="special">
<xsl:sort select="@id"/>
</xsl:apply-templates>
<xsl:text> </xsl:text>
</package><xsl:text>&#xA;&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<!-- Calls the template of specialCases.xsl,
which calls the "normal" template when the
case is normal. -->
<xsl:apply-templates select='.' mode="special">
<xsl:sort select="@id"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="*" mode="normal">
<xsl:variable name="version">
<xsl:call-template name="version">
<xsl:with-param name="label" select="./@xreflabel"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<!-- If there is a "sect1" ancestor, this means that
we have a module -->
<xsl:when test="ancestor::sect1">
<xsl:text> </xsl:text>
<module><xsl:text>&#xA; </xsl:text>
<xsl:element name="name">
<xsl:value-of select="./@id"/>
</xsl:element>
<xsl:text>&#xA; </xsl:text>
<xsl:element name="version">
<xsl:value-of select="$version"/>
</xsl:element>
<xsl:if
test="document($installed-packages)//package[name=current()/@id]">
<xsl:text>&#xA; </xsl:text>
<xsl:element name="inst-version">
<xsl:value-of
select="document(
$installed-packages
)//package[name=current()/@id]/version"/>
</xsl:element>
</xsl:if>
<!-- Dependencies -->
<!-- First the case of python modules or d-bus bindings -->
<xsl:if test="self::sect2">
<!-- dependencies -->
<xsl:apply-templates select=".//para[@role='required' or
@role='recommended' or
@role='optional']"
mode="dependency"/>
</xsl:if>
<!-- For python modules, the preceding module is an optional dep -->
<xsl:if test="ancestor::sect1[@id='python-modules']">
<xsl:apply-templates
select="preceding-sibling::sect2[@role='package']
//listitem[para/xref/@linkend=current()/@id]"
mode="prec-dep"/>
</xsl:if>
<!-- Now the case of perl modules: let us test our XSLT abilities.
Well, "use the sibling, Luke" -->
<xsl:if test="self::bridgehead">
<xsl:apply-templates select="following-sibling::itemizedlist[1]
/listitem/itemizedlist/listitem"
mode="perlmod-dep">
<xsl:sort select="position()"
data-type="number"
order="descending"/>
</xsl:apply-templates>
</xsl:if>
<!-- End dependencies -->
<xsl:text>&#xA; </xsl:text>
</module><xsl:text>&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text>
<package><xsl:text>&#xA; </xsl:text>
<xsl:element name="name">
<xsl:value-of select="./@id"/>
</xsl:element>
<xsl:text>&#xA; </xsl:text>
<xsl:element name="version">
<xsl:value-of select="$version"/>
</xsl:element>
<xsl:if
test="document($installed-packages)//package[name=current()/@id]">
<xsl:text>&#xA; </xsl:text>
<xsl:element name="inst-version">
<xsl:value-of
select="document(
$installed-packages
)//package[name=current()/@id]/version"/>
</xsl:element>
</xsl:if>
<!-- Dependencies -->
<!-- If in Xorg or KDE chapter, consider that the preceding package is
the first dependency (not always noted in the book) -->
<xsl:if test="ancestor::chapter[@id='kde4-core'] or
(ancestor::chapter[@id='x-window-system'] and
preceding-sibling::sect1[@id != 'xorg7'])">
<xsl:text>
</xsl:text>
<xsl:choose>
<xsl:when test="contains(preceding-sibling::sect1[1]/@id,
'xorg7-') and not(@id='printproto')">
<xsl:call-template name="expand-deps">
<xsl:with-param name="section">
<xsl:value-of select="preceding-sibling::sect1[1]/@id"/>
</xsl:with-param>
<xsl:with-param name="status" select="'required'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:element name="dependency">
<xsl:attribute name="status">required</xsl:attribute>
<xsl:attribute name="name">
<xsl:choose>
<xsl:when test="@id='printproto'">xorg-server</xsl:when>
<xsl:otherwise>
<xsl:value-of
select="preceding-sibling::sect1[1]/@id"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="type">ref</xsl:attribute>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:apply-templates select=".//para[@role='required' or
@role='recommended' or
@role='optional']"
mode="dependency"/>
<!-- End dependencies -->
<xsl:text>&#xA; </xsl:text>
</package><xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="version">
<xsl:param name="label" select="abc-2"/>
<xsl:variable name="start" select="string-length(substring-before(translate($label,'123456789','000000000'),'-0'))+2"/>
<xsl:variable name="prelim-ver" select="substring($label,$start)"/>
<xsl:choose>
<xsl:when test="contains($prelim-ver,'onfiguration')"/>
<xsl:when test="contains($prelim-ver,'escription')"/>
<xsl:when test="contains($prelim-ver,'EggDBus')">
<xsl:value-of select="substring-before($prelim-ver,' (EggDBus)')"/>
</xsl:when>
<xsl:when test="contains($label,'JDK')">
<xsl:value-of select="translate($prelim-ver,' ','_')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$prelim-ver"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="para" mode="dependency">
<xsl:variable name="status" select="./@role"/>
<!-- No ulink for now (see special case for Perl modules) -->
<xsl:for-each select="./xref">
<xsl:choose>
<xsl:when test="contains(@linkend,'xorg7-')">
<xsl:call-template name="expand-deps">
<xsl:with-param name="section">
<xsl:value-of select="@linkend"/>
</xsl:with-param>
<xsl:with-param name="status">
<xsl:value-of select="$status"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>
</xsl:text>
<xsl:element name="dependency">
<xsl:attribute name="status">
<xsl:value-of select="$status"/>
</xsl:attribute>
<xsl:attribute name="name">
<xsl:value-of select="@linkend"/>
</xsl:attribute>
<xsl:attribute name="type">ref</xsl:attribute>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
<xsl:template match="listitem" mode="prec-dep">
<xsl:if test="preceding-sibling::listitem">
<xsl:text>
</xsl:text>
<xsl:element name="dependency">
<!-- the dep on the preceding package used to be required for python.
It seems optional now -->
<xsl:attribute name="status">optional</xsl:attribute>
<xsl:attribute name="name">
<xsl:value-of select="preceding-sibling::listitem[1]//@linkend"/>
</xsl:attribute>
<xsl:attribute name="type">ref</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<xsl:template match="listitem" mode="perlmod-dep">
<xsl:param name="glue" select="'&#xA; '"/>
<xsl:choose>
<xsl:when test="para/xref|para[@id]/ulink">
<xsl:value-of select="$glue"/>
<xsl:element name="dependency">
<xsl:attribute name="status">
<xsl:choose>
<xsl:when
test="count(./para/text()[contains(string(),
'ptional')
]
)&gt;0">optional</xsl:when>
<xsl:otherwise>required</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="name">
<xsl:if test="para/xref">
<xsl:value-of select="para/xref/@linkend"/>
</xsl:if>
<xsl:if test="para/ulink">
<xsl:value-of select="para/@id"/>
</xsl:if>
</xsl:attribute>
<xsl:attribute name="type">
<xsl:if test="para/xref">ref</xsl:if>
<xsl:if test="para/ulink">link</xsl:if>
</xsl:attribute>
<xsl:apply-templates select="itemizedlist/listitem"
mode="perlmod-dep">
<xsl:sort select="position()"
data-type="number"
order="descending"/>
<xsl:with-param name="glue" select="concat($glue,' ')"/>
</xsl:apply-templates>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="itemizedlist/listitem"
mode="perlmod-dep">
<xsl:sort select="position()"
data-type="number"
order="descending"/>
<xsl:with-param name="glue" select="$glue"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

442
BLFS/xsl/make_book.xsl Normal file
View file

@ -0,0 +1,442 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id: make_book.xsl 31 2012-02-19 08:25:04Z labastie $ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name="list" select="''"/>
<xsl:param name="MTA" select="'sendmail'"/>
<xsl:output
method="xml"
encoding="ISO-8859-1"
doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"/>
<xsl:template match="/">
<book>
<xsl:copy-of select="/book/bookinfo"/>
<preface>
<?dbhtml filename="preface.html"?>
<title>Preface</title>
<xsl:copy-of select="id('bootscripts')"/>
</preface>
<chapter>
<?dbhtml filename="chapter.html"?>
<title>Installing packages in dependency build order</title>
<xsl:call-template name="apply-list">
<xsl:with-param name="list" select="normalize-space($list)"/>
</xsl:call-template>
</chapter>
<xsl:copy-of select="id('CC')"/>
<xsl:copy-of select="id('MIT')"/>
<index/>
</book>
</xsl:template>
<!-- apply-templates for each item in the list.
Normally, those items are id of nodes.
Those nodes can be sect1 (normal case),
sect2 (python modules or DBus bindings)
bridgehead (perl modules)
para (dependency of perl modules).
The templates after this one treat each of those cases.
However, some items are xorg package names, and not id.
We need special instructions in that case.
The difficulty is that some of those names *are* id's,
because they are referenced in the index.
Hopefully, none of those id's are sect{1,2}, bridgehead or para...-->
<xsl:template name="apply-list">
<xsl:param name="list" select="''"/>
<xsl:if test="string-length($list) &gt; 0">
<xsl:choose>
<xsl:when test="contains($list,' ')">
<xsl:call-template name="apply-list">
<xsl:with-param name="list"
select="substring-before($list,' ')"/>
</xsl:call-template>
<xsl:call-template name="apply-list">
<xsl:with-param name="list"
select="substring-after($list,' ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="not(id($list)[self::sect1 or self::sect2 or self::para or self::bridgehead])">
<xsl:apply-templates
select="//sect1[contains(@id,'xorg7')
and contains(string(.//userinput),
concat($list,'-'))]"
mode="xorg">
<xsl:with-param name="package" select="$list"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="id($list)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<!-- The normal case : just copy to the book. Exceptions are if there
is a xref, so use a special "mode" template -->
<xsl:template match="sect1">
<xsl:apply-templates select="." mode="sect1"/>
</xsl:template>
<xsl:template match="processing-instruction()" mode="sect1">
<xsl:copy-of select="."/>
</xsl:template>
<!-- Any node which has no xref descendant is copied verbatim. If there
is an xref descendant, output the node and recurse. -->
<xsl:template match="*" mode="sect1">
<xsl:choose>
<xsl:when test="self::xref">
<xsl:choose>
<xsl:when test="contains(concat(' ',normalize-space($list),' '),
concat(' ',@linkend,' '))">
<xsl:choose>
<xsl:when test="@linkend='x-window-system' or @linkend='xorg7'">
<xref linkend="xorg7-server"/>
</xsl:when>
<xsl:when test="@linkend='server-mail'">
<xref linkend="{$MTA}"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="@linkend='bootscripts'">
<xsl:copy-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@linkend"/> (in full book)
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test=".//xref">
<xsl:element name="{name()}">
<xsl:for-each select="attribute::*">
<xsl:attribute name="{name()}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:for-each>
<xsl:apply-templates mode="sect1"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Python modules and DBus bindings -->
<xsl:template match="sect2">
<xsl:apply-templates select='.' mode="sect2"/>
</xsl:template>
<xsl:template match="*" mode="sect2">
<xsl:choose>
<xsl:when test="self::sect2">
<xsl:element name="sect1">
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
<xsl:attribute name="xreflabel"><xsl:value-of select="@xreflabel"/></xsl:attribute>
<xsl:processing-instruction name="dbhtml">filename="<xsl:value-of
select="@id"/>.html"</xsl:processing-instruction>
<xsl:apply-templates mode="sect2"/>
</xsl:element>
</xsl:when>
<xsl:when test="self::sect3">
<xsl:element name="sect2">
<xsl:attribute name="role">
<xsl:value-of select="@role"/>
</xsl:attribute>
<xsl:apply-templates mode="sect2"/>
</xsl:element>
</xsl:when>
<xsl:when test="self::bridgehead">
<xsl:element name="bridgehead">
<xsl:attribute name="renderas">
<xsl:if test="@renderas='sect4'">sect3</xsl:if>
<xsl:if test="@renderas='sect5'">sect4</xsl:if>
</xsl:attribute>
<xsl:value-of select='.'/>
</xsl:element>
</xsl:when>
<xsl:when test="self::xref">
<xsl:choose>
<xsl:when test="contains(concat(' ',normalize-space($list),' '),
concat(' ',@linkend,' '))">
<xsl:choose>
<xsl:when test="@linkend='x-window-system' or @linkend='xorg7'">
<xref linkend="xorg7-server"/>
</xsl:when>
<xsl:when test="@linkend='server-mail'">
<xref linkend="{$MTA}"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@linkend"/> (in full book)
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test=".//xref">
<xsl:element name="{name()}">
<xsl:for-each select="attribute::*">
<xsl:attribute name="{name()}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:for-each>
<xsl:apply-templates mode="sect2"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Perl modules : transform them to minimal sect1. Use a template
for installation instructions -->
<xsl:template match="bridgehead">
<xsl:element name="sect1">
<xsl:attribute name="id"><xsl:value-of select="./@id"/></xsl:attribute>
<xsl:attribute name="xreflabel"><xsl:value-of select="./@xreflabel"/></xsl:attribute>
<xsl:processing-instruction name="dbhtml">
filename="<xsl:value-of select="@id"/>.html"</xsl:processing-instruction>
<title><xsl:value-of select="./@xreflabel"/></title>
<sect2 role="package">
<title>Introduction to <xsl:value-of select="@id"/></title>
<bridgehead renderas="sect3">Package Information</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>Download (HTTP): <xsl:copy-of select="./following-sibling::itemizedlist[1]/listitem/para/ulink"/></para>
</listitem>
<listitem>
<para>Download (FTP): <ulink url=" "/></para>
</listitem>
</itemizedlist>
</sect2>
<xsl:choose>
<xsl:when test="following-sibling::itemizedlist[1]//xref[@linkend='perl-standard-install'] | following-sibling::itemizedlist[1]/preceding-sibling::para//xref[@linkend='perl-standard-install']">
<xsl:apply-templates mode="perl-install" select="id('perl-standard-install')"/>
</xsl:when>
<xsl:otherwise>
<sect2 role="installation">
<title>Installation of <xsl:value-of select="@xreflabel"/></title>
<para>Run the following commands:</para>
<for-each select="following-sibling::bridgehead/preceding-sibling::screen[not(@role)]">
<xsl:copy-of select="."/>
</for-each>
<para>Now, as the <systemitem class="username">root</systemitem> user:</para>
<for-each select="following-sibling::bridgehead/preceding-sibling::screen[@role='root']">
<xsl:copy-of select="."/>
</for-each>
</sect2>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:template>
<!-- The case of depdendencies of perl modules. Same treatment
as for perl modules. Just easier because always perl standard -->
<xsl:template match="para">
<xsl:element name="sect1">
<xsl:attribute name="id"><xsl:value-of select="./@id"/></xsl:attribute>
<xsl:attribute name="xreflabel"><xsl:value-of select="./@xreflabel"/></xsl:attribute>
<xsl:processing-instruction name="dbhtml">filename="<xsl:value-of
select="@id"/>.html"</xsl:processing-instruction>
<title><xsl:value-of select="./@xreflabel"/></title>
<sect2 role="package">
<title>Introduction to <xsl:value-of select="@id"/></title>
<bridgehead renderas="sect3">Package Information</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>Download (HTTP): <xsl:copy-of select="./ulink"/></para>
</listitem>
<listitem>
<para>Download (FTP): <ulink url=" "/></para>
</listitem>
</itemizedlist>
</sect2>
<xsl:apply-templates mode="perl-install" select="id('perl-standard-install')"/>
</xsl:element>
</xsl:template>
<!-- copy of the perl standard installation instructions:
suppress id (otherwise not unique) and note (which we
do not want to apply -->
<xsl:template match="sect2" mode="perl-install">
<sect2 role="installation">
<xsl:for-each select="./*">
<xsl:if test="not(self::note)">
<xsl:copy-of select="."/>
</xsl:if>
</xsl:for-each>
</sect2>
</xsl:template>
<!-- we have got an xorg package. We are at the installation page
but now we need to make an autonomous page from the global
one -->
<xsl:template match="sect1" mode="xorg">
<xsl:param name="package"/>
<xsl:variable name="tarball">
<xsl:call-template name="tarball">
<xsl:with-param name="package" select="concat(' ',$package,'-')"/>
<xsl:with-param name="cat-md5"
select="string(.//userinput[starts-with(string(),'cat ')])"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="md5sum">
<xsl:call-template name="md5sum">
<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"
select=".//userinput[starts-with(string(),'for ')]"/>
</xsl:call-template>
</xsl:variable>
<xsl:element name="sect1">
<xsl:attribute name="id"><xsl:value-of select="$package"/></xsl:attribute>
<xsl:processing-instruction name="dbhtml">
filename="<xsl:value-of select='$package'/>.html"
</xsl:processing-instruction>
<title><xsl:value-of select="$package"/></title>
<sect2 role="package">
<title>Introduction to <xsl:value-of select="$package"/></title>
<bridgehead renderas="sect3">Package Information</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>Download (HTTP): <xsl:element name="ulink">
<xsl:attribute name="url">
<xsl:value-of
select=".//para[contains(string(),'(HTTP)')]/ulink/@url"/>
<xsl:value-of select="$tarball"/>
</xsl:attribute>
</xsl:element>
</para>
</listitem>
<listitem>
<para>Download (FTP): <xsl:element name="ulink">
<xsl:attribute name="url">
<xsl:value-of
select=".//para[contains(string(),'(FTP)')]/ulink/@url"/>
<xsl:value-of select="$tarball"/>
</xsl:attribute>
</xsl:element>
</para>
</listitem>
<listitem>
<para>
Download MD5 sum: <xsl:value-of select="$md5sum"/>
</para>
</listitem>
</itemizedlist>
</sect2>
<sect2 role="installation">
<title>Installation of <xsl:value-of select="$package"/></title>
<para>
Install <application><xsl:value-of select="$package"/></application>
by running the following commands:
</para>
<screen><userinput>packagedir=<xsl:value-of
select="substring-before($tarball,'.tar.bz2')"/>
<xsl:text>&#xA;</xsl:text>
<xsl:value-of select="substring-before($install-instructions,
'as_root')"/>
</userinput></screen>
<para>
Now as the <systemitem class="username">root</systemitem> user:
</para>
<screen role='root'>
<userinput><xsl:value-of select="substring-after(
$install-instructions,
'as_root')"/>
</userinput>
</screen>
</sect2>
</xsl:element><!-- sect1 -->
</xsl:template>
<!-- get the tarball name from the text that comes from the .md5 file -->
<xsl:template name="tarball">
<xsl:param name="package"/>
<xsl:param name="cat-md5"/>
<!-- DEBUG
<xsl:message><xsl:text>Entering "tarball" template:
package is: </xsl:text>
<xsl:value-of select="$package"/><xsl:text>
cat-md5 is: </xsl:text>
<xsl:value-of select="$cat-md5"/>
</xsl:message>
END DEBUG -->
<xsl:choose>
<xsl:when test="contains(substring-before($cat-md5,$package),'&#xA;')">
<xsl:call-template name="tarball">
<xsl:with-param name="package" select="$package"/>
<xsl:with-param name="cat-md5"
select="substring-after($cat-md5,'&#xA;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="substring-after(
substring-before($cat-md5,'&#xA;'),' ')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- same for md5sum -->
<xsl:template name="md5sum">
<xsl:param name="package"/>
<xsl:param name="cat-md5"/>
<xsl:choose>
<xsl:when test="contains(substring-before($cat-md5,$package),'&#xA;')">
<xsl:call-template name="md5sum">
<xsl:with-param name="package" select="$package"/>
<xsl:with-param name="cat-md5"
select="substring-after($cat-md5,'&#xA;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="substring-before($cat-md5,' ')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="inst-instr">
<xsl:param name="inst-instr"/>
<xsl:choose>
<xsl:when test="contains($inst-instr,'pushd')">
<xsl:call-template name="inst-instr">
<xsl:with-param name="inst-instr"
select="substring-after(
substring-after($inst-instr,'pushd'),
'&#xA;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="substring-before($inst-instr,'popd')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

616
BLFS/xsl/scripts.xsl Normal file
View file

@ -0,0 +1,616 @@
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl"
version="1.0">
<!-- $Id: scripts.xsl 34 2012-02-21 16:05:09Z labastie $ -->
<!-- XSLT stylesheet to create shell scripts from "linear build" BLFS books. -->
<!-- Build as user (y) or as root (n)? -->
<xsl:param name="sudo" select="'y'"/>
<xsl:template match="/">
<xsl:apply-templates select="//sect1"/>
</xsl:template>
<!--=================== Master chunks code ======================-->
<xsl:template match="sect1">
<xsl:if test="@id != 'bootscripts'">
<!-- The file names -->
<xsl:variable name="filename" select="@id"/>
<!-- The build order -->
<xsl:variable name="position" select="position()"/>
<xsl:variable name="order">
<xsl:choose>
<xsl:when test="string-length($position) = 1">
<xsl:text>00</xsl:text>
<xsl:value-of select="$position"/>
</xsl:when>
<xsl:when test="string-length($position) = 2">
<xsl:text>0</xsl:text>
<xsl:value-of select="$position"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$position"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Depuration code -->
<xsl:message>
<xsl:text>SCRIPT is </xsl:text>
<xsl:value-of select="concat($order,'-z-',$filename)"/>
<xsl:text>&#xA; FTPDIR is </xsl:text>
<xsl:value-of select="$filename"/>
<xsl:text>&#xA;&#xA;</xsl:text>
</xsl:message>
<!-- Creating the scripts -->
<exsl:document href="{$order}-z-{$filename}" method="text">
<xsl:text>#!/bin/bash&#xA;set -e&#xA;&#xA;</xsl:text>
<xsl:choose>
<!-- Package page -->
<xsl:when test="sect2[@role='package'] and not(@id = 'xorg7-app' or
@id = 'xorg7-data' or @id = 'xorg7-driver' or
@id = 'xorg7-font' or @id = 'xorg7-lib' or
@id = 'xorg7-proto' or @id = 'xorg7-util')">
<!-- Variables -->
<!-- These three lines could be important if SRC_ARCHIVE,
FTP_SERVER and SRCDIR were not set in the environment.
But they are not tested for length or anything later,
so not needed
<xsl:text>SRC_ARCHIVE=$SRC_ARCHIVE&#xA;</xsl:text>
<xsl:text>FTP_SERVER=$FTP_SERVER&#xA;</xsl:text>
<xsl:text>SRC_DIR=$SRC_DIR&#xA;&#xA;</xsl:text>-->
<xsl:text>&#xA;PKG_DIR=</xsl:text>
<xsl:value-of select="$filename"/>
<xsl:text>&#xA;</xsl:text>
<!-- Download code and build commands -->
<xsl:apply-templates select="sect2"/>
<!-- Clean-up -->
<!-- xorg7-server used to require mesalib tree being present.
That is no more true
<xsl:if test="not(@id='mesalib')"> -->
<xsl:text>cd $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
<!-- In some case, some files in the build tree are owned
by root -->
<xsl:if test="$sudo='y'">
<xsl:text>sudo </xsl:text>
</xsl:if>
<xsl:text>rm -rf $UNPACKDIR unpacked&#xA;&#xA;</xsl:text>
<!-- Same reason as preceding comment
</xsl:if>
<xsl:if test="@id='xorg7-server'">
<xsl:text>cd $SRC_DIR/MesaLib
UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^./@@;s@/.*@@'`
rm -rf $UNPACKDIR unpacked&#xA;&#xA;</xsl:text>
</xsl:if> -->
</xsl:when>
<!-- Xorg7 pseudo-packages -->
<xsl:when test="contains(@id,'xorg7') and not(@id = 'xorg7-server')">
<xsl:text># Useless SRC_DIR=$SRC_DIR
cd $SRC_DIR
mkdir -p xc
cd xc&#xA;</xsl:text>
<xsl:apply-templates select="sect2" mode="xorg7"/>
</xsl:when>
<!-- Non-package page -->
<xsl:otherwise>
<xsl:apply-templates select=".//screen"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>exit</xsl:text>
</exsl:document>
</xsl:if>
</xsl:template>
<!--======================= Sub-sections code =======================-->
<xsl:template match="sect2">
<xsl:choose>
<xsl:when test="@role = 'package'">
<xsl:text>mkdir -p $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
<xsl:text>cd $SRC_DIR/$PKG_DIR&#xA;</xsl:text>
<xsl:apply-templates select="bridgehead[@renderas='sect3']"/>
<xsl:text>&#xA;</xsl:text>
</xsl:when>
<xsl:when test="@role = 'installation'">
<xsl:text>
if [ "${PACKAGE%.zip}" = "${PACKAGE}" ]; then
if [[ -e unpacked ]] ; then
UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^./@@;s@/.*@@'`
[[ -n $UNPACKDIR ]] &amp;&amp; [[ -d $UNPACKDIR ]] &amp;&amp; rm -rf $UNPACKDIR
fi
tar -xvf $PACKAGE > unpacked
UNPACKDIR=`grep '[^./]\+' unpacked | head -n1 | sed 's@^./@@;s@/.*@@'`
else
UNPACKDIR=${PACKAGE%.zip}
[[ -n $UNPACKDIR ]] &amp;&amp; [[ -d $UNPACKDIR ]] &amp;&amp; rm -rf $UNPACKDIR
unzip -d $UNPACKDIR ${PACKAGE}
fi
cd $UNPACKDIR&#xA;</xsl:text>
<xsl:apply-templates select=".//screen | .//para/command"/>
<xsl:if test="$sudo = 'y'">
<xsl:text>sudo /sbin/</xsl:text>
</xsl:if>
<xsl:text>ldconfig&#xA;&#xA;</xsl:text>
</xsl:when>
<xsl:when test="@role = 'configuration'">
<xsl:apply-templates select=".//screen" mode="config"/>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="sect2" mode="xorg7">
<xsl:choose>
<!-- <xsl:when test="@role = 'package'">
<xsl:apply-templates select="itemizedlist/listitem/para" mode="xorg7"/>
</xsl:when>-->
<xsl:when test="not(@role)">
<!-- This is the packages download instructions> -->
<xsl:apply-templates select=".//screen" mode="xorg7"/>
</xsl:when>
<xsl:when test="@role = 'installation'">
<xsl:apply-templates select=".//screen" mode="xorg7"/>
<xsl:if test="$sudo = 'y'">
<xsl:text>sudo /sbin/</xsl:text>
</xsl:if>
<xsl:text>ldconfig&#xA;&#xA;</xsl:text>
</xsl:when>
<xsl:when test="@role = 'configuration'">
<xsl:text>if [[ $XORG_PREFIX != /usr ]] ; then&#xA;</xsl:text>
<xsl:apply-templates select=".//screen"/>
<xsl:text>fi&#xA;</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
<!--==================== Download code =======================-->
<xsl:template name="package_name">
<xsl:param name="url" select="foo"/>
<xsl:param name="sub-url" select="substring-after($url,'/')"/>
<xsl:choose>
<xsl:when test="contains($sub-url,'/')">
<xsl:call-template name="package_name">
<xsl:with-param name="url" select="$sub-url"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="contains($sub-url,'?')">
<xsl:value-of select="substring-before($sub-url,'?')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$sub-url"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="bridgehead">
<xsl:choose>
<xsl:when test="string()='Package Information'">
<xsl:variable name="url">
<xsl:choose>
<xsl:when
test="string-length(
following-sibling::itemizedlist[1]/listitem[1]/para/ulink/@url)
&gt; 10">
<xsl:value-of select=
"following-sibling::itemizedlist[1]/listitem[1]/para/ulink/@url"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select=
"following-sibling::itemizedlist[1]/listitem[2]/para/ulink/@url"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="package">
<xsl:call-template name="package_name">
<xsl:with-param name="url" select="$url"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable
name="first_letter"
select="translate(substring($package,1,1),
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
'abcdefghijklmnopqrstuvwxyz')"/>
<xsl:text>PACKAGE=</xsl:text>
<xsl:value-of select="$package"/>
<xsl:text>&#xA;if [[ ! -f $PACKAGE ]] ; then&#xA;</xsl:text>
<!-- SRC_ARCHIVE may have subdirectories or not -->
<xsl:text> if [[ -f $SRC_ARCHIVE/$PKG_DIR/$PACKAGE ]] ; then&#xA;</xsl:text>
<xsl:text> cp $SRC_ARCHIVE/$PKG_DIR/$PACKAGE $PACKAGE&#xA;</xsl:text>
<xsl:text> elif [[ -f $SRC_ARCHIVE/$PACKAGE ]] ; then&#xA;</xsl:text>
<xsl:text> cp $SRC_ARCHIVE/$PACKAGE $PACKAGE&#xA; else&#xA;</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>/$PACKAGE</xsl:text>
<xsl:apply-templates
select="following-sibling::itemizedlist[1]/listitem/para"
mode="package"/>
</xsl:when>
<xsl:when test="contains(string(),'Additional')">
<xsl:apply-templates
select="following-sibling::itemizedlist[1]/listitem/para"
mode="additional"/>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:template>
<xsl:template match="para" mode="package">
<xsl:choose>
<xsl:when test="contains(string(),'HTTP')">
<!-- Upstream HTTP URL -->
<xsl:if test="string-length(ulink/@url) &gt; '10'">
<xsl:text> || \&#xA; wget -T 30 -t 5 </xsl:text>
<xsl:choose>
<xsl:when test="contains(ulink/@url,'?')">
<xsl:value-of select="substring-before(ulink/@url,'?')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="ulink/@url"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="not(contains(string(parent::listitem/following-sibling::listitem[1]/para),'FTP'))">
<xsl:text>
cp $PACKAGE $SRC_ARCHIVE
fi
fi
</xsl:text>
</xsl:if>
</xsl:if>
</xsl:when>
<xsl:when test="contains(string(),'FTP')">
<!-- Upstream FTP URL -->
<xsl:if test="string-length(ulink/@url) &gt; '10'">
<xsl:text> || \&#xA; wget -T 30 -t 5 </xsl:text>
<xsl:value-of select="ulink/@url"/>
</xsl:if>
<xsl:text>
cp $PACKAGE $SRC_ARCHIVE
fi
fi
</xsl:text>
</xsl:when>
<xsl:when test="contains(string(),'MD5')">
<!-- some md5 sums are written with a LF -->
<xsl:variable name="md5">
<xsl:choose>
<xsl:when test="contains(substring-after(string(),'sum: '),'&#xA;')">
<xsl:value-of select="substring-before(substring-after(string(),'sum: '),'&#xA;')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring-after(string(),'sum: ')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:text>echo "</xsl:text>
<xsl:value-of select="$md5"/>
<xsl:text>&#x20;&#x20;$PACKAGE" | md5sum -c -&#xA;</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="para" mode="additional">
<xsl:choose>
<xsl:when test="contains(string(ulink/@url),'.patch')">
<xsl:variable name="patch">
<xsl:call-template name="package_name">
<xsl:with-param name="url" select="ulink/@url"/>
</xsl:call-template>
</xsl:variable>
<xsl:text>PATCH=</xsl:text>
<xsl:value-of select="$patch"/>
<xsl:text>&#xA;if [[ ! -f $PATCH ]] ; then&#xA;</xsl:text>
<!-- SRC_ARCHIVE may have subdirectories or not -->
<xsl:text> if [[ -f $SRC_ARCHIVE/$PKG_DIR/$PATCH ]] ; then&#xA;</xsl:text>
<xsl:text> cp $SRC_ARCHIVE/$PKG_DIR/$PATCH $PATCH&#xA;</xsl:text>
<xsl:text> elif [[ -f $SRC_ARCHIVE/$PATCH ]] ; then&#xA;</xsl:text>
<xsl:text> cp $SRC_ARCHIVE/$PATCH $PATCH&#xA; else&#xA;</xsl:text>
<xsl:text>wget -T 30 -t 5 </xsl:text>
<xsl:value-of select="ulink/@url"/>
<xsl:text>&#xA;</xsl:text>
<xsl:text>
cp $PATCH $SRC_ARCHIVE
fi
fi
</xsl:text>
</xsl:when>
<xsl:when test="ulink">
<xsl:if test="string-length(ulink/@url) &gt; '10'">
<xsl:variable name="package">
<xsl:call-template name="package_name">
<xsl:with-param name="url" select="ulink/@url"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable
name="first_letter"
select="translate(substring($package,1,1),
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
'abcdefghijklmnopqrstuvwxyz')"/>
<xsl:text>PACKAGE1=</xsl:text>
<xsl:value-of select="$package"/>
<xsl:text>&#xA;if [[ ! -f $PACKAGE1 ]] ; then&#xA;</xsl:text>
<!-- SRC_ARCHIVE may have subdirectories or not -->
<xsl:text> if [[ -f $SRC_ARCHIVE/$PKG_DIR/$PACKAGE1 ]] ; then&#xA;</xsl:text>
<xsl:text> cp $SRC_ARCHIVE/$PKG_DIR/$PACKAGE1 $PACKAGE1&#xA;</xsl:text>
<xsl:text> elif [[ -f $SRC_ARCHIVE/$PACKAGE1 ]] ; then&#xA;</xsl:text>
<xsl:text> cp $SRC_ARCHIVE/$PACKAGE1 $PACKAGE1&#xA; else&#xA;</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>/$PACKAGE1</xsl:text>
<xsl:text> || \&#xA; wget -T 30 -t 5 </xsl:text>
<xsl:value-of select="ulink/@url"/>
<xsl:text>
cp $PACKAGE1 $SRC_ARCHIVE
fi
fi
</xsl:text>
</xsl:if>
</xsl:when>
<xsl:when test="contains(string(),'MD5')">
<!-- some md5 sums are written with a LF -->
<xsl:variable name="md5">
<xsl:choose>
<xsl:when test="contains(substring-after(string(),'sum: '),'&#xA;')">
<xsl:value-of select="substring-before(substring-after(string(),'sum: '),'&#xA;')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring-after(string(),'sum: ')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:text>echo "</xsl:text>
<xsl:value-of select="$md5"/>
<xsl:text>&#x20;&#x20;$PACKAGE1" | md5sum -c -&#xA;</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="itemizedlist/listitem/para" mode="xorg7">
<xsl:if test="contains(string(ulink/@url),'.md5') or
contains(string(ulink/@url),'.wget')">
<xsl:text>wget -T 30 -t 5 </xsl:text>
<xsl:value-of select="ulink/@url"/>
<xsl:text>&#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="itemizedlist/listitem/para" mode="xorg7-patch">
<xsl:if test="contains(string(ulink/@url),'.patch')">
<xsl:text>wget -T 30 -t 5 </xsl:text>
<xsl:value-of select="ulink/@url"/>
<xsl:text>&#xA;</xsl:text>
</xsl:if>
</xsl:template>
<!--======================== Commands code ==========================-->
<xsl:template match="screen">
<xsl:if test="child::* = userinput and not(@role = 'nodump')">
<xsl:choose>
<xsl:when test="@role = 'root'">
<xsl:if test="$sudo = 'y'">
<xsl:text>sudo -E sh &lt;&lt; ROOT_EOF&#xA;</xsl:text>
</xsl:if>
<xsl:apply-templates mode="root"/>
<xsl:if test="$sudo = 'y'">
<xsl:text>&#xA;ROOT_EOF</xsl:text>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="userinput"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>&#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="screen" mode="xorg7">
<xsl:if test="child::* = userinput and not(@role = 'nodump')">
<xsl:apply-templates select="userinput" mode="xorg7"/>
<xsl:text>&#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="screen" mode="config">
<xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
<xsl:text>[[ ! -d $SRC_DIR/blfs-bootscripts ]] &amp;&amp; mkdir $SRC_DIR/blfs-bootscripts
pushd $SRC_DIR/blfs-bootscripts
URL=</xsl:text>
<xsl:value-of select="id('bootscripts')//itemizedlist//ulink/@url"/><xsl:text>
BOOTPACKG=$(basename $URL)
[[ ! -f "$BOOTPACKG" ]] &amp;&amp; { wget -T 30 -t 5 $URL; rm -f unpacked; }
if [[ -e unpacked ]] ; then
UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
if ! [[ -d $UNPACKDIR ]]; then
rm unpacked
tar -xvf $BOOTPACKG > unpacked
UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
fi
else
tar -xvf $BOOTPACKG > unpacked
UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'`
fi
cd $UNPACKDIR
</xsl:text>
</xsl:if>
<xsl:apply-templates select='.'/>
<xsl:if test="preceding-sibling::para[1]/xref[@linkend='bootscripts']">
<xsl:text>
popd</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:template>
<xsl:template match="screen" mode="sect-ver">
<xsl:text>section=</xsl:text>
<xsl:value-of select="substring-before(substring-after(string(),'mkdir '),' &amp;')"/>
<xsl:text>&#xA;sect_ver=</xsl:text>
<xsl:value-of select="substring-before(substring-after(string(),'-c ../'),'.md5')"/>
<xsl:text>&#xA;</xsl:text>
</xsl:template>
<xsl:template match="para/command">
<xsl:if test="(contains(string(),'test') or
contains(string(),'check'))">
<xsl:text>#</xsl:text>
<xsl:value-of select="substring-before(string(),'make')"/>
<xsl:text>make -k</xsl:text>
<xsl:value-of select="substring-after(string(),'make')"/>
<xsl:text> || true&#xA;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="userinput">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="userinput" mode="xorg7">
<xsl:apply-templates mode="xorg7"/>
</xsl:template>
<xsl:template match="text()" mode="xorg7">
<xsl:call-template name="output-text">
<xsl:with-param name="out-string" select="string()"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="output-text">
<xsl:param name="out-string" select="''"/>
<xsl:choose>
<xsl:when test="contains($out-string,'bash -e')">
<xsl:call-template name="output-text">
<xsl:with-param name="out-string"
select="substring-before($out-string,'bash -e')"/>
</xsl:call-template>
<xsl:text># bash -e</xsl:text>
<xsl:call-template name="output-text">
<xsl:with-param name="out-string"
select="substring-after($out-string,'bash -e')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($out-string,'exit')">
<xsl:call-template name="output-text">
<xsl:with-param name="out-string"
select="substring-before($out-string,'exit')"/>
</xsl:call-template>
<xsl:text># exit</xsl:text>
<xsl:call-template name="output-text">
<xsl:with-param name="out-string"
select="substring-after($out-string,'exit')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($out-string,'mkdir')">
<xsl:call-template name="output-text">
<xsl:with-param name="out-string"
select="substring-before($out-string,'mkdir')"/>
</xsl:call-template>
<xsl:text>mkdir -p</xsl:text>
<xsl:call-template name="output-text">
<xsl:with-param name="out-string"
select="substring-after($out-string,'mkdir')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($out-string,'rm -r ')">
<xsl:call-template name="output-text">
<xsl:with-param name="out-string"
select="substring-before($out-string,'rm -r ')"/>
</xsl:call-template>
<xsl:text>rm -rf </xsl:text>
<xsl:call-template name="output-text">
<xsl:with-param name="out-string"
select="substring-after($out-string,'rm -r ')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$out-string"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="text()" mode="root">
<xsl:call-template name="output-root">
<xsl:with-param name="out-string" select="string()"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="output-root">
<xsl:param name="out-string" select="''"/>
<xsl:choose>
<xsl:when test="contains($out-string,'make')">
<xsl:call-template name="output-root">
<xsl:with-param name="out-string"
select="substring-before($out-string,'make')"/>
</xsl:call-template>
<xsl:text>make -j1</xsl:text>
<xsl:call-template name="output-root">
<xsl:with-param name="out-string"
select="substring-after($out-string,'make')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($out-string,'$') and $sudo = 'y'">
<xsl:call-template name="output-root">
<xsl:with-param name="out-string"
select="substring-before($out-string,'$')"/>
</xsl:call-template>
<xsl:text>\$</xsl:text>
<xsl:call-template name="output-root">
<xsl:with-param name="out-string"
select="substring-after($out-string,'$')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($out-string,'`') and $sudo = 'y'">
<xsl:call-template name="output-root">
<xsl:with-param name="out-string"
select="substring-before($out-string,'`')"/>
</xsl:call-template>
<xsl:text>\`</xsl:text>
<xsl:call-template name="output-root">
<xsl:with-param name="out-string"
select="substring-after($out-string,'`')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($out-string,'\') and $sudo = 'y'">
<xsl:call-template name="output-root">
<xsl:with-param name="out-string"
select="substring-before($out-string,'\')"/>
</xsl:call-template>
<xsl:text>\\</xsl:text>
<xsl:call-template name="output-root">
<xsl:with-param name="out-string"
select="substring-after($out-string,'\')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$out-string"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="replaceable">
<xsl:text>**EDITME</xsl:text>
<xsl:apply-templates/>
<xsl:text>EDITME**</xsl:text>
</xsl:template>
<xsl:template match="replaceable" mode="root">
<xsl:text>**EDITME</xsl:text>
<xsl:apply-templates/>
<xsl:text>EDITME**</xsl:text>
</xsl:template>
</xsl:stylesheet>

View file

@ -22,8 +22,8 @@ menu "--- BOOK Settings"
# config BOOK_HLFS # config BOOK_HLFS
# bool "Hardened Linux From Scratch" # bool "Hardened Linux From Scratch"
config BOOK_BLFS # config BOOK_BLFS
bool "Beyond Linux From Scratch" # bool "Beyond Linux From Scratch"
endchoice endchoice
config PROGNAME config PROGNAME
@ -33,12 +33,12 @@ menu "--- BOOK Settings"
default "clfs2" if BOOK_CLFS2 default "clfs2" if BOOK_CLFS2
default "clfs3" if BOOK_CLFS3 default "clfs3" if BOOK_CLFS3
default "hlfs" if BOOK_HLFS default "hlfs" if BOOK_HLFS
default "blfs" if BOOK_BLFS # default "blfs" if BOOK_BLFS
config RUN_ME config RUN_ME
string string
default "./jhalfs run" if !BOOK_BLFS default "./jhalfs run"# if !BOOK_BLFS
default "./blfs-tool" if BOOK_BLFS # default "./blfs-tool" if BOOK_BLFS
#--- End BOOK/script #--- End BOOK/script
#--- Book version #--- Book version
@ -60,7 +60,7 @@ menu "--- BOOK Settings"
config WORKING_COPY config WORKING_COPY
bool "Working Copy" bool "Working Copy"
depends on !BOOK_BLFS # depends on !BOOK_BLFS
help help
#-- A local working copy #-- A local working copy
@ -500,7 +500,7 @@ menu "--- BOOK Settings"
config CUSTOM_TOOLS config CUSTOM_TOOLS
bool "Add custom tools support" bool "Add custom tools support"
default n default n
depends on !BOOK_BLFS # depends on !BOOK_BLFS
help help
#--- Activating this option additional packages you create #--- Activating this option additional packages you create
# will be installed after finished the xLFS system build. # will be installed after finished the xLFS system build.
@ -511,7 +511,8 @@ menu "--- BOOK Settings"
config BLFS_TOOL config BLFS_TOOL
bool "Add blfs-tool support" bool "Add blfs-tool support"
default n default n
depends on !BOOK_BLFS && !BOOK_CLFS3 # depends on !BOOK_BLFS && !BOOK_CLFS3
depends on !BOOK_CLFS3
help help
#--- Activating this option will install additional #--- Activating this option will install additional
# packages needed to use blfs-tool when booting # packages needed to use blfs-tool when booting
@ -573,17 +574,12 @@ menu "--- BOOK Settings"
bool "DocBook XML DTD (required)" bool "DocBook XML DTD (required)"
default y default y
config DEP_UNZIP
bool "UnZip (required to install DocBook XML DTD)"
default y
depends on DEP_DBXML
#config DEP_DBXSL #config DEP_DBXSL
#bool "DocBook XSL (required)" #bool "DocBook XSL (required)"
#default y #default y
config DEP_LYNX config DEP_LYNX
bool "lynx (required)" bool "lynx (optional, for reading the generated book)"
default y default y
config DEP_SUDO config DEP_SUDO
@ -596,34 +592,46 @@ menu "--- BOOK Settings"
config DEP_GPM config DEP_GPM
bool "GPM (optional, see help)" bool "GPM (optional, see help)"
default y default n
help help
#-- You MUST install the gpm bootscript manually #-- if you install gpm, it will be started
# and create its configuration file. # automatically on boot. You'll have to edit
# # /etc/sysconfig/mouse for your system
# An alternative is to unselect this option and
# install gpm, its configuration file, and its
# bootscript using the custom tools support.
config DEP_SVN config DEP_SVN
bool "SVN client (optional, see help)" bool "SVN client (optional, see help)"
default n default n
help help
#-- Subversion-1.3.1 will be installed. This version is #-- Subversion is needed for updating the book
# old but does not rely on additional packages to be # sources. If you want ssl support, select
# built. # OPENSSL below.
#
# If you are happy with this old version and don't config DEP_OPENSSL
# need extra features, select this option. bool "OPENSSL (optional, see help)"
default n
help
#-- selecting OPENSSL here allows to build
# subversion with ssl support, avoiding a later
# recompilation
config DEP_PYTHON
bool "PYTHON 2 (optional, see help)"
default n
help
#-- selecting PYTHON 2 here allows to build
# the libxml2 and libxslt python modules,
# avoiding a later recompilation
endmenu endmenu
#--- End blfs-tool Support #--- End blfs-tool Support
#--- BLFS specific params #--- BLFS specific params
config BLFS_ROOT config BLFS_ROOT
string "Directory root" string "Directory root"
default "$HOME/blfs_root" if BOOK_BLFS # default "$HOME/blfs_root" if BOOK_BLFS
default "/blfs_root" if BLFS_TOOL default "/blfs_root" if BLFS_TOOL
depends on BOOK_BLFS || BLFS_TOOL # depends on BOOK_BLFS || BLFS_TOOL
depends on BLFS_TOOL
help help
#-- Full path to the directory where all required #-- Full path to the directory where all required
# files and scripts will be stored. # files and scripts will be stored.
@ -631,7 +639,8 @@ menu "--- BOOK Settings"
config BLFS_XML config BLFS_XML
string "BLFS sources directory" string "BLFS sources directory"
default "blfs-xml" default "blfs-xml"
depends on BOOK_BLFS || BLFS_TOOL # depends on BOOK_BLFS || BLFS_TOOL
depends BLFS_TOOL
help help
#-- The directory name under $BLFS_ROOT where the BLFS #-- The directory name under $BLFS_ROOT where the BLFS
# book sources will be checkout. # book sources will be checkout.
@ -639,7 +648,8 @@ menu "--- BOOK Settings"
config TRACKING_DIR config TRACKING_DIR
string "Installed packages database directory" string "Installed packages database directory"
default "/var/lib/jhalfs/BLFS" default "/var/lib/jhalfs/BLFS"
depends on BOOK_BLFS || BLFS_TOOL || CUSTOM_TOOLS # depends on BOOK_BLFS || BLFS_TOOL || CUSTOM_TOOLS
depends on BLFS_TOOL || CUSTOM_TOOLS
help help
#-- Full path to the directory where the database of #-- Full path to the directory where the database of
# installed packages will be created. # installed packages will be created.
@ -660,7 +670,7 @@ menu "--- BOOK Settings"
endmenu endmenu
menu "--- General Settings" menu "--- General Settings"
depends on !BOOK_BLFS # depends on !BOOK_BLFS
#--- Set User Account #--- Set User Account
config CONFIG_USER config CONFIG_USER
@ -806,7 +816,7 @@ menu "--- General Settings"
endmenu endmenu
menu "--- Build Settings" menu "--- Build Settings"
depends on !BOOK_BLFS # depends on !BOOK_BLFS
#--- Test Suites #--- Test Suites
config CONFIG_TESTS config CONFIG_TESTS
@ -1011,7 +1021,7 @@ menu "--- Build Settings"
endmenu endmenu
menu "--- Advanced Features" menu "--- Advanced Features"
depends on !BOOK_BLFS # depends on !BOOK_BLFS
config REPORT config REPORT
bool "Create SBU and disk usage report" bool "Create SBU and disk usage report"
@ -1164,7 +1174,7 @@ endmenu
config REBUILD_MAKEFILE config REBUILD_MAKEFILE
bool "Rebuild the Makefile (see help)" bool "Rebuild the Makefile (see help)"
default n default n
depends on !BOOK_BLFS # depends on !BOOK_BLFS
help help
#-- Rebuild the Makefile #-- Rebuild the Makefile
# #

View file

@ -6,32 +6,15 @@ I felt the need for documenting it when trying to add package management.
Functions are listed in alphabetical order, with a short description and the Functions are listed in alphabetical order, with a short description and the
file where they are defined. file where they are defined.
-----------------------------------------------------------------------------
add_blfs_deps_urls():
From common/libs/func_blfs_deps.
Description: Since the URLS and MD5 of BLFS dependencies are hardcoded,
there is no easy way to extrat them. So this function adds them at the
end of `urls.lst'.
Called by: create_urls
-------------------------------------------------------------------------- --------------------------------------------------------------------------
copy_blfs_deps_scripts(): install_blfs_tools():
From common/libs/func_blfs_deps. From common/libs/func_install_blfs.
Description: Copies the scriptlets from `blfs-tools-deps' to the Description: Copy the needed files to `BLFS_ROOT'. Initialize
subdirectory `blfs-tools-deps' in `${PROGNAME}-commands'. Must the package tracking. Generates a `configuration' file from
be called from `$JHALFSDIR' where `$COMMON/blfs-tools-deps' should have the tool dependencies settings, and use it to generate
been copied first. Removes `$JHALFSDIR/blfs-tools-deps' at the end. scriptlets from the blfs book. Uses those scriptlets to download the
Called by: extract_commands needed tarballs. Then generates a Makefile for building the dependencies.
-------------------------------------------------------------------------- Called by: jhalfs
wrt_blfs_tool_targets():
From common/libs/func_blfs_deps.
Description: Writes Makefile entries for BLFS tools dependencies.
should be called from the `${PROGNAME}-commands' directory and
with `$MKFILE' set.
TODO: Notice that tidy, unzip, lynx and docbook versions are hardcoded there.
TODO: This function does not implement the mechanism described in
`README.CUSTOM' for the `ddd-d-scriptlet' naming scheme.
Called by: build_Makefiles (from master.sh)
Uses: makefile helper functions to write in makefile.
-------------------------------------------------------------------------- --------------------------------------------------------------------------
get_sources(): get_sources():
From common/libs/func_download_pkgs. From common/libs/func_download_pkgs.
@ -279,7 +262,6 @@ function failure():
From extras/farce. From extras/farce.
Description: Description:
-------------------------------------------------------------------------- --------------------------------------------------------------------------
extras/farce: emessage "internal error in failure() for TYPE $TYPE"
function fatal(): function fatal():
From extras/farce. From extras/farce.
Description: Description:
@ -352,8 +334,6 @@ see_ya():
From jhalfs. From jhalfs.
Description: Description:
-------------------------------------------------------------------------- --------------------------------------------------------------------------
jhalfs: # Tidy and Unzip version are harcoded also in wrt_blfs_tool_targets()
jhalfs: # Create $BUILDDIR/sources even though it could be created by get_sources()
chapter4_Makefiles(): chapter4_Makefiles():
From LFS/master.sh. From LFS/master.sh.
Description: Description:

41
README
View file

@ -77,23 +77,27 @@ $Id$
6. BLFS_TOOL SUPPORT:: 6. BLFS_TOOL SUPPORT::
For books that support it, there is an option to install blfs-tool and its For books that support it (TODO: which ones?), there is an option
dependencies on the final system. The pre-made build dependencies to install an automated framework for building BLFS packages. Let
scripts has been written based on a LFS build. For CLFS and HLFS us call it blfs-tool for now. When you tick `BOOK Settings/Add
builds you may need to adjust that scripts, that are found into the blfs-tool support' in jhalfs configuration menu, the tools are
common/blfs-tool-deps directory in the jhalfs sources tree. installed in $BLFS_ROOT (default /blfs_root) on the xLFS system,
and a few dependencies (which you may select) are built at the
end of the jhalfs run, before the custom tools. As of March 8, 2012,
works only with LFS. The instructions for building the dependencies
are taken from the BLFS book.
(TODO: is this relevant to present CLFS?)
WARNING:: If you add blfs-tool support on a CLFS Sysroot build WARNING:: If you add blfs-tool support on a CLFS Sysroot build
you MUST to edit the dependencies scripts to fix the you MUST edit the scripts to fix the installation paths.
installation paths.
Be careful when you modify the scripts as you can
easily disable the host system.
After booting the new xLFS system some steps are needed to finish After booting the new xLFS system some steps are needed to finish
blfs-tool installation: the installation of the automated tools:
- A user account must be created. You must be logged on that user - A user account must be created. You must be logged on that user
account to use blfs-tool. account to use blfs-tool. This is not strictly necessary,
since the packages can be built as root, too, but it is
never a good idea to build packages as root.
- Move /blfs-root to that user's home and change ownership of the - Move /blfs-root to that user's home and change ownership of the
directory and files to the user. directory and files to the user.
@ -101,16 +105,21 @@ $Id$
- Give the user read and write privileges over the $TRACKING_DIR - Give the user read and write privileges over the $TRACKING_DIR
directory and the files that it contains. directory and the files that it contains.
- If you think that you may need the libxml2/libxslt Python modules, - Configure sudo, adding the needed privileges for the user. For
remove the libxml2 and libxslt trackin files found in $TRACKING_DIR. newer sudo version, do not forget to add a line Defaults secure_path=
containing /sbin and /usr/sbin (in /etc/sudoers), otherwise some
executables are not found.
- Configure sudo, adding the needed privileges for the user. - Although it is not strictly necessary, it is recommended to install
the bash shell startup files (as per `3.After LFS Configuration
Issues' of the BLFS book), as some instructions in BLFS rely on
their being present.
We assume that blfs-tool will be used on a running fresh xLFS system. We assume that blfs-tool will be used on a running fresh xLFS system.
To use it to build BLFS packages from the chroot jail is also possible, To use it to build BLFS packages from the chroot jail is also possible,
but is for you to figure out how to do that. but not supported.
To know how to blfs-tool works, see README.BLFS. To know how to use blfs-tool, see README.BLFS.
7. LAYOUT:: 7. LAYOUT::

View file

@ -2,7 +2,7 @@ $Id$
1. INTRODUCTION:: 1. INTRODUCTION::
If you want to add blfs-tool support into a xLFS base system build, If you want to add blfs-tool support into an xLFS base system build,
read the "BLFS_TOOL SUPPORT" section found in the README and be sure read the "BLFS_TOOL SUPPORT" section found in the README and be sure
to follow the after-booting installation intructions. to follow the after-booting installation intructions.
@ -13,7 +13,7 @@ $Id$
change based on what dependencies will be used, etc. change based on what dependencies will be used, etc.
That being said, the goal of the blfs-tool is to help you solve package That being said, the goal of the blfs-tool is to help you solve package
dependencies, create build scripts and a Makefile. Few of the auto-generated dependencies, create build scripts and a Makefile. Not all the auto-generated
build scripts and Makefile will work "as is", thus, as a general rule, build scripts and Makefile will work "as is", thus, as a general rule,
you will need to review and edit the scripts while reading the book. you will need to review and edit the scripts while reading the book.
@ -33,10 +33,10 @@ $Id$
3. USAGE:: 3. USAGE::
Due the complexity of the BLFS book, the scripts and Makefile generation Due to the complexity of the BLFS book, the scripts and Makefile
is done in several steps: generation is done in several steps:
3.1 INSTALLED PACKAGES TRACKING SYSTEM 3.1 INSTALLED PACKAGES TRACKING SYSTEM::
This tool includes a very simple tracking system to log which packages This tool includes a very simple tracking system to log which packages
have been installed using the tool. It is used to skip installed packages have been installed using the tool. It is used to skip installed packages
@ -44,60 +44,99 @@ $Id$
updated in the BLFS book. Do not rely on this feature as a package updated in the BLFS book. Do not rely on this feature as a package
management tool. management tool.
The directory where tracking files will be stored needs to be created The tracking system itself is an XML file: instpkg.xml. It is
before installing blfs-tool. You can place this directory anywhere, taking initialized when <make> is first run in blfs_root. It resides in a
care that the user must have read and write privileges on that directory directory, which is created when needed during the process of building
and on all files it contains. custom tools or blfs dependencies, right after xLFS. You can specify
that directory location in the blfs-tools submenu of jhalfs. You may
need to update permissions and/or ownership of this directory before
using the blfs tool (see README in jhalfs).
To use the default path set in the installation menu, run as root: The default location of the tracking directory is /var/lib/jhalfs/BLFS.
NB : after the initial build, that directory is only used to contain
install -d -m1777 /var/lib/jhalfs/BLFS instpkg.xml, unless custom tools have been built. In the latter case,
it also contains empty files whose name are $PKG-$VERSION for each
versionned package built. The information about those packages is
included into instpkg.xml the next time the tool is run.
3.2 BLFS_TOOL INSTALLATION:: 3.2 BLFS_TOOL INSTALLATION::
Run "make" to launch the jhalfs menuconfig interface. Select the BLFS 3.2.1 Normal install
book and version. Then set the installation directory (default The tools are installed just after the building of xLFS, if the
$HOME/blfs_root), the BLFS sources directory (default blfs-xml), and appropriate options have been selected in the building menu, as per
the installed packages tracking directory (default /var/lib/jhalfs/BLFS). jhalfs README. If you forgot to select the options and xLFS has been
built, it is possible to go back to selecting the appropriate
BLFS tools options in the jhalfs menu, then tick `Run makefile'
and not `Rebuild files'. You obtain a /blfs_root directory in the
root directory of the new xLFS system, which contains the followings:
All required files will be placed in the installation directory and blfs-xml/* SVN tree of the selected BLFS book version
BLFS XML sources will be installed in the named sub-directory. lib/constants.inc functions libraries
/func_dependencies for building the dependency tree
menu/* lxdialog and menuconfig source code
xsl/gen_pkg_list.xsl XSL stylesheet to generate the package database
/gen_config.xsl XSL stylesheet to generate the Config.in file
for use in the menuconfig system
/dependencies.xsl XSL stylesheet to generate the dependency list
of a package
/make_book.xsl XSL stylesheet to generate the linear book.xml
/scripts.xsl XSL stylesheet to generate the scriptlets from
book.xml
/bump.xsl XSL stylesheet to generate to update the tracking
file
README.BLFS this file
TODO developers notes (well, not updated often)
gen_pkg_book.sh resolves dependencies and generates linear BLFS
books and build scripts
gen-makefile.sh generates the target Makefile
progress_bar.sh the target Makefile progress bar
gen-special.sh Helper script for generating the package database
Makefile Used by make to update the package database from
the SVN tree, then launch the menuconfig interface,
and run gen_pkg_book.sh based on configuration
settings
packdesc.dtd a simple DTD describing the format of the package
database and the tracking file.
envars.conf envars needed when running the target build scripts
Installed files: 3.2.2 Install to an already running LFS/BLFS system
If you forgot to install the tools when building xLFS, or want to try
the tools, you can just run the install-blfs-tools.sh script. It will
create the above hierarchy in your home directory and intialize the
tracking file. You have first to make sure that the tracking dir exists
and is writable by the user. You may also populate it with (empty) files
whose names are of the form package-version, for installed packages, so
that they are included into the tracking file.
3.3.3 Working files
Several files are generated during the process:
blfs-xml/* SVN tree of the selected BLFS book version packages.xml auto-generated packages database
lib/* functions libraries, xsl stylesheets, and auto-generated Config.in input file for the menu driven choices
meta-packages dependencies tree files configuration file generated by the menuconfig process
menu/* lxdialog and menuconfig source code dependencies/* files recording the dependency tree
README.BLFS this file book.xml the linearized book
TODO developers notes book-html/* the linearized book rendered in html
update_book.sh update the XML book sources and regenerates packages scripts/* the scriptlets
database and meta-packages dependencies tree
gen_config.sh regenerates Config.in
gen_pkg_book.sh resolves dependencies and generates linear BLFS books
and build scripts
gen-makefile.sh generates the target Makefile
progress_bar.sh the target Makefile progress bar
Makefile run gen_config.sh to update Config.in,
then launch the menuconfig interface, and lastly run
gen_pkg_book.sh based on configuration settings
Config.in menuconfig interface input file
packages auto-generated packages database
envars.conf envars needed when running the target build scripts
From now on, all the work must be done from inside the installation From now on, all the work must be done from inside the installation
root directory. root directory.
When finished the installation, the configuration and target selection You may move that directory to the $HOME of a non root user, or build
menu is launch. as root from that directory.
3.3 UPDATING BOOK SOURCES:: 3.3 UPDATING BOOK SOURCES::
If you are using the development book version and you want to update If you are using the development book version and you want to update
installed packages to the latest version found in that book, you need to installed packages to the latest version found in that book, you need to
update the XML sources and packages database. update the XML sources and packages database. This is not necessary if
you just built xLFS, and you can skip to step 3.4.
To do that run "./update_book.sh" To do that, run "make update". It may happen that the subversion
version of your building host is older than the version you just
built. This may generate weird errors like "'.' omitted". The easiest
thing to do in that case, is to completely remove the blfs-xml directory
and run "make update". With recent versions of subversion, you can also
run "svn upgrade" from inside the blfs-xml directory.
On the next configuration run, packages already installed but listed On the next configuration run, packages already installed but listed
with a new version in the book will be available for target selection with a new version in the book will be available for target selection
@ -106,46 +145,58 @@ $Id$
3.4 CONFIGURING AND PARSING THE BOOK:: 3.4 CONFIGURING AND PARSING THE BOOK::
The next step is to create a book and build scripts in dependency The next step is to create a book and build scripts in dependency
build order for a target package. A target can be a package or a build order for one or several packages.
meta-package.
WARNING:
Only one target (meta-package or individual package) must be
selected on each configuration run.
There is no way to solve dependencies properly when more
than one target are selected.
Run <make> to launch the configuration interface. The main menu contains Run <make> to launch the configuration interface. The main menu contains
three blocks: meta-package selection, individual package selection, and two blocks: individual package selection, and build options.
build options.
When a meta-package is selected, it is possible to unselect unwanted
components. The unselected components will be skipped if no other components
depends on them.
In the build options section, the dependencies level and default packages In the build options section, the dependencies level and default packages
used to solve alternatives are set. You can also select whether the build will used to solve alternatives are set (currently, only for the MTA). You can
be made as a normal user or as root. That settings are saved to be reused in also select whether the build will be made as a normal user or as root.
future configuration runs. Those settings are saved to be reused in future configuration runs.
If, for example, your target selection is Xsoft-->Graphweb-->galeon, a Note that you may select as many targets as you want, not just one
directory named "galeon" will be created. Inside that directory you will as in the previous version of this tool. But we suggest to not select
find a directory named "HTML" that contains a galeon-based HTML book with too many at a time to be able to sort issues!
its dependencies in build order, and a "scripts" directory with build
scripts for that packages.
There are also two other directories ("dependencies" and "xincludes") When you are done with the menu, a few checks occur, and the book is
that contain files generated while resolving dependencies trees. generated. When circular dependencies are found, a 3 line message is
printed:
A is a dependency of B
C is a dependency of A
A is a dependency of C
and a question:
Do you want to build A first?
This means that the system has found the dependency chain: B->A->C->A.
You have therefore to choose whether A is built before C, or
C before A: the system cannot make that choice (well, maybe in a few
year, with an AI system able to understand the book). If you answer no,
C is built first. If you answer yes, C is put in place of A as a dependency
of B, then the tree dependency restarts from there, that is with the
layout B->C->... You may then hit the case B->C->A->C, for which you
should answer no, unless you want to enter an infinite (human driven)
loop;-)
3.5 EDITING BUILD SCRIPTS You end up with a book.xml file which contains the linearized book,
and a rendered HTML, in the directory book-html, which you can browse with
"lynx book-html/index.html" (or with any other browser).
Now it is time to review the generated book and scripts, making any changes Furthermore, there is a directory "scripts", which contains the generated
to the scripts necessary to fix generation bugs or to suit your needs. scriptlets.
There is also another directory, "dependencies" that contains files
generated while resolving dependencies.
3.5 EDITING BUILD SCRIPTS::
Now it is time to review the generated book and scripts, making any
changes to the scripts necessary to fix generation bugs or to suit your
needs.
Scripts for additional packages (i.e., for non-BLFS packages) can be Scripts for additional packages (i.e., for non-BLFS packages) can be
easily inserted. For example, if you want to install the external dependency easily inserted. For example, if you want to install the external dependency
"bar" before "foo" package and the "foo" script is named "064-z-foo", you "bar" before "foo" package and the "foo" script is named "064-z-foo", you
need to create a "064-y-bar" build script. just need to create a "064-y-bar" build script.
Remember, the package tracking system isn't a package management tool Remember, the package tracking system isn't a package management tool
and knows nothing about packages not in the BLFS book. and knows nothing about packages not in the BLFS book.
@ -153,54 +204,50 @@ $Id$
Also, review and edit envars.conf. This file is used to set global envars Also, review and edit envars.conf. This file is used to set global envars
needed by the build scripts. needed by the build scripts.
3.6 CREATING THE MAKEFILE 3.6 CREATING THE MAKEFILE::
When the build scripts are ready to be run, the Makefile can be When the build scripts are ready to be run, the Makefile can be
created. Be sure that you cd into the "package" directory and run created. Create an empty directory (for example "mkdir work") and cd
../gen-makefile.sh to that directory. Then run ../gen-makefile.sh
Review the Makefile, and, if all looks sane, start the build. Review the Makefile, and, if all looks sane, start the build by running
"make".
4. GENERATED BUILD SCRIPTS ISSUES:: 4. GENERATED BUILD SCRIPTS ISSUES::
In this section, known issues with the generated build scripts are In this section, known issues with the generated build scripts are
discussed. They are due to build procedures and/or BLFS layout particularities discussed. They are due to build procedures and/or BLFS layout
that we can't handle. In several cases, editing the build scripts is mandatory. particularities that we can't handle. In several cases, editing the
build scripts is mandatory.
You may also need to insert some build scripts created by you to resolve You may also need to insert some build scripts created by you to resolve
unhandled dependencies and/or to remove some script installing the affected unhandled dependencies and/or to remove some script installing the affected
package by hand. package by hand.
4.1 BLFS BOOTSCRIPTS 4.1 BLFS BOOTSCRIPTS::
For now, bootscripts installation will fail. You will need to edit Normally, bootscript installation should work. On the other hand, the
the scripts for packages that install bootscripts and fix their book does not give instruction for running them, so you might have to
installation command. That could be fixed in the future. manually insert /etc/init.d/rc.d/<initscript> at some place during the build.
4.2 PACKAGE CONFIGURATION 4.2 PACKAGE CONFIGURATION::
For those packages that have a "Configuration" section, you should For those packages that have a "Configuration" section, you should
edit the build script to fit the needs of your system. edit the build script to fit the needs of your system. Sometimes, the
bash startup files are modified (see for example the instructions for
llvm). The shipped 'envars.conf' contains a line 'source /etc/profile',
which ensures that the proper environment variables are used.
4.4 PDL, Perl modules, and Glib-Bindings. 4.3 GCC, JDK, Sane, and KDE-multimedia, freetype2, MesaLib and others
The generated scripts for these packages are broken and can not On the pages for those packages, the BLFS book actually has instructions
be fixed. You must rename it as the sub-package to be installed and
edit it to use the proper commads for that sub-package.
You may need to create additional scripts for these sub-package
dependencies, if any.
4.4 GCC, JDK, Sane, and KDE-multimedia, freetype2, MesaLib and others
On the pages for these packages, the BLFS book actually has instructions
to download and install two or more packages. You must edit the scripts to to download and install two or more packages. You must edit the scripts to
fix this. fix this.
We will try to fix some of them, but this may not be possible. We will try to fix some of them, but this may not be possible.
4.5 XORG7 4.4 XORG7
The generated scripts for Xorg7 pseudo-packages have $SRC_ARCHIVE The generated scripts for Xorg7 packages have $SRC_ARCHIVE
support for individual packages, but not for patches nor *.wget and *.md5 support for individual packages, but not for patches nor *.wget and *.md5
files. files.
@ -209,32 +256,42 @@ $Id$
The *.wget and *.md5 files should be downladed always from inside The *.wget and *.md5 files should be downladed always from inside
the scripts to be sure that the most current individual packages are the scripts to be sure that the most current individual packages are
used. Thus don't reuse previouly existing ones. used. Thus don't reuse previously existing ones.
In the script for xorg7-font, be sure to move the fonts directories In the script for xorg7-font, be sure to move the fonts directories
symlinks creation to after the "for ... done" loop. symlinks creation to after the "for ... done" loop.
4.6 PATCHES
By default, all required patches will be downloaded from the NET. 4.5 PATCHES
If you have previously downloaded the patches, you must edit the Please, make sure that all scripts have the commands to download/apply
scripts to use your local patches. the required patches. Due to book layout issues, some patches may be
missing.
Also, be sure that all scripts have the commands to download/apply the 4.6 ROOT COMMANDS
required patches. Due to book layout issues, some patches may be missing.
4.7 ROOT COMMANDS
If building as a normal user (the default setting), be sure that all If building as a normal user (the default setting), be sure that all
commands that require root privileges are run using sudo. Also make sure commands that require root privileges are run using sudo. Also make sure
necessary root privilege commands are visible in your PATH. necessary root privilege commands are visible in your PATH. Or use
the `Defaults secure_path=' in /etc/sudoers.
For commands necessitating root privileges, the generated scripts wrap
them with the construct:
sudo -E sh << ROOT_EOF
<commands to be executed as root with `$', ``', and `\' escaped>
ROOT_EOF
The -E switch ensures the whole environment is passed to the
commands to be run with root privileges. It is effective only if the
/etc/sudoers file contains `Defaults setenv', or SETENV in the user
attributes. If you think it is a security issue, you may forbid this
flag in /etc/sudoers, but then, you have to un-escape `$' for variables
coming from the environment in the instructions.
Although this construct is rather strong, it can fail in some corner
cases, so carefully review those instructions.
Due to book layout issues, some sudo commands may be missing. Due to book layout issues, some sudo commands may be missing.
4.8 OTHERS 4.7 OTHERS
There may be other issues that we are not aware of. If you find There may be other issues that we are not aware of. If you find
any, please report it to <alfs-discuss@linuxfromscratch.org>. any, please report it to <alfs-discuss@linuxfromscratch.org>.

View file

@ -60,4 +60,17 @@ BY : Pierre Labastie
upgrade. The user has to provide his own function. A template is provided upgrade. The user has to provide his own function. A template is provided
in the pkgmngt subdirectory. in the pkgmngt subdirectory.
3. DETAILED INSTRUCTIONS:
Before beginning, you should know which package manager you want, where
to get the sources, and how to use it for:
a) Making a package from a directory tree. Usually, there is some control
file containing the version, pacakager, build system (32 or 64 bits at
least) or other more or less usefull but mandatory bits of information
which you should understand.
b) Unpack the package.
Second, you ought to have a basic knowledge of bash scripting and
docbook-xml writing, because you have to write a bash function for packing
and unpacking the package, and a set of instructions to install the PM.

182
blfs-tool
View file

@ -1,182 +0,0 @@
#!/bin/bash
# $Id$
set -e
# From common/common-functions
# VT100 colors
declare -r BLACK=$'\e[1;30m'
declare -r DK_GRAY=$'\e[0;30m'
declare -r RED=$'\e[31m'
declare -r GREEN=$'\e[32m'
declare -r YELLOW=$'\e[33m'
declare -r BLUE=$'\e[34m'
declare -r MAGENTA=$'\e[35m'
declare -r CYAN=$'\e[36m'
declare -r WHITE=$'\e[37m'
declare -r OFF=$'\e[0m'
declare -r BOLD=$'\e[1m'
declare -r REVERSE=$'\e[7m'
declare -r HIDDEN=$'\e[8m'
declare -r tab_=$'\t'
declare -r nl_=$'\n'
declare -r DD_BORDER="${BOLD}==============================================================================${OFF}"
declare -r SD_BORDER="${BOLD}------------------------------------------------------------------------------${OFF}"
declare -r STAR_BORDER="${BOLD}******************************************************************************${OFF}"
# bold yellow > < pair
declare -r R_arrow=$'\e[1;33m>\e[0m'
declare -r L_arrow=$'\e[1;33m<\e[0m'
#>>>>>>>>>>>>>>>ERROR TRAPPING >>>>>>>>>>>>>>>>>>>>
#-----------------------#
simple_error() { # Basic error trap.... JUST DIE
#-----------------------#
# If +e then disable text output
if [[ "$-" =~ e ]]; then
echo -e "\n${RED}ERROR:${GREEN} basic error trapped!${OFF}\n" >&2
fi
}
see_ya() {
echo -e "\n${L_arrow}${BOLD}jhalfs-trunk${R_arrow} exit${OFF}\n"
}
##### Simple error TRAPS
# ctrl-c SIGINT
# ctrl-y
# ctrl-z SIGTSTP
# SIGHUP 1 HANGUP
# SIGINT 2 INTRERRUPT FROM KEYBOARD Ctrl-C
# SIGQUIT 3
# SIGKILL 9 KILL
# SIGTERM 15 TERMINATION
# SIGSTOP 17,18,23 STOP THE PROCESS
#####
set -e
trap see_ya 0
trap simple_error ERR
trap 'echo -e "\n\n${RED}INTERRUPT${OFF} trapped\n" && exit 2' 1 2 3 15 17 18 23
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# envars not sourced from configuration file
COMMON_DIR="common"
VERBOSITY=1
[[ $VERBOSITY > 0 ]] && echo -n "Loading config params from <configuration>..."
source configuration
[[ $? > 0 ]] && echo "file:configuration did not load.." && exit 1
[[ $VERBOSITY > 0 ]] && echo "OK"
[[ $VERBOSITY > 0 ]] && echo -n "Loading function <func_check_version.sh>..."
source $COMMON_DIR/libs/func_check_version.sh
[[ $? > 0 ]] && echo " function module did not load.." && exit 2
[[ $VERBOSITY > 0 ]] && echo "OK"
[[ $VERBOSITY > 0 ]] && echo -n "Loading function <func_validate_configs.sh>..."
source $COMMON_DIR/libs/func_validate_configs.sh
[[ $? > 0 ]] && echo " function module did not load.." && exit 2
[[ $VERBOSITY > 0 ]] && echo "OK"
[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
# Be sure that we have a configuration file
[[ -z $BOOK_BLFS ]] && echo -e "\nNo BLFS configuration found. Please configure it." && exit 1
# Set default book version
BRANCH_ID=${BRANCH_ID:=development}
# Set the SVN tree
case $BRANCH_ID in
development ) TREE=trunk/BOOK ;;
*EDIT* ) echo " You forgot to set the branch or stable book version."
echo " Please rerun make and fix the configuration."
exit 2 ;;
branch-* ) TREE=branches/${BRANCH_ID#branch-}/BOOK ;;
* ) TREE=tags/${BRANCH_ID} ;;
esac
# Check for minimun dependencies versions
xsltprocVer=`xsltproc -V | head -n1 `
libxmlVer=$(echo $xsltprocVer | cut -d " " -f3)
libxsltVer=$(echo $xsltprocVer | cut -d " " -f5)
tidyVer=`tidy -V | cut -d " " -f9`
# Version numbers are packed strings not xx.yy.zz format.
check_version "2.06.20" "${libxmlVer:0:1}.${libxmlVer:1:2}.${libxmlVer:3:2}" "LIBXML2"
check_version "1.01.14" "${libxsltVer:0:1}.${libxsltVer:1:2}.${libxsltVer:3:2}" "LIBXSLT"
check_version "2004" "${tidyVer}" "TIDY"
XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?>
<?xml-stylesheet type='text/xsl' href='http://docbook.sourceforge.net/release/xsl/1.69.1/xhtml/docbook.xsl'?>
<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN'
'http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd'>
<article>
<title>Test file</title>
<sect1>
<title>Some title</title>
<para>Some text</para>
</sect1>
</article>"
if `echo $XML_FILE | xmllint -noout -postvalid - 2>/dev/null` ; then
check_version "4.5" "4.5" "DocBook XML DTD"
else
echo "Warning: not found a working DocBook XML DTD 4.5 installation"
exit 2
fi
# if `echo $XML_FILE | xsltproc --noout - 2>/dev/null` ; then
# check_version "1.69.1" "1.69.1" "DocBook XSL"
# else
# echo "Warning: not found a working DocBook XSL 1.69.1 installation"
# exit 2
# fi
echo "${SD_BORDER}${nl_}"
# For consistency with other books
validate_config
echo "${SD_BORDER}${nl_}"
echo -n "Are you happy with these settings? yes/no (no): "
read ANSWER
if [ x$ANSWER != "xyes" ] ; then
echo "${nl_}Rerun make to fix the configuration options.${nl_}"
exit 1
fi
echo "${nl_}${SD_BORDER}${nl_}"
# Install the files
[[ ! -d $BLFS_ROOT ]] && mkdir -p $BLFS_ROOT
cp -r BLFS/* $BLFS_ROOT
cp -r menu $BLFS_ROOT
cp $COMMON_DIR/progress_bar.sh $BLFS_ROOT
cp README.BLFS $BLFS_ROOT
# Start the work
cd $BLFS_ROOT
# Clean-up
rm -rf libs/.svn
rm -rf menu/.svn
rm -rf menu/lxdialog/.svn
# Set some harcoded envars to their proper values
sed -i 's,blfs-xml,'$BLFS_XML',' update_book.sh libs/book.xsl
sed -i 's,tracking-dir,'$TRACKING_DIR',' update_book.sh gen-makefile.sh
# Fetch book sources and create packages and meta-packages dependencies files
if [[ -d $BLFS_XML ]] ; then
./update_book.sh
else
./update_book.sh get $BLFS_XML $TREE
fi
# Run the menuconfig interface
make -B

View file

@ -1,33 +0,0 @@
#!/bin/bash
# $Id$
set -e
cd $PKGDIR
./configure --prefix=/usr
make
if ! [ -z $PKG_DEST ]; then
mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}}
ln -sv share/{man,doc,info} $PKG_DEST/usr
case $(uname -m) in
x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
esac
fi
make DESTDIR=$PKG_DEST install
if ! [ -z $PKG_DEST ]; then
rm -fv $PKG_DEST/{,usr/}lib64
rm -fv $PKG_DEST/usr/{man,doc,info}
for dir in $PKG_DEST/usr/share/{doc,info,man}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/usr/{lib,share}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/{lib,usr}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
packInstall
fi
rm -rf $PKG_DEST
exit

View file

@ -1,33 +0,0 @@
#!/bin/bash
# $Id$
set -e
cd $PKGDIR
./configure --prefix=/usr
make
if ! [ -z $PKG_DEST ]; then
mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}}
ln -sv share/{man,doc,info} $PKG_DEST/usr
case $(uname -m) in
x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
esac
fi
make DESTDIR=$PKG_DEST install
if ! [ -z $PKG_DEST ]; then
rm -fv $PKG_DEST/{,usr/}lib64
rm -fv $PKG_DEST/usr/{man,doc,info}
for dir in $PKG_DEST/usr/share/{doc,info,man}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/usr/{lib,share}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/{lib,usr}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
packInstall
fi
rm -rf $PKG_DEST
exit

View file

@ -1,39 +0,0 @@
#!/bin/bash
# $Id$
set -e
cd $PKGDIR
./configure --prefix=/usr
make
if ! [ -z $PKG_DEST ]; then
mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}}
ln -sv share/{man,doc,info} $PKG_DEST/usr
case $(uname -m) in
x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
esac
fi
make DESTDIR=$PKG_DEST install
install -v -m644 -D htmldoc/tidy.1 \
$PKG_DEST/usr/share/man/man1/tidy.1
install -v -m755 -d $PKG_DEST/usr/share/doc/tidy-cvs_20101110
install -v -m644 htmldoc/*.{html,gif,css} \
$PKG_DEST/usr/share/doc/tidy-cvs_20101110
if ! [ -z $PKG_DEST ]; then
rm -fv $PKG_DEST/{,usr/}lib64
rm -fv $PKG_DEST/usr/{man,doc,info}
for dir in $PKG_DEST/usr/share/{doc,info,man}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/usr/{lib,share}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/{lib,usr}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
packInstall
fi
rm -rf $PKG_DEST
exit

View file

@ -1,42 +0,0 @@
#!/bin/bash
# $Id$
set -e
cd $PKGDIR
case `uname -m` in
i?86)
sed -i -e 's/DASM"/DASM -DNO_LCHMOD"/' unix/Makefile
make -f unix/Makefile linux
;;
*)
sed -i -e 's/CFLAGS="-O -Wall/& -DNO_LCHMOD/' unix/Makefile
make -f unix/Makefile linux_noasm
;;
esac
if ! [ -z $PKG_DEST ]; then
mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}}
ln -sv share/{man,doc,info} $PKG_DEST/usr
case $(uname -m) in
x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
esac
fi
make prefix=$PKG_DEST/usr install
if ! [ -z $PKG_DEST ]; then
rm -fv $PKG_DEST/{,usr/}lib64
rm -fv $PKG_DEST/usr/{man,doc,info}
for dir in $PKG_DEST/usr/share/{doc,info,man}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/usr/{lib,share}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/{lib,usr}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
packInstall
fi
rm -rf $PKG_DEST
exit

View file

@ -1,113 +0,0 @@
#!/bin/bash
# $Id$
set -e
cd /sources
mkdir docbook-xml
cd docbook-xml
unzip ../docbook-xml-4.5.zip
install -v -d -m755 $PKG_DEST/usr/share/xml/docbook/xml-dtd-4.5
install -v -d -m755 $PKG_DEST/etc/xml
chown -R root:root .
cp -v -af docbook.cat *.dtd ent/ *.mod \
$PKG_DEST/usr/share/xml/docbook/xml-dtd-4.5
if [ ! -e $PKG_DEST/etc/xml/docbook ]; then
xmlcatalog --noout --create $PKG_DEST/etc/xml/docbook
fi
xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML V4.5//EN" \
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" \
$PKG_DEST/etc/xml/docbook
xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML CALS Table Model V4.5//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.5/calstblx.dtd" \
$PKG_DEST/etc/xml/docbook
xmlcatalog --noout --add "public" \
"-//OASIS//DTD XML Exchange Table Model 19990315//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.5/soextblx.dtd" \
$PKG_DEST/etc/xml/docbook
xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook XML Information Pool V4.5//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.5/dbpoolx.mod" \
$PKG_DEST/etc/xml/docbook
xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook XML Document Hierarchy V4.5//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.5/dbhierx.mod" \
$PKG_DEST/etc/xml/docbook
xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook XML HTML Tables V4.5//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.5/htmltblx.mod" \
$PKG_DEST/etc/xml/docbook
xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook XML Notations V4.5//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.5/dbnotnx.mod" \
$PKG_DEST/etc/xml/docbook
xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook XML Character Entities V4.5//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.5/dbcentx.mod" \
$PKG_DEST/etc/xml/docbook
xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook XML Additional General Entities V4.5//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.5/dbgenent.mod" \
$PKG_DEST/etc/xml/docbook
xmlcatalog --noout --add "rewriteSystem" \
"http://www.oasis-open.org/docbook/xml/4.5" \
"file:///usr/share/xml/docbook/xml-dtd-4.5" \
$PKG_DEST/etc/xml/docbook
xmlcatalog --noout --add "rewriteURI" \
"http://www.oasis-open.org/docbook/xml/4.5" \
"file:///usr/share/xml/docbook/xml-dtd-4.5" \
$PKG_DEST/etc/xml/docbook
if [ ! -e $PKG_DEST/etc/xml/catalog ]; then
xmlcatalog --noout --create $PKG_DEST/etc/xml/catalog
fi
xmlcatalog --noout --add "delegatePublic" \
"-//OASIS//ENTITIES DocBook XML" \
"file:///etc/xml/docbook" \
$PKG_DEST/etc/xml/catalog
xmlcatalog --noout --add "delegatePublic" \
"-//OASIS//DTD DocBook XML" \
"file:///etc/xml/docbook" \
$PKG_DEST/etc/xml/catalog
xmlcatalog --noout --add "delegateSystem" \
"http://www.oasis-open.org/docbook/" \
"file:///etc/xml/docbook" \
$PKG_DEST/etc/xml/catalog
xmlcatalog --noout --add "delegateURI" \
"http://www.oasis-open.org/docbook/" \
"file:///etc/xml/docbook" \
$PKG_DEST/etc/xml/catalog
for DTDVERSION in 4.1.2 4.2 4.3 4.4
do
xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML V$DTDVERSION//EN" \
"http://www.oasis-open.org/docbook/xml/$DTDVERSION/docbookx.dtd" \
$PKG_DEST/etc/xml/docbook
xmlcatalog --noout --add "rewriteSystem" \
"http://www.oasis-open.org/docbook/xml/$DTDVERSION" \
"file:///usr/share/xml/docbook/xml-dtd-4.5" \
$PKG_DEST/etc/xml/docbook
xmlcatalog --noout --add "rewriteURI" \
"http://www.oasis-open.org/docbook/xml/$DTDVERSION" \
"file:///usr/share/xml/docbook/xml-dtd-4.5" \
$PKG_DEST/etc/xml/docbook
xmlcatalog --noout --add "delegateSystem" \
"http://www.oasis-open.org/docbook/xml/$DTDVERSION/" \
"file:///etc/xml/docbook" \
$PKG_DEST/etc/xml/catalog
xmlcatalog --noout --add "delegateURI" \
"http://www.oasis-open.org/docbook/xml/$DTDVERSION/" \
"file:///etc/xml/docbook" \
$PKG_DEST/etc/xml/catalog
done
if ! [ -z "$PKG_DEST" ]; then
export PKGDIR=/sources/docbook-xml
packInstall
fi
rm -rf $PKG_DEST
cd ..
rm -rf docbook-xml
exit

View file

@ -1,39 +0,0 @@
#!/bin/bash
# $Id$
set -e
cd $PKGDIR
install -v -m755 -d /usr/share/xml/docbook/xsl-stylesheets-1.69.1
cp -v -R VERSION common eclipse extensions fo html \
htmlhelp images javahelp lib manpages params \
profiling slides template website xhtml \
/usr/share/xml/docbook/xsl-stylesheets-1.69.1
if [ ! -d /etc/xml ]; then install -v -m755 -d /etc/xml; fi
if [ ! -f /etc/xml/catalog ]; then
xmlcatalog --noout --create /etc/xml/catalog
fi
xmlcatalog --noout --add "rewriteSystem" \
"http://docbook.sourceforge.net/release/xsl/1.69.1" \
"/usr/share/xml/docbook/xsl-stylesheets-1.69.1" \
/etc/xml/catalog
xmlcatalog --noout --add "rewriteURI" \
"http://docbook.sourceforge.net/release/xsl/1.69.1" \
"/usr/share/xml/docbook/xsl-stylesheets-1.69.1" \
/etc/xml/catalog
xmlcatalog --noout --add "rewriteSystem" \
"http://docbook.sourceforge.net/release/xsl/current" \
"/usr/share/xml/docbook/xsl-stylesheets-1.69.1" \
/etc/xml/catalog
xmlcatalog --noout --add "rewriteURI" \
"http://docbook.sourceforge.net/release/xsl/current" \
"/usr/share/xml/docbook/xsl-stylesheets-1.69.1" \
/etc/xml/catalog
exit

View file

@ -1,42 +0,0 @@
#!/bin/bash
# $Id$
set -e
cd $PKGDIR
./configure --prefix=/usr --sysconfdir=/etc
make
if ! [ -z $PKG_DEST ]; then
mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}}
ln -sv share/{man,doc,info} $PKG_DEST/usr
case $(uname -m) in
x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
esac
fi
make DESTDIR=$PKG_DEST install
ln -v -s libgpm.so.2.1.0 $PKG_DEST/usr/lib/libgpm.so
mkdir -pv $PKG_DEST/etc
install -v -m644 conf/gpm-root.conf $PKG_DEST/etc
install -v -m755 -d $PKG_DEST/usr/share/doc/gpm-1.20.6
chmod -v 755 doc/{changes,support}
chmod -v 644 doc/{changes/*,support/*,FAQ,HACK_GPM,README*}
cp -v -R doc/{FAQ,HACK_GPM,README*,changes,support} \
$PKG_DEST/usr/share/doc/gpm-1.20.6
if ! [ -z $PKG_DEST ]; then
rm -fv $PKG_DEST/{,usr/}lib64
rm -fv $PKG_DEST/usr/{man,doc,info}
for dir in $PKG_DEST/usr/share/{doc,info,man}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/usr/{lib,share}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/{lib,usr}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
packInstall
fi
rm -rf $PKG_DEST
exit

View file

@ -1,41 +0,0 @@
#!/bin/bash
# $Id$
set -e
cd $PKGDIR
./configure --prefix=/usr \
--sysconfdir=/etc/lynx \
--datadir=/usr/share/doc/lynx-2.8.8dev.10 \
--with-zlib \
--with-bzlib \
--with-screen=ncursesw \
--enable-locale-charset
make
if ! [ -z $PKG_DEST ]; then
mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}}
ln -sv share/{man,doc,info} $PKG_DEST/usr
case $(uname -m) in
x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
esac
fi
make DESTDIR=$PKG_DEST install-full
chgrp -v -R root $PKG_DEST/usr/share/doc/lynx-2.8.8dev.10/lynx_doc
if ! [ -z $PKG_DEST ]; then
rm -fv $PKG_DEST/{,usr/}lib64
rm -fv $PKG_DEST/usr/{man,doc,info}
for dir in $PKG_DEST/usr/share/{doc,info,man}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/usr/{lib,share}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/{lib,usr}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
packInstall
fi
rm -rf $PKG_DEST
exit

View file

@ -1,42 +0,0 @@
#!/bin/bash
# $Id$
set -e
cd $PKGDIR
./configure --prefix=/usr \
--libexecdir=/usr/lib \
--with-ignore-dot \
--with-all-insults \
--enable-shell-sets-home \
--disable-root-sudo \
--with-logfac=auth \
--without-pam \
--without-sendmail
make
if ! [ -z $PKG_DEST ]; then
mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}}
ln -sv share/{man,doc,info} $PKG_DEST/usr
case $(uname -m) in
x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
esac
fi
make DESTDIR=$PKG_DEST install
if ! [ -z $PKG_DEST ]; then
rm -fv $PKG_DEST/{,usr/}lib64
rm -fv $PKG_DEST/usr/{man,doc,info}
for dir in $PKG_DEST/usr/share/{doc,info,man}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/usr/{lib,share}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/{lib,usr}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
packInstall
fi
rm -rf $PKG_DEST
exit

View file

@ -1,36 +0,0 @@
#!/bin/bash
# $Id$
set -e
cd $PKGDIR
./configure --prefix=/usr \
--sysconfdir=/etc \
--without-ssl
make
if ! [ -z $PKG_DEST ]; then
mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}}
ln -sv share/{man,doc,info} $PKG_DEST/usr
case $(uname -m) in
x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
esac
fi
make DESTDIR=$PKG_DEST install
if ! [ -z $PKG_DEST ]; then
rm -fv $PKG_DEST/{,usr/}lib64
rm -fv $PKG_DEST/usr/{man,doc,info}
for dir in $PKG_DEST/usr/share/{doc,info,man}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/usr/{lib,share}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/{lib,usr}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
packInstall
fi
rm -rf $PKG_DEST
exit

View file

@ -1,35 +0,0 @@
#!/bin/bash
# $Id$
set -e
cd $PKGDIR
./configure --prefix=/usr --disable-static \
CFLAGS="-g -O2 -DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1" &&
make
if ! [ -z $PKG_DEST ]; then
mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}}
ln -sv share/{man,doc,info} $PKG_DEST/usr
case $(uname -m) in
x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
esac
fi
make DESTDIR=$PKG_DEST install
if ! [ -z $PKG_DEST ]; then
rm -fv $PKG_DEST/{,usr/}lib64
rm -fv $PKG_DEST/usr/{man,doc,info}
for dir in $PKG_DEST/usr/share/{doc,info,man}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/usr/{lib,share}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/{lib,usr}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
packInstall
fi
rm -rf $PKG_DEST
exit

View file

@ -1,35 +0,0 @@
#!/bin/bash
# $Id$
set -e
cd $PKGDIR
patch -Np1 -i ../apr-1.4.5-config.patch
./configure
make
if ! [ -z $PKG_DEST ]; then
mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}}
ln -sv share/{man,doc,info} $PKG_DEST/usr
case $(uname -m) in
x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
esac
fi
make DESTDIR=$PKG_DEST install
if ! [ -z $PKG_DEST ]; then
rm -fv $PKG_DEST/{,usr/}lib64
rm -fv $PKG_DEST/usr/{man,doc,info}
for dir in $PKG_DEST/usr/share/{doc,info,man}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/usr/{lib,share}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/{lib,usr}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
packInstall
fi
rm -rf $PKG_DEST
exit

View file

@ -1,35 +0,0 @@
#!/bin/bash
# $Id$
set -e
cd $PKGDIR
patch -Np1 -i ../apr-util-1.4.1-config.patch
./configure --with-apr=/usr/bin/apr-1-config
make
if ! [ -z $PKG_DEST ]; then
mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}}
ln -sv share/{man,doc,info} $PKG_DEST/usr
case $(uname -m) in
x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
esac
fi
make DESTDIR=$PKG_DEST install
if ! [ -z $PKG_DEST ]; then
rm -fv $PKG_DEST/{,usr/}lib64
rm -fv $PKG_DEST/usr/{man,doc,info}
for dir in $PKG_DEST/usr/share/{doc,info,man}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/usr/{lib,share}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/{lib,usr}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
packInstall
fi
rm -rf $PKG_DEST
exit

View file

@ -1,36 +0,0 @@
#!/bin/bash
# $Id$
set -e
cd $PKGDIR
./configure --prefix=/usr
make
if ! [ -z $PKG_DEST ]; then
mkdir -pv $PKG_DEST/{lib,usr/{share/{man,doc,info},lib}}
ln -sv share/{man,doc,info} $PKG_DEST/usr
case $(uname -m) in
x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
esac
fi
make DESTDIR=$PKG_DEST install
install -v -m755 -d $PKG_DEST/usr/share/doc/subversion-1.7.1
cp -v -R doc/* $PKG_DEST/usr/share/doc/subversion-1.7.1
if ! [ -z $PKG_DEST ]; then
rm -fv $PKG_DEST/{,usr/}lib64
rm -fv $PKG_DEST/usr/{man,doc,info}
for dir in $PKG_DEST/usr/share/{doc,info,man}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/usr/{lib,share}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
for dir in $PKG_DEST/{lib,usr}; do
[[ -z $(ls $dir) ]] && rmdir -v $dir
done
packInstall
fi
rm -rf $PKG_DEST
exit

View file

@ -1,37 +0,0 @@
Submitted By: Pierre Labastie
Date: 2011-12-27
Initial Package Version: 1.4.5 (taken from BLFS patch for httpd-2.2.0)
Upstream Status: Not submitted (jhalfs specific)
Origin: jhalfs
Description: Modify the layout for installing Apache Portable Runtime
diff -Naur apr-1.4.5-orig/config.layout apr-1.4.5/config.layout
--- apr-1.4.5-orig/config.layout 2004-11-24 22:51:51.000000000 +0000
+++ apr-1.4.5/config.layout 2005-12-14 21:06:37.000000000 +0000
@@ -11,18 +11,18 @@
# Classical APR path layout designed for parallel installs.
<Layout apr>
- prefix: /usr/local/apr
+ prefix: /usr
exec_prefix: ${prefix}
bindir: ${exec_prefix}/bin
- sbindir: ${exec_prefix}/bin
+ sbindir: ${exec_prefix}/sbin
libdir: ${exec_prefix}/lib
- libexecdir: ${exec_prefix}/modules
- mandir: ${prefix}/man
- sysconfdir: ${prefix}/conf
- datadir: ${prefix}
- installbuilddir: ${datadir}/build-${APR_MAJOR_VERSION}
- includedir: ${prefix}/include/apr-${APR_MAJOR_VERSION}
- localstatedir: ${prefix}
+ libexecdir: ${exec_prefix}/lib/apache
+ mandir: ${prefix}/share/man
+ sysconfdir: /etc/apache
+ datadir: /srv/www
+ installbuilddir: ${libexecdir}/build
+ includedir: ${prefix}/include/apache
+ localstatedir: ${datadir}
libsuffix: -${APR_MAJOR_VERSION}
</Layout>

View file

@ -1,31 +0,0 @@
diff -Naur apr-util-1.4.1.orig/config.layout apr-util-1.4.1/config.layout
--- apr-util-1.4.1.orig/config.layout 2005-02-09 13:18:43.000000000 +0100
+++ apr-util-1.4.1/config.layout 2011-12-27 19:29:41.667841632 +0100
@@ -11,18 +11,18 @@
# Classical APR-util path layout designed for parallel installs.
<Layout apr-util>
- prefix: /usr/local/apr
+ prefix: /usr
exec_prefix: ${prefix}
bindir: ${exec_prefix}/bin
- sbindir: ${exec_prefix}/bin
+ sbindir: ${exec_prefix}/sbin
libdir: ${exec_prefix}/lib
- libexecdir: ${exec_prefix}/modules
- mandir: ${prefix}/man
- sysconfdir: ${prefix}/conf
- datadir: ${prefix}
- installbuilddir: ${datadir}/build
- includedir: ${prefix}/include/apr-${APRUTIL_MAJOR_VERSION}
- localstatedir: ${prefix}
+ libexecdir: ${exec_prefix}/lib/apache
+ mandir: ${prefix}/share/man
+ sysconfdir: /etc/apache
+ datadir: /srv/www
+ installbuilddir: ${libexecdir}/build
+ includedir: ${prefix}/include/apache
+ localstatedir: ${datadir}
libsuffix: -${APRUTIL_MAJOR_VERSION}
</Layout>

View file

@ -73,6 +73,9 @@ if [ "${CLEAN}" = "y" ]; then
fi fi
sudo rm -rf $BUILDDIR/{bin,boot,dev,etc,home,lib{,64},media,mnt,run} sudo rm -rf $BUILDDIR/{bin,boot,dev,etc,home,lib{,64},media,mnt,run}
sudo rm -rf $BUILDDIR/{opt,root,sbin,srv,tmp,tools,cross-tools,usr,var} sudo rm -rf $BUILDDIR/{opt,root,sbin,srv,tmp,tools,cross-tools,usr,var}
if [[ "${BLFS_TOOL}" = "y" ]] ; then
sudo rm -rf $BUILDDIR/$BLFS_ROOT
fi
echo "done" echo "done"
echo -n "Cleaning $JHALFSDIR ..." echo -n "Cleaning $JHALFSDIR ..."
sudo rm -rf $JHALFSDIR sudo rm -rf $JHALFSDIR
@ -107,9 +110,4 @@ source $COMMON_DIR/libs/func_wrt_Makefile
[[ $VERBOSITY2 > 0 ]] && echo "OK" [[ $VERBOSITY2 > 0 ]] && echo "OK"
[[ $VERBOSITY2 > 0 ]] && echo -n "Loading <func_blfs_deps>..."
source $COMMON_DIR/libs/func_blfs_deps
[[ $? > 0 ]] && echo "file libs/func_blfs_deps did not load.." && exit 1
[[ $VERBOSITY2 > 0 ]] && echo "OK"
[[ $VERBOSITY2 > 0 ]] && echo -n " ..." [[ $VERBOSITY2 > 0 ]] && echo -n " ..."

View file

@ -1,222 +0,0 @@
#!/bin/bash
# $Id$
#----------------------------# Hardcoded URLs and MD5.
add_blfs_deps_urls() { # No easy way to extract it.
#----------------------------# Some FTP mirrors may not work
local BLFS_SERVER="${SERVER}/pub/blfs/conglomeration/"
if [[ "${DEP_LIBXML}" = "y" ]] ; then
echo "${LIBXML_URL} ${BLFS_SERVER}libxml2/${LIBXML_PKG} ${LIBXML_MD5}" >> urls.lst
fi
if [[ "${DEP_LIBXSLT}" = "y" ]] ; then
echo "${LIBXSLT_URL} ${BLFS_SERVER}libxslt/${LIBXSLT_PKG} ${LIBXSLT_MD5}" >> urls.lst
fi
if [[ "${DEP_TIDY}" = "y" ]] ; then
echo "${TIDY_URL} ${BLFS_SERVER}tidy/${TIDY_PKG} ${TIDY_MD5}" >> urls.lst
fi
if [[ "${DEP_UNZIP}" = "y" ]] ; then
echo "${UNZIP_URL} ${BLFS_SERVER}unzip/${UNZIP_PKG} ${UNZIP_MD5}" >> urls.lst
fi
if [[ "${DEP_DBXML}" = "y" ]] ; then
echo "${DBXML_URL} ${BLFS_SERVER}docbook-xml/${DBXML_PKG} ${DBXML_MD5}" >> urls.lst
fi
# if [[ "${DEP_DBXSL}" = "y" ]] ; then
# echo "${DBXSL_URL} ${BLFS_SERVER}docbook-xsl/${DBXSL_PKG} ${DBXSL_MD5}" >> urls.lst
# fi
if [[ "${DEP_LYNX}" = "y" ]] ; then
echo "${LYNX_URL} ${BLFS_SERVER}lynx/${LYNX_PKG} ${LYNX_MD5}" >> urls.lst
fi
if [[ "${DEP_SUDO}" = "y" ]] ; then
echo "${SUDO_URL} ${BLFS_SERVER}sudo/${SUDO_PKG} ${SUDO_MD5}" >> urls.lst
fi
if [[ "${DEP_WGET}" = "y" ]] ; then
echo "${WGET_URL} ${BLFS_SERVER}wget/${WGET_PKG} ${WGET_MD5}" >> urls.lst
fi
if [[ "${DEP_SVN}" = "y" ]] ; then
echo "${SQLITE_URL} ${BLFS_SERVER}sqlite/${SQLITE_PKG} ${SQLITE_MD5}" >> urls.lst
echo "${APR_URL} ${BLFS_SERVER}apr/${APR_PKG} ${APR_MD5}" >> urls.lst
## Cannot use file:// with wget, so cannot download apr patches.
## They have been put directly in $BUILDDIR/sources
## The next line only for being able to check md5sum
echo "${APR_PATCH_1_URL} ${BLFS_SERVER}apr/${APR_PATCH_1} ${APR_PATCH_1_MD5}" >> urls.lst
echo "${APR_U_URL} ${BLFS_SERVER}apr-util/${APR_U_PKG} ${APR_U_MD5}" >> urls.lst
echo "${APR_U_PATCH_1_URL} ${BLFS_SERVER}apr-util/${APR_U_PATCH_1} ${APR_U_PATCH_1_MD5}" >> urls.lst
echo "${SVN_URL} ${BLFS_SERVER}subversion/${SVN_PKG} ${SVN_MD5}" >> urls.lst
fi
if [[ "${DEP_GPM}" = "y" ]] ; then
echo "${GPM_URL} ${BLFS_SERVER}gpm/${GPM_PKG} ${GPM_MD5}" >> urls.lst
fi
}
#----------------------------# Maybe there is a better way to do this, but this
copy_blfs_deps_scripts() { # method avoid to place the test on all
#----------------------------# $PROGNAME/master.sh scripts.
mkdir -p ${PROGNAME}-commands/blfs-tool-deps
if [[ "${DEP_LIBXML}" = "y" ]] ; then
mv blfs-tool-deps/901-libxml2 ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_LIBXSLT}" = "y" ]] ; then
mv blfs-tool-deps/902-libxslt ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_TIDY}" = "y" ]] ; then
mv blfs-tool-deps/903-tidy ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_UNZIP}" = "y" ]] ; then
mv blfs-tool-deps/904-unzip ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_DBXML}" = "y" ]] ; then
mv blfs-tool-deps/905-docbook-xml ${PROGNAME}-commands/blfs-tool-deps
fi
# if [[ "${DEP_DBXSL}" = "y" ]] ; then
# mv blfs-tool-deps/906-docbook-xsl ${PROGNAME}-commands/blfs-tool-deps
# fi
if [[ "${DEP_LYNX}" = "y" ]] ; then
mv blfs-tool-deps/908-lynx ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_SUDO}" = "y" ]] ; then
mv blfs-tool-deps/909-sudo ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_WGET}" = "y" ]] ; then
mv blfs-tool-deps/910-wget ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_SVN}" = "y" ]] ; then
mv blfs-tool-deps/911-sqlite ${PROGNAME}-commands/blfs-tool-deps
mv blfs-tool-deps/912-apr ${PROGNAME}-commands/blfs-tool-deps
mv blfs-tool-deps/913-apr-util ${PROGNAME}-commands/blfs-tool-deps
mv blfs-tool-deps/914-subversion ${PROGNAME}-commands/blfs-tool-deps
fi
if [[ "${DEP_GPM}" = "y" ]] ; then
mv blfs-tool-deps/907-gpm ${PROGNAME}-commands/blfs-tool-deps
fi
rm -rf blfs-tool-deps
}
#----------------------------------#
wrt_blfs_tool_targets() { #
#----------------------------------#
PREV=""
echo "${tab_}${GREEN}Processing... ${L_arrow}BLFS_TOOL ${R_arrow}"
for file in blfs-tool-deps/* ; do
# Keep the script file name
this_script=`basename $file`
# Grab the name of the target
name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@'`
# Find the package.
case $name in
lynx ) pkg_tarball=${LYNX_PKG} ;;
tidy ) pkg_tarball=${TIDY_PKG} ;;
unzip ) pkg_tarball=${UNZIP_PKG} ;;
* ) pkg_tarball=$(get_package_tarball_name $name) ;;
esac
# Append each name of the script files to a list (this will become
# the names of the targets in the Makefile)
blfs_tool="$blfs_tool ${this_script}"
#--------------------------------------------------------------------#
# >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
#--------------------------------------------------------------------#
#
# Drop in the name of the target on a new line, and the previous target
# as a dependency. Also call the echo_message function.
if [ "$PROGNAME" = "clfs2" ]; then
LUSER_wrt_target "${this_script}" "$PREV"
else
CHROOT_wrt_target "${this_script}" "$PREV"
fi
# Insert instructions for unpacking the package and changing directories
# DocBook-XML is a zip, the build script will handle that.
if [ "$PROGNAME" = "clfs2" ]; then
[[ ! "$name" = "docbook-xml" ]] && LUSER_wrt_unpack "$pkg_tarball"
else
case "$name" in
*docbook*)
(
cat << EOF
@if [ "\$(PKGMNGT)" = "y" ]; then \\
echo "export PKG_DEST=\$(SRC)/\$@" > envars; \\
echo "source packInstall.sh" >> envars; \\
echo "export -f packInstall" >> envars; \\
fi;
EOF
) >> $MKFILE.tmp ;;
*) CHROOT_Unpack "$pkg_tarball" ;;
esac
fi
# Run the script.
if [ "$PROGNAME" = "clfs2" ]; then
LUSER_wrt_RunAsUser "${file}"
else
CHROOT_wrt_RunAsRoot "$file"
fi
# Remove the build directory(ies) except if the package build fails.
if [ "$PROGNAME" = "clfs2" ]; then
[[ ! "$name" = "docbook-xml" ]] && LUSER_RemoveBuildDirs "$name"
else
[[ ! "$name" = "docbook-xml" ]] && CHROOT_wrt_RemoveBuildDirs "$name"
fi
# Touch the tracking file.
case $name in
docbook-xml ) pkg_ver=DocBook-4.5 ;;
lynx ) pkg_ver=lynx-2.8.8dev.10 ;;
tidy ) pkg_ver=html-tidy-cvs_20101110 ;;
unzip ) pkg_ver=unzip-6.0 ;;
sqlite ) pkg_ver=sqlite-3.7.10 ;;
* ) pkg_ver=$(echo $pkg_tarball | sed -e 's/.tar.*//;s/.tgz//;s/.zip//') ;;
esac
if [ "$PROGNAME" = "clfs2" ]; then
echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/$pkg_ver" >> $MKFILE.tmp
else
echo -e "\t@touch $TRACKING_DIR/$pkg_ver" >> $MKFILE.tmp
fi
# Include a touch of the target name so make can check
# if it's already been made.
wrt_touch
#
#--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
#--------------------------------------------------------------------#
# Keep the script file name for Makefile dependencies.
PREV=${this_script}
done
}

View file

@ -152,8 +152,6 @@ extract_commands() { #
exit 1 ;; exit 1 ;;
esac esac
[[ "${BLFS_TOOL}" = "y" ]] && copy_blfs_deps_scripts
echo "done" echo "done"
# Make the scripts executable. # Make the scripts executable.

View file

@ -180,10 +180,6 @@ create_urls() { #
cd $BUILDDIR/sources cd $BUILDDIR/sources
if [[ "${BLFS_TOOL}" = "y" ]]; then
add_blfs_deps_urls
fi
if [[ "${CUSTOM_TOOLS}" = "y" ]]; then if [[ "${CUSTOM_TOOLS}" = "y" ]]; then
add_CustomToolsURLS add_CustomToolsURLS
fi fi

View file

@ -0,0 +1,188 @@
#!/bin/bash
# $Id$
#----------------------------# Prepare BLFS_ROOT and extract
install_blfs_tools() { # the scriptlets to build
#----------------------------# the dependency tools
set -e
# Install the files
[[ ! -d ${BUILDDIR}${BLFS_ROOT} ]] && mkdir -pv ${BUILDDIR}${BLFS_ROOT}
cp -r BLFS/* ${BUILDDIR}${BLFS_ROOT}
cp -r menu ${BUILDDIR}${BLFS_ROOT}
cp $COMMON_DIR/progress_bar.sh ${BUILDDIR}${BLFS_ROOT}
cp README.BLFS ${BUILDDIR}${BLFS_ROOT}
# Clean-up
make -C ${BUILDDIR}${BLFS_ROOT}/menu clean
rm -rf ${BUILDDIR}${BLFS_ROOT}/libs/.svn
rm -rf ${BUILDDIR}${BLFS_ROOT}/xsl/.svn
rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/.svn
rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/lxdialog/.svn
# Set some harcoded envars to their proper values
sed -i s@tracking-dir@$TRACKING_DIR@ \
${BUILDDIR}${BLFS_ROOT}/{Makefile,gen-makefile.sh}
sed -i s@trunk/BOOK@$BLFS_TREE@ \
${BUILDDIR}${BLFS_ROOT}/Makefile
# Downloads the book, initialize the tracking file and the package database
# sudo is needed if $BUILDDIR/var/lib is owned by root and /var/lib/jhalfs
# has to be created
sudo make -j1 -C $BUILDDIR$BLFS_ROOT TRACKING_DIR=$BUILDDIR$TRACKING_DIR \
$BUILDDIR$BLFS_ROOT/packages.xml
# Because the BLFS Makefile is supposed to be used in chroot (or booted)
# mode, the tracking file has wrong path for DTD. Change it:
sudo sed -i s@$BUILDDIR@@ $BUILDDIR$TRACKING_DIR/instpkg.xml
# Manually build a 'configuration' file
if [ "$DEP_LIBXML" = y ]; then
LINE_LIBXML='CONFIG_libxml2=y'
else
LINE_LIBXML='#CONFIG_libxml2 is not set'
fi
if [ "$DEP_LIBXSLT" = y ]; then
LINE_LIBXSLT='CONFIG_libxslt=y'
else
LINE_LIBXSLT='#CONFIG_libxslt is not set'
fi
if [ "$DEP_TIDY" = y ]; then
LINE_TIDY='CONFIG_html-tidy=y'
else
LINE_TIDY='#CONFIG_html-tidy is not set'
fi
if [ "$DEP_DBXML" = y ]; then
LINE_DBXML='CONFIG_DocBook=y'
else
LINE_DBXML='#CONFIG_DocBook is not set'
fi
if [ "$DEP_LYNX" = y ]; then
LINE_LYNX='CONFIG_lynx=y'
else
LINE_LYNX='#CONFIG_lynx is not set'
fi
if [ "$DEP_SUDO" = y ]; then
LINE_SUDO='CONFIG_sudo=y'
else
LINE_SUDO='#CONFIG_sudo is not set'
fi
if [ "$DEP_WGET" = y ]; then
LINE_WGET='CONFIG_wget=y'
else
LINE_WGET='#CONFIG_wget is not set'
fi
if [ "$DEP_GPM" = y ]; then
LINE_GPM='CONFIG_gpm=y'
else
LINE_GPM='#CONFIG_gpm is not set'
fi
if [ "$DEP_SVN" = y ]; then
LINE_SVN='CONFIG_subversion=y'
else
LINE_SVN='#CONFIG_subversion is not set'
fi
if [ "$DEP_OPENSSL" = y ]; then
LINE_OPENSSL='CONFIG_openssl=y'
else
LINE_OPENSSL='#CONFIG_openssl is not set'
fi
if [ "$DEP_PYTHON" = y ]; then
LINE_PYTHON='CONFIG_python2=y'
else
LINE_PYTHON='#CONFIG_python2 is not set'
fi
cat >$BUILDDIR$BLFS_ROOT/configuration <<EOF
$LINE_PYTHON
$LINE_LIBXML
$LINE_LIBXSLT
$LINE_TIDY
$LINE_DBXML
$LINE_OPENSSL
$LINE_WGET
$LINE_SVN
$LINE_GPM
$LINE_LYNX
$LINE_SUDO
MAIL_SERVER=sendmail
optDependency=2
SUDO=n
EOF
# Generates the scripts for the blfs tools dependencies (in ./scripts)
yes "yes" | $BUILDDIR$BLFS_ROOT/gen_pkg_book.sh $BUILDDIR$BLFS_ROOT
# Move the scriptlets where they should be
sudo rm -rf $BUILDDIR$BLFS_ROOT/scripts
mv scripts $BUILDDIR$BLFS_ROOT
# Generates a list containing download and copying instructions for tarballs
echo -e '#!/bin/bash\nset -e\n' > $BUILDDIR$BLFS_ROOT/download_script
sed -n -e '/PACKAGE=/,/md5sum/p' \
-e '/PACKAGE1=/,/^fi/p' \
-e '/PATCH=/,/^fi/p' \
-e '/URL=/,/unpacked/p' \
$BUILDDIR$BLFS_ROOT/scripts/* >> $BUILDDIR$BLFS_ROOT/download_script
chmod u+x $BUILDDIR$BLFS_ROOT/download_script
# Downloads (or copy) to build_dir/sources
pushd $BUILDDIR/sources
# Remove `unpacked' files if some have been left
sudo find . -name unpacked -exec rm \{\} \;
FTP_SERVER=$SERVER/pub/blfs/ SRC_ARCHIVE=$SRC_ARCHIVE $BUILDDIR$BLFS_ROOT/download_script
# The blfs-bootscripts package is at the wrong location
mkdir -p blfs-bootscripts
cp blfs-bootscripts*tar* blfs-bootscripts
popd
rm -v $BUILDDIR$BLFS_ROOT/download_script
# Suppresses unneeded parts of the scriptlets
if [ "$DEP_WGET" = y ] && ! [ "$DEP_OPENSSL" = y ]; then
sed -i s'/-ssl=.*/out-ssl/' $BUILDDIR$BLFS_ROOT/scripts/*wget
fi
if [ "$DEP_SUDO" = y ]; then
sed -i '/pam.d/i mkdir -p /etc/pam.d' $BUILDDIR$BLFS_ROOT/scripts/*sudo
fi
if [ "$DEP_SVN" = y ]; then
sed -i -e /javahl/d -e /swig/d $BUILDDIR$BLFS_ROOT/scripts/*subversion
sed -i -e '/pushd/,/popd/d' -e /tea/d $BUILDDIR$BLFS_ROOT/scripts/*sqlite
fi
if [ "$DEP_PYTHON" = y ]; then
sed -i -e '/^make.*Doc/d' -e '/^chmod/{n;N;d}' $BUILDDIR$BLFS_ROOT/scripts/*python2
fi
if [ "$DEP_OPENSSL" = y ]; then
sed -i 's/^make$/make -j1/' $BUILDDIR$BLFS_ROOT/scripts/*openssl
fi
if [ "$DEP_LYNX" = y ]; then
if [ "$DEP_OPENSSL" = y -o "$DEP_WGET" = y ]; then
sed -i -e 's/configure/& --with-ssl/' \
-e '/make$/i echo "#define USE_OPENSSL_INCL 1" >> lynx_cfg.h &&' \
$BUILDDIR$BLFS_ROOT/scripts/*lynx
fi
fi
# At last generates the build Makefile
mkdir -p $BUILDDIR$BLFS_ROOT/work
pushd $BUILDDIR$BLFS_ROOT/work
../gen-makefile.sh
sed -i -e '/xsltproc/,+6d' \
-e '/^all/s@$@ update@' \
-e 's/touch/@touch/' Makefile
cat >> Makefile << EOF
update:
@echo Updating the tracking file
@for file in *-*; do \\
xsltproc --stringparam packages ../packages.xml \\
--stringparam package \$\${file##*z-} \\
-o track.tmp \\
../xsl/bump.xsl \$(TRACKING_FILE); \\
sed -i 's@PACKDESC@$BLFS_ROOT/packdesc.dtd@' track.tmp; \\
xmllint --format --postvalid track.tmp > \$(TRACKING_FILE); \\
rm track.tmp; \\
done
@touch \$@
@echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK
@echo --------------------------------------------------------------------------------\$(WHITE)
EOF
popd
}

View file

@ -57,9 +57,9 @@ inline_doc
# Additional variables (add DEP_DBXSL when required again) # Additional variables (add DEP_DBXSL when required again)
local -r blfs_tool_PARAM_LIST="BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR \ local -r blfs_tool_PARAM_LIST="BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR \
DEP_LIBXML DEP_LIBXSLT DEP_TIDY DEP_UNZIP \ DEP_LIBXML DEP_LIBXSLT DEP_TIDY \
DEP_DBXML DEP_LYNX DEP_SUDO DEP_WGET \ DEP_DBXML DEP_LYNX DEP_SUDO DEP_WGET \
DEP_SVN DEP_GPM" DEP_SVN DEP_GPM DEP_OPENSSL DEP_PYTHON"
local -r custom_tool_PARAM_LIST="TRACKING_DIR" local -r custom_tool_PARAM_LIST="TRACKING_DIR"
# Internal variables # Internal variables

90
install-blfs-tools.sh Executable file
View file

@ -0,0 +1,90 @@
#!/bin/bash
# $Id$
set -e
# VT100 colors
declare -r BLACK=$'\e[1;30m'
declare -r DK_GRAY=$'\e[0;30m'
declare -r RED=$'\e[31m'
declare -r GREEN=$'\e[32m'
declare -r YELLOW=$'\e[33m'
declare -r BLUE=$'\e[34m'
declare -r MAGENTA=$'\e[35m'
declare -r CYAN=$'\e[36m'
declare -r WHITE=$'\e[37m'
declare -r OFF=$'\e[0m'
declare -r BOLD=$'\e[1m'
declare -r REVERSE=$'\e[7m'
declare -r HIDDEN=$'\e[8m'
declare -r tab_=$'\t'
declare -r nl_=$'\n'
declare -r DD_BORDER="${BOLD}==============================================================================${OFF}"
declare -r SD_BORDER="${BOLD}------------------------------------------------------------------------------${OFF}"
declare -r STAR_BORDER="${BOLD}******************************************************************************${OFF}"
# bold yellow > < pair
declare -r R_arrow=$'\e[1;33m>\e[0m'
declare -r L_arrow=$'\e[1;33m<\e[0m'
VERBOSITY=1
COMMON_DIR="common"
BLFS_TOOL='y'
BUILDDIR=$(cd ~;pwd)
BLFS_ROOT="/blfs_root"
TRACKING_DIR="/var/lib/jhalfs/BLFS"
[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
#*******************************************************************#
[[ $VERBOSITY > 0 ]] && echo -n "Loading function <func_check_version.sh>..."
source $COMMON_DIR/libs/func_check_version.sh
[[ $? > 0 ]] && echo " function module did not load.." && exit 2
[[ $VERBOSITY > 0 ]] && echo "OK"
[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
# blfs-tool envars
BLFS_BRANCH_ID=${BLFS_BRANCH_ID:=development}
case $BLFS_BRANCH_ID in
development ) BLFS_TREE=trunk/BOOK ;;
branch-* ) BLFS_TREE=branches/${BLFS_BRANCH_ID#branch-} ;;
* ) BLFS_TREE=tags/${BLFS_BRANCH_ID} ;;
esac
# Check for build prerequisites.
echo
check_prerequisites
echo "${SD_BORDER}${nl_}"
# Install the files
[[ $VERBOSITY > 0 ]] && echo -n Populating the ${BUILDDIR}${BLFS_ROOT} directory
[[ ! -d ${BUILDDIR}${BLFS_ROOT} ]] && mkdir -pv ${BUILDDIR}${BLFS_ROOT}
cp -r BLFS/* ${BUILDDIR}${BLFS_ROOT}
cp -r menu ${BUILDDIR}${BLFS_ROOT}
cp $COMMON_DIR/progress_bar.sh ${BUILDDIR}${BLFS_ROOT}
cp README.BLFS ${BUILDDIR}${BLFS_ROOT}
[[ $VERBOSITY > 0 ]] && echo "... OK"
[[ $VERBOSITY > 0 ]] && echo -n Cleaning the ${BUILDDIR}${BLFS_ROOT} directory
# Clean-up
make -C ${BUILDDIR}${BLFS_ROOT}/menu clean
rm -rf ${BUILDDIR}${BLFS_ROOT}/libs/.svn
rm -rf ${BUILDDIR}${BLFS_ROOT}/xsl/.svn
rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/.svn
rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/lxdialog/.svn
# Set some harcoded envars to their proper values
sed -i s@tracking-dir@$TRACKING_DIR@ \
${BUILDDIR}${BLFS_ROOT}/{Makefile,gen-makefile.sh}
[[ $VERBOSITY > 0 ]] && echo "... OK"
[[ $VERBOSITY > 0 ]] && echo -n "Downloading and validating the book (may take some time)"
make -j1 -C $BUILDDIR$BLFS_ROOT TRACKING_DIR=$TRACKING_DIR \
$BUILDDIR$BLFS_ROOT/packages.xml
[[ $VERBOSITY > 0 ]] && echo "... OK"

144
jhalfs
View file

@ -189,85 +189,6 @@ esac
# Set the document location... # Set the document location...
BOOK=${BOOK:=$JHALFSDIR/$PROGNAME-$LFSVRS} BOOK=${BOOK:=$JHALFSDIR/$PROGNAME-$LFSVRS}
# blfs-tool envars
BLFS_TOOL=${BLFS_TOOL:-n}
if [[ "${BLFS_TOOL}" = "y" ]] ; then
BLFS_BRANCH_ID=${BLFS_BRANCH_ID:=development}
case $BLFS_BRANCH_ID in
development ) BLFS_TREE=trunk/BOOK ;;
*EDIT* ) echo " You forgot to set the BLFS branch or stable book version."
echo " Please rerun make and fix the configuration."
exit 2 ;;
branch-* ) BLFS_TREE=branches/${BLFS_BRANCH_ID#branch-} ;;
* ) BLFS_TREE=tags/${BLFS_BRANCH_ID} ;;
esac
# Dependencies envars, easier to update.
# Tidy and Unzip version are harcoded also in wrt_blfs_tool_targets()
# libxml2
LIBXML_PKG="libxml2-2.7.8.tar.gz"
LIBXML_URL="ftp://xmlsoft.org/libxml2/${LIBXML_PKG}"
LIBXML_MD5="8127a65e8c3b08856093099b52599c86"
# libxslt
LIBXSLT_PKG="libxslt-1.1.26.tar.gz"
LIBXSLT_URL="ftp://xmlsoft.org/libxslt/${LIBXSLT_PKG}"
LIBXSLT_MD5="e61d0364a30146aaa3001296f853b2b9"
# tidy
TIDY_PKG="tidy-cvs_20101110.tar.bz2"
TIDY_URL="http://anduin.linuxfromscratch.org/sources/BLFS/svn/t/${TIDY_PKG}"
TIDY_MD5="dd1fe109b4259ad3f364b175787ad5e9"
# unzip
UNZIP_PKG="unzip60.tar.gz"
UNZIP_URL="http://downloads.sourceforge.net/infozip/${UNZIP_PKG}"
UNZIP_MD5="62b490407489521db863b523a7f86375"
# DocBook XML DTD
DBXML_PKG="docbook-xml-4.5.zip"
DBXML_URL="http://www.docbook.org/xml/4.5/${DBXML_PKG}"
DBXML_MD5="03083e288e87a7e829e437358da7ef9e"
# DocBook XSL
# DBXSL_PKG="docbook-xsl-1.69.1.tar.bz2"
# DBXSL_URL="http://prdownloads.sourceforge.net/docbook/${DBXSL_PKG}"
# DBXSL_MD5="6ebd29a67f2dcc3f2220f475ee6f6552"
# Lynx
LYNX_PKG="lynx2.8.8dev.10.tar.bz2"
LYNX_URL="http://lynx.isc.org/current/${LYNX_PKG}"
LYNX_MD5="1c9ef3746520c69914b461f88de6b12e"
# sudo
SUDO_PKG="sudo-1.8.2.tar.gz"
SUDO_URL="http://www.sudo.ws/sudo/dist/${SUDO_PKG}"
SUDO_MD5="000f458e7391be9fdf459a9ad6a4912a"
# wget
WGET_PKG="wget-1.13.4.tar.xz"
WGET_URL="ftp://ftp.gnu.org/gnu/wget/${WGET_PKG}"
WGET_MD5="7f518b3a71e9efd330e9a0c3714f8463"
# SQLite (for subversion)
SQLITE_PKG="sqlite-autoconf-3071000.tar.gz"
SQLITE_URL="http://sqlite.org/${SQLITE_PKG}"
SQLITE_MD5="9ed2ca93577b58cfa0d01f64b9312ab9"
# Apache Portable Runtime (for subversion)
APR_PKG="apr-1.4.5.tar.bz2"
APR_URL="http://mirror.speednetwork.de/apache/apr/$APR_PKG"
APR_MD5="8b53f5a5669d0597f2da889a2f576eb6"
# APR config patch
APR_PATCH_1="apr-1.4.5-config.patch"
APR_PATCH_1_URL="file:///sources/local-patches/${APR_PATCH_1}"
APR_PATCH_1_MD5="fff6eddf998f4e956915f8053c15e41e"
# Apache Portable Runtime Utilities (for subversion)
APR_U_PKG="apr-util-1.4.1.tar.bz2"
APR_U_URL="http://mirrors.ircam.fr/pub/apache/apr/$APR_U_PKG"
APR_U_MD5="52b31b33fb1aa16e65ddaefc76e41151"
# APR-util config patch
APR_U_PATCH_1="apr-util-1.4.1-config.patch"
APR_U_PATCH_1_URL="file:///sources/local-patches/${APR_U_PATCH_1}"
APR_U_PATCH_1_MD5="4c07cb0d298ae9ddc75cd2d5acdedb2b"
# Subversion
SVN_PKG="subversion-1.7.1.tar.bz2"
SVN_URL="http://archive.apache.org/dist/subversion/${SVN_PKG}"
SVN_MD5="8a4fa74385df85a9702141b6b68b8307"
# GPM
GPM_PKG="gpm-1.20.6.tar.bz2"
GPM_URL="http://www.nico.schottelius.org/software/gpm/archives/$GPM_PKG"
GPM_MD5="6b534da16dc1b28ba828dea89e520f6f"
fi
#--- Envars not sourced from configuration #--- Envars not sourced from configuration
case $PROGNAME in case $PROGNAME in
@ -319,6 +240,23 @@ source $COMMON_DIR/libs/func_custom_pkgs
[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}" [[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
# blfs-tool envars
BLFS_TOOL=${BLFS_TOOL:-n}
if [[ "${BLFS_TOOL}" = "y" ]] ; then
BLFS_BRANCH_ID=${BLFS_BRANCH_ID:=development}
case $BLFS_BRANCH_ID in
development ) BLFS_TREE=trunk/BOOK ;;
*EDIT* ) echo " You forgot to set the BLFS branch or stable book version."
echo " Please rerun make and fix the configuration."
exit 2 ;;
branch-* ) BLFS_TREE=branches/${BLFS_BRANCH_ID#branch-} ;;
* ) BLFS_TREE=tags/${BLFS_BRANCH_ID} ;;
esac
[[ $VERBOSITY > 0 ]] && echo -n "Loading blfs tools installation function..."
source $COMMON_DIR/libs/func_install_blfs
[[ $? > 0 ]] && echo "function module did not load.." && exit 1
[[ $VERBOSITY > 0 ]] && echo "OK"
fi
################################### ###################################
### MAIN ### ### MAIN ###
@ -363,12 +301,6 @@ fi
if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
# If $BUILDDIR has subdirectories like tools/ or bin/, stop the run
# and notify the user about that.
if [ -d $BUILDDIR/tools -o -d $BUILDDIR/bin ] && [ -z $CLEAN ] ; then
eval "$no_empty_builddir"
fi
# If requested, clean the build directory # If requested, clean the build directory
clean_builddir clean_builddir
@ -407,10 +339,6 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
# Copy urls.xsl, if needed # Copy urls.xsl, if needed
[[ "$GETPKG" = "y" ]] && cp $COMMON_DIR/urls.xsl $JHALFSDIR/ [[ "$GETPKG" = "y" ]] && cp $COMMON_DIR/urls.xsl $JHALFSDIR/
# #
# Copy APR patches, if needed
[[ "$DEP_SVN" = "y" ]] &&
cp $COMMON_DIR/blfs-tool-deps/apr*.patch $BUILDDIR/sources
#
# Create the test-log directory, if needed # Create the test-log directory, if needed
[[ "$TEST" != "0" ]] && [[ ! -d $TESTLOGDIR ]] && install -d -m 1777 $TESTLOGDIR [[ "$TEST" != "0" ]] && [[ ! -d $TESTLOGDIR ]] && install -d -m 1777 $TESTLOGDIR
# #
@ -434,7 +362,6 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
cp extras/* $JHALFSDIR/extras cp extras/* $JHALFSDIR/extras
fi fi
# #
# Copy custom tools config files, if requested # Copy custom tools config files, if requested
if [[ "${CUSTOM_TOOLS}" = "y" ]]; then if [[ "${CUSTOM_TOOLS}" = "y" ]]; then
echo "Copying custom tool scripts to $JHALFSDIR" echo "Copying custom tool scripts to $JHALFSDIR"
@ -444,22 +371,9 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
# #
# Install blfs-tool, if requested. # Install blfs-tool, if requested.
if [[ "${BLFS_TOOL}" = "y" ]] ; then if [[ "${BLFS_TOOL}" = "y" ]] ; then
# Install the files echo Downloading and validating the BLFS book
[[ ! -d ${BUILDDIR}${BLFS_ROOT} ]] && mkdir -p ${BUILDDIR}${BLFS_ROOT} echo '(may take some time...)'
cp -r BLFS/* ${BUILDDIR}${BLFS_ROOT} install_blfs_tools 2>&1 | tee -a $LOGDIR/$LOG
cp -r menu ${BUILDDIR}${BLFS_ROOT}
cp $COMMON_DIR/progress_bar.sh ${BUILDDIR}${BLFS_ROOT}
cp README.BLFS ${BUILDDIR}${BLFS_ROOT}
# Clean-up
rm -rf ${BUILDDIR}${BLFS_ROOT}/libs/.svn
rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/.svn
rm -rf ${BUILDDIR}${BLFS_ROOT}/menu/lxdialog/.svn
# Set some harcoded envars to their proper values
sed -i 's,blfs-xml,'$BLFS_XML',' ${BUILDDIR}${BLFS_ROOT}/{update_book.sh,libs/book.xsl}
sed -i 's,tracking-dir,'$TRACKING_DIR',' ${BUILDDIR}${BLFS_ROOT}/{update_book.sh,gen-makefile.sh}
# Copy the dependencies build scripts
cp -r $COMMON_DIR/blfs-tool-deps $JHALFSDIR/
rm -rf $JHALFSDIR/blfs-tool-deps/.svn
fi fi
# #
@ -468,24 +382,10 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
extract_commands extract_commands
echo "${SD_BORDER}${nl_}" echo "${SD_BORDER}${nl_}"
# Get the BLFS book, if requested.
if [[ "${BLFS_TOOL}" = "y" ]] ; then
echo -n "Downloading the BLFS document, $BLFS_BRANCH_ID version... "
if [[ ! -d ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} ]] ; then
mkdir -p ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML}
svn co $SVN_2/BLFS/$BLFS_TREE ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} >>$LOGDIR/$LOG 2>&1
else
pushd ${BUILDDIR}${BLFS_ROOT}/${BLFS_XML} 1> /dev/null
svn up >>$LOGDIR/$LOG 2>&1
popd 1> /dev/null
fi
echo -ne "done\n"
echo "${SD_BORDER}${nl_}"
fi
fi fi
# When regenerating the Makefile, we need to know also the canonical book version # When regenerating the Makefile, we need to know also the
# canonical book version
if [[ "$REBUILD_MAKEFILE" = "y" ]] ; then if [[ "$REBUILD_MAKEFILE" = "y" ]] ; then
case $PROGNAME in case $PROGNAME in
clfs* ) clfs* )