Compare commits

...

124 Commits

Author SHA1 Message Date
Pierre Labastie af63ee2d34 Merge trunk r3767-3773 2014-01-01 09:49:25 +00:00
Pierre Labastie f5337a92d7 merge trunk r3766 2013-12-22 16:59:31 +00:00
Pierre Labastie dda2496778 Merge trunk r3762 to r3765 2013-12-16 14:23:20 +00:00
Pierre Labastie 5130b3ac7d Merge trunk r3750-3760 2013-11-17 22:20:07 +00:00
Pierre Labastie 84a651cade Some cleanup 2013-11-07 10:30:33 +00:00
Pierre Labastie df41521ba6 Merge trunk 3745:3750 2013-11-06 21:56:23 +00:00
Pierre Labastie adc85de5af merging trunk r3743 r3744 2013-11-01 14:25:30 +00:00
Pierre Labastie 199132680a Merge trunk r3741 (error handling) 2013-10-30 15:51:56 +00:00
Pierre Labastie 04ba33625a Merge last changes to trunk 2013-10-29 16:59:40 +00:00
Pierre Labastie 6216d18cee Merge trunk r3734 2013-10-06 09:01:50 +00:00
Pierre Labastie f33756b8ab merge trunk r3730:3732 2013-10-05 17:52:45 +00:00
Pierre Labastie 3fed586036 Merge trunk r3728 2013-09-27 20:47:05 +00:00
Pierre Labastie d928c71bca Merge trunk r3726 2013-09-22 07:17:17 +00:00
Pierre Labastie 90bfb42e51 Merge trunk r3724 2013-09-21 19:02:11 +00:00
Pierre Labastie 6c83a56f30 Merge trunk r3721,3722 2013-09-21 10:38:16 +00:00
Pierre Labastie df08148a5b Merge trunk r3719 2013-09-17 13:45:07 +00:00
Pierre Labastie 89dffbf1c9 Merge trunk r3717 2013-09-14 21:34:25 +00:00
Pierre Labastie 6bcf33e8c6 Add versionning to the BLFS machinery 2013-09-14 11:16:02 +00:00
Pierre Labastie b8cc36b751 Merge trunk r3714 2013-09-14 10:51:08 +00:00
Pierre Labastie 27c5769103 Merge trunk r3712 2013-09-14 10:31:49 +00:00
Pierre Labastie f62e4c5591 merge trunk rev 3710 2013-07-22 13:48:40 +00:00
Pierre Labastie 8c48f24287 merge trunk r3707 2013-06-08 12:39:56 +00:00
Pierre Labastie 16b8febb8c merge trunk r3705 2013-05-21 20:22:41 +00:00
Pierre Labastie d8ed3a9917 Merge trunk r3703 2013-05-18 20:47:47 +00:00
Pierre Labastie 0a661b663c Further deps modifications
in order to be sure that the preceding page is a dep in the X chapter
2013-04-19 21:38:09 +00:00
Pierre Labastie 14a3e908c2 Order the depdendencies in xorg
packages according to the order in the "cat"
command, rather than the order of the entity declarations
2013-04-18 16:15:26 +00:00
Pierre Labastie d48726d654 Corrected make_book.xsl again 2013-04-15 21:39:44 +00:00
Pierre Labastie e86d4cd693 Further correction of make_book.xsl 2013-04-15 20:48:24 +00:00
Pierre Labastie 1f3e275542 in make_book.xsl:
add contains(@id,xorg7) to the sect1 test for xorg packages
2013-04-15 13:53:59 +00:00
Pierre Labastie 5e486cf6b7 Merge trunk r3696 2013-04-05 15:14:20 +00:00
Pierre Labastie 1825286a86 Merge trunk r3694 2013-04-05 13:26:25 +00:00
Pierre Labastie 07278936c8 Merge trunk r3692 2013-04-04 20:09:42 +00:00
Pierre Labastie 9fe527f6a9 Merging trunk r3690 2013-04-03 20:38:15 +00:00
Pierre Labastie d236bbdf03 BLFS tools:
- Separates the groups of xorg package into individual builds
2013-03-31 17:25:21 +00:00
Pierre Labastie d0c94a3a6e Allows stripping -libstdc++ in master.sh to be able to build gcc-libstdc++ 2013-03-27 13:26:27 +00:00
Pierre Labastie 44b831e90a Merge trunk r3604 2013-03-23 14:25:27 +00:00
Pierre Labastie 0cc9d4e383 Merge trunk r3603, 3648, 3673, 3677 2013-03-23 13:51:58 +00:00
Pierre Labastie c88b48d6f2 Merge trunk r3677 2013-03-21 11:27:50 +00:00
Pierre Labastie 91d7db18a0 Merge trunk r3675 2013-03-20 17:28:03 +00:00
Pierre Labastie 7b9c8a0bab Includes recent SSL instructions for LYNX in func_install_blfs 2013-03-17 12:24:00 +00:00
Pierre Labastie cc0170cb5b Protect /etc/profile sourcing in BLFS/envars.conf 2013-03-14 08:26:23 +00:00
Pierre Labastie edba613102 Merge upstream r3669 2013-03-13 22:04:56 +00:00
Pierre Labastie cbd04930b3 Merge jhalfs 3667 2013-03-13 16:48:19 +00:00
Pierre Labastie 2629bf2580 Merge jhalfs r3665 2013-03-04 16:49:45 +00:00
Pierre Labastie 930b7429ca Merge trunk r3660 2013-03-03 14:23:03 +00:00
Pierre Labastie aefbe0fe11 Add ssl support to lynx 2013-03-03 12:49:07 +00:00
Pierre Labastie 96857f897b Merge trunk r3661 2013-03-03 12:37:08 +00:00
Pierre Labastie 76f888864d Merge jhalfs r3658 2013-03-02 14:14:44 +00:00
Pierre Labastie 960099fb0d Merge trunk rev 3654 2013-02-20 08:41:22 +00:00
Pierre Labastie ad89c458cb Ajust XORG_CONFIG var in BLFS/envars.conf 2013-02-09 19:25:03 +00:00
Pierre Labastie 9dd4cccfb0 Ignore when useradd throws an error because it cannot handle
-k /dev/null
(happens at least in Suse distributions)
2013-01-29 17:53:28 +00:00
Pierre Labastie f6ac40603a Changed minimal sudo version to 1.7.0, where the "-E" flag first appeared 2013-01-23 09:52:21 +00:00
Pierre Labastie b35ce443f5 change func_install_blfs:
-remove sqlite instructions using swig and tcl
-add sudo toa few command so that the directory can be cleaned more easily
2013-01-12 07:58:34 +00:00
Pierre Labastie d33f161b86 Comment out all the GNOME envars as stated in the preceding commit log 2013-01-07 10:57:01 +00:00
Pierre Labastie 89cb93bd91 Update of BLFS/envars.conf file:
- new KDE envars and instructions
- obsoleting GNOME envars as they are not needed in the present version
of the book
2013-01-07 10:52:43 +00:00
Pierre Labastie a98e987a5b merge rev 3643 into ablfs 2012-12-30 16:56:46 +00:00
Pierre Labastie 6faeb632b2 Remove lib64 when cleaning build dir 2012-12-30 16:54:18 +00:00
Pierre Labastie eabc2055e3 Change dependance on preceding module in Python Modules from "required"
to "optional"
2012-12-27 08:28:26 +00:00
Pierre Labastie e51fab2cc5 Correct a bug in xsl files, which made modules disappear when no other
package was present in a sublist.
+ make version bumping work for modules
2012-12-27 08:10:02 +00:00
Pierre Labastie 12fb268a9e Change BLFS tools envars.conf to reflect removal of KDE3:
change all KDE4_XXX variables to KDE_XXX
2012-12-22 21:34:44 +00:00
Pierre Labastie 1061e6bc9d Adjust to modifications in X Window chapter 2012-12-12 21:05:08 +00:00
Pierre Labastie c39db54a53 Follows update of jhalfs-trunk 2012-07-26 10:23:46 +00:00
Pierre Labastie 4c8774a46e copied master.sh from jhalfs trunk 2012-05-13 09:21:20 +00:00
Pierre Labastie a13a53f30f Corrected the owner of /etc/lfs-release so that it is now root 2012-05-12 21:11:04 +00:00
Pierre Labastie dd7e92a4ad Typo in BLFS/xsl/scripts.xsl 2012-05-06 07:41:10 +00:00
Pierre Labastie ee1e22bb30 Makes xorg-driver a required dep of xterm, since the preceding-sibling
is not a unique package. In xsl/gen_pkg_list.xsl
2012-04-22 20:59:19 +00:00
Pierre Labastie 6b268524bf Added the case when sleep is in /usr/bin to progress_bar.sh 2012-04-21 21:23:58 +00:00
Pierre Labastie 115c75a753 In BLFS tools: generate dependencies in book order for KDE 2012-04-15 08:27:58 +00:00
Pierre Labastie 0bd3836477 Usage shows that it is better to have all defaults to "n" in BLFS
for Config.in
2012-04-15 08:18:16 +00:00
Pierre Labastie 3ab1fcab85 Correct a typo in envars.conf 2012-04-11 20:56:27 +00:00
Pierre Labastie e9bc540021 Update envars.conf for KDE4 2012-04-10 14:38:40 +00:00
Pierre Labastie d721466a77 Give xterm2 as a dependency when xorg is requested 2012-04-09 19:20:00 +00:00
Pierre Labastie f53dc4cf43 Change again the root commands, so that all control characters are escaped
Update the corresponding part in README.BLFS
2012-04-09 10:17:30 +00:00
Pierre Labastie d6f2ebfaae Change order in func_install_blfs so that wget is installed
with openssl support if selected
2012-04-05 19:55:14 +00:00
Pierre Labastie 0d793a8580 Change xz version req as in trunk 2012-03-29 08:24:02 +00:00
Pierre Labastie 5ed79efc8f Typos in envars.conf 2012-03-27 05:39:27 +00:00
Pierre Labastie 52402f1a52 Add sudo to the create-du_sbu command in Makefile, so that it can read
all the dirs
2012-03-24 10:39:30 +00:00
Pierre Labastie 46d25bc515 Fix a missing \n in gen_pkg_book.sh 2012-03-24 10:17:34 +00:00
Pierre Labastie f67b8c226f Remove obsolete variables from gen_pkg_book.sh 2012-03-24 10:05:54 +00:00
Pierre Labastie 3c2e2885b1 Change an @ command in BLFS Makefile to honour $(Q) variable 2012-03-23 15:56:02 +00:00
Pierre Labastie 18c1c950ea Fix gnome variables in envars.conf for blfs tools 2012-03-23 15:00:42 +00:00
Pierre Labastie f3fb6ce378 Add a script to install the blfs tools to an already running system 2012-03-22 21:04:08 +00:00
Pierre Labastie dcb29a9834 Add DEP_OPENSSL and DEP_PYTHON to
variables to be checked
2012-03-22 20:47:21 +00:00
Pierre Labastie de947d2bee Allows to build Python and openssl before libxml2 and subversion respectively
in BLFS tools, avoiding later recompilation
2012-03-22 20:42:41 +00:00
Pierre Labastie cd668b9315 Correction to the code for outputing root commands, so that the backquote and
backslash character are not escaped when not using sudo
2012-03-22 20:40:04 +00:00
Pierre Labastie 970f2dc6e0 Change script generation of root command: replace fragile construct
sudo sh -c '<commands>'
with slightly less fragile construct
sudo sh << ROOT_EOF
<commands with ` and \ escaped>
ROOT_EOF
Note: $ are not escaped, which is usually what is intended, but not always
2012-03-20 17:12:26 +00:00
Pierre Labastie c1decbe119 Correct typos in FUNCTION_LIST 2012-03-20 13:37:52 +00:00
Pierre Labastie 78e2ad2335 change the cleaning code so that sources is not removed when not
using BLFS tools
2012-03-17 12:11:22 +00:00
Pierre Labastie e61321f006 Suppress useless blfs-tool-deps 2012-03-13 10:38:40 +00:00
Pierre Labastie 688117a681 Typo in BLFS/Makefile 2012-03-13 09:32:39 +00:00
Pierre Labastie 55733136b6 Add comments to BLFS/Makefile
Use /bin/echo to write the initial instpkg.xml. Hopefully, the behavior
of /bin/echo is independant on the shell
Add a sudo to a sed in finc_install_blfs (needed in some cases)
2012-03-11 16:37:10 +00:00
Pierre Labastie 81cd513e46 Add a sudo instruction in func_install_blfs 2012-03-09 20:27:22 +00:00
Pierre Labastie b9b4e313cd updated FUNCTION_LIST 2012-03-09 17:06:11 +00:00
Pierre Labastie 6cf9d46b73 Remove obsolete func_blfs_deps 2012-03-08 21:27:02 +00:00
Pierre Labastie 7ea25e4564 Add new functions for the blfs tool dependencies 2012-03-08 18:08:28 +00:00
Pierre Labastie 9a8653966c Update the blfs parts of README files 2012-03-08 18:03:56 +00:00
Pierre Labastie 2507cf77d9 Major change for the inclusion of blfs-tool dependencies:
- build them before custom tools
- use instructions in the BLFS book instead of harcoded ones
- use the dependency tracker of the tool itself (kind of bootstrap)
2012-03-08 17:42:55 +00:00
Pierre Labastie 34986b88da Add the version parameter of bump.xsl to Makefile
Separates first install of instpkg.xml from subsequent updates due to
new packages present in TRACK_DIR
2012-03-07 21:38:18 +00:00
Pierre Labastie f3a500d5ef Source /etc/profile in envars.conf,
so that the environment is up to
date during the build
2012-03-07 21:32:03 +00:00
Pierre Labastie 18a2beaa27 Add a "version" parameter to bump.xsl 2012-03-05 17:33:11 +00:00
Pierre Labastie 6631b83ab8 Code to copy back the tarball to SRC_ARCHIVE and
to account for the possibility of new-line in md5sums strings
in scripts.xsl
2012-03-05 17:23:09 +00:00
Pierre Labastie d120fec35b Forgot one Id property in custom 2012-03-03 20:18:50 +00:00
Pierre Labastie 968e95875f Update second place where MD5 sums occur in BLFS/xsl/scripts.xsl 2012-03-03 20:14:40 +00:00
Pierre Labastie fd988ce1ca copy back downloaded files to SRC_ARCHIVE in BLFS 2012-03-03 20:08:37 +00:00
Pierre Labastie 0aaeb8ec6e Add logic for the case when MD5 sums are not immediately followed by </para>
in BLFS/xsl/scripts.xsl
2012-03-03 18:41:53 +00:00
Pierre Labastie 4fdb8bd089 suppress a useless template in bump.xsl 2012-03-03 17:02:26 +00:00
Pierre Labastie 63e068c48e remove the no empty build dir guard (buggy anyway) and cosmetics in a comment 2012-02-29 13:22:01 +00:00
Pierre Labastie b9c5dc9d7b Change the code for downloading patches in scripts.xsl
Correct the ftp server usage whan downloading non package files
2012-02-29 13:16:50 +00:00
Pierre Labastie 9d0e0eb568 Change a few variables in gen-makefile.sh, and clean work directory 2012-02-29 13:12:01 +00:00
Pierre Labastie 6cf28686ff merge create-sbu-report.sh from trunk 2012-02-28 18:12:12 +00:00
Pierre Labastie 52389b577c Updated BLFS/Makefile so that initial generation of TRACKFILE is more robust 2012-02-27 10:52:29 +00:00
Pierre Labastie 9683707108 Added unpacking instruction for "zip"ped packages in generated scripts 2012-02-27 10:47:30 +00:00
Pierre Labastie b957bb6fd8 Correct hard linked directory in gen_pkg_book.sh 2012-02-25 17:41:55 +00:00
Pierre Labastie d8add36def Correct initialisation of variables
in gen_pkg_book.sh
2012-02-25 17:36:48 +00:00
Pierre Labastie 2180d05288 Remove obsolete blfs-tool ans associated menu 2012-02-25 14:41:46 +00:00
Pierre Labastie d08afa550a Restore a note about xorg7-font which had disappeared when updating README.BLFS 2012-02-25 10:08:03 +00:00
Pierre Labastie 5e9076f11d Add sudo to generation of rm-rf when cleanning the build tree
because some files may be ownded by root (python2 e.g.)
2012-02-25 09:51:13 +00:00
Pierre Labastie d7818f5134 Updates to README and README.BLFS. First "alpha release" 2012-02-24 15:29:08 +00:00
Pierre Labastie 96a30c7a23 Adds -j1 to "make install", impose a dependency on preceding package in X*
chapter
2012-02-23 17:42:27 +00:00
Pierre Labastie 7e51281ea6 Changed the pkgmngt part of lfs.xsl so that no script is created if
packageManager.xml has not <screen><userinput> nodes for that
2012-02-23 14:12:55 +00:00
Pierre Labastie 59364d06eb Add cleaning of menu dir in blfs_root 2012-02-22 21:36:57 +00:00
Pierre Labastie c1987b0daf clean also blfs_root when cleaning the build dir 2012-02-22 18:09:30 +00:00
Pierre Labastie 63fc514fa4 Initial modificaiton of BLFS tools 2012-02-22 17:09:47 +00:00
Pierre Labastie 021620981e Initial import of jhalfs trunk 2012-02-22 16:44:36 +00:00
67 changed files with 4054 additions and 4044 deletions

View File

@ -1,40 +1,122 @@
# From the Build Scripts Written By: Jim Gifford <lfs@jg555.com>
# Modified By: Joe Ciccone <jciccone@linuxfromscratch.org
# Additional changes: George Boudreau <georgeb@linuxfromscratch.org>
# Pierre Labastie <pierre.labastie at neuf.fr>
# $Id$
ifdef V
Q =
else
Q = @
endif
# Known behavior
LANG=C
LC_ALL=C
# The right-hand side is updated by jhalfs
TRACKING_DIR = tracking-dir
TOPDIR=$(shell pwd)
CONFIG_CONFIG_IN = Config.in
CONFIG = menu
BLFS_XML = $(TOPDIR)/blfs-xml
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:
$(MAKE) -B -C $(CONFIG) conf
define INITIAL_TRACK
<?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:
$(MAKE) -B -C $(CONFIG) ncurses conf mconf
SVN = svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK
menuconfig: $(CONFIG)/mconf
@./update_book.sh none
@./gen_config.sh
@$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
@./gen_pkg_book.sh
ALLXML := $(filter-out $(RENDERTMP)/%, \
$(wildcard $(BLFS_XML)/*.xml $(BLFS_XML)/*/*.xml $(BLFS_XML)/*/*/*.xml $(BLFS_XML)/*/*/*/*.xml $(BLFS_XML)/*/*/*/*/*.xml))
ALLXSL := $(filter-out $(RENDERTMP)/%, \
$(wildcard $(BLFS_XML)/*.xsl $(BLFS_XML)/*/*.xsl $(BLFS_XML)/*/*/*.xsl $(BLFS_XML)/*/*/*/*.xsl $(BLFS_XML)/*/*/*/*/*.xsl))
config: $(CONFIG)/conf
@$(CONFIG)/conf $(CONFIG_CONFIG_IN)
$(BOOK_XML): $(CONFIG_OUT)
$(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:
rm -f configuration configuration.old error
- $(MAKE) -C $(CONFIG) clean
rm -f $(CONFIG_OUT) $(CONFIG_OUT).old $(TOPDIR)/packages.xml $(XSLDIR)/specialCases.xsl $(CONFIG_CONFIG_IN) book.xml
rm -rf $(TOPDIR)/dependencies $(TOPDIR)/book-html $(TOPDIR)/scripts
- $(MAKE) -C $(MENU) clean
clean-target:
rm -f error
- $(MAKE) -C $(CONFIG) clean
.PHONY: all menuconfig config clean clean-target $(CONFIG)/conf $(CONFIG)/mconf
.PHONY: clean all update $(CONFIG_OUT)

View File

@ -16,7 +16,7 @@ export LC_ALL=C
#--- The local repository for packages/file
# Any missing file will be downloaded and archived here,
# 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.
# 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
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.
# Full path to the top level directory where packages will be stored,
# unpacked, and compiled.
export SRC_DIR=$HOME/sources
export SRC_DIR=/sources
#======== Xorg7 envars ===========
@ -38,14 +40,29 @@ export SRC_DIR=$HOME/sources
export XORG_PREFIX=/usr
#--- 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
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.
# See also the GNOME Pre-installation Configuration HTML page for
# aditional required commands.
@ -55,17 +72,36 @@ export GNOME_PREFIX=/usr
#======== KDE envars =============
# Refer to `Chapter 27. Introduction->KDE Pre-installation Configuration'
# for rationale. We use envars.conf instead of /etc/profile.d. But if you
# install into a different prefix, you'll need to update ld.so.conf and
# man-db.conf, and to create and populate the directories $KDE_PREFIX/share
# and /etc/dbus-1, as instructed.
#--- Installation prefix
export KDE_PREFIX=/usr
#--- If you want to install KDE on a non standart prefix, uncomment
# the next export lines and edit it if needed.
# See also the KDE Pre-installation Configuration HTML page for
# aditional required commands.
#export PATH=$PATH:$KDE_PREFIX/bin
#export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$KDE_PREFIX/lib/pkgconfig
#--- If you want to install KDE on a non standard prefix, uncomment
# the next lines and edit them as needed.
#export KDE_PREFIX=/opt/kde
#export KDEDIR=$KDE_PREFIX
#PATH=$PATH:$KDE_PREFIX/bin
#if [ -z PKG_CONFIG_PATH ]; then
#export PKG_CONFIG_PATH=$KDE_PREFIX/lib/pkgconfig:$KDE_PREFIX/share/pkgconfig
#else
# PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$KDE_PREFIX/lib/pkgconfig:$KDE_PREFIX/share/pkgconfig
#fi
#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 =============
@ -79,7 +115,7 @@ export KDE_PREFIX=/usr
# expected, please rebuild without optimizations before
# asking for support.
#export MAKEFLAGS="-j3"
export MAKEFLAGS="-j5"
#export CFLAGS="-O3 -pipe"
#export CXXFLAGS=$CFLAGS
@ -89,3 +125,10 @@ export KDE_PREFIX=/usr
#export OTHER_CXXFLAGS=$CXXFLAGS
#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
# TEMPORARY VARIABLES.. development use only
declare TOPDIR='..'
declare ATOPDIR=`cd $TOPDIR; pwd`
declare MKFILE=Makefile
declare PREV_PACKAGE=""
declare BUILD_SCRIPTS=scripts
declare TRACKING_DIR=tracking-dir
declare BUILD_SCRIPTS=${TOPDIR}/scripts
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
# YOU MAY NEED TO EDIT THIS FILE MANUALLY
@ -38,7 +42,7 @@ __write_build_cmd() { #
#----------------------------------#
(
cat << EOF
@source ../envars.conf && ${BUILD_SCRIPTS}/\$@ >logs/\$@ 2>&1
@source ${TOPDIR}/envars.conf && ${BUILD_SCRIPTS}/\$@ >logs/\$@ 2>&1
EOF
) >> $MKFILE.tmp
}
@ -47,50 +51,17 @@ EOF
__wrt_touch() { #
#----------------------------------#
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
@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 && \\
echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
echo --------------------------------------------------------------------------------\$(WHITE)
@ -103,7 +74,6 @@ EOF
__write_entry() { #
#----------------------------#
local script_name=$1
local pkg_ver=$2
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
# if it's already been made.
__wrt_touch "${script_name}" "${pkg_ver}"
__wrt_touch "${script_name}"
#
#--------------------------------------------------------------------#
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
@ -126,50 +96,6 @@ __write_entry() { #
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 () { #
#----------------------------#
@ -182,36 +108,18 @@ generate_Makefile () { #
>$MKFILE.tmp
for package_script in scripts/* ; do
for package_script in ${BUILD_SCRIPTS}/* ; do
this_script=`basename $package_script`
pkg_ver=$(grep "^${this_script#*-?-}[[:space:]]" ../packages | cut -f3)
pkg_list="$pkg_list ${this_script}"
__write_entry "${this_script}" "${pkg_ver}"
__write_entry "${this_script}"
PREV_PACKAGE=${this_script}
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
$HEADER
PACKAGE= $PACKAGE
TRACKING_DIR= $TRACKING_DIR
TRACKING_FILE= $TRACKING_FILE
BOLD= ""
RED= ""
@ -228,7 +136,7 @@ define echo_message
endef
define fin_message
define end_message
@echo \$(BOLD)
@echo --------------------------------------------------------------------------------
@echo \$(BOLD) Build complete for the package \$(BLUE)\$(PACKAGE)\$(BOLD) and its dependencies
@ -236,7 +144,7 @@ define fin_message
endef
all : $pkg_list
@\$(call fin_message )
@\$(call end_message )
EOF
) > $MKFILE
@ -247,18 +155,16 @@ EOF
}
if [[ -e Config.in ]] ; then
echo -e "\n\tThis script must be run from inside a target package directory.\n"
if [[ ! -d ${BUILD_SCRIPTS} ]] ; then
echo -e "\n\tThe \'${BUILD_SCRIPTS}\' directory has not been found.\n"
exit 1
fi
if [[ ! -d scripts ]] ; then
echo -e "\n\tNo ./scripts/ directory has been found.\n"
exit 1
fi
# Let us make a clean base:
rm -rf *
generate_Makefile
cp ../progress_bar.sh .
cp ${TOPDIR}/progress_bar.sh .
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
declare -r ConfigFile="configuration"
declare TARGET
TOPDIR=$1
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 SUDO
declare PKGXML
declare BLFS_XML
declare VERBOSITY=1
#--------------------------#
parse_configuration() { #
#--------------------------#
local cntr
local optTARGET
local -i cntr=0
local -a optTARGET
while [ 0 ]; do
read || break 1
while read; do
# Garbage collection
case ${REPLY} in
@ -29,51 +41,25 @@ parse_configuration() { #
esac
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.
optDependency=* | \
PRINT_SERVER=* | \
MAIL_SERVER=* | \
GHOSTSCRIPT=* | \
KBR5=* | \
X11=* | \
SUDO=* ) eval ${REPLY} # Define/set a global variable..
continue ;;
esac
if [[ "${REPLY}" =~ ^CONFIG_ ]]; then
echo -n "$REPLY"
if [[ $((++cntr)) > 1 ]]; then
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
echo "$REPLY"
optTARGET[$((cntr++))]=$( echo $REPLY | sed -e 's@CONFIG_@@' -e 's@=y@@' )
fi
done <$ConfigFile
done < $ConfigFile
if [[ $optTARGET = "" ]]; then
echo -e "\n>>> NO TARGET SELECTED.. applicaton terminated"
echo -e " Run <make> again and select a package to build\n"
if (( $cntr == 0 )); then
echo -e "\n>>> NO TARGET SELECTED.. application terminated"
echo -e " Run <make> again and select (a) package(s) to build\n"
exit 0
fi
TARGET=$optTARGET
TARGET=(${optTARGET[*]})
DEP_LEVEL=$optDependency
SUDO=${SUDO:-n}
}
@ -82,43 +68,32 @@ parse_configuration() { #
validate_configuration() { #
#--------------------------#
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 config_param
local -i index
for config_param in ${PARAM_LIST}; do
echo -e "`eval echo $PARAM_VALS`"
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
while [ 0 ]; do
read || break 1
case ${REPLY} in
\#* | '') continue ;;
esac
# 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}
local -i index
local DepDir=$1
rm -f $DepDir/*.dep
echo 1 > $DepDir/root.dep
for (( index=0 ; index < ${#TARGET[*]} ; index ++ )); do
echo ${TARGET[${index}]} >> $DepDir/root.dep
done
}
@ -131,29 +106,23 @@ regenerate_deps() { #
clean_configuration() { #
#--------------------------#
tail -n 29 configuration > configuration.tmp
mv configuration.tmp configuration
tail -n 15 ${ConfigFile} > ${ConfigFile}.tmp
mv ${ConfigFile}.tmp ${ConfigFile}
}
#---------------------
# Constants
source libs/constants.inc
source ${LibDir}/constants.inc
[[ $? > 0 ]] && echo -e "\n\tERROR: constants.inc did not load..\n" && exit
#---------------------
# Dependencies module
source libs/func_dependencies
source ${LibDir}/func_dependencies
[[ $? > 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 --------
if [[ ! -f packages ]] ; then
if [[ ! -f ${PackFile} ]] ; then
echo -e "\tNo packages file has been found.\n"
echo -e "\tExecution aborted.\n"
exit 1
@ -170,9 +139,48 @@ if [ x$ANSWER != "xyes" ] ; then
exit 1
fi
echo "${nl_}${SD_BORDER}${nl_}"
regenerate_deps
generate_dependency_tree
generate_TARGET_xml
generate_target_book
create_build_scripts "${SUDO}"
clean_configuration
rm -rf $DepDir
mkdir $DepDir
generate_deps $DepDir
pushd $DepDir > /dev/null
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$
#
set -e
declare -i cntr=0
# A string of spaces for indenting:
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() { #
#----------------------------#
: <<inline_doc
function: Create a dependency tree for the TARGET
input vars: none
externals: vars: TARGET
PKGXML
function: Create a subtree of the dependency tree
(recursive function)
input vars: $1 : file with a list of targets
the first line of the file is an array
of links
externals: vars: BLFS_XML
DEP_LEVEL
func: do_dependencies
modifies: vars: PKGXML
BLFS_XML
modifies: vars: none
returns: nothing
output: files: $TARGET.dep
$TARGET-index.xml.tmp
depure.txt
output: files: for each pkg with dependencies in $1,
a file pkg.dep and its dependencies
on error: nothing
on success: nothing
inline_doc
local ENTRY_START
local ENTRY_END
local DepFile=$1
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
if [[ -d $TARGET ]] ; then
echo -e "\tERROR: Looks like $TARGET has been already processed."
echo -e "\tPlease delete or rename the $TARGET directory.\n"
exit 1
else
mkdir $TARGET && cd $TARGET
{
# BEWARE : the order of options matters : read -a -u6 rootlink hangs forever
# (actually, the doc says -a array -u fd)
# We use fd number 6 for input from DepFile, because we need 0 for user input
read -u6 -a rootlink
depth=${#rootlink[*]}
dep_level=$DEP_LEVEL
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
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
#---------------------
# XML file of the target package
PKGXML=`grep "^$TARGET[[:space:]]" ../packages | cut -f2`
#---------------------
# The BLFS sources directory.
BLFS_XML=`echo $PKGXML | sed -e 's,/.*,,'`
if [[ ! -d ../$BLFS_XML ]] ; then
echo -e "\tThe BLFS book sources directory is missing.\n"
echo -e "\tExecution aborted.\n"
cd .. && rmdir $TARGET
exit 1
fi
#---------------------
# XInclude stuff
ENTRY_START="<xi:include xmlns:xi=\"http://www.w3.org/2003/XInclude\" href=\"../"
ENTRY_END="\"/>"
echo -e "\tGenerating $TARGET dependencies tree ..."
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
;;
if [[ -f ${id_of_dep}.dep ]]; then
sed -i "1i${rootlink[*]} $count" ${id_of_dep}.dep
generate_dependency_tree ${id_of_dep}.dep
# Test return value, in case we exchange dependencies
case $? in
0) # Normal return
;;
1) # We are backing up to parent
if [[ ${exchange_triplet} == ${DepFile%.dep} ]]
then tree_erase ${id_of_dep}.dep
# Just doing a sed -i "s@${id_of_dep}@${exchange_triplet[2]}@" $DepFile
# is not good if $DepFile contains several times the same line
# so first find the first line and then sed
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]}
flag=true
else
# echo backing up to ${exchange_triplet} at ${DepFile%.dep}
return 1
fi
;;
esac
fi
#------------------
# 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
else
echo "${rootlink[*]} $count" > ${id_of_dep}.dep
fi
done
#------------------
if [[ "$PKG" = "xorg7" ]] ; then
# Add their XInclude
PKG_XML=${BLFS_XML}/x/installing/xorg7.xml
echo -e " $ENTRY_START$PKG_XML$ENTRY_END" >> xincludes/$PKG.xinc.tmp
fi
#------------------
mv xincludes/$PKG.xinc.tmp xincludes/$PKG.xinc
IFS=$'\x0A'
for line in `cat xincludes/$PKG.xinc` ; do
IFS=$saveIFS
# Remove the Xinclude entry if found.
sed -e "s,^[[:space:]]*$line,," -e '/./!d' -i $TARGET-index.xml.tmp
# Write the XInclude
echo -e "$line" >> $TARGET-index.xml.tmp
done
done
echo -en "\n End: $depth${spaceSTR:0:$depth}${GREEN}$DepFile${OFF}"
} 6<$DepFile
# It may happen that a file is created with several times
# the same line. Normally, all those lines but one
# would be flagged to be removed (or all of them if
# 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.
# so first get the number of first line and then delete
# that line
for line in $lines_to_remove
do lineno=$(sed -n /^$line\$/= $DepFile | head -n1)
sed -i ${lineno}d $DepFile
done
return 0
}
#---------------#
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>

155
BLFS/xsl/dependencies.xsl Normal file
View File

@ -0,0 +1,155 @@
<?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='xorg-env'"/>
<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>

343
BLFS/xsl/gen_pkg_list.xsl Normal file
View File

@ -0,0 +1,343 @@
<?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 (not anymore) 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']">
<xsl:text>
</xsl:text>
<xsl:element name="dependency">
<xsl:attribute name="status">required</xsl:attribute>
<xsl:attribute name="name">
<xsl:value-of select="preceding-sibling::sect1[1]/@id"/>
</xsl:attribute>
<xsl:attribute name="type">ref</xsl:attribute>
</xsl:element>
</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>

630
BLFS/xsl/scripts.xsl Normal file
View File

@ -0,0 +1,630 @@
<?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)
if [[ ! -f $BOOTPACKG ]] ; then
if [[ -f $SRC_ARCHIVE/$PKG_DIR/$BOOTPACKG ]] ; then
cp $SRC_ARCHIVE/$PKG_DIR/$BOOTPACKG $BOOTPACKG
elif [[ -f $SRC_ARCHIVE/$BOOTPACKG ]] ; then
cp $SRC_ARCHIVE/$BOOTPACKG $BOOTPACKG
else
wget -T 30 -t 5 $URL
cp $BOOTPACKG $SRC_ARCHIVE
fi
rm -f unpacked
fi
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 </xsl:text>
<xsl:if test="not(contains(string(),'-k'))">
<xsl:text>-k </xsl:text>
</xsl:if>
<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

@ -6,7 +6,8 @@
<!-- $Id$ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl"
version="1.0">
@ -30,8 +31,8 @@
-->
<xsl:param name="bomb-testsuite" select="n"/>
<!-- Install vim-lang package? -->
<xsl:param name="vim-lang" select="y"/>
<!-- Install vim-lang package? OBSOLETE should always be 'n'-->
<xsl:param name="vim-lang" select="n"/>
<!-- Time zone -->
<xsl:param name="timezone" select="GMT"/>
@ -217,6 +218,25 @@
</xsl:choose>
</xsl:when>
<!-- Fixing toolchain test suites run XXX more to fix -->
<xsl:when test="contains(string(),'glibc-check-log')">
<xsl:choose>
<xsl:when test="$testsuite != '0'">
<xsl:value-of select="substring-before(string(),'2&gt;')"/>
<xsl:choose>
<xsl:when test="$bomb-testsuite = 'n'">
<xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
<xsl:if test="contains(string(),' -k ')">
<xsl:text> || true</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="string() = 'make check' or
contains(string(), 'make -k check')">
<xsl:choose>
@ -237,25 +257,6 @@
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="contains(string(),'glibc-check-log')">
<xsl:choose>
<xsl:when test="$testsuite != '0'">
<xsl:value-of select="substring-before(string(),'&gt;g')"/>
<xsl:choose>
<xsl:when test="$bomb-testsuite = 'n'">
<xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1</xsl:text>
<xsl:if test="contains(string(),' -k ')">
<xsl:text> || true</xsl:text>
</xsl:if>
<xsl:text>&#xA;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="contains(string(),'test_summary') or
contains(string(),'expect -c')">
<xsl:choose>
@ -270,6 +271,21 @@
<xsl:apply-templates/>
<xsl:text> || true&#xA;</xsl:text>
</xsl:when>
<!-- Add -j1 to make install commands -->
<xsl:when test="contains(string(),'make ') and
contains(string(),'install')">
<xsl:value-of select="substring-before(string(),'make ')"/>
<xsl:text>make -j1 </xsl:text>
<xsl:value-of select="substring-after(string(),'make ')"/>
<xsl:text>&#xA;</xsl:text>
</xsl:when>
<!-- Avoid calling hostname in chroot -->
<xsl:when test="ancestor::note[@os='a00']">
<xsl:if test="$method='boot'">
<xsl:apply-templates/>
<xsl:text>&#xA;</xsl:text>
</xsl:if>
</xsl:when>
<!-- The rest of commands -->
<xsl:otherwise>
<xsl:apply-templates/>

View File

@ -18,14 +18,14 @@ host_prep_Makefiles() { #
cat << EOF
023-creatingtoolsdir:
@\$(call echo_message, Building)
@mkdir \$(MOUNT_PT)/tools && \\
@install -dv \$(MOUNT_PT)/tools && \\
rm -f /tools && \\
ln -s \$(MOUNT_PT)/tools /
@\$(call housekeeping)
024-creatingcrossdir: 023-creatingtoolsdir
@\$(call echo_message, Building)
@mkdir -v \$(MOUNT_PT)/cross-tools && \\
@install -dv \$(MOUNT_PT)/cross-tools && \\
rm -f /cross-tools && \\
ln -s \$(MOUNT_PT)/cross-tools /
@\$(call housekeeping)
@ -33,13 +33,15 @@ cat << EOF
025-addinguser: 024-creatingcrossdir
@\$(call echo_message, Building)
@if [ ! -d \$(LUSER_HOME) ]; then \\
groupadd \$(LGROUP); \\
useradd -s /bin/bash -g \$(LGROUP) -m -k /dev/null \$(LUSER); \\
groupadd \$(LGROUP); \\
useradd -s /bin/bash -g \$(LGROUP) -d \$(LUSER_HOME) \$(LUSER); \\
mkdir -pv \$(LUSER_HOME); \\
chown -v \$(LUSER):\$(LGROUP) \$(LUSER_HOME); \\
else \\
touch luser-exist; \\
fi;
@chown \$(LUSER) \$(MOUNT_PT)/tools && \\
chown \$(LUSER) \$(MOUNT_PT)/cross-tools && \\
touch luser-exist; \\
fi
@chown -v \$(LUSER) \$(MOUNT_PT)/tools && \\
chown -v \$(LUSER) \$(MOUNT_PT)/cross-tools && \\
chmod -R a+wt \$(MOUNT_PT)/\$(SCRIPT_ROOT) && \\
chmod a+wt \$(SRCSDIR)
@\$(call housekeeping)
@ -48,7 +50,7 @@ cat << EOF
@\$(call echo_message, Building)
@if [ -f \$(LUSER_HOME)/.bashrc -a ! -f \$(LUSER_HOME)/.bashrc.XXX ]; then \\
mv \$(LUSER_HOME)/.bashrc \$(LUSER_HOME)/.bashrc.XXX; \\
fi;
fi
@if [ -f \$(LUSER_HOME)/.bash_profile -a ! -f \$(LUSER_HOME)/.bash_profile.XXX ]; then \\
mv \$(LUSER_HOME)/.bash_profile \$(LUSER_HOME)/.bash_profile.XXX; \\
fi;
@ -67,9 +69,12 @@ cat << EOF
echo "export CLFS_TARGET32=\"${TARGET32}\"" >> \$(LUSER_HOME)/.bashrc && \\
echo "source $JHALFSDIR/envars" >> \$(LUSER_HOME)/.bashrc
@chown \$(LUSER):\$(LGROUP) \$(LUSER_HOME)/.bashrc && \\
chmod a+wt \$(MOUNT_PT) && \\
if [ -d \$(MOUNT_PT)/var ]; then \\
chown -R \$(LUSER) \$(MOUNT_PT)/var; \\
fi && \\
touch envars && \\
chmod -R a+wt \$(MOUNT_PT) && \\
chown -R \$(LUSER) \$(MOUNT_PT)/\$(SCRIPT_ROOT)
chown \$(LUSER):\$(LGROUP) envars
@\$(call housekeeping)
EOF
) >> $MKFILE.tmp
@ -120,6 +125,7 @@ cross_tools_Makefiles() { #
# If $pkg_tarball isn't empty, we've got a package...
#
[[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
[[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = 3 ]] && wrt_makeflags "${name}"
#
LUSER_wrt_RunAsUser "${file}"
#
@ -178,7 +184,7 @@ temptools_Makefiles() { #
# Insert instructions for unpacking the package and to set the PKGDIR variable.
#
[[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
[[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
[[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
#
LUSER_wrt_RunAsUser "${file}"
#
@ -231,7 +237,7 @@ chroot_Makefiles() { #
*util-linux)
LUSER_wrt_target "${this_script}" "$PREV"
LUSER_wrt_unpack "$pkg_tarball"
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
[[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
LUSER_wrt_RunAsUser "${file}"
LUSER_RemoveBuildDirs "${name}"
wrt_touch
@ -240,7 +246,7 @@ chroot_Makefiles() { #
*util-linux-ng)
LUSER_wrt_target "${this_script}" "$PREV"
LUSER_wrt_unpack "$pkg_tarball"
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
[[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
LUSER_wrt_RunAsUser "${file}"
LUSER_RemoveBuildDirs "${name}"
wrt_touch
@ -249,7 +255,7 @@ chroot_Makefiles() { #
*util-linux-libs)
LUSER_wrt_target "${this_script}" "$PREV"
LUSER_wrt_unpack "$pkg_tarball"
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
[[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
LUSER_wrt_RunAsUser "${file}"
LUSER_RemoveBuildDirs "${name}"
wrt_touch
@ -258,7 +264,7 @@ chroot_Makefiles() { #
*e2fsprogs)
LUSER_wrt_target "${this_script}" "$PREV"
LUSER_wrt_unpack "$pkg_tarball"
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
[[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
LUSER_wrt_RunAsUser "${file}"
LUSER_RemoveBuildDirs "${name}"
wrt_touch
@ -267,7 +273,7 @@ chroot_Makefiles() { #
*e2fsprogs-libs)
LUSER_wrt_target "${this_script}" "$PREV"
LUSER_wrt_unpack "$pkg_tarball"
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
[[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
LUSER_wrt_RunAsUser "${file}"
LUSER_RemoveBuildDirs "${name}"
wrt_touch
@ -289,7 +295,7 @@ chroot_Makefiles() { #
#
if [ "$pkg_tarball" != "" ] ; then
CHROOT_Unpack "$pkg_tarball"
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
[[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
fi
#
# Select a script execution method
@ -377,7 +383,7 @@ boot_Makefiles() { #
# Insert instructions for unpacking the package and changing directories
#
[[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
[[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
[[ "$pkg_tarball" != "" ]] && [[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
#
# Select a script execution method
case $this_script in
@ -448,7 +454,7 @@ testsuite_tools_Makefiles() { #
CHROOT_wrt_target "${this_script}" "$PREV"
#
CHROOT_Unpack "$pkg_tarball"
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
[[ "$OPTIMIZE" -ge "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
#
CHROOT_wrt_RunAsRoot "${file}"
#
@ -555,7 +561,7 @@ final_system_Makefiles() { #
CHROOT_Unpack "$pkg_tarball"
# If the testsuites must be run, initialize the log file
case $name in
binutils | gcc | glibc | eglibc )
binutils | gcc | glibc | eglibc | gmp | mpfr | mpc | isl | cloog )
[[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}"
;;
* )
@ -844,17 +850,11 @@ bootable_Makefiles() { #
#--------------------------------------#
build_Makefile() { # Construct a Makefile from the book scripts
#--------------------------------------#
#
# Script crashes if error trapping is on
#
set +e
declare -f method_cmds
set -e
echo "...Creating Makefile... ${BOLD}START${OFF}"
cd $JHALFSDIR/${PROGNAME}-commands
# Start with a clean files
# Start with clean files
>$MKFILE
>$MKFILE.tmp
@ -878,8 +878,6 @@ set -e
# Add the CUSTOM_TOOLS targets, if needed
[[ "$CUSTOM_TOOLS" = "y" ]] && wrt_CustomTools_target
# Add the BLFS_TOOL targets, if needed
[[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets
# Add a header, some variables and include the function file
# to the top of the real Makefile.
@ -914,7 +912,8 @@ cat << EOF
all: ck_UID mk_SETUP mk_CROSS mk_SUDO mk_SYSTOOLS create-sbu_du-report mk_CUSTOM_TOOLS mk_BLFS_TOOL
@sudo make do-housekeeping
@echo "$VERSION - jhalfs build" > clfs-release && \\
sudo mv clfs-release \$(MOUNT_PT)/etc
sudo mv clfs-release \$(MOUNT_PT)/etc && \\
sudo chown root:root \$(MOUNT_PT)/etc/clfs-release
@\$(call echo_finished,$VERSION)
ck_UID:
@ -934,7 +933,7 @@ mk_SETUP:
#---------------AS LUSER
mk_CROSS: mk_SETUP
@\$(call echo_PHASE,Cross and Temporary Tools)
@(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) AS_LUSER" )
@( \$(SU_LUSER) "make -C \$(MOUNT_PT)/\$(SCRIPT_ROOT) BREAKPOINT=\$(BREAKPOINT) AS_LUSER" )
@sudo make restore-luser-env
@touch \$@
@ -950,7 +949,14 @@ mk_SYSTOOLS: mk_SUDO
@( sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) CHROOT_JAIL")
@touch \$@
mk_CUSTOM_TOOLS: create-sbu_du-report
mk_BLFS_TOOL: create-sbu_du-report
@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
\$(call sh_echo_PHASE,Building BLFS_TOOL); \\
(sudo \$(CHROOT1) "make -C $BLFS_ROOT/work"); \\
fi;
@touch \$@
mk_CUSTOM_TOOLS: mk_BLFS_TOOL
@if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
\$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\
sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}; \\
@ -958,14 +964,6 @@ mk_CUSTOM_TOOLS: create-sbu_du-report
fi;
@touch \$@
mk_BLFS_TOOL: mk_CUSTOM_TOOLS
@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
\$(call sh_echo_PHASE,Building BLFS_TOOL); \\
sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\
sudo \$(CHROOT1) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BLFS_TOOL"; \\
fi;
@touch \$@
SETUP: $host_prep
AS_LUSER: $cross_tools $temptools
SUDO: $orphan_scripts
@ -974,7 +972,6 @@ PREP_CHROOT_JAIL: ${chroottools}
CHROOT_JAIL: SHELL=/tools/bin/bash
CHROOT_JAIL: $testsuitetools $basicsystem $bootscripttools $bootabletools
CUSTOM_TOOLS: $custom_list
BLFS_TOOL: $blfs_tool
create-sbu_du-report: mk_SYSTOOLS
@ -987,7 +984,13 @@ create-sbu_du-report: mk_SYSTOOLS
do-housekeeping:
@-umount \$(MOUNT_PT)/dev/pts
@-umount \$(MOUNT_PT)/dev/shm
@-if [ -h \$(MOUNT_PT)/dev/shm ]; then \\
link=\$\$(readlink \$(MOUNT_PT)/dev/shm); \\
umount \$(MOUNT_PT)/\$\$link; \\
unset link; \\
else \\
umount \$(MOUNT_PT)/dev/shm; \\
fi
@-umount \$(MOUNT_PT)/dev
@-umount \$(MOUNT_PT)/sys
@-umount \$(MOUNT_PT)/proc
@ -1025,7 +1028,7 @@ ck_UID:
echo "|However, if this is the boot environment |"; \\
echo "| the command you are looking for is |"; \\
echo "| make makesys |"; \\
echo "| to finish off the build |"; \\
echo "| to complete the build |"; \\
echo "+--------------------------------------------------+"; \\
exit 1; \\
fi
@ -1041,7 +1044,7 @@ mk_SETUP:
mk_CROSS: mk_SETUP
@\$(call echo_PHASE,Cross Tool)
@(sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) AS_LUSER" )
@( \$(SU_LUSER) "make -C \$(MOUNT_PT)/\$(SCRIPT_ROOT) BREAKPOINT=\$(BREAKPOINT) AS_LUSER" )
@touch \$@
mk_SUDO: mk_CROSS
@ -1055,7 +1058,14 @@ mk_FINAL:
@( source /root/.bash_profile && make BREAKPOINT=\$(BREAKPOINT) AS_ROOT )
@touch \$@
mk_CUSTOM_TOOLS: mk_FINAL
mk_BLFS_TOOL: mk_FINAL
@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
\$(call sh_echo_PHASE,Building BLFS_TOOL); \\
( make -C $BLFS_ROOT/work ); \\
fi;
@touch \$@
mk_CUSTOM_TOOLS: mk_BLFS_TOOL
@if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
\$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\
mkdir -p ${TRACKING_DIR}; \\
@ -1063,21 +1073,12 @@ mk_CUSTOM_TOOLS: mk_FINAL
fi;
@touch \$@
mk_BLFS_TOOL: mk_CUSTOM_TOOLS
@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
\$(call sh_echo_PHASE,Building BLFS_TOOL); \\
mkdir -p $TRACKING_DIR; \\
( source /root/.bash_profile && make BREAKPOINT=\$(BREAKPOINT) BLFS_TOOL ); \\
fi
@touch \$@
SETUP: $host_prep
AS_LUSER: $cross_tools $temptools ${boottools}
SUDO: $orphan_scripts
AS_ROOT: SHELL=/tools/bin/bash
AS_ROOT: $testsuitetools $basicsystem $bootscripttools $bootabletools
CUSTOM_TOOLS: $custom_list
BLFS_TOOL: $blfs_tool
do-housekeeping:
@-rm /tools /cross-tools

201
Config.in
View File

@ -21,9 +21,6 @@ menu "--- BOOK Settings"
# config BOOK_HLFS
# bool "Hardened Linux From Scratch"
config BOOK_BLFS
bool "Beyond Linux From Scratch"
endchoice
config PROGNAME
@ -33,33 +30,38 @@ menu "--- BOOK Settings"
default "clfs2" if BOOK_CLFS2
default "clfs3" if BOOK_CLFS3
default "hlfs" if BOOK_HLFS
default "blfs" if BOOK_BLFS
config RUN_ME
string
default "./jhalfs run" if !BOOK_BLFS
default "./blfs-tool" if BOOK_BLFS
default "./jhalfs run"
#--- End BOOK/script
#--- Book version
choice
prompt "Release"
default relSVN
default relSVN if BOOK_LFS || BOOK_HLFS
default relGIT if BOOK_CLFS || BOOK_CLFS2 || BOOK_CLFS3
config relSVN
bool "SVN"
depends on BOOK_LFS || BOOK_HLFS
help
#-- Current development version as in trunk
config relGIT
bool "GIT"
depends on BOOK_CLFS || BOOK_CLFS2 || BOOK_CLFS3
help
#-- Current development git master branch
config WORKING_COPY
bool "Working Copy"
depends on !BOOK_BLFS
help
#-- A local working copy
config BRANCH
bool "Branch or stable book" if !BOOK_CLFS2 && !BOOK_CLFS3
help
#-- A supported SVN branch or stable released book
#-- A supported SVN/GIT branch or stable released book
endchoice
config BRANCH_ID
@ -135,7 +137,7 @@ menu "--- BOOK Settings"
bool "32-bit"
config DATA_64
bool "64-bit" if !ARCH_PPC
bool "64-bit"
config DATA_MULTI
bool "multilib" if !(BOOK_CLFS3 && ARCH_MIPS )
@ -250,8 +252,8 @@ menu "--- BOOK Settings"
default "mips64el-unknown-linux-uclibc" if BOOK_CLFS3 && PROC_mipsel && DATA_64
default "mips64-unknown-linux-uclibc" if BOOK_CLFS3 && PROC_mips && DATA_64
default "powerpc-unknown-linux-gnu" if ARCH_PPC && DATA_32
default "powerpc64-unknown-linux-gnu" if ARCH_PPC && DATA_MULTI
default "powerpc-unknown-linux-gnu" if ARCH_PPC && DATA_32
default "powerpc64-unknown-linux-gnu" if ARCH_PPC && (DATA_MULTI || DATA_64)
default "sparc-unknown-linux-gnu" if ARCH_SPARC && DATA_32
default "sparc64-unknown-linux-gnu" if ARCH_SPARC && (DATA_64 || DATA_MULTI)
@ -311,6 +313,7 @@ menu "--- BOOK Settings"
default "ppc" if ARCH_PPC && DATA_32
default "ppc64" if ARCH_PPC && DATA_MULTI
default "ppc64-64" if ARCH_PPC && DATA_64
default "sparc" if ARCH_SPARC && DATA_32
default "sparc64" if ARCH_SPARC && DATA_MULTI
@ -419,79 +422,10 @@ menu "--- BOOK Settings"
default "2.6" if KERNEL_26
default "2.4" if KERNEL_24
# menu "HLFS Additional Features"
# depends on BOOK_HLFS
#
# config SET_SSP
# bool "Stack-smashing protector"
# default y
#
# config SET_ASLR
# bool "Address-space layout randomization"
# default y
#
# config SET_PAX
# bool "PaX-aware ELF executables and kernel"
# default y
#
# config SET_HARDENED_TMP
# bool "Hardened temporary files creation"
# default y
#
# config SET_WARNINGS
# bool "Additional warnings"
# default y
#
# config SET_MISC
# bool "Miscellaneous features"
# default y
#
# config SET_BLOWFISH
# bool "Blowfish passwords"
# default y
# endmenu
config SSP
# depends on SET_SSP
string
default ",ssp,"
config ASLR
# depends on SET_ASLR
string
default ",aslr,"
config PAX
# depends on SET_PAX
string
default ",pax,"
config HARDENED_TMP
# depends on SET_HARDENED_TMP
string
default ",hardened_tmp,"
config WARNINGS
# depends on SET_WARNINGS
string
default ",warnings,"
config MISC
# depends on SET_MISC
string
default ",misc,"
config BLOWFISH
# depends on SET_BLOWFISH
string
default ",blowfish,"
#--- End HLFS specific params
#--- Custom Tools support
config CUSTOM_TOOLS
bool "Add custom tools support"
default n
depends on !BOOK_BLFS
help
#--- Activating this option additional packages you create
# will be installed after finished the xLFS system build.
@ -502,7 +436,7 @@ menu "--- BOOK Settings"
config BLFS_TOOL
bool "Add blfs-tool support"
default n
depends on !BOOK_BLFS && !BOOK_CLFS3
depends on !BOOK_CLFS3
help
#--- Activating this option will install additional
# packages needed to use blfs-tool when booting
@ -531,12 +465,24 @@ menu "--- BOOK Settings"
help
#-- Current development version as in trunk
config BLFS_WORKING_COPY
bool "BLFS working copy"
help
#-- A local working copy of the BLFS book.
config BLFS_BRANCH
bool "BLFS Branch or stable book"
help
#-- A supported SVN branch or stable book release
endchoice
config BLFS_WC_LOCATION
string "Location of the local BLFS working copy (mandatory)"
default "**EDIT ME**"
depends on BLFS_WORKING_COPY
help
#-- Full path to the BLFS book working copy"
config BLFS_BRANCH_ID
string "BLFS Book Version (mandatory)"
default "**EDIT ME**"
@ -564,17 +510,12 @@ menu "--- BOOK Settings"
bool "DocBook XML DTD (required)"
default y
config DEP_UNZIP
bool "UnZip (required to install DocBook XML DTD)"
default y
depends on DEP_DBXML
#config DEP_DBXSL
#bool "DocBook XSL (required)"
#default y
config DEP_LYNX
bool "lynx (required)"
bool "lynx (optional, for reading the generated book)"
default y
config DEP_SUDO
@ -587,34 +528,44 @@ menu "--- BOOK Settings"
config DEP_GPM
bool "GPM (optional, see help)"
default y
default n
help
#-- You MUST install the gpm bootscript manually
# and create its configuration file.
#
# An alternative is to unselect this option and
# install gpm, its configuration file, and its
# bootscript using the custom tools support.
#-- if you install gpm, it will be started
# automatically on boot. You'll have to edit
# /etc/sysconfig/mouse for your system
config DEP_SVN
bool "SVN client (optional, see help)"
default n
help
#-- Subversion-1.3.1 will be installed. This version is
# old but does not rely on additional packages to be
# built.
#
# If you are happy with this old version and don't
# need extra features, select this option.
#-- Subversion is needed for updating the book
# sources. If you want ssl support, select
# OPENSSL below.
config DEP_OPENSSL
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
#--- End blfs-tool Support
#--- BLFS specific params
config BLFS_ROOT
string "Directory root"
default "$HOME/blfs_root" if BOOK_BLFS
default "/blfs_root" if BLFS_TOOL
depends on BOOK_BLFS || BLFS_TOOL
default "/blfs_root"
depends on BLFS_TOOL
help
#-- Full path to the directory where all required
# files and scripts will be stored.
@ -622,7 +573,7 @@ menu "--- BOOK Settings"
config BLFS_XML
string "BLFS sources directory"
default "blfs-xml"
depends on BOOK_BLFS || BLFS_TOOL
depends BLFS_TOOL
help
#-- The directory name under $BLFS_ROOT where the BLFS
# book sources will be checkout.
@ -630,7 +581,7 @@ menu "--- BOOK Settings"
config TRACKING_DIR
string "Installed packages database directory"
default "/var/lib/jhalfs/BLFS"
depends on BOOK_BLFS || BLFS_TOOL || CUSTOM_TOOLS
depends on BLFS_TOOL || CUSTOM_TOOLS
help
#-- Full path to the directory where the database of
# installed packages will be created.
@ -651,7 +602,6 @@ menu "--- BOOK Settings"
endmenu
menu "--- General Settings"
depends on !BOOK_BLFS
#--- Set User Account
config CONFIG_USER
@ -797,7 +747,6 @@ menu "--- General Settings"
endmenu
menu "--- Build Settings"
depends on !BOOK_BLFS
#--- Test Suites
config CONFIG_TESTS
@ -1002,7 +951,6 @@ menu "--- Build Settings"
endmenu
menu "--- Advanced Features"
depends on !BOOK_BLFS
config REPORT
bool "Create SBU and disk usage report"
@ -1052,23 +1000,29 @@ menu "--- Advanced Features"
#--- Optimizations
if !BOOK_CLFS2 && !BOOK_CLFS3
config CONFIG_OPTIMIZE
bool "Use optimization (see help)"
bool "Optimization and parallelization"
default n
help
#-- Actual optimization flags MUST be defined in ./optimize/*
# files before activating this option.
# Opens a menu for various optimization settings:
# Actual optimization flags MUST be defined in ./optimize/*
# before activating this option.
#
# WARNING: The use of build optimizations may be dangerous.
# You should know what you are doing and be sure that the
# optimization settings listed below are what you want.
# It there are build issues or the system doesn't work as
# expected, please rebuild without optimizations before
# asking for support.
# WARNING: The use of build optimizations may lead to build issues.
# If the system doesn't work as expected, please rebuild
# without optimizations before asking for support.
menu "Optimization settings"
depends on CONFIG_OPTIMIZE
config N_PARALLEL
int "Number of parallel `make' jobs"
default 1
help
#-- The usual recommandation is (number of CPU cores)+1
# Do not set for meaningful SBU calculations.
choice
prompt "Optimization level "
default OPT_1
depends CONFIG_OPTIMIZE
help
#-- Optimization values are set in optimize/* files
@ -1077,18 +1031,22 @@ if !BOOK_CLFS2 && !BOOK_CLFS3
config OPT_2
bool "Both temp tools and final system"
endchoice
config OPT_3
bool "Cross tools (only MAKEFLAGS), temp tools and final system" if BOOK_CLFS
endchoice
endmenu
config OPTIMIZE
int
default "0" if !CONFIG_OPTIMIZE
default "1" if OPT_1
default "2" if OPT_2
default "3" if OPT_3
endif
#--- End Optimizations
#-- Internal Settings
menu "--- Internal Settings (WARNING: for jhalfs developers only)"
menu "Internal Settings (WARNING: for jhalfs developers only)"
config SCRIPT_ROOT
string "Scripts root"
@ -1151,7 +1109,6 @@ endmenu
config REBUILD_MAKEFILE
bool "Rebuild the Makefile (see help)"
default n
depends on !BOOK_BLFS
help
#-- 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
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():
From common/libs/func_blfs_deps.
Description: Copies the scriptlets from `blfs-tools-deps' to the
subdirectory `blfs-tools-deps' in `${PROGNAME}-commands'. Must
be called from `$JHALFSDIR' where `$COMMON/blfs-tools-deps' should have
been copied first. Removes `$JHALFSDIR/blfs-tools-deps' at the end.
Called by: extract_commands
--------------------------------------------------------------------------
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.
install_blfs_tools():
From common/libs/func_install_blfs.
Description: Copy the needed files to `BLFS_ROOT'. Initialize
the package tracking. Generates a `configuration' file from
the tool dependencies settings, and use it to generate
scriptlets from the blfs book. Uses those scriptlets to download the
needed tarballs. Then generates a Makefile for building the dependencies.
Called by: jhalfs
--------------------------------------------------------------------------
get_sources():
From common/libs/func_download_pkgs.
@ -279,7 +262,6 @@ function failure():
From extras/farce.
Description:
--------------------------------------------------------------------------
extras/farce: emessage "internal error in failure() for TYPE $TYPE"
function fatal():
From extras/farce.
Description:
@ -352,8 +334,6 @@ see_ya():
From jhalfs.
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():
From LFS/master.sh.
Description:

View File

@ -118,102 +118,9 @@
<xsl:if test="sect2[@role='installation']">
<xsl:text>cd $PKGDIR&#xA;</xsl:text>
</xsl:if>
<xsl:apply-templates
select=".//screen[not(@role) or
@role != 'nodump']/userinput[
@remap = 'pre' or
@remap = 'configure' or
@remap = 'make' or
@remap = 'test' and
not(current()/@id='ch-tools-dejagnu')]"/>
<xsl:if
test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
$pkgmngt = 'y' and
descendant::screen[not(@role) or
@role != 'nodump']/userinput[
@remap='install']">
<xsl:text>mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin}
mkdir -pv $PKG_DEST/usr/{lib,bin,sbin,include}
mkdir -pv $PKG_DEST/usr/share/{doc,info,man}
mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
ln -sv share/{man,doc,info} $PKG_DEST/usr
case $(uname -m) in
x86_64) ln -sv lib $PKG_DEST/lib64 &amp;&amp; ln -sv lib $PKG_DEST/usr/lib64 ;;
esac
</xsl:text>
</xsl:if>
<xsl:if test="@id = 'ch-system-glibc' and
$pkgmngt = 'y'">
<xsl:text>mkdir -pv $PKG_DEST/usr/include/{rpc,rpcsvc}
</xsl:text>
</xsl:if>
<xsl:apply-templates
select=".//screen[not(@role) or
@role != 'nodump']/userinput[@remap = 'install']"/>
<xsl:if test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
$pkgmngt = 'y' and
descendant::screen[not(@role) or
@role != 'nodump']/userinput[
@remap='install']">
<xsl:if test="@id = 'ch-system-man-pages'">
<!-- those files are provided by the shadow package -->
<xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5}
</xsl:text>
</xsl:if>
<xsl:text>rm -fv $PKG_DEST/{,usr/}lib64
rm -fv $PKG_DEST/usr/{man,doc,info}
for dir in $PKG_DEST/usr/share/man/man{1..8}; do
[[ -z $(ls $dir) ]] &amp;&amp; rmdir -v $dir
done
for dir in $PKG_DEST/usr/share/{doc,info,man}; do
[[ -z $(ls $dir) ]] &amp;&amp; rmdir -v $dir
done
for dir in $PKG_DEST/usr/{lib,bin,sbin,include}; do
[[ -z $(ls $dir) ]] &amp;&amp; rmdir -v $dir
done
for dir in $PKG_DEST/{boot,etc,lib,bin,sbin}; do
[[ -z $(ls $dir) ]] &amp;&amp; rmdir -v $dir
done
packInstall
rm -rf $PKG_DEST
</xsl:text>
</xsl:if>
<xsl:if test="$testsuite='3' and @id='ch-tools-glibc'">
<xsl:copy-of select="//userinput[@remap='locale-test']"/>
<xsl:text>&#xA;</xsl:text>
</xsl:if>
<xsl:if test="@id='ch-system-glibc'">
<xsl:choose>
<xsl:when test="$full-locale='y'">
<xsl:copy-of select="//userinput[@remap='locale-full']"/>
<xsl:text>&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="//userinput[@remap='locale-test']"/>
<xsl:text>&#xA;</xsl:text>
<xsl:if test="not(contains(string(//userinput[@remap='locale-test']),$lang)) and $lang!='C' and $lang!='POSIX'">
<xsl:text>if LOCALE=`grep "</xsl:text>
<xsl:value-of select="$lang"/>
<xsl:text>/" $PKGDIR/localedata/SUPPORTED`; then
CHARMAP=`echo $LOCALE | sed 's,[^/]*/\([^ ]*\) [\],\1,'`
INPUT=`echo $LOCALE | sed 's,[/.].*,,'`
LOCALE=`echo $LOCALE | sed 's,/.*,,'`
localedef -i $INPUT -f $CHARMAP $LOCALE
fi
</xsl:text>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:apply-templates
select=".//screen[
not(@role) or
@role != 'nodump'
]/userinput[
not(@remap) or
@remap='adjust' or
@remap='test' and current()/@id='ch-tools-dejagnu'
]"/>
<xsl:apply-templates select="sect2|
screen[not(@role) or
@role!='nodump']/userinput"/>
<xsl:if test="@id='ch-system-creatingdirs'">
<xsl:apply-templates
select="document('packageManager.xml')//sect1[
@ -235,7 +142,126 @@ fi
</xsl:if>
</xsl:template>
<xsl:template match="sect1" mode="pkgmngt">
<xsl:template match="sect2">
<!--XML::Parser is on the same page as Perl. The present code is OK
except for PKG_DEST and PKGDIR, which would be the same as for Perl.
so set them to valid values.
Since rev 10281, that is no more true. So comment out.
<xsl:if test="contains(string(./title),'XML::Parser')">
<xsl:text>PKGDIR=$(dirname $PKGDIR)/</xsl:text>
<xsl:copy-of select="substring-after(.//userinput[@remap='pre'], 'cd ')"/>
<xsl:text>
PKG_DEST=$(dirname $PKGDIR)/000-xml-parser
</xsl:text>
</xsl:if>-->
<xsl:apply-templates
select=".//screen[not(@role) or
@role != 'nodump']/userinput[
@remap = 'pre' or
@remap = 'configure' or
@remap = 'make' or
@remap = 'test' and
not(current()/../@id='ch-tools-dejagnu')]"/>
<xsl:if
test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
$pkgmngt = 'y' and
descendant::screen[not(@role) or
@role != 'nodump']/userinput[
@remap='install']">
<xsl:text>mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin}
mkdir -pv $PKG_DEST/usr/{lib,bin,sbin,include}
mkdir -pv $PKG_DEST/usr/share/{doc,info,man}
mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
ln -sv share/{man,doc,info} $PKG_DEST/usr
case $(uname -m) in
x86_64) ln -sv lib $PKG_DEST/lib64 &amp;&amp; ln -sv lib $PKG_DEST/usr/lib64 ;;
esac
</xsl:text>
</xsl:if>
<xsl:if test="../@id = 'ch-system-glibc' and
@role='installation' and
$pkgmngt = 'y'">
<xsl:text>mkdir -pv $PKG_DEST/usr/include/{rpc,rpcsvc}
</xsl:text>
</xsl:if>
<xsl:apply-templates
select=".//screen[not(@role) or
@role != 'nodump']/userinput[@remap = 'install']"/>
<xsl:if test="ancestor::chapter[@id != 'chapter-temporary-tools'] and
$pkgmngt = 'y' and
descendant::screen[not(@role) or
@role != 'nodump']/userinput[
@remap='install']">
<xsl:if test="../@id = 'ch-system-man-pages'">
<!-- these files are provided by the shadow package -->
<xsl:text>rm -fv $PKG_DEST/usr/share/man/{man3/getspnam.3,man5/passwd.5}
</xsl:text>
</xsl:if>
<!-- Attr man/man2 pages are already installed by man-pages. As of
March 2013, they are the same pages. Check it sometimes... -->
<xsl:if test="../@id = 'ch-system-attr'">
<xsl:text>rm -fv $PKG_DEST/usr/share/man/man2/*
</xsl:text>
</xsl:if>
<xsl:text>rm -fv $PKG_DEST/{,usr/}lib64
rm -fv $PKG_DEST/usr/{man,doc,info}
for dir in $PKG_DEST/usr/share/man/man{1..8}; do
[[ -z $(ls $dir) ]] &amp;&amp; rmdir -v $dir
done
for dir in $PKG_DEST/usr/share/{doc,info,man}; do
[[ -z $(ls $dir) ]] &amp;&amp; rmdir -v $dir
done
for dir in $PKG_DEST/usr/{lib,bin,sbin,include}; do
[[ -z $(ls $dir) ]] &amp;&amp; rmdir -v $dir
done
for dir in $PKG_DEST/{boot,etc,lib,bin,sbin}; do
[[ -z $(ls $dir) ]] &amp;&amp; rmdir -v $dir
done
packInstall
rm -rf $PKG_DEST
</xsl:text>
</xsl:if>
<xsl:if test="$testsuite='3' and
../@id='ch-tools-glibc' and
@role='installation'">
<xsl:copy-of select="//userinput[@remap='locale-test']"/>
<xsl:text>&#xA;</xsl:text>
</xsl:if>
<xsl:if test="../@id='ch-system-glibc' and @role='installation'">
<xsl:choose>
<xsl:when test="$full-locale='y'">
<xsl:copy-of select="//userinput[@remap='locale-full']"/>
<xsl:text>&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="//userinput[@remap='locale-test']"/>
<xsl:text>&#xA;</xsl:text>
<xsl:if test="not(contains(string(//userinput[@remap='locale-test']),$lang)) and $lang!='C' and $lang!='POSIX'">
<xsl:text>if LOCALE=`grep "</xsl:text>
<xsl:value-of select="$lang"/>
<xsl:text>/" $PKGDIR/localedata/SUPPORTED`; then
CHARMAP=`echo $LOCALE | sed 's,[^/]*/\([^ ]*\) [\],\1,'`
INPUT=`echo $LOCALE | sed 's,[/.].*,,'`
LOCALE=`echo $LOCALE | sed 's,/.*,,'`
localedef -i $INPUT -f $CHARMAP $LOCALE
fi
</xsl:text>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:apply-templates
select=".//screen[
not(@role) or
@role != 'nodump'
]/userinput[
not(@remap) or
@remap='adjust' or
@remap='test' and current()/../@id='ch-tools-dejagnu'
]"/>
</xsl:template>
<xsl:template match="sect1" mode="pkgmngt">
<xsl:param name="dirname" select="chapter05"/>
<!-- The build order -->
<xsl:param name="order" select="062"/>
@ -244,35 +270,39 @@ fi
<xsl:variable name="pi-file-value" select="substring-after($pi-file,'filename=')"/>
<xsl:variable name="filename" select="substring-before(substring($pi-file-value,2),'.html')"/>
<!-- Creating dirs and files -->
<exsl:document href="{$dirname}/{$order}-{position()}-{$filename}" method="text">
<xsl:text>#!/bin/bash
<xsl:if test="count(descendant::screen/userinput) &gt; 0 and
count(descendant::screen/userinput) &gt;
count(descendant::screen[@role='nodump'])">
<exsl:document href="{$dirname}/{$order}-{position()}-{$filename}"
method="text">
<xsl:text>#!/bin/bash
set +h
set -e
cd $PKGDIR
</xsl:text>
<xsl:apply-templates
select=".//screen[not(@role) or @role != 'nodump']/userinput[@remap != 'adjust']"
<xsl:apply-templates
select=".//screen[not(@role) or
@role != 'nodump']/userinput[@remap != 'adjust']"
mode="pkgmngt"/>
<xsl:if test="$dirname = 'chapter06'">
<xsl:text>packInstall
<xsl:if test="$dirname = 'chapter06'">
<xsl:text>packInstall
rm -rf $PKG_DEST
</xsl:text>
</xsl:if>
<xsl:apply-templates
select=".//screen[
not(@role) or
@role != 'nodump'
]/userinput[
not(@remap) or
@remap='adjust'
</xsl:if>
<xsl:apply-templates
select=".//screen[not(@role) or
@role != 'nodump'
]/userinput[not(@remap) or
@remap='adjust'
]"
mode="pkgmngt"/>
<xsl:text>
<xsl:text>
echo -e "\n\nTotalseconds: $SECONDS\n"
exit
</xsl:text>
</exsl:document>
</exsl:document>
</xsl:if>
</xsl:template>
<xsl:template match="userinput" mode="pkgmngt">
@ -311,6 +341,12 @@ exit
select="substring-before(string(),'2&gt;&amp;1')"/>
<xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<!-- special case for procps-ng -->
<xsl:when test="contains(string(), 'pushd')">
<xsl:text>{ </xsl:text>
<xsl:apply-templates/>
<xsl:text>; } &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<xsl:when test="contains(string(), 'make -k')">
<xsl:apply-templates/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
@ -339,11 +375,18 @@ exit
select="substring-before(string(),'2&gt;&amp;1')"/>
<xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
</xsl:when>
<!-- special case for gmp -->
<xsl:when test="contains(string(), 'tee gmp-check-log')">
<xsl:text>(</xsl:text>
<xsl:apply-templates/>
<xsl:text>&gt;&gt; $TEST_LOG 2&gt;&amp;1 &amp;&amp; exit $PIPESTATUS)&#xA;</xsl:text>
</xsl:when>
<!-- special case for procps-ng -->
<xsl:when test="contains(string(), 'pushd')">
<xsl:text>{ </xsl:text>
<xsl:apply-templates/>
<xsl:text>; } &gt;&gt; $TEST_LOG 2&gt;&amp;1&#xA;</xsl:text>
</xsl:when>
<xsl:when test="contains(string(), 'make -k')">
<xsl:apply-templates/>
<xsl:text> &gt;&gt; $TEST_LOG 2&gt;&amp;1 || true&#xA;</xsl:text>
@ -391,13 +434,11 @@ exit
<xsl:choose>
<xsl:when test="./literal">
<xsl:call-template name="outputpkgdest">
<xsl:with-param name="outputstring"
select="text()[1]"/>
<xsl:with-param name="outputstring" select="text()[1]"/>
</xsl:call-template>
<xsl:apply-templates select="literal"/>
<xsl:call-template name="outputpkgdest">
<xsl:with-param name="outputstring"
select="text()[2]"/>
<xsl:with-param name="outputstring" select="text()[2]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
@ -491,13 +532,20 @@ exit
'install')"/>
<xsl:text>install&#xA;</xsl:text>
</xsl:when>
<xsl:when test="ancestor::sect1[@id='ch-system-attr']">
<xsl:text>DIST_ROOT=$PKG_DEST make</xsl:text>
<xsl:call-template name="outputpkgdest">
<xsl:with-param name="outputstring"
select="substring-after($outputstring,'make')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
<xsl:call-template name="outputpkgdest">
<xsl:with-param
<xsl:text>make DESTDIR=$PKG_DEST</xsl:text>
<xsl:call-template name="outputpkgdest">>
<xsl:with-param
name="outputstring"
select="substring-after($outputstring,'make')"/>
</xsl:call-template>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>

View File

@ -29,7 +29,7 @@ chapter4_Makefiles() { #
021-addinguser: 020-creatingtoolsdir
@\$(call echo_message, Building)
@if [ ! -d \$(LUSER_HOME) ]; then \\
@-if [ ! -d \$(LUSER_HOME) ]; then \\
groupadd \$(LGROUP); \\
useradd -s /bin/bash -g \$(LGROUP) -m -k /dev/null \$(LUSER); \\
else \\
@ -78,13 +78,13 @@ chapter5_Makefiles() {
this_script=`basename $file`
# If no testsuites are run, then TCL, Expect, DejaGNU and Check
# aren't needed.
# aren't needed (but building them does not hurt).
# Fix also locales creation when running chapter05 testsuites (ugly)
case "${this_script}" in
*tcl) [[ "${TEST}" = "0" ]] && continue ;;
*expect) [[ "${TEST}" = "0" ]] && continue ;;
*dejagnu) [[ "${TEST}" = "0" ]] && continue ;;
*check) [[ "${TEST}" = "0" ]] && continue ;;
# *tcl) [[ "${TEST}" = "0" ]] && continue ;;
# *expect) [[ "${TEST}" = "0" ]] && continue ;;
# *dejagnu) [[ "${TEST}" = "0" ]] && continue ;;
# *check) [[ "${TEST}" = "0" ]] && continue ;;
*stripping) [[ "${STRIP}" = "n" ]] && continue ;;
*glibc) [[ "${TEST}" = "3" ]] && \
sed -i 's@/usr/lib/locale@/tools/lib/locale@' $file ;;
@ -102,7 +102,9 @@ chapter5_Makefiles() {
# Grab the name of the target (minus the -pass1 or -pass2 in the case of gcc
# and binutils in chapter 5)
name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@' -e 's@-pass[0-9]\{1\}@@'`
name=`echo ${this_script} | sed -e 's@[0-9]\{3\}-@@' \
-e 's@-pass[0-9]\{1\}@@' \
-e 's@-libstdc++@@'`
# Set the dependency for the first target.
if [ -z $PREV ] ; then PREV=022-settingenvironment ; fi
@ -111,20 +113,20 @@ chapter5_Makefiles() {
# >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
#--------------------------------------------------------------------#
#
# Find the name of the tarball and the version of the package
pkg_tarball=$(get_package_tarball_name $name)
pkg_version=$(get_package_version $pkg_tarball)
# Drop in the name of the target on a new line, and the previous target
# as a dependency. Also call the echo_message function.
LUSER_wrt_target "${this_script}" "$PREV"
# Find the version of the command files, if it corresponds with the building of
# a specific package
pkg_tarball=$(get_package_tarball_name $name)
LUSER_wrt_target "${this_script}" "$PREV" "$pkg_version"
# If $pkg_tarball isn't empty, we've got a package...
if [ "$pkg_tarball" != "" ] ; then
# Insert instructions for unpacking the package and to set the PKGDIR variable.
LUSER_wrt_unpack "$pkg_tarball"
# If the testsuites must be run, initialize the log file
[[ "$TEST" = "3" ]] && LUSER_wrt_test_log "${this_script}"
[[ "$TEST" = "3" ]] && LUSER_wrt_test_log "${this_script}" "$pkg_version"
# If using optimizations, write the instructions
[[ "$OPTIMIZE" = "2" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
fi
@ -133,8 +135,8 @@ chapter5_Makefiles() {
# and date and disk usage again at the bottom of the log file.
# The changingowner script must be run as root.
case "${this_script}" in
*changingowner) wrt_RunAsRoot "$file" ;;
*) LUSER_wrt_RunAsUser "$file" ;;
*changingowner) wrt_RunAsRoot "$file" "$pkg_version" ;;
*) LUSER_wrt_RunAsUser "$file" "$pkg_version" ;;
esac
# Remove the build directory(ies) except if the package build fails
@ -211,6 +213,7 @@ chapter6_Makefiles() {
# a specific package. We need this here to can skip scripts not needed for
# iterations rebuilds
pkg_tarball=$(get_package_tarball_name $name)
pkg_version=$(get_package_version $pkg_tarball)
if [[ "$pkg_tarball" = "" ]] && [[ -n "$N" ]] ; then
case "${this_script}" in
@ -236,8 +239,8 @@ chapter6_Makefiles() {
# In the mount of kernel filesystems we need to set LFS
# and not to use chroot.
case "${this_script}" in
*kernfs) LUSER_wrt_target "${this_script}" "$PREV" ;;
*) CHROOT_wrt_target "${this_script}" "$PREV" ;;
*kernfs) LUSER_wrt_target "${this_script}" "$PREV" "$pkg_version" ;;
*) CHROOT_wrt_target "${this_script}" "$PREV" "$pkg_version" ;;
esac
# If $pkg_tarball isn't empty, we've got a package...
@ -252,10 +255,10 @@ chapter6_Makefiles() {
# If the testsuites must be run, initialize the log file
case $name in
binutils | gcc | glibc | gmp | mpfr )
[[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}"
[[ "$TEST" != "0" ]] && CHROOT_wrt_test_log "${this_script}" "$pkg_version"
;;
* )
[[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && CHROOT_wrt_test_log "${this_script}"
[[ "$TEST" = "2" ]] || [[ "$TEST" = "3" ]] && CHROOT_wrt_test_log "${this_script}" "$pkg_version"
;;
esac
# If using optimizations, write the instructions
@ -265,8 +268,8 @@ chapter6_Makefiles() {
# In the mount of kernel filesystems we need to set LFS
# and not to use chroot.
case "${this_script}" in
*kernfs) wrt_RunAsRoot "$file" ;;
*) CHROOT_wrt_RunAsRoot "$file" ;;
*kernfs) wrt_RunAsRoot "$file" "$pkg_version" ;;
*) CHROOT_wrt_RunAsRoot "$file" "$pkg_version" ;;
esac
# Write installed files log and remove the build directory(ies)
@ -327,7 +330,8 @@ chapter78_Makefiles() {
# as a dependency. Also call the echo_message function.
CHROOT_wrt_target "${this_script}" "$PREV"
# Find the bootscripts and kernel package names
# Find the bootscripts or networkscripts (for systemd)
# and kernel package names
case "${this_script}" in
*bootscripts)
name="lfs-bootscripts"
@ -337,6 +341,14 @@ chapter78_Makefiles() {
fi
CHROOT_Unpack "$pkg_tarball"
;;
*network-scripts)
name="lfs-network-scripts"
pkg_tarball=$(get_package_tarball_name $name)
if [ "${INSTALL_LOG}" = "y" ] ; then
CHROOT_wrt_TouchTimestamp
fi
CHROOT_Unpack "$pkg_tarball"
;;
*kernel)
name="linux"
pkg_tarball=$(get_package_tarball_name $name)
@ -363,14 +375,18 @@ chapter78_Makefiles() {
esac
case "${this_script}" in
*bootscripts) CHROOT_wrt_RemoveBuildDirs "dummy"
if [ "${INSTALL_LOG}" = "y" ] ; then
CHROOT_wrt_LogNewFiles "$name"
fi ;;
*kernel) CHROOT_wrt_RemoveBuildDirs "dummy"
if [ "${INSTALL_LOG}" = "y" ] ; then
CHROOT_wrt_LogNewFiles "$name"
fi ;;
*bootscripts) CHROOT_wrt_RemoveBuildDirs "dummy"
if [ "${INSTALL_LOG}" = "y" ] ; then
CHROOT_wrt_LogNewFiles "$name"
fi ;;
*network-scripts) CHROOT_wrt_RemoveBuildDirs "dummy"
if [ "${INSTALL_LOG}" = "y" ] ; then
CHROOT_wrt_LogNewFiles "$name"
fi ;;
*kernel) CHROOT_wrt_RemoveBuildDirs "dummy"
if [ "${INSTALL_LOG}" = "y" ] ; then
CHROOT_wrt_LogNewFiles "$name"
fi ;;
esac
# Include a touch of the target name so make can check
@ -408,8 +424,6 @@ build_Makefile() { #
chapter78_Makefiles
# Add the CUSTOM_TOOLS targets, if needed
[[ "$CUSTOM_TOOLS" = "y" ]] && wrt_CustomTools_target
# Add the BLFS_TOOL targets, if needed
[[ "$BLFS_TOOL" = "y" ]] && wrt_blfs_tool_targets
# Add a header, some variables and include the function file
# to the top of the real Makefile.
@ -440,10 +454,19 @@ build_Makefile() { #
(
cat << EOF
all: ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_CUSTOM_TOOLS mk_BLFS_TOOL
all: ck_UID mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_BLFS_TOOL mk_CUSTOM_TOOLS
@sudo make do_housekeeping
@echo "$VERSION - jhalfs build" > lfs-release && \\
sudo mv lfs-release \$(MOUNT_PT)/etc
@echo $VERSION > lfs-release && \\
sudo mv lfs-release \$(MOUNT_PT)/etc && \\
sudo chown root:root \$(MOUNT_PT)/etc/lfs-release
@/bin/echo -e -n \\
DISTRIB_ID=\\"Linux From Scratch\\"\\\\n\\
DISTRIB_RELEASE=\\"$VERSION\\"\\\\n\\
DISTRIB_CODENAME=\\"$(whoami)-jhalfs\\"\\\\n\\
DISTRIB_DESCRIPTION=\\"Linux From Scratch\\"\\\\n\\
> lsb-release && \\
sudo mv lsb-release \$(MOUNT_PT)/etc && \\
sudo chown root:root \$(MOUNT_PT)/etc/lsb-release
@\$(call echo_finished,$VERSION)
ck_UID:
@ -454,14 +477,6 @@ ck_UID:
exit 1; \\
fi
ck_LFS:
@if [ \`echo \$(LFS)\`x = "x" ]; then \\
echo "--------------------------------------------------"; \\
echo "Enviroment variable LFS must be set"; \\
echo "--------------------------------------------------"; \\
exit 1; \
fi
mk_SETUP:
@\$(call echo_SU_request)
@sudo make BREAKPOINT=\$(BREAKPOINT) SETUP
@ -469,7 +484,7 @@ mk_SETUP:
mk_LUSER: mk_SETUP
@\$(call echo_SULUSER_request)
@( sudo \$(SU_LUSER) "source .bashrc && cd \$(MOUNT_PT)/\$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) LUSER" )
@( \$(SU_LUSER) "make -C \$(MOUNT_PT)/\$(SCRIPT_ROOT) BREAKPOINT=\$(BREAKPOINT) LUSER" )
@sudo make restore-luser-env
@touch \$@
@ -487,7 +502,14 @@ mk_BOOT: mk_CHROOT
@( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BOOT")
@touch \$@
mk_CUSTOM_TOOLS: create-sbu_du-report
mk_BLFS_TOOL: create-sbu_du-report
@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
\$(call sh_echo_PHASE,Building BLFS_TOOL); \\
(sudo \$(CHROOT2) "make -C $BLFS_ROOT/work"); \\
fi;
@touch \$@
mk_CUSTOM_TOOLS: mk_BLFS_TOOL
@if [ "\$(ADD_CUSTOM_TOOLS)" = "y" ]; then \\
\$(call sh_echo_PHASE,Building CUSTOM_TOOLS); \\
sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}; \\
@ -495,30 +517,35 @@ mk_CUSTOM_TOOLS: create-sbu_du-report
fi;
@touch \$@
mk_BLFS_TOOL: mk_CUSTOM_TOOLS
@if [ "\$(ADD_BLFS_TOOLS)" = "y" ]; then \\
\$(call sh_echo_PHASE,Building BLFS_TOOL); \\
sudo mkdir -p $BUILDDIR$TRACKING_DIR; \\
(sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make BREAKPOINT=\$(BREAKPOINT) BLFS_TOOL"); \\
fi;
@touch \$@
devices: ck_UID
sudo mount -v --bind /dev \$(MOUNT_PT)/dev
sudo mount -vt devpts devpts \$(MOUNT_PT)/dev/pts
sudo mount -vt proc proc \$(MOUNT_PT)/proc
sudo mount -vt sysfs sysfs \$(MOUNT_PT)/sys
if [ -h \$(MOUNT_PT)/dev/shm ]; then \\
link=\$\$(readlink \$(MOUNT_PT)/dev/shm); \\
sudo mkdir -p \$(MOUNT_PT)/\$\$link; \\
sudo mount -vt tmpfs shm \$(MOUNT_PT)/\$\$link; \\
unset link; \\
else \\
sudo mount -vt tmpfs shm \$(MOUNT_PT)/dev/shm; \\
fi
devices: ck_LFS ck_UID
sudo mount -v --bind /dev \$(LFS)/dev
sudo mount -vt devpts devpts \$(LFS)/dev/pts
sudo mount -vt tmpfs shm \$(LFS)/dev/shm
sudo mount -vt proc proc \$(LFS)/proc
sudo mount -vt sysfs sysfs \$(LFS)/sys
teardown: ck_LFS
sudo umount -v \$(LFS)/sys
sudo umount -v \$(LFS)/proc
sudo umount -v \$(LFS)/dev/shm
sudo umount -v \$(LFS)/dev/pts
sudo umount -v \$(LFS)/dev
teardown:
sudo umount -v \$(MOUNT_PT)/sys
sudo umount -v \$(MOUNT_PT)/proc
sudo umount -v \$(MOUNT_PT)/dev/pts
if [ -h \$(MOUNT_PT)/dev/shm ]; then \\
link=\$\$(readlink \$(MOUNT_PT)/dev/shm); \\
sudo umount -v \$(MOUNT_PT)/\$\$link; \\
unset link; \\
else \\
sudo umount -v \$(MOUNT_PT)/dev/shm; \\
fi
sudo umount -v \$(MOUNT_PT)/dev
chroot: devices
sudo /usr/sbin/chroot \$(LFS) /tools/bin/env -i \\
sudo /usr/sbin/chroot \$(MOUNT_PT) /tools/bin/env -i \\
HOME=/root TERM=\$(TERM) PS1='\\u:\\w\\\$\$ ' \\
PATH=/bin:/usr/bin:/sbin:/usr/sbin \\
/tools/bin/bash --login
@ -531,13 +558,12 @@ CHROOT: SHELL=/tools/bin/bash
CHROOT: $chapter6
BOOT: $chapter78
CUSTOM_TOOLS: $custom_list
BLFS_TOOL: $blfs_tool
create-sbu_du-report: mk_BOOT
@\$(call echo_message, Building)
@if [ "\$(ADD_REPORT)" = "y" ]; then \\
./create-sbu_du-report.sh logs $VERSION; \\
sudo ./create-sbu_du-report.sh logs $VERSION; \\
\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report); \\
fi;
@touch \$@
@ -556,7 +582,13 @@ restore-luser-env:
do_housekeeping:
@-umount \$(MOUNT_PT)/sys
@-umount \$(MOUNT_PT)/proc
@-umount \$(MOUNT_PT)/dev/shm
@-if [ -h \$(MOUNT_PT)/dev/shm ]; then \\
link=\$\$(readlink \$(MOUNT_PT)/dev/shm); \\
umount \$(MOUNT_PT)/\$\$link; \\
unset link; \\
else \\
umount \$(MOUNT_PT)/dev/shm; \\
fi
@-umount \$(MOUNT_PT)/dev/pts
@-umount \$(MOUNT_PT)/dev
@-rm /tools

View File

@ -17,6 +17,7 @@ $(CONFIG)/mconf:
$(MAKE) -C $(CONFIG) ncurses conf mconf
menuconfig: $(CONFIG)/mconf
-@cp -a configuration configuration.old
@$(CONFIG)/mconf $(CONFIG_CONFIG_IN)
config: $(CONFIG)/conf

48
README
View File

@ -67,9 +67,12 @@ $Id$
If you accepted the displayed settings jhalfs will proceed to create the
Makefile, optionally download packages.
::NEWS::
IMPORTANT::
You must be logged as a normal user with sudo privileges to run
the Makefile.
the Makefile. Furthermore, you are supposed to have enough privilege
to become any user. If you are not bothered about security issues,
the entry for the user "jhalfs_user" in /etc/sudoers could be
jhalfs_user ALL=(ALL) NOPASSWD:ALL
NOTE::
If you run the jhalfs script directly the only function you can select
@ -77,23 +80,27 @@ $Id$
6. BLFS_TOOL SUPPORT::
For books that support it, there is an option to install blfs-tool and its
dependencies on the final system. The pre-made build dependencies
scripts has been written based on a LFS build. For CLFS and HLFS
builds you may need to adjust that scripts, that are found into the
common/blfs-tool-deps directory in the jhalfs sources tree.
For books that support it (TODO: which ones?), there is an option
to install an automated framework for building BLFS packages. Let
us call it blfs-tool for now. When you tick `BOOK Settings/Add
blfs-tool support' in jhalfs configuration menu, the tools are
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
you MUST to edit the dependencies scripts to fix the
installation paths.
Be careful when you modify the scripts as you can
easily disable the host system.
you MUST edit the scripts to fix the installation paths.
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
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
directory and files to the user.
@ -101,16 +108,21 @@ $Id$
- Give the user read and write privileges over the $TRACKING_DIR
directory and the files that it contains.
- If you think that you may need the libxml2/libxslt Python modules,
remove the libxml2 and libxslt trackin files found in $TRACKING_DIR.
- Configure sudo, adding the needed privileges for the user. For
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.
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::

View File

@ -2,7 +2,7 @@ $Id$
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
to follow the after-booting installation intructions.
@ -13,7 +13,7 @@ $Id$
change based on what dependencies will be used, etc.
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,
you will need to review and edit the scripts while reading the book.
@ -33,10 +33,10 @@ $Id$
3. USAGE::
Due the complexity of the BLFS book, the scripts and Makefile generation
is done in several steps:
Due to the complexity of the BLFS book, the scripts and Makefile
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
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
management tool.
The directory where tracking files will be stored needs to be created
before installing blfs-tool. You can place this directory anywhere, taking
care that the user must have read and write privileges on that directory
and on all files it contains.
The tracking system itself is an XML file: instpkg.xml. It is
initialized when <make> is first run in blfs_root. It resides in a
directory, which is created when needed during the process of building
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:
install -d -m1777 /var/lib/jhalfs/BLFS
The default location of the tracking directory is /var/lib/jhalfs/BLFS.
NB : after the initial build, that directory is only used to contain
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::
Run "make" to launch the jhalfs menuconfig interface. Select the BLFS
book and version. Then set the installation directory (default
$HOME/blfs_root), the BLFS sources directory (default blfs-xml), and
the installed packages tracking directory (default /var/lib/jhalfs/BLFS).
3.2.1 Normal install
The tools are installed just after the building of xLFS, if the
appropriate options have been selected in the building menu, as per
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 sources will be installed in the named sub-directory.
blfs-xml/* SVN tree of the selected BLFS book version
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
lib/* functions libraries, xsl stylesheets, and auto-generated
meta-packages dependencies tree files
menu/* lxdialog and menuconfig source code
README.BLFS this file
TODO developers notes
update_book.sh update the XML book sources and regenerates packages
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
packages.xml auto-generated packages database
Config.in input file for the menu driven choices
configuration file generated by the menuconfig process
dependencies/* files recording the dependency tree
book.xml the linearized book
book-html/* the linearized book rendered in html
scripts/* the scriptlets
From now on, all the work must be done from inside the installation
root directory.
When finished the installation, the configuration and target selection
menu is launch.
You may move that directory to the $HOME of a non root user, or build
as root from that directory.
3.3 UPDATING BOOK SOURCES::
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
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
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::
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
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.
build order for one or several packages.
Run <make> to launch the configuration interface. The main menu contains
three blocks: meta-package selection, individual package selection, and
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.
two blocks: individual package selection, and build options.
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
be made as a normal user or as root. That settings are saved to be reused in
future configuration runs.
used to solve alternatives are set (currently, only for the MTA). You can
also select whether the build will be made as a normal user or as root.
Those settings are saved to be reused in future configuration runs.
If, for example, your target selection is Xsoft-->Graphweb-->galeon, a
directory named "galeon" will be created. Inside that directory you will
find a directory named "HTML" that contains a galeon-based HTML book with
its dependencies in build order, and a "scripts" directory with build
scripts for that packages.
Note that you may select as many targets as you want, not just one
as in the previous version of this tool. But we suggest to not select
too many at a time to be able to sort issues!
There are also two other directories ("dependencies" and "xincludes")
that contain files generated while resolving dependencies trees.
When you are done with the menu, a few checks occur, and the book is
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
to the scripts necessary to fix generation bugs or to suit your needs.
Furthermore, there is a directory "scripts", which contains the generated
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
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
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
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
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
created. Be sure that you cd into the "package" directory and run
../gen-makefile.sh
created. Create an empty directory (for example "mkdir work") and cd
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::
In this section, known issues with the generated build scripts are
discussed. They are due to build procedures and/or BLFS layout particularities
that we can't handle. In several cases, editing the build scripts is mandatory.
discussed. They are due to build procedures and/or BLFS layout
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
unhandled dependencies and/or to remove some script installing the affected
package by hand.
4.1 BLFS BOOTSCRIPTS
4.1 BLFS BOOTSCRIPTS::
For now, bootscripts installation will fail. You will need to edit
the scripts for packages that install bootscripts and fix their
installation command. That could be fixed in the future.
Normally, bootscript installation should work. On the other hand, the
book does not give instruction for running them, so you might have to
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
edit the build script to fit the needs of your system.
For those packages that have a "Configuration" section, you should
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
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
On the pages for those packages, the BLFS book actually has instructions
to download and install two or more packages. You must edit the scripts to
fix this.
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
files.
@ -209,32 +256,42 @@ $Id$
The *.wget and *.md5 files should be downladed always from inside
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
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
scripts to use your local patches.
Please, make sure that all scripts have the commands to download/apply
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
required patches. Due to book layout issues, some patches may be missing.
4.7 ROOT COMMANDS
4.6 ROOT COMMANDS
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
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.
4.8 OTHERS
4.7 OTHERS
There may be other issues that we are not aware of. If you find
any, please report it to <alfs-discuss@linuxfromscratch.org>.

View File

@ -1,6 +1,5 @@
TITLE : Package management in jhalfs
ADDED : $Date$
BY : Pierre Labastie
BY : Pierre Labastie (work in progress)
1. INTRODUCTION:
@ -60,4 +59,17 @@ BY : Pierre Labastie
upgrade. The user has to provide his own function. A template is provided
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.

11
TODO
View File

@ -5,14 +5,17 @@
MASTER SCRIPT
-------------
- Nothing for now.
- Add a way to choose the network configuration (ip, gateway, etc).
- [CLFS] Add a switch to choose between static or DHCP network configuration
for CLFS.
xLFS MODULES
------------
- To develop a new "restart" Makefile target code to can resume an stopped build
after a host reboot, if possible.
- Add a way to choose the network configuration (ip, gateway, etc).
- [CLFS] Add a switch to choose between static or DHCP network configuration
for CLFS.
BLFS MODULE (See BLFS/TODO)
@ -22,4 +25,4 @@ BLFS MODULE (See BLFS/TODO)
OTHERS
------
- Bugs haunting and code clean-up.
- Bugs hunting and code clean-up.

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

@ -71,8 +71,14 @@ if [ "${CLEAN}" = "y" ]; then
if [ -d $BUILDDIR/sys ] ; then
sudo rmdir $BUILDDIR/sys || exit 1
fi
sudo rm -rf $BUILDDIR/{bin,boot,dev,etc,home,lib,media,mnt,opt,root,sbin,srv,tmp,tools,cross-tools,usr,var}
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}
echo "done"
if [[ "${BLFS_TOOL}" = "y" ]] ; then
echo -n "Cleaning $BUILDDIR/$BLFS_ROOT ..."
sudo rm -rf $BUILDDIR/$BLFS_ROOT
echo "done"
fi
echo -n "Cleaning $JHALFSDIR ..."
sudo rm -rf $JHALFSDIR
echo "done"
@ -106,9 +112,4 @@ source $COMMON_DIR/libs/func_wrt_Makefile
[[ $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 " ..."

View File

@ -51,7 +51,8 @@ free >> "$REPORT"
BUILDLOGS="`grep -l "^Totalseconds:" ${LOGSDIR}/*`"
# Match the first timed log to extract the SBU unit value from it
BASELOG=`grep -l "^Totalseconds:" $LOGSDIR/* | head -n1`
FIRSTLOG=`grep -l "^Totalseconds:" $LOGSDIR/* | head -n1`
BASELOG=`grep -l "^Totalseconds:" $LOGSDIR/???-binutils* | head -n1`
echo -e "\nUsing ${BASELOG#*[[:digit:]]-} to obtain the SBU unit value."
SBU_UNIT=`sed -n 's/^Totalseconds:\s\([[:digit:]]*\)$/\1/p' $BASELOG`
echo -e "\nThe SBU unit value is equal to $SBU_UNIT seconds.\n"
@ -91,7 +92,7 @@ for log in $BUILDLOGS ; do
# Append installed files disk usage to the previous entry,
# except for the first parsed log
if [ "$log" != "$BASELOG" ] ; then
if [ "$log" != "$FIRSTLOG" ] ; then
INSTALL=`perl -e 'print ('$DU1' - '$DU1PREV')';`
INSTALLMB=`perl -e 'printf "%.3f" , ('$DU1MB' - '$DU1MBPREV')';`
echo -e "Installed files disk usage:\t\t\t\t$INSTALL KB or $INSTALLMB MB\n" >> $REPORT
@ -115,7 +116,19 @@ for log in $BUILDLOGS ; do
done
# For printing the last 'Installed files disk usage', we need to 'du' the
# root dir, excluding the jhalfs directory (and lost+found). We assume
# that the rootdir is $LOGSDIR/../..
DU1=`du -skx --exclude=jhalfs --exclude=lost+found $LOGSDIR/../.. | cut -f1`
DU1MB=`perl -e 'printf "%.3f" , ('$DU1' / '1024')';`
INSTALL=`perl -e 'print ('$DU1' - '$DU1PREV')';`
INSTALLMB=`perl -e 'printf "%.3f" , ('$DU1MB' - '$DU1MBPREV')';`
echo -e "Installed files disk usage:\t\t\t\t$INSTALL KB or $INSTALLMB MB\n" >> $REPORT
# Append install values for grand total
INSTALL2=`perl -e 'printf "%.3f" , ('$INSTALL2' + '$INSTALL')';`
INSTALLMB2=`perl -e 'printf "%.3f" , ('$INSTALLMB2' + '$INSTALLMB')';`
# Dump grand totals
echo -e "\n$LINE\n\nTotal time required to build the systen:\t\t$SBU2 SBU" >> $REPORT
echo -e "\n$LINE\n\nTotal time required to build the system:\t\t$SBU2 SBU" >> $REPORT
# Total disk usage: including /tools but not /sources.
echo -e "Total Installed files disk usage:\t\t\t$INSTALL2 KB or $INSTALLMB2 MB" >> $REPORT

79
common/hostreqs.xsl Normal file
View File

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- $Id:$ -->
<!-- Extracts minimal versions from LFS book host requirements,
and generates a script containing statements of the
form MIN_prog_VERSION=xx.yy.zz.
-->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>
<xsl:template match="/sect1">
<xsl:apply-templates select=".//listitem//emphasis"/>
</xsl:template>
<xsl:template match="emphasis">
<!-- We assume that what is emphasized is in the form:
aa...aa-dccsaaa (a anything except @, - "dash", d digit,
c anything except space, s space)
or
aa...aasdccsaaa
This means we have to replace digits with @, and look for '-@'
or ' @' -->
<xsl:variable name="normalized-string"
select="translate(normalize-space(string()),
'0123456789',
'@@@@@@@@@@')"/>
<xsl:variable name="begin-ver">
<xsl:choose>
<xsl:when test="contains($normalized-string,' @')">
<xsl:value-of select="string-length(substring-before($normalized-string,' @'))+1"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string-length(substring-before($normalized-string,'-@'))+1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="remaining-part"
select="substring($normalized-string,number($begin-ver)+1)"/>
<xsl:variable name="end-ver">
<xsl:choose>
<xsl:when test="contains($remaining-part,' ')">
<xsl:value-of
select="string-length(substring-before($remaining-part,' '))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of
select="string-length($remaining-part)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:text>local MIN_</xsl:text>
<xsl:choose>
<xsl:when test="contains(string(),'Kernel')">
<xsl:text>Linux</xsl:text>
</xsl:when>
<xsl:when test="contains(string(),'GLIBC')">
<xsl:text>Glibc</xsl:text>
</xsl:when>
<xsl:when test="contains(string(),'XZ')">
<xsl:text>Xz</xsl:text>
</xsl:when>
<xsl:otherwise>
<!-- We assume that there are no dash nor space in other names -->
<xsl:value-of select="substring(string(),1,number($begin-ver)-1)"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>_VER=</xsl:text>
<xsl:value-of select="substring(string(),number($begin-ver)+1,$end-ver)"/>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>

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

@ -16,45 +16,40 @@ get_book() { #
case $PROGNAME in
lfs) svn_root="LFS" ;;
hlfs) svn_root="HLFS" ;;
clfs) svn_root="cross-lfs" ;;
clfs2) svn_root="cross-lfs" ;;
clfs3) svn_root="cross-lfs" ;;
clfs*) svn_root="cross-lfs" ;;
*) echo "BOOK not defined in function <get_book>"
exit 1 ;;
esac
# Grab a fresh book if it's missing, otherwise, update it from the
# repo. If we've already extracted the commands, move on to getting the
# sources.
if [ -d ${PROGNAME}-$LFSVRS ] ; then
cd ${PROGNAME}-$LFSVRS
if LC_ALL=C svn up | grep -q At && \
test -d $JHALFSDIR/${PROGNAME}-commands && \
test -f $JHALFSDIR/pkg_tarball_list ; then
# Set the canonical book version
echo -ne "done\n"
cd $JHALFSDIR
case $PROGNAME in
clfs | clfs2 | clfs3 )
VERSION=$(xmllint --noent $BOOK/prologue/$ARCH/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;
*)
VERSION=$(xmllint --noent $BOOK/prologue/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;
esac
get_sources
else
echo -ne "done\n"
extract_commands
fi
if [ $PROGNAME == "lfs" ] || [ $PROGNAME == "hlfs" ] && [ ! -d ${PROGNAME}-${LFSVRS}/.svn ]; then
svn co $SVN/${svn_root}/${TREE} ${PROGNAME}-$LFSVRS >>$LOGDIR/$LOG 2>&1
elif [ $PROGNAME == "clfs" ] || [ $PROGNAME == "clfs2" ] || [ $PROGNAME == "clfs3" ] && [ ! -d ${PROGNAME}-${LFSVRS}/.git ]; then
echo $TREE
git clone $GIT ${PROGNAME}-$LFSVRS >>$LOGDIR/$LOG 2>&1
if [ ! $TREE == "development" ]; then
cd ${PROGNAME}-$LFSVRS
echo "Checking out $LFSVRS at $PWD in $TREE"
git checkout ${TREE} >>$LOGDIR/$LOG 2>&1
fi
else
svn co $SVN/${svn_root}/${TREE} ${PROGNAME}-$LFSVRS >>$LOGDIR/$LOG 2>&1
echo -ne "done\n"
extract_commands
cd ${PROGNAME}-$LFSVRS
case $PROGNAME in
clfs*) git pull >>$LOGDIR/$LOG 2>&1
if [ ! $TREE == "development" ]; then
git checkout ${TREE} >>$LOGDIR/$LOG 2>&1
fi
;;
lfs | hlfs) svn up >>$LOGDIR/$LOG 2>&1 ;;
*) ;;
esac
fi
echo -ne "done\n"
else
echo -ne "Using $BOOK as book's sources ...\n"
extract_commands
fi
echo -ne " Document version ${L_arrow}${BOLD}${VERSION}${R_arrow}\n"
}
#----------------------------#
@ -67,8 +62,8 @@ extract_commands() { #
cd $JHALFSDIR
case $PROGNAME in
clfs | clfs2 | clfs3 )
VERSION=$(xmllint --noent $BOOK/prologue/$ARCH/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;
clfs*)
VERSION=$(xmllint --noent $BOOK/BOOK/prologue/$ARCH/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;
*)
VERSION=$(xmllint --noent $BOOK/prologue/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;
esac
@ -94,7 +89,7 @@ extract_commands() { #
--stringparam page $PAGE \
--stringparam lang $LANG \
--stringparam sparc $SPARC64_PROC \
-o ./${PROGNAME}-commands/ $XSL $BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
-o ./${PROGNAME}-commands/ $XSL $BOOK/BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
;;
clfs2)
@ -105,7 +100,7 @@ extract_commands() { #
--stringparam timezone $TIMEZONE \
--stringparam page $PAGE \
--stringparam lang $LANG \
-o ./${PROGNAME}-commands/ $XSL $BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
-o ./${PROGNAME}-commands/ $XSL $BOOK/BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
;;
clfs3)
@ -116,7 +111,7 @@ extract_commands() { #
--stringparam timezone $TIMEZONE \
--stringparam page $PAGE \
--stringparam lang $LANG \
-o ./${PROGNAME}-commands/ $XSL $BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
-o ./${PROGNAME}-commands/ $XSL $BOOK/BOOK/$ARCH-index.xml >>$LOGDIR/$LOG 2>&1
;;
hlfs)
@ -137,7 +132,9 @@ extract_commands() { #
lfs)
echo -n " ${L_arrow}${BOLD}LFS${R_arrow} build... "
pushd $BOOK > /dev/null
bash process-scripts.sh >> $LOGDIR/$LOG 2>&1
if [ -f process-scripts.sh ]; then
bash process-scripts.sh >> $LOGDIR/$LOG 2>&1
fi
popd > /dev/null
xsltproc --nonet \
--xinclude \
@ -155,8 +152,6 @@ extract_commands() { #
exit 1 ;;
esac
[[ "${BLFS_TOOL}" = "y" ]] && copy_blfs_deps_scripts
echo "done"
# Make the scripts executable.
@ -180,9 +175,9 @@ create_package_list() { #
if [ ! -z $ARCH ] ; then echo -n " $ARCH" ; fi
echo -n "... "
case ${PROGNAME} in
clfs | clfs2 | clfs3 )
clfs*)
xsltproc --nonet --xinclude -o pkg_tarball_list packages.xsl \
$BOOK/materials/${ARCH}-chapter.xml >>$LOGDIR/$LOG 2>&1
$BOOK/BOOK/materials/${ARCH}-chapter.xml >>$LOGDIR/$LOG 2>&1
;;
hlfs)
xsltproc --nonet --xinclude \
@ -197,6 +192,7 @@ create_package_list() { #
-o pkg_tarball_list packages.xsl \
$BOOK/chapter03/chapter03.xml >>$LOGDIR/$LOG 2>&1
;;
*)
esac
if [[ "${BLFS_TOOL}" = "y" ]] ; then

View File

@ -22,7 +22,7 @@ inline_doc
declare -i major minor revision change
declare -i ref_major ref_minor ref_revision ref_change
declare -r spaceSTR=" "
declare -r spaceSTR=" "
shopt -s extglob #needed for ${x##*(0)} below
@ -34,11 +34,11 @@ inline_doc
local IFS
write_error_and_die() {
echo -e "\n\t\t$TXT version -->${tst_version}<-- is too old.
echo -e "\n\t\t$TXT is missing or version -->${tst_version}<-- is too old.
This script requires ${ref_version} or greater\n"
# Ask the user instead of bomb, to make happy that packages which version
# ouput don't follow our expectations
echo "If you are sure that you have instaled a proper version of ${BOLD}$TXT${OFF}"
echo "If you are sure that you have installed a proper version of ${BOLD}$TXT${OFF}"
echo "but jhalfs has failed to detect it, press 'c' and 'ENTER' keys to continue,"
echo -n "otherwise press 'ENTER' key to stop jhalfs. "
read ANSWER
@ -54,24 +54,30 @@ inline_doc
echo -ne "${TXT}${dotSTR:${#TXT}} ${L_arrow}${BOLD}${tst_version}${OFF}${R_arrow}"
# echo -ne "$TXT:\t${L_arrow}${BOLD}${tst_version}${OFF}${R_arrow}"
IFS=".-(pa" # Split up w.x.y.z as well as w.x.y-rc (catch release candidates)
IFS=".-(pab" # Split up w.x.y.z as well as w.x.y-rc (catch release candidates)
set -- $ref_version # set positional parameters to minimum ver values
ref_major=$1; ref_minor=$2; ref_revision=$3
#
set -- $tst_version # Set positional parameters to test version values
# Values beginning with zero are taken as octal, so that for example
# 2.07.08 gives an error because 08 cannot be octal. The ## stuff supresses
# leading sero's
# leading zero's
major=${1##*(0)}; minor=${2##*(0)}; revision=${3##*(0)}
#
# Compare against minimum acceptable version..
(( major > ref_major )) && echo " ${spaceSTR:${#tst_version}}${GREEN}OK${OFF}" && return
(( major > ref_major )) &&
echo " ${spaceSTR:${#tst_version}}${GREEN}OK${OFF} (Min version: ${ref_version})" &&
return
(( major < ref_major )) && write_error_and_die
# major=ref_major
(( minor < ref_minor )) && write_error_and_die
(( minor > ref_minor )) && echo " ${spaceSTR:${#tst_version}}${GREEN}OK${OFF}" && return
(( minor > ref_minor )) &&
echo " ${spaceSTR:${#tst_version}}${GREEN}OK${OFF} (Min version: ${ref_version})" &&
return
# minor=ref_minor
(( revision >= ref_revision )) && echo " ${spaceSTR:${#tst_version}}${GREEN}OK${OFF}" && return
(( revision >= ref_revision )) &&
echo " ${spaceSTR:${#tst_version}}${GREEN}OK${OFF} (Min version: ${ref_version})" &&
return
# oops.. write error msg and die
write_error_and_die
@ -82,63 +88,164 @@ inline_doc
check_prerequisites() { #
#----------------------------#
case $PROGNAME in
clfs | clfs2 | clfs3) HOSTREQS="BOOK/prologue/common/hostreqs.xml" ;;
*) HOSTREQS="prologue/hostreqs.xml" ;;
esac
eval $(xsltproc $COMMON_DIR/hostreqs.xsl $BOOK/$HOSTREQS)
# Avoid translation of version strings
local LC_ALL=C
export LC_ALL
# LFS/HLFS/CLFS prerequisites
check_version "2.6.25" "`uname -r`" "KERNEL"
check_version "3.2" "$BASH_VERSION" "BASH"
check_version "4.1.2" "`gcc -dumpversion`" "GCC"
check_version "2.5.1" "$(ldd --version | head -n1 | awk '{print $NF}')" "GLIBC"
check_version "2.17" "$(ld --version | head -n1 | awk '{print $NF}')" "BINUTILS"
check_version "1.18" "$(tar --version | head -n1 | cut -d" " -f4)" "TAR"
if [ -n "$MIN_Linux_VER" ]; then
check_version "$MIN_Linux_VER" "`uname -r`" "KERNEL"
fi
if [ -n "$MIN_Bash_VER" ]; then
check_version "$MIN_Bash_VER" "$BASH_VERSION" "BASH"
fi
if [ ! -z $MIN_GCC_VER ]; then
check_version "$MIN_GCC_VER" "`gcc -dumpversion`" "GCC"
check_version "$MIN_GCC_VER" "`g++ -dumpversion`" "G++"
elif [ ! -z $MIN_Gcc_VER ]; then
check_version "$MIN_Gcc_VER" "`gcc -dumpversion`" "GCC"
fi
if [ -n "$MIN_Glibc_VER" ]; then
check_version "$MIN_Glibc_VER" "$(ldd --version | head -n1 | awk '{print $NF}')" "GLIBC"
fi
if [ -n "$MIN_Binutils_VER" ]; then
check_version "$MIN_Binutils_VER" "$(ld --version | head -n1 | awk '{print $NF}')" "BINUTILS"
fi
if [ -n "$MIN_Tar_VER" ]; then
check_version "$MIN_Tar_VER" "$(tar --version | head -n1 | cut -d" " -f4)" "TAR"
fi
if [ -n "$MIN_Bzip2_VER" ]; then
bzip2Ver="$(bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f8)"
check_version "1.0.4" "${bzip2Ver%%,*}" "BZIP2"
check_version "2.3" "$(bison --version | head -n1 | cut -d" " -f4)" "BISON"
check_version "6.9" "$(chown --version | head -n1 | cut -d")" -f2)" "COREUTILS"
check_version "2.8.1" "$(diff --version | head -n1 | cut -d" " -f4)" "DIFF"
check_version "4.2.31" "$(find --version | head -n1 | cut -d" " -f4)" "FIND"
check_version "3.1.5" "$(gawk --version | head -n1 | cut -d" " -f3)" "GAWK"
check_version "2.5.1a" "$(grep --version | head -n1 | awk '{print $NF}')" "GREP"
check_version "1.3.12" "$(gzip --version 2>&1 | head -n1 | cut -d" " -f2)" "GZIP"
check_version "1.4.10" "$(m4 --version 2>&1 | head -n1 | awk '{print $NF}')" "M4"
check_version "3.81" "$(make --version | head -n1 | cut -d " " -f3 | cut -c1-4)" "MAKE"
check_version "2.5.4" "$(patch --version | head -n1 | sed 's/.*patch //')" "PATCH"
check_version "5.8.8" "$(perl -V:version | cut -f2 -d\')" "PERL"
check_version "4.1.5" "$(sed --version | head -n1 | cut -d" " -f4)" "SED"
check_version "4.9" "$(makeinfo --version | head -n1 | awk '{ print$NF }')" "TEXINFO"
check_version "5.0.3" "$(xz --version | head -n1 | cut -d" " -f4)" "XZ"
check_version "$MIN_Bzip2_VER" "${bzip2Ver%%,*}" "BZIP2"
fi
if [ -n "$MIN_Bison_VER" ]; then
check_version "$MIN_Bison_VER" "$(bison --version | head -n1 | cut -d" " -f4)" "BISON"
fi
if [ -n "$MIN_Coreutils_VER" ]; then
check_version "$MIN_Coreutils_VER" "$(chown --version | head -n1 | cut -d" " -f4)" "COREUTILS"
fi
if [ -n "$MIN_Diffutils_VER" ]; then
check_version "$MIN_Diffutils_VER" "$(diff --version | head -n1 | cut -d" " -f4)" "DIFF"
fi
if [ -n "$MIN_Findutils_VER" ]; then
check_version "$MIN_Findutils_VER" "$(find --version | head -n1 | cut -d" " -f4)" "FIND"
fi
if [ -n "$MIN_Gawk_VER" ]; then
check_version "$MIN_Gawk_VER" "$(gawk --version | head -n1 | awk -F'[ ,]+' '{print $3}')" "GAWK"
fi
if [ -n "$MIN_Grep_VER" ]; then
check_version "$MIN_Grep_VER" "$(grep --version | head -n1 | awk '{print $NF}')" "GREP"
fi
if [ -n "$MIN_Gzip_VER" ]; then
check_version "$MIN_Gzip_VER" "$(gzip --version 2>&1 | head -n1 | cut -d" " -f2)" "GZIP"
fi
if [ -n "$MIN_M4_VER" ]; then
check_version "$MIN_M4_VER" "$(m4 --version 2>&1 | head -n1 | awk '{print $NF}')" "M4"
fi
if [ -n "$MIN_Make_VER" ]; then
check_version "$MIN_Make_VER" "$(make --version | head -n1 | cut -d " " -f3 | cut -c1-4)" "MAKE"
fi
if [ -n "$MIN_Patch_VER" ]; then
check_version "$MIN_Patch_VER" "$(patch --version | head -n1 | sed 's/.*patch //')" "PATCH"
fi
if [ -n "$MIN_Perl_VER" ]; then
check_version "$MIN_Perl_VER" "$(perl -V:version | cut -f2 -d\')" "PERL"
fi
if [ -n "$MIN_Sed_VER" ]; then
check_version "$MIN_Sed_VER" "$(sed --version | head -n1 | cut -d" " -f4)" "SED"
fi
if [ -n "$MIN_Texinfo_VER" ]; then
check_version "$MIN_Texinfo_VER" "$(makeinfo --version | head -n1 | awk '{ print$NF }')" "TEXINFO"
fi
if [ -n "$MIN_Xz_VER" ]; then
check_version "$MIN_Xz_VER" "$(xz --version | head -n1 | cut -d" " -f4)" "XZ"
fi
}
#----------------------------#
check_alfs_tools() { #
#----------------------------#
: << inline_doc
Those tools are needed for the proper operation of jhalfs
inline_doc
# Avoid translation of version strings
local LC_ALL=C
export LC_ALL
# Check for minimum sudo version
SUDO_LOC="$(whereis -b sudo | cut -d" " -f2)"
if [ -x $SUDO_LOC ]; then
sudoVer="$(sudo -V | head -n1 | cut -d" " -f3)"
check_version "1.6.8" "${sudoVer}" "SUDO"
check_version "1.7.0" "${sudoVer}" "SUDO"
else
echo "${nl_}\"${RED}sudo${OFF}\" ${BOLD}must be installed on your system for jhalfs to run"
exit 1
fi
# Check for minimum libxml2 and libxslt versions
xsltprocVer=$(xsltproc -V | head -n1 )
libxmlVer=$(echo $xsltprocVer | cut -d " " -f3)
libxsltVer=$(echo $xsltprocVer | cut -d " " -f5)
# Check for wget presence (using a dummy version)
WGET_LOC="$(whereis -b wget | cut -d" " -f2)"
if [ -x $WGET_LOC ]; then
wgetVer="$(wget --version | head -n1 | cut -d" " -f3)"
check_version "1.0.0" "${wgetVer}" "WGET"
else
echo "${nl_}\"${RED}wget${OFF}\" ${BOLD}must be installed on your system for jhalfs to run"
exit 1
fi
# 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"
# Before checking libxml2 and libxslt version information, ensure tools
# needed from those packages are actually available. Avoids a small
# cosmetic bug of book version information not being retrieved if
# xmllint is unavailable, especially when on recent non-LFS hosts.
# The next versions checks are required only when BLFS_TOOL is set and
# this dependencies has not be selected for installation
if [[ "$BLFS_TOOL" = "y" ]] ; then
XMLLINT_LOC="$(whereis -b xmllint | cut -d" " -f2)"
XSLTPROC_LOC="$(whereis -b xsltproc | cut -d" " -f2)"
if [ ! -x $XMLLINT_LOC ]; then
echo "${nl_}\"${RED}xmllint${OFF}\" ${BOLD}must be installed on your system for jhalfs to run"
exit 1
fi
if [[ -z "$DEP_TIDY" ]] ; then
tidyVer=$(tidy -V | cut -d " " -f9)
check_version "2004" "${tidyVer}" "TIDY"
fi
if [ -x $XSLTPROC_LOC ]; then
# Check if the proper DocBook-XML-DTD and DocBook-XSL are correctly installed
XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?>
# Check for minimum libxml2 and libxslt versions
xsltprocVer=$(xsltproc -V | head -n1 )
libxmlVer=$(echo $xsltprocVer | cut -d " " -f3)
libxsltVer=$(echo $xsltprocVer | cut -d " " -f5)
# 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"
else
echo "${nl_}\"${RED}xsltproc${OFF}\" ${BOLD}must be installed on your system for jhalfs to run"
exit 1
fi
}
#----------------------------#
check_blfs_tools() { #
#----------------------------#
: << inline_doc
In addition to the tools needed for the LFS part, tidy and docbook-xml
are needed for installing the BLFS tools
inline_doc
# Avoid translation of version strings
local LC_ALL=C
export LC_ALL
tidyVer=$(tidy -V | cut -d " " -f9)
check_version "2004" "${tidyVer}" "TIDY"
# Minimal docbook-xml code for testing
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'>
@ -150,24 +257,10 @@ XML_FILE="<?xml version='1.0' encoding='ISO-8859-1'?>
</sect1>
</article>"
if [[ -z "$DEP_DBXML" ]] ; then
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
fi
# if [[ -z "$DEP_DBXSL" ]] ; then
# 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
# fi
fi # end BLFS_TOOL=Y
if `echo $XML_FILE | xmllint -nonet -noout -postvalid - 2>/dev/null` ; then
check_version "4.5" "4.5" "DocBook XML DTD"
else
echo "Error: you need docbook for installing BLFS tools"
exit 2
fi
}

View File

@ -26,9 +26,11 @@ get_sources() { # Download file, write name to MISSING_FILES.DMP if
# Housekeeping
[[ ! -d $BUILDDIR/sources ]] && mkdir $BUILDDIR/sources
cd $BUILDDIR/sources
[[ -f MD5SUMS ]] && rm MD5SUMS
[[ -f MISSING_FILES.DMP ]] && rm MISSING_FILES.DMP
[[ -f urls.lst ]] && rm urls.lst
# If using CLFS, /sources is writable by all, but with sticky bit,
# and user does not hold MD5SUMS nor the other files, so use sudo
[[ -f MD5SUMS ]] && sudo rm MD5SUMS
[[ -f MISSING_FILES.DMP ]] && sudo rm MISSING_FILES.DMP
[[ -f urls.lst ]] && sudo rm urls.lst
# Generate URLs file
create_urls
@ -39,7 +41,7 @@ get_sources() { # Download file, write name to MISSING_FILES.DMP if
# Skip some packages if they aren't needed
case $line in
*/check* | */tcl* | */expect* | */dejagnu* | */tree* | */gcc-testsuite* )
*/tree* | */gcc-testsuite* ) #unneeded now?
[[ "$TEST" = "0" ]] && continue
;;
*/vim-*-lang* )
@ -85,8 +87,9 @@ get_sources() { # Download file, write name to MISSING_FILES.DMP if
fi
# Deal with udev and bootscripts m5sum issue
[[ $BOOKMD5 = "BOOTSCRIPTS-MD5SUM" ]] && continue
[[ $BOOKMD5 = "UDEV-MD5SUM" ]] && continue
[[ $BOOKMD5 = "BOOTSCRIPTS-MD5SUM" ]] && continue
[[ $BOOKMD5 = "UDEV-MD5SUM" ]] && continue
[[ $BOOKMD5 = "LFS-NETSCRIPTS-MD5SUM" ]] && continue
# IF the md5sum does not match the existing files
if ! echo "$MD5" | md5sum -c - >/dev/null ; then
@ -145,31 +148,13 @@ create_urls() { #
cd $JHALFSDIR
case ${PROGNAME} in
clfs)
clfs*)
echo -n "Creating CLFS <${ARCH}> specific URLs file"
xsltproc --nonet --xinclude \
--stringparam server $SERVER \
--stringparam family clfs \
-o $BUILDDIR/sources/urls.lst urls.xsl \
$BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
echo " ...OK"
;;
clfs2)
echo -n "Creating CLFS2 <${ARCH}> specific URLs file"
xsltproc --nonet --xinclude \
--stringparam server $SERVER \
--stringparam family clfs \
-o $BUILDDIR/sources/urls.lst urls.xsl \
$BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
echo " ...OK"
;;
clfs3)
echo -n "Creating CLFS3 <${ARCH}> specific URLs file"
xsltproc --nonet --xinclude \
--stringparam server $SERVER \
--stringparam family clfs \
-o $BUILDDIR/sources/urls.lst urls.xsl \
$BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
$BOOK/BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
echo " ...OK"
;;
hlfs)
@ -197,10 +182,6 @@ create_urls() { #
cd $BUILDDIR/sources
if [[ "${BLFS_TOOL}" = "y" ]]; then
add_blfs_deps_urls
fi
if [[ "${CUSTOM_TOOLS}" = "y" ]]; then
add_CustomToolsURLS
fi

View File

@ -0,0 +1,207 @@
#!/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
# If we have a working copy, copy it:
if [[ "$BLFS_WORKING_COPY" = "y" ]]; then
echo "copying the local BLFS working copy (may take some time)"
# -r: recursive; -u: only if newer; -T: otherwise, would copy to a subdirectory
# of blfs-xml, if blfs-xml already exists; --preserve=timestamps: if the local
# book has already been validated, tmp is posterior to the others, and
# validation will not be done again.
cp -ruT --preserve=timestamps $BLFS_WC_LOCATION \
${BUILDDIR}${BLFS_ROOT}/blfs-xml
fi
# Downloads the book if necessary, 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
# DocBook is a rec dep of libxslt
# 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_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=/,/^fi/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
popd
rm -v $BUILDDIR$BLFS_ROOT/download_script
# Suppresses unneeded parts of the scriptlets
if [ "$DEP_LIBXSLT" = y ]; then
# libxslt pulls docbook-xsl in, which populates the catalog with annoying
# **EDITME** references. Fortunately, those lines are regognizable because
# they occur between lines containing '/etc/xml/catalog' at the end of the
# line (without '&&'). I have not found a simple way to delete lines
# between 2 addresses, excluding either the first or the last one. So use
# a loop for accumulating lines and deleting at the end.
# Sorry for sed synthax.
sed -i '\@^[[:space:]]*/etc/xml/catalog$@{
n
:a
\@/etc/xml/catalog$@bb
N
ba
:b
d}' \
$BUILDDIR$BLFS_ROOT/scripts/*docbook-xsl
fi
if [ "$DEP_SUDO" = y ]; then
sed -i '/cat.*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
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
# The generated Makefile updates the tracking file after each package
# installation, using libxslt, which is not installed yet. So move
# updating to the end of the process, adding an 'update' target
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

@ -53,13 +53,13 @@ inline_doc
local -r clfs_PARAM_LIST="$CLFS_book $GENERAL_common $CLFS_build $ADVANCED_chroot $ADVANCED_common"
local -r clfs2_PARAM_LIST="$CLFS2_book $GENERAL_common $CLFS2_build $ADVANCED_common"
local -r clfs3_PARAM_LIST="$CLFS3_book $GENERAL_common $CLFS3_build $ADVANCED_common"
local -r blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR"
# local -r blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR"
# Additional variables (add DEP_DBXSL when required again)
local -r blfs_tool_PARAM_LIST="BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR \
DEP_LIBXML DEP_LIBXSLT DEP_TIDY DEP_UNZIP \
DEP_DBXML DEP_LYNX DEP_SUDO DEP_WGET \
DEP_SVN DEP_GPM"
# Additional variables
local -r blfs_tool_PARAM_LIST="\
BLFS_TREE BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR \
DEP_LIBXML DEP_LIBXSLT DEP_TIDY DEP_DBXML DEP_LYNX DEP_SUDO DEP_WGET \
DEP_SVN DEP_GPM DEP_OPENSSL DEP_PYTHON"
local -r custom_tool_PARAM_LIST="TRACKING_DIR"
# Internal variables
@ -184,10 +184,6 @@ inline_doc
echo
;;
# BLFS params.
BRANCH_ID | BLFS_ROOT | BLFS_XML ) echo "`eval echo $PARAM_VALS`" ;;
TRACKING_DIR ) validate_dir -z -d -w ;;
# Display non-validated envars found in ${PROGNAME}_PARAM_LIST
* ) echo -e "`eval echo $PARAM_VALS`" ;;

View File

@ -36,7 +36,7 @@ crLOGDIR = /\$(SCRIPT_ROOT)/$LOGDIRBASE
crTESTLOGDIR = /\$(SCRIPT_ROOT)/$TESTLOGDIRBASE
crFILELOGDIR = /\$(SCRIPT_ROOT)/$FILELOGDIRBASE
SU_LUSER = su - \$(LUSER) -c
SU_LUSER = sudo -u \$(LUSER) -i sh -c
LUSER_HOME = \$(LHOME)/\$(LUSER)
PRT_DU = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found \$(MOUNT_PT) \`\n"
PRT_DU_CR = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found / \`\n"
@ -58,7 +58,7 @@ EOF
#=======================
#==== PACKAGES NAMES ===
#==== PACKAGES NAMES AND VERSIONS ====
#----------------------------------#
get_package_tarball_name() { #
@ -96,18 +96,61 @@ get_package_tarball_name() { #
;;
e2fsprogs-libs) echo $(grep "^e2fsprogs" $JHALFSDIR/pkg_tarball_list | head -n1 )
;;
libcap) echo $(grep "^libcap" $JHALFSDIR/pkg_tarball_list | head -n1 )
;;
util-linux-libs) echo $(grep "^util-linux" $JHALFSDIR/pkg_tarball_list | head -n1 )
;;
xz-utils) echo $(grep "^xz" $JHALFSDIR/pkg_tarball_list | head -n1 )
;;
;;
sqlite) echo $(grep "^sqlite" $JHALFSDIR/pkg_tarball_list | head -n1 )
;;
;;
udev) echo $(grep "^systemd" $JHALFSDIR/pkg_tarball_list | head -n1 )
;;
xml-parser) echo $(grep "^XML" $JHALFSDIR/pkg_tarball_list | head -n1 )
;;
libdbus) echo $(grep "^dbus" $JHALFSDIR/pkg_tarball_list | head -n1 )
;;
*) echo $(grep "^$script_name[_-][[:digit:]]" $JHALFSDIR/pkg_tarball_list | head -n1 )
;;
esac
}
#----------------------------------#
get_package_version() { #
#----------------------------------#
# Those hacks may change depending on the invention of devs for tarball names.
# Normally, we expect -digit to signal the beginning of the version field
# but it may happen that there is no '-' (tcl, expect), that the version
# field is ddd-d (pkg-config-lite-028-1, since sed is greedy, it finds only
# the second dash) or that the first character of the version is not a digit
# (iputils-s20121221)...
case ${1} in
tcl*|expect*|tzdata*|xmlts*|unzip*|lynx*)
echo ${1} | sed -e 's@^[^[:digit:]]*@@' \
-e 's@\(-src\)*\.tar.*@@'
;;
iputils*) echo ${1} | sed -e 's@^.*-@@' \
-e 's@\.tar.*@@'
;;
LVM*) echo ${1} | sed -e 's@^[^.]*\.@@' \
-e 's@\.tgz.*@@'
;;
iproute*) echo ${1} | sed -e 's@^[^-]*-@@' \
-e 's@\.tar.*@@'
;;
pkg*|udev*|Singular*)
echo ${1} | sed -e 's@^.*[a-z]-\([[:digit:]]\)@\1@' \
-e 's@\.tar.*@@' \
-e 's@\.zip.*@@'
;;
*) echo ${1} | sed -e 's@^.*[-_]\([[:digit:]]\)@\1@' \
-e 's@\.tar.*@@' \
-e 's@\.zip.*@@'
;;
esac
}
#=======================
@ -118,14 +161,18 @@ LUSER_wrt_target() { # Create target and initialize log file
#----------------------------------#
local i=$1
local PREV=$2
local version
if [ "$3" != "" ]; then
version=-$3
fi
(
cat << EOF
$i: $PREV
@\$(call echo_message, Building)
${NO_PROGRESS} @export BASHBIN=\$(SHELL) && \$(SHELL) progress_bar.sh \$@ \$\$PPID &
@echo "\$(nl_)\`date\`\$(nl_)" >logs/\$@
@\$(PRT_DU) >>logs/\$@
@echo "\$(nl_)\`date\`\$(nl_)" >logs/\$@$version
@\$(PRT_DU) >>logs/\$@$version
EOF
) >> $MKFILE.tmp
}
@ -135,14 +182,18 @@ CHROOT_wrt_target() { # Create target and initialize log file
#----------------------------------#
local i=$1
local PREV=$2
local version
if [ "$3" != "" ]; then
version=-$3
fi
(
cat << EOF
$i: $PREV
@\$(call echo_message, Building)
${NO_PROGRESS} @export BASHBIN=\$(SHELL) && \$(SHELL) progress_bar.sh \$@ \$\$PPID &
@echo "\$(nl_)\`date\`\$(nl_)" >logs/\$@
@\$(PRT_DU_CR) >>logs/\$@
@echo "\$(nl_)\`date\`\$(nl_)" >logs/\$@$version
@\$(PRT_DU_CR) >>logs/\$@$version
EOF
) >> $MKFILE.tmp
}
@ -203,11 +254,15 @@ EOF
#----------------------------------#
LUSER_wrt_test_log() { # Initialize testsuite log file
#----------------------------------#
local TESTLOGFILE=$1
local version
if [ "$2" != "" ]; then
version=-$2
fi
local TESTLOGFILE=$1$version
(
cat << EOF
@echo "export TEST_LOG=\$(TESTLOGDIR)/$TESTLOGFILE" >> envars && \\
echo "\$(nl_)\`date\`\$(nl_)" >\$(TESTLOGDIR)/\$@
echo "\$(nl_)\`date\`\$(nl_)" >\$(TESTLOGDIR)/$TESTLOGFILE
EOF
) >> $MKFILE.tmp
}
@ -215,11 +270,15 @@ EOF
#----------------------------------#
CHROOT_wrt_test_log() { #
#----------------------------------#
local TESTLOGFILE=$1
local version
if [ "$2" != "" ]; then
version=-$2
fi
local TESTLOGFILE=$1$version
(
cat << EOF
@echo "export TEST_LOG=\$(crTESTLOGDIR)/$TESTLOGFILE" >> envars && \\
echo "\$(nl_)\`date\`\$(nl_)" >test-logs/\$@
echo "\$(nl_)\`date\`\$(nl_)" >\$(crTESTLOGDIR)/$TESTLOGFILE
EOF
) >> $MKFILE.tmp
}
@ -233,6 +292,10 @@ EOF
wrt_RunAsRoot() { # Some scripts must be run as root..
#----------------------------------#
local MOUNT_ENV
local version
if [ "$2" != "" ]; then
version=-$2
fi
local file=$1
case ${PROGNAME} in
@ -247,8 +310,8 @@ wrt_RunAsRoot() { # Some scripts must be run as root..
(
cat << EOF
@export ${MOUNT_ENV}=\$(MOUNT_PT) && \\
${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 && \\
\$(PRT_DU) >>logs/\$@
${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@$version 2>&1 && \\
\$(PRT_DU) >>logs/\$@$version
EOF
) >> $MKFILE.tmp
}
@ -257,12 +320,16 @@ EOF
LUSER_wrt_RunAsUser() { # Calculate time with perl, footer to log file
#----------------------------------#
local file=$1
local version
if [ "$2" != "" ]; then
version=-$2
fi
(
cat << EOF
@source ~/.bashrc && \\
\$(CMDSDIR)/`dirname $file`/\$@ >> logs/\$@ 2>&1 && \\
\$(PRT_DU) >>logs/\$@
\$(CMDSDIR)/`dirname $file`/\$@ >> logs/\$@$version 2>&1 && \\
\$(PRT_DU) >>logs/\$@$version
EOF
) >> $MKFILE.tmp
}
@ -271,11 +338,15 @@ EOF
CHROOT_wrt_RunAsRoot() { #
#----------------------------------#
local file=$1
local version
if [ "$2" != "" ]; then
version=-$2
fi
(
cat << EOF
@source envars && \\
\$(crCMDSDIR)/`dirname $file`/\$@ >>logs/\$@ 2>&1 && \\
\$(PRT_DU_CR) >>logs/\$@
\$(crCMDSDIR)/`dirname $file`/\$@ >>logs/\$@$version 2>&1 && \\
\$(PRT_DU_CR) >>logs/\$@$version
EOF
) >> $MKFILE.tmp

View File

@ -33,8 +33,8 @@ endef
define echo_SU_request
@echo $(BOLD)--------------------------------------------------------------------------------
@echo $(BLUE)$@
@echo $(WHITE)ROOT privilege is required to perform a number commands
@echo sudo will request a password to all high privilege cmds to execute correctly
@echo $(WHITE)ROOT privilege is required to perform a number of commands
@echo sudo will request a password in order to execute all high privilege commands
endef
define echo_SULUSER_request
@ -182,7 +182,7 @@ define echo_report
echo $(BOLD) The report file $(BLUE)$(1)$(BOLD) has been created ; \
echo ; \
echo $(WHITE)Please send the $(BOLD)$(MOUNT_PT)/jhalfs/$(1)$(WHITE) ; \
echo file to $(BOLD)manuel@linuxfromscratch.org$(WHITE) ; \
echo file to $(BOLD)jhalfs-reports@linuxfromscratch.org$(WHITE) ; \
echo ; \
echo That will help us to keep more accurate SBU and ; \
echo disk usage values into the book. Thanks. ; \
@ -200,26 +200,31 @@ define echo_finished
@echo To be able to boot your new system you need to follow
@echo the next steps:$(WHITE)
@echo
@echo $(tab_)- Mount the virtual kernel file systems.
@echo
@echo $(tab_)- Enter to the chroot using the command found
@echo $(tab_)in the section -Entering the Chroot Environment-
@echo $(tab_)except if building CLFS with METHOD=boot.
@echo
@echo $(tab_)- Set a password for the root user.
@echo
@echo $(tab_)- Edit or create /etc/fstab, /etc/hosts, /etc/sysconfig/clock,
@echo $(tab_)/etc/sysconfig/console, /etc/sysconfig/network,
@echo $(tab_)/etc/sysconfig//network-devices/ifconfig.eth0/ipv4 and
@echo $(tab_)any other configuration file required to suit your needs.
@echo
@echo $(tab_)- Exit from the chroot.
@echo $(tab_)- Edit or create /etc/fstab,
@echo $(tab_) " /etc/hosts,"
@echo $(tab_) " /etc/sysconfig/clock,"
@echo $(tab_) " /etc/sysconfig/console,"
@echo $(tab_) " /etc/sysconfig/network,"
@echo $(tab_) " /etc/sysconfig/ifconfig.eth0,"
@echo $(tab_) " /etc/resolv.conf"
@echo $(tab_)and any other configuration file required to suit your needs.
@echo
@echo $(tab_)- Set-up the boot loader, except if building CLFS with METHOD=boot.
@echo $(tab_)You can set-up the host bootloader or the new boot-loader
@echo $(tab_)installed on the new system.
@echo $(tab_)If the last, you must to mount the virtual filesystems, re-enter
@echo $(tab_)the chroot and be sure that /dev is populated with the
@echo $(tab_)required devices before configure the boot-loader. When ready,
@echo $(tab_)exit from the chroot and umount the filesystems
@echo
@echo $(tab_)You can set-up the new boot-loader installed on the new system
@echo $(tab_)or the host bootloader.
@echo
@echo $(tab_)If the last, it is better to exit first from the chroot.
@echo
@echo $(tab_)- Exit from the chroot and umount the filesystems.
@echo
@echo If you are an experienced LFS user, several of those steps can be
@echo skipped or done in a different way. But then, that is something

View File

@ -3,7 +3,7 @@
set -e
# Be sure that we know the taget name
# Be sure that we know the target name
[[ -z $1 ]] && exit
TARGET=$1 # Remember the target build we are looking for
MAKE_PPID=$2
@ -26,8 +26,10 @@ declare -i PREV_SEC=0
# Prevent segfault on stripping phases
if [[ "$BASHBIN" = "/tools/bin/bash" ]] ; then
SLEEP=/tools/bin/sleep
else
elif [ -x /bin/sleep ] ; then
SLEEP=/bin/sleep
else
SLEEP=/usr/bin/sleep
fi
write_or_exit() {

View File

@ -40,7 +40,7 @@
or not(ancestor::varlistentry[@vendor])) and
(contains(@url, '.bz2') or contains(@url, '.tar.gz') or
contains(@url, '.tgz') or contains(@url, '.patch') or
contains(@url, '.xz')) and
contains(@url, '.xz') or contains(@url, '.lzma')) and
not(ancestor-or-self::*/@condition = 'pdf')">
<!-- Extract the package name -->
<xsl:variable name="package">

View File

@ -1,5 +1,5 @@
#
# $Id:$
# $Id$
# NASM (Netwide Assembler) is an 80x86 assembler designed
# for portability and modularity. It includes a
# disassembler as well.

116
install-blfs-tools.sh Executable file
View File

@ -0,0 +1,116 @@
#!/bin/bash
# $Id$
set -e
: << inline_doc
Installs a set-up to build BLFS packages.
You can set these variables:
TRACKING_DIR : where the installed package file is kept.
(default /var/lib/jhalfs/BLFS)
BLFS_ROOT : where the installed tools will be installed, relative to $HOME.
Must start with a '/' (default /blfs_root)
BLFS_BRANCH_ID: development, branch-xxx, xxx (where xxx is a valid tag)
(default development)
Examples:
1 - If you plan to use the tools to build BLFS on top of LFS, but you did not
use jhalfs, or forgot to include the jhalfs-blfs tools:
(as root) mkdir -p /var/lib/jhalfs/BLFS && chown -R user /var/lib/jhalfs
(as user) ./install-blfs-tools
2 - To install with only user privileges:
TRACKING_DIR=/home/user/blfs_root/trackdir ./install-blfs-tools
inline_doc
# 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:=/blfs_root}"
TRACKING_DIR="${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_alfs_tools
check_blfs_tools
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}
# Ensures the tracking directory exists.
# Throws an error if it does not exist and the user does not
# have write permission to create it.
# If it exists, does nothing.
mkdir -p $TRACKING_DIR
[[ $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"

242
jhalfs
View File

@ -1,6 +1,8 @@
#!/bin/bash
# $Id$
set -e
# Pass trap handlers to functions
set -E
# VT100 colors
declare -r BLACK=$'\e[1;30m'
@ -37,12 +39,18 @@ 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
LASTLINE="$1"
LASTERR="$2"
LASTFUNC="$3"
LASTSOURCE="$4"
# echo -e "\n${RED}ERROR:${GREEN} basic error trapped!${OFF}\n" >&2
echo -e "\n${RED}ERROR:${GREEN} Error $LASTERR at $LASTSOURCE line ${LASTLINE}!${OFF}\n" >&2
fi
exit $LASTERR
}
see_ya() {
echo -e "\n${L_arrow}${BOLD}jhalfs-trunk${R_arrow} exit${OFF}\n"
echo -e "\n${L_arrow}${BOLD}jhalfs-ablfs${R_arrow} exit${OFF}\n"
}
##### Simple error TRAPS
# ctrl-c SIGINT
@ -57,12 +65,12 @@ see_ya() {
#####
set -e
trap see_ya 0
trap simple_error ERR
trap 'simple_error "${LINENO}" "$?" "${FUNCNAME}" "${BASH_SOURCE}"' ERR
trap 'echo -e "\n\n${RED}INTERRUPT${OFF} trapped\n" && exit 2' 1 2 3 15 17 18 23
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
version="
${BOLD} \"jhalfs-trunk\"${OFF} builder tool (development) \$Rev$
${BOLD} \"jhalfs-ablfs\"${OFF} builder tool (development) \$Rev$
\$Date$
Written by George Boudreau and Manuel Canales Esparcia,
@ -83,6 +91,19 @@ case $1 in
;;
esac
# If the user has not saved his configuration file, let's ask
# if he or she really wants to run this stuff
if [ $(ls -l --time-style='+%Y%m%d%H%M%S' configuration.old | cut -d' ' -f 6) \
-ge $(ls -l --time-style='+%Y%m%d%H%M%S' configuration | cut -d' ' -f 6) ]
then echo -n "Do you want to run jhalfs? yes/no (yes): "
read ANSWER
if [ x${ANSWER:0:1} = "xn" -o x${ANSWER:0:1} = "xN" ] ; then
echo "${nl_}Exiting gracefully.${nl_}"
exit
fi
fi
# Change this to 0 to suppress almost all messages
VERBOSITY=1
[[ $VERBOSITY > 0 ]] && echo -n "Loading config params from <configuration>..."
@ -139,8 +160,7 @@ BRANCH_ID=${BRANCH_ID:=development}
case $BRANCH_ID in
development )
case $PROGNAME in
clfs2 ) TREE=branches/clfs-sysroot/BOOK ;;
clfs3 ) TREE=branches/clfs-embedded/BOOK ;;
clfs* ) TREE="" ;;
*) TREE=trunk/BOOK ;;
esac
LFSVRS=development
@ -165,102 +185,25 @@ case $BRANCH_ID in
LFSVRS=${BRANCH_ID}
TREE=tags/${BRANCH_ID}/BOOK
;;
clfs | clfs2 | clfs3)
clfs* )
LFSVRS=${BRANCH_ID}
TREE=tags/${BRANCH_ID}
TREE=clfs-${BRANCH_ID}
;;
* )
esac
;;
esac
# Set the document location...
BOOK=${BOOK:=$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
case $PROGNAME in
# TODO: clfs is now on git
# clfs* ) declare -r SVN="http://svn.cross-lfs.org/svn/repos" ;;
* ) declare -r SVN="svn://svn.linuxfromscratch.org" ;;
clfs ) declare -r GIT="git://git.cross-lfs.org/cross-lfs" ;;
clfs2 ) declare -r GIT="git://git.cross-lfs.org/clfs-sysroot" ;;
clfs3 ) declare -r GIT="git://git.cross-lfs.org/clfs-embedded" ;;
*) declare -r SVN="svn://svn.linuxfromscratch.org" ;;
esac
declare -r LOG=000-masterscript.log
# Needed for fetching BLFS book sources when building CLFS
@ -304,15 +247,56 @@ source $COMMON_DIR/libs/func_custom_pkgs
[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
[[ $VERBOSITY > 0 ]] && echo Checking tools required for jhalfs
check_alfs_tools
[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
# blfs-tool envars
BLFS_TOOL=${BLFS_TOOL:-n}
if [[ "${BLFS_TOOL}" = "y" ]] ; then
[[ $VERBOSITY > 0 ]] && echo Checking supplementary tools for installing BLFS
check_blfs_tools
[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
BLFS_SVN=${BLFS_SVN:-n}
BLFS_WORKING_COPY=${BLFS_WORKING_COPY:-n}
BLFS_BRANCH=${BLFS_BRANCH:-n}
if [[ "${BLFS_SVN}" = "y" ]]; then
BLFS_BRANCH_ID=development
BLFS_TREE=trunk/BOOK
elif [[ "${BLFS_WORKING_COPY}" = "y" ]]; then
[[ -d "$BLFS_WC_LOCATION" ]] &&
[[ -d "$BLFS_WC_LOCATION/postlfs" ]] || {
echo " BLFS tools: This is not a working copy: $BLFS_WC_LOCATION."
echo " Please rerun make and fix the configuration."
exit 2
}
BLFS_TREE=$(cd $BLFS_WC_LOCATION; svn info | grep URL | sed 's@.*BLFS/@@')
BLFS_BRANCH_ID=$(echo $BLFS_TREE | sed -e 's@trunk/BOOK@development@' \
-e 's@branches/@branch-@' \
-e 's@tags/@@' \
-e 's@/BOOK@@')
elif [[ "${BLFS_BRANCH}" = "y" ]] ; then
case $BLFS_BRANCH_ID in
*EDIT* ) echo " You forgot to set the BLFS branch or stable book version."
echo " Please rerun make and fix the configuration."
exit 2 ;;
branch-systemd ) BLFS_TREE=branches/systemd ;;
branch-* ) BLFS_TREE=branches/${BLFS_BRANCH_ID#branch-}/BOOK ;;
6.2* | 7.4* ) BLFS_TREE=tags/${BLFS_BRANCH_ID} ;;
* ) BLFS_TREE=tags/${BLFS_BRANCH_ID}/BOOK ;;
esac
fi
[[ $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 ###
###################################
# Check for build prerequisites.
echo
check_prerequisites
echo "${SD_BORDER}${nl_}"
validate_config
echo "${SD_BORDER}${nl_}"
@ -320,7 +304,7 @@ 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
exit
fi
echo "${nl_}${SD_BORDER}${nl_}"
@ -345,6 +329,8 @@ if [[ "$OPTIMIZE" != "0" ]]; then
source optimize/opt_config
[[ $? > 0 ]] && echo " optimize/opt_config did not load.." && exit
[[ $VERBOSITY > 0 ]] && echo "OK"
# The number of parallel jobs is taken from configuration now
MAKEFLAGS="-j${N_PARALLEL}"
# Validate optimize settings, if required
validate_opt_settings
fi
@ -352,12 +338,6 @@ fi
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
clean_builddir
@ -380,7 +360,11 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
cp $COMMON_DIR/{makefile-functions,progress_bar.sh,packages.xsl} $JHALFSDIR/
#
# Fix the XSL book parser
sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL}
case $PROGNAME in
clfs* ) sed 's,FAKEDIR,'${BOOK}/BOOK',' ${PACKAGE_DIR}/${XSL} > $JHALFSDIR/${XSL} ;;
lfs | hlfs ) sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL} ;;
* ) ;;
esac
export XSL=$JHALFSDIR/${XSL}
#
@ -392,10 +376,6 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
# Copy urls.xsl, if needed
[[ "$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
[[ "$TEST" != "0" ]] && [[ ! -d $TESTLOGDIR ]] && install -d -m 1777 $TESTLOGDIR
#
@ -419,7 +399,6 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
cp extras/* $JHALFSDIR/extras
fi
#
# Copy custom tools config files, if requested
if [[ "${CUSTOM_TOOLS}" = "y" ]]; then
echo "Copying custom tool scripts to $JHALFSDIR"
@ -429,49 +408,24 @@ if [[ "$REBUILD_MAKEFILE" = "n" ]] ; then
#
# Install blfs-tool, if requested.
if [[ "${BLFS_TOOL}" = "y" ]] ; then
# Install the files
[[ ! -d ${BUILDDIR}${BLFS_ROOT} ]] && mkdir -p ${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
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
echo Installing BLFS book and tools
install_blfs_tools 2>&1 | tee -a $LOGDIR/$LOG
[[ ${PIPESTATUS[0]} != 0 ]] && exit 1
fi
#
# Download or updates the book source
get_book
extract_commands
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
# 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
case $PROGNAME in
clfs | clfs2 | clfs3 )
clfs* )
VERSION=$(xmllint --noent $JHALFSDIR/$BOOK/prologue/$ARCH/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;
*)
VERSION=$(xmllint --noent $JHALFSDIR/$BOOK/prologue/bookinfo.xml 2>/dev/null | grep subtitle | sed -e 's/^.*ion //' -e 's/<\/.*//') ;;
@ -482,4 +436,10 @@ build_Makefile
echo "${SD_BORDER}${nl_}"
# Check for build prerequisites.
echo
cd $CWD
check_prerequisites
echo "${SD_BORDER}${nl_}"
# All is well, run the build (if requested)
run_make

View File

@ -7,16 +7,12 @@
#$Id$
#
#--- Extra flags passed to the packages make commands
# "unset" will cause the variable to be not set
# instead of just set to null.
MAKEFLAGS="-j3"
#--- List of packages that have issues with jobs control.
#--- List of packages that have issues with parallelization.
# This list may be different for you.
# If your MAKEFLAGS don't contains a -jX option, you can set
# a empty list here.
BLACK_LIST="autoconf dejagnu gettext groff man-db vim"
BLACK_LIST="attr autoconf coreutils dejagnu gettext gperf groff man-db vim"
# Rationale for attr, coreutils, gperf: the tests do not pass with -jX
# CLFS packages
BLACK_LIST="$BLACK_LIST libee"
#--- Default optimization mode
# This mode is overridden by definitions in opt_override;
@ -26,7 +22,7 @@ BLACK_LIST="autoconf dejagnu gettext groff man-db vim"
#
# Not set here combined modes of form defOpt_myMode.
# Combined modes of form modeA_modeB can be set here.
DEF_OPT_MODE=O2pipe
DEF_OPT_MODE=noOpt
#--- Active optimization variables

View File

@ -1,5 +1,2 @@
binutils noOpt
gcc noOpt
glibc noOpt
grub noOpt
zlib defOpt_fPIC

View File

@ -38,7 +38,7 @@ validate_opt_settings() { # Show optimize setting and wait user agreeme
read ANSWER
if [ x$ANSWER != "xyes" ] ; then
echo "${nl_}Fix the optimization options and rerun the script.${nl_}"
exit 1
exit
fi
echo "${nl_}${SD_BORDER}${nl_}"
}