Scripts needed to convert a book to other formats

This commit is contained in:
Vladimir Pertsev 2022-05-11 01:28:03 +05:00
parent 4dbb80b580
commit 50aef8accc
15 changed files with 2539 additions and 5 deletions

212
Makefile Normal file
View File

@ -0,0 +1,212 @@
#BASEDIR = ~/lfs-book
#SYSDDIR = ~/lfs-systemd
#DUMPDIR = ~/lfs-commands
RENDERTMP = $(HOME)/tmp
CHUNK_QUIET = 1
ROOT_ID =
SHELL = /bin/bash
ifdef V
Q =
else
Q = @
endif
ifndef REV
REV = sysv
endif
ifneq ($(REV), sysv)
ifneq ($(REV), systemd)
$(error REV must be 'sysv' (default) or 'systemd'.)
endif
endif
ifeq ($(REV), sysv)
BASEDIR ?= ~/lfs-book
PDF_OUTPUT ?= LFS-BOOK.pdf
NOCHUNKS_OUTPUT ?= LFS-BOOK.html
DUMPDIR ?= ~/cross-lfs-commands
else
BASEDIR ?= ~/lfs-systemd
PDF_OUTPUT ?= LFS-SYSD-BOOK.pdf
NOCHUNKS_OUTPUT ?= LFS-SYSD-BOOK.html
DUMPDIR ?= ~/lfs-sysd-commands
endif
book: validate profile-html
@echo "Generating chunked XHTML files at $(BASEDIR)/ ..."
$(Q)xsltproc --nonet \
--stringparam chunk.quietly $(CHUNK_QUIET) \
--stringparam rootid "$(ROOT_ID)" \
--stringparam base.dir $(BASEDIR)/ \
stylesheets/lfs-chunked.xsl \
$(RENDERTMP)/lfs-html.xml
@echo "Copying CSS code and images..."
$(Q)mkdir -p $(BASEDIR)/stylesheets
$(Q)cp stylesheets/lfs-xsl/*.css $(BASEDIR)/stylesheets
$(Q)sed -i 's|../stylesheet|stylesheet|' $(BASEDIR)/index.html
$(Q)mkdir -p $(BASEDIR)/images
$(Q)cp images/*.png $(BASEDIR)/images
@echo "Running Tidy and obfuscate.sh..."
$(Q)for filename in `find $(BASEDIR) -name "*.html"`; do \
tidy -config tidy.conf $$filename; \
true; \
/bin/bash obfuscate.sh $$filename; \
sed -e "s@text/html@application/xhtml+xml@g" \
-e "s/\xa9/\©/ " \
-i $$filename; \
done;
$(Q)$(MAKE) --no-print-directory wget-list md5sums
pdf: validate
@echo "Generating profiled XML for PDF..."
$(Q)xsltproc --nonet \
--stringparam profile.condition pdf \
--output $(RENDERTMP)/lfs-pdf.xml \
stylesheets/lfs-xsl/profile.xsl \
$(RENDERTMP)/lfs-full.xml
@echo "Generating FO file..."
$(Q)xsltproc --nonet \
--stringparam rootid "$(ROOT_ID)" \
--output $(RENDERTMP)/lfs-pdf.fo \
stylesheets/lfs-pdf.xsl \
$(RENDERTMP)/lfs-pdf.xml
$(Q)sed -i -e 's/span="inherit"/span="all"/' $(RENDERTMP)/lfs-pdf.fo
$(Q)bash pdf-fixups.sh $(RENDERTMP)/lfs-pdf.fo
@echo "Generating PDF file..."
$(Q)mkdir -p $(RENDERTMP)/images
$(Q)cp images/*.png $(RENDERTMP)/images
$(Q)mkdir -p $(BASEDIR)
$(Q)fop -q $(RENDERTMP)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT) 2>fop.log
@echo "$(BASEDIR)/$(PDF_OUTPUT) created"
@echo "fop.log created"
nochunks: validate profile-html
@echo "Generating non chunked XHTML file..."
$(Q)xsltproc --nonet \
--stringparam rootid "$(ROOT_ID)" \
--output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
stylesheets/lfs-nochunks.xsl \
$(RENDERTMP)/lfs-html.xml
# $(RENDERTMP)/lfs-html2.xml
@echo "Running Tidy..."
$(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
@echo "Running obfuscate.sh..."
$(Q)bash obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
$(Q)sed -i -e "s@text/html@application/xhtml+xml@g" $(BASEDIR)/$(NOCHUNKS_OUTPUT)
$(Q)sed -i -e "s@../wget-list@wget-list@" $(BASEDIR)/$(NOCHUNKS_OUTPUT)
$(Q)sed -i -e "s@../md5sums@md5sums@" $(BASEDIR)/$(NOCHUNKS_OUTPUT)
$(Q)sed -i -e "s@\xa9@\©@" $(BASEDIR)/$(NOCHUNKS_OUTPUT)
@echo "Output at $(BASEDIR)/$(NOCHUNKS_OUTPUT)"
tmpdir:
@echo "Creating and cleaning $(RENDERTMP)"
$(Q)mkdir -p $(RENDERTMP)
$(Q)rm -f $(RENDERTMP)/lfs*.xml
$(Q)rm -f $(RENDERTMP)/*wget*
$(Q)rm -f $(RENDERTMP)/*md5sum*
$(Q)rm -f $(RENDERTMP)/*pdf.fo
validate: tmpdir version
@echo "Processing bootscripts..."
$(Q)bash process-scripts.sh
@echo "Adjusting for revision $(REV)..."
$(Q)xsltproc --nonet \
--xinclude \
--output $(RENDERTMP)/lfs-html2.xml \
--stringparam profile.revision $(REV) \
stylesheets/lfs-xsl/profile.xsl \
index.xml
@echo "Validating the book..."
$(Q)xmllint --nonet \
--noent \
--postvalid \
-o $(RENDERTMP)/lfs-full.xml \
$(RENDERTMP)/lfs-html2.xml
$(Q)rm -f appendices/*.script
$(Q)./aux-file-data.sh $(RENDERTMP)/lfs-full.xml
@echo "Validation complete."
profile-html:
@echo "Generating profiled XML for XHTML..."
$(Q)xsltproc --nonet \
--stringparam profile.condition html \
--output $(RENDERTMP)/lfs-html.xml \
stylesheets/lfs-xsl/profile.xsl \
$(RENDERTMP)/lfs-full.xml
wget-list: $(BASEDIR)/wget-list
$(BASEDIR)/wget-list: stylesheets/wget-list.xsl chapter03/chapter03.xml \
packages.ent patches.ent general.ent
@echo "Generating consolidated wget list at $(BASEDIR)/wget-list ..."
$(Q)mkdir -p $(BASEDIR)
# $(Q)xsltproc --nonet --xinclude \
# --stringparam profile.revision $(REV) \
# --output $(RENDERTMP)/sysd-wget.xml \
# stylesheets/lfs-xsl/profile.xsl \
# chapter03/chapter03.xml
$(Q)xsltproc --xinclude --nonet \
--output $(BASEDIR)/wget-list \
stylesheets/wget-list.xsl \
chapter03/chapter03.xml
md5sums: $(BASEDIR)/md5sums
$(BASEDIR)/md5sums: stylesheets/wget-list.xsl chapter03/chapter03.xml \
packages.ent patches.ent
@echo "Generating consolidated md5sum file at $(BASEDIR)/md5sums ..."
$(Q)mkdir -p $(BASEDIR)
$(Q)xsltproc --nonet --xinclude \
--stringparam profile.revision $(REV) \
--output $(RENDERTMP)/sysv-md5sum.xml \
stylesheets/lfs-xsl/profile.xsl \
chapter03/chapter03.xml
$(Q)xsltproc --xinclude --nonet \
--output $(BASEDIR)/md5sums \
stylesheets/md5sum.xsl \
$(RENDERTMP)/sysv-md5sum.xml
$(Q)sed -i -e \
"s/BOOTSCRIPTS-MD5SUM/$(shell md5sum lfs-bootscripts*.tar.xz | cut -d' ' -f1)/" \
$(BASEDIR)/md5sums
version:
$(Q)./git-version.sh $(REV)
#dump-commands: validate
# @echo "Dumping book commands..."
# $(Q)xsltproc --nonet \
# --output $(RENDERTMP)/lfs-html.xml \
# --stringparam profile.revision $(REV) \
# stylesheets/lfs-xsl/profile.xsl \
# $(RENDERTMP)/lfs-full.xml
# $(Q)rm -rf $(DUMPDIR)
# $(Q)xsltproc --output $(DUMPDIR)/ \
# stylesheets/dump-commands.xsl \
# $(RENDERTMP)/lfs-html.xml
# @echo "Dumping book commands complete in $(DUMPDIR)"
all: book nochunks pdf # dump-commands
.PHONY : all book dump-commands nochunks pdf profile-html tmpdir validate md5sums wget-list version

View File

@ -1,6 +1,32 @@
# lfs-ru
## Перевод книги Linux From Scratch на русский язык
LFS Book README
## История изменений
### 10.05.2022
- Запущено зеркало сайта LFS [mirror.linuxfromscratch.ru](https://mirror.linuxfromscratch.ru)
В этом документе содержится информация о том, как выполнить преобразование
книги из XML формата в другой формат (например, HTML, PDF, PS и TXT). Для
начала, если вы ещё этого не сделали, пожалуйста, откройте и прочитайте
информацию, представленную в файле INSTALL, чтобы установить необходимое
программное обеспечение. Если вы уже выполнили все шаги в файле INSTALL,
ознакомьтесь с примерами того, как выполнить преобразование файлов в другие
форматы.
Во всех примерах необходимо указание аргумента REV=systemd, если требуется
сборка книги редакции systemd.
XML в XHTML:
-------------
make BASEDIR=/path/to/output/location
XML в одностраничный XHTML (nochunks):
------------------------------------
make BASEDIR=/path/to/output/location nochunks
XML в TXT
----------
Следуйте инструкциям для nochunks и затем запустите:
lynx -dump /path/to/nochunks > /path/to/output
XML в PDF:
-----------
make BASEDIR=/path/to/output/location pdf

30
aux-file-data.sh Normal file
View File

@ -0,0 +1,30 @@
#!/bin/bash
if [ $# -lt 1 ] ; then
echo "This script needs the location of the xml file to update"
exit 1
fi
FILE=$1
./make-aux-files.sh
# Bootscript data
bootscripts=$(ls lfs-bootscripts*.xz)
base=$(basename $bootscripts .tar.xz)
bootsize=$(ls -l --block-size=1024 $bootscripts | cut -f5 -d" ")
bootmd5=$(md5sum $bootscripts | cut -f1 -d" ")
# Figure intalled size of bootscripts
TOPDIR=$(pwd)
TMP_DIR=$(mktemp -d /tmp/lfsbootfiles.XXXXXX)
pushd $TMP_DIR > /dev/null
tar -xf $TOPDIR/$bootscripts
bootinstallsize=$(du -sk $TMP_DIR | cut -f1)
popd > /dev/null
rm -rf $TMP_DIR
sed -i -e s/BOOTSCRIPTS-SIZE/$bootsize/ \
-e s/BOOTSCRIPTS-INSTALL-KB/$bootinstallsize/ \
-e s/BOOTSCRIPTS-MD5SUM/$bootmd5/ $FILE

122
general.ent Normal file
View File

@ -0,0 +1,122 @@
<!-- Editing up to the line of ==== should be enough
to generate a book for development, release, or rc-->
<!ENTITY % development "INCLUDE"><!-- set to INCLUDE for development,
set to IGNORE for release or rc -->
<!ENTITY % release "IGNORE"> <!-- set to INCLUDE for release,
set to IGNORE for development or rc -->
<!ENTITY % rc "IGNORE"> <!-- set to INCLUDE for rc,
set to IGNORE for development or
release -->
<!ENTITY % relnum "11.1"><!-- must be given for release or rc -->
<!ENTITY % reldate "March 1st, 2022"><!-- must ve given for release or rc -->
<!ENTITY % crdate "1999-2022"><!-- must ve given for release or rc -->
<!ENTITY % rcnum "2"><!-- must be given only for rc -->
<!-- ================================================================== -->
<!-- Do not change anything below unless the www or book layouts change -->
<!-- Automatically generated by git-version.sh. Used for release or dev -->
<!ENTITY % conditional-entities SYSTEM "conditional.ent">
%conditional-entities;
<![ %development; [
<!-- version info automatically generated by git -->
<!ENTITY % version-entities SYSTEM "version.ent">
%version-entities;
<![ %sysv; [
<!ENTITY short-version "svn"> <!-- Used below in &blfs-book; -->
<!ENTITY errata "&lfs-root;lfs/errata/development/">
]]>
<![ %systemd; [
<!ENTITY short-version "systemd"> <!-- Used below in &blfs-book; -->
<!ENTITY errata "&lfs-root;lfs/errata/systemd/">
]]>
<!ENTITY generic-version "development"> <!-- Used below in
&patches-root;,
&donwloads-root;, and
&test-results; -->
]]><!-- End %development -->
<![ %release; [
<![ %sysv; [
<!ENTITY version "%relnum;">
<!ENTITY short-version "%relnum;"> <!-- Used below in &blfs-book; -->
]]>
<![ %systemd; [
<!ENTITY version "%relnum;-systemd">
<!ENTITY short-version "stable-systemd"> <!-- Used below in &blfs-book; -->
]]>
<!ENTITY errata "&lfs-root;lfs/errata/&version;/">
<!ENTITY generic-version "%relnum;"> <!-- Used below in
&patches-root;,
&donwloads-root;, and
&test-results; -->
<!ENTITY releasedate "%reldate;">
<!ENTITY copyrightdate "%crdate;">
]]>
<![ %rc; [
<![ %sysv; [
<!ENTITY version "%relnum;-rc%rcnum;">
<!ENTITY short-version "svn"> <!-- Used below in &blfs-book; -->
]]>
<![ %systemd; [
<!ENTITY version "%relnum;-systemd-rc%rcnum;">
<!ENTITY short-version "systemd"> <!-- Used below in &blfs-book; -->
]]>
<!ENTITY errata "&lfs-root;lfs/errata/&version;/">
<!ENTITY generic-version "%relnum;-rc%rcnum;"> <!-- Used below in
&patches-root;,
&downloads-root;, and
&test-results; -->
<!ENTITY releasedate "%reldate;">
<!ENTITY copyrightdate "%crdate;">
]]>
<!ENTITY lfs-root "https://www.linuxfromscratch.org/">
<!ENTITY blfs-root "&lfs-root;blfs/">
<!ENTITY blfs-book "&blfs-root;view/&short-version;/">
<!ENTITY faq-root "&lfs-root;faq/">
<!ENTITY hints-root "&lfs-root;hints/downloads/files/">
<!ENTITY hints-index "&lfs-root;hints/list.html">
<!ENTITY patches-root "&lfs-root;patches/lfs/&generic-version;/">
<!-- Only used for sysv (lfs-bootscripts): -->
<!ENTITY downloads-root "&lfs-root;lfs/downloads/&generic-version;/">
<!ENTITY livecd-root "&lfs-root;livecd/">
<!ENTITY test-results "&lfs-root;lfs/build-logs/&generic-version;/">
<!ENTITY secadv "&lfs-root;lfs/advisories/">
<!ENTITY min-kernel "3.2">
<!--
<!ENTITY patches-rootd "&lfs-root;patches/lfs/&generic-versiond;/">
<!ENTITY downloads-rootd "&lfs-root;lfs/downloads/&generic-versiond;/">
<!ENTITY test-resultsd "&lfs-root;lfs/build-logs/&generic-versiond;/">
<!ENTITY erratad "&lfs-root;lfs/errata/&generic-versiond;/">
-->
<!ENTITY lfs-ticket-root "https://wiki.linuxfromscratch.org/lfs/ticket/">
<!ENTITY anduin-sources "https://anduin.linuxfromscratch.org/LFS">
<!ENTITY buildtime "Ïðèáëèçèòåëüíîå âðåìÿ ñáîðêè">
<!ENTITY diskspace "Òðåáóåìîå äèñêîâîå ïðîñòðàíñòâî">
<!ENTITY dependencies "Óñòàíîâêà çàâèñèò îò">
<!ENTITY runtime "Òðåáóåòñÿ âî âðåìÿ âûïîëíåíèÿ">
<!ENTITY testsuites "Íàáîð òåñòîâ çàâèñèò îò">
<!ENTITY before "Äîëæåí áûòü óñòàíîâëåí äî">
<!ENTITY external "Íåîáÿçàòåëüíûå çàâèñèìîñòè">
<!ENTITY gnu "https://ftp.gnu.org/gnu/">
<!ENTITY gnu-software "https://www.gnu.org/software/">
<!ENTITY alpha-gnu "https://alpha.gnu.org/gnu/">
<!ENTITY kernel "https://www.kernel.org/pub/">
<!ENTITY sourceforge "https://prdownloads.sourceforge.net/">
<!ENTITY savannah "https://download.savannah.gnu.org">
<!ENTITY savannah-nongnu "https://savannah.nongnu.org">
<!ENTITY github "https://github.com">
<!ENTITY root "<systemitem class='username'>root</systemitem>">
<!ENTITY lfs-user "<systemitem class='username'>lfs</systemitem>">
<!ENTITY % packages-entities SYSTEM "packages.ent">
%packages-entities;
<!ENTITY % patches-entities SYSTEM "patches.ent">
%patches-entities;

67
git-version.sh Normal file
View File

@ -0,0 +1,67 @@
#!/bin/sh
if [ "$1" = sysv ]; then
SYSV="INCLUDE"
SYSTEMD="IGNORE "
elif [ "$1" = systemd ]; then
SYSV="IGNORE "
SYSTEMD="INCLUDE"
else
echo You must provide either \"sysv\" or \"systemd\" as argument
exit 1
fi
echo "<!ENTITY % sysv \"$SYSV\">" > conditional.ent
echo "<!ENTITY % systemd \"$SYSTEMD\">" >> conditional.ent
if ! git status > /dev/null; then
# Either it's not a git repository, or git is unavaliable.
# Just workaround.
echo "<![ %sysv; [" > version.ent
echo "<!ENTITY version \"unknown\">" >> version.ent
echo "]]>" >> version.ent
echo "<![ %systemd; [" >> version.ent
echo "<!ENTITY version \"unknown-systemd\">" >> version.ent
echo "]]>" >> version.ent
echo "<!ENTITY releasedate \"unknown\">" >> version.ent
echo "<!ENTITY copyrightdate \"1999-2022\">" >> version.ent
exit 0
fi
export LC_ALL=en_US.utf8
export TZ=US/Pacific
commit_date=$(git show -s --format=format:"%cd" --date=local)
year=$(date --date "$commit_date" "+%Y")
month=$(date --date "$commit_date" "+%B")
month_digit=$(date --date "$commit_date" "+%m")
day=$(date --date "$commit_date" "+%d" | sed 's/^0//')
case $day in
"1" | "21" | "31" ) suffix="st";;
"2" | "22" ) suffix="nd";;
"3" | "23" ) suffix="rd";;
* ) suffix="th";;
esac
full_date="$month $day$suffix, $year"
sha="$(git describe --abbrev=1)"
rev=$(echo "$sha" | sed 's/-g[^-]*$//')
version="$rev"
versiond="$rev-systemd"
if [ "$(git diff HEAD | wc -l)" != "0" ]; then
version="$version+"
versiond="$versiond+"
fi
echo "<![ %sysv; [" > version.ent
echo "<!ENTITY version \"$version\">" >> version.ent
echo "]]>" >> version.ent
echo "<![ %systemd; [" >> version.ent
echo "<!ENTITY version \"$versiond\">" >> version.ent
echo "]]>" >> version.ent
echo "<!ENTITY releasedate \"$full_date\">" >> version.ent
echo "<!ENTITY copyrightdate \"1999-$year\">" >> version.ent

64
index.xml Normal file
View File

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "general.ent">
%general-entities;
]>
<book>
<!-- Another test -->
<!-- Another test -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="prologue/bookinfo.xml"/>
<!--
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="prologue/dedication.xml"/>
-->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="prologue/preface.xml"/>
<part id="part1">
<title>Ââåäåíèå</title>
<?dbhtml filename="part1.html"?>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter01/chapter01.xml"/>
</part>
<part id="part2">
<title>Ïîäãîòîâêà ê ñáîðêå</title>
<?dbhtml filename="part2.html"?>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter02/chapter02.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter03/chapter03.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter04/chapter04.xml"/>
</part>
<part id="part3">
<title>Ñáîðêà êðîññ-êîìïèëÿòîðà è âðåìåííîãî íàáîðà èíñòðóìåíòîâ</title>
<?dbhtml filename="part3.html"?>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="part3intro/part3intro.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter05/chapter05.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter06/chapter06.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter07/chapter07.xml"/>
</part>
<part id="part4">
<title>Ñáîðêà ñèñòåìû LFS</title>
<?dbhtml filename="part4.html"?>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter08/chapter08.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter09/chapter09.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter10/chapter10.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter11/chapter11.xml"/>
</part>
<part id="part5">
<title>Ïðèëîæåíèÿ</title>
<?dbhtml filename="part5.html"?>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="appendices/acronymlist.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="appendices/acknowledgments.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="appendices/dependencies.xml"/>
<!-- sysv only -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="appendices/scripts.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="appendices/udev-rules.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="appendices/license.xml"/>
</part>
<index/>
</book>

532
lfs-latest-git.php Normal file
View File

@ -0,0 +1,532 @@
#! /usr/bin/php
<?php
$dirs = array();
$vers = array();
date_default_timezone_set( "GMT" );
$date = date( "Y-m-d H:i:s" );
// Special cases
$exceptions = array();
//$exceptions[ 'gmp' ] = "UPDIR=/.*(gmp-\d[\d\.-]*\d).*/:DOWNDIR=";
$regex = array();
//$regex[ 'bzip2' ] = "/^.*current version is ([\d\.]+).*$/";
$regex[ 'check' ] = "/^.*Check (\d[\d\.]+\d).*$/";
$regex[ 'intltool' ] = "/^.*Latest version is (\d[\d\.]+\d).*$/";
$regex[ 'less' ] = "/^.*current released version is less-(\d+).*$/";
$regex[ 'mpfr' ] = "/^mpfr-([\d\.]+)\.tar.*$/";
$regex[ 'Python' ] = "/^.*Latest Python 3.*Python (3[\d\.]+\d).*$/";
$regex[ 'systemd' ] = "/^.*v([\d]+)$/";
//$regex[ 'sysvinit' ] = "/^.*sysvinit-([\d\.]+)dsf\.tar.*$/";
$regex[ 'tzdata' ] = "/^.*tzdata([\d]+[a-z]).*$/";
$regex[ 'xz' ] = "/^.*xz-([\d\.]*\d).*$/";
$regex[ 'zlib' ] = "/^.*zlib ([\d\.]*\d).*$/";
function find_max( $lines, $regex_match, $regex_replace )
{
$a = array();
if ( ! is_array( $lines ) ) return -1;
foreach ( $lines as $line )
{
if ( ! preg_match( $regex_match, $line ) ) continue;
// Isolate the version and put in an array
$slice = preg_replace( $regex_replace, "$1", $line );
if ( $slice == $line ) continue;
array_push( $a, $slice );
}
// SORT_NATURAL requires php-5.4.0 or later
rsort( $a, SORT_NATURAL ); // Max version is at the top
return ( isset( $a[0] ) ) ? $a[0] : -2;
}
function find_even_max( $lines, $regex_match, $regex_replace )
{
$a = array();
foreach ( $lines as $line )
{
if ( ! preg_match( $regex_match, $line ) ) continue;
// Isolate the version and put in an array
$slice = preg_replace( $regex_replace, "$1", $line );
if ( "x$slice" == "x$line" ) continue;
// Skip odd numbered minor versions and minors > 80
list( $major, $minor, $rest ) = explode( ".", $slice . ".0" );
if ( $minor % 2 == 1 ) continue;
if ( $minor > 80 ) continue;
array_push( $a, $slice );
}
rsort( $a, SORT_NATURAL ); // Max version is at the top
return ( isset( $a[0] ) ) ? $a[0] : -2;
}
function http_get_file( $url )
{
if ( ! preg_match( "/sourceforge/", $url ) &&
! preg_match( "/mpfr/", $url ) &&
! preg_match( "/psmisc/", $url ) )
{
exec( "curl --location --silent --max-time 30 $url", $dir );
$s = implode( "\n", $dir );
$dir = strip_tags( $s );
return explode( "\n", $dir );
}
else if ( preg_match( "/mpfr/", $url ) )
{
# There seems to be a problem with the mpfs certificate
exec( "curl --location --silent --insecure --max-time 30 $url", $dir );
$s = implode( "\n", $dir );
$dir = strip_tags( $s );
return explode( "\n", $dir );
}
else
{
exec( "lynx -dump $url 2>/dev/null", $lines );
return $lines;
}
}
function max_parent( $dirpath, $prefix )
{
// First, remove a directory
$dirpath = rtrim ( $dirpath, "/" ); // Trim any trailing slash
$position = strrpos( $dirpath, "/" );
$dirpath = substr ( $dirpath, 0, $position );
$lines = http_get_file( $dirpath );
$regex_match = "#${prefix}[\d\.]+/#";
$regex_replace = "#^.*(${prefix}[\d\.]+)/.*$#";
$max = find_max( $lines, $regex_match, $regex_replace );
return "$dirpath/$max";
}
function get_packages( $package, $dirpath )
{
global $exceptions;
global $regex;
//if ( $package != "psmisc" ) return 0; // debug
if ( $package == "bc" ) $dirpath = "https://github.com/gavinhoward/bc/releases";
if ( $package == "check" ) $dirpath = "https://github.com/libcheck/check/releases";
if ( $package == "e2fsprogs" ) $dirpath = "https://sourceforge.net/projects/e2fsprogs/files/e2fsprogs";
if ( $package == "expat" ) $dirpath = "https://sourceforge.net/projects/expat/files";
if ( $package == "elfutils" ) $dirpath = "https://sourceware.org/ftp/elfutils";
if ( $package == "expect" ) $dirpath = "https://sourceforge.net/projects/expect/files";
if ( $package == "eudev" ) $dirpath = "https://github.com/eudev-project/eudev/releases";
if ( $package == "file" ) $dirpath = "https://github.com/file/file/tags";
if ( $package == "flex" ) $dirpath = "https://github.com/westes/flex/releases";
if ( $package == "gcc" ) $dirpath = max_parent( $dirpath, "gcc-" );
if ( $package == "iana-etc" ) $dirpath = "https://github.com/Mic92/iana-etc/releases";
if ( $package == "intltool" ) $dirpath = "https://launchpad.net/intltool/trunk";
if ( $package == "libffi" ) $dirpath = "https://github.com/libffi/libffi/releases";
if ( $package == "meson" ) $dirpath = "https://github.com/mesonbuild/meson/releases";
if ( $package == "mpc" ) $dirpath = "https://ftp.gnu.org/gnu/mpc";
if ( $package == "mpfr" ) $dirpath = "https://mpfr.loria.fr/mpfr-current";
if ( $package == "ncurses" ) $dirpath = "https://invisible-mirror.net/archives/ncurses";
if ( $package == "ninja" ) $dirpath = "https://github.com/ninja-build/ninja/releases";
if ( $package == "procps-ng" ) $dirpath = "https://gitlab.com/procps-ng/procps/-/tags";
if ( $package == "psmisc" ) $dirpath = "https://gitlab.com/psmisc/psmisc/-/tags";
if ( $package == "Python" ) $dirpath = "https://www.python.org/downloads/source/";
if ( $package == "shadow" ) $dirpath = "https://github.com/shadow-maint/shadow/releases";
if ( $package == "MarkupSafe" ) $dirpath = "https://pypi.python.org/pypi/MarkupSafe/";
if ( $package == "Jinja" ) $dirpath = "https://pypi.python.org/pypi/Jinja2/";
if ( $package == "systemd" ) $dirpath = "https://github.com/systemd/systemd/releases";
//if ( $package == "tcl" ) $dirpath = "https://sourceforge.net/projects/tcl/files";
if ( $package == "tcl" ) $dirpath = "https://www.tcl.tk/software/tcltk/download.html";
if ( $package == "util-linux" ) $dirpath = max_parent( $dirpath, "v." );
if ( $package == "vim" ) $dirpath = "https://github.com/vim/vim/tags";
if ( $package == "wheel" ) $dirpath = "https://pypi.org/project/wheel/#files";
if ( $package == "zstd" ) $dirpath = "https://github.com/facebook/zstd/releases";
// Check for ftp
if ( preg_match( "/^ftp/", $dirpath ) )
{
echo "ftp should not occur\n";
/*
$dirpath = substr( $dirpath, 6 ); // Remove ftp://
$dirpath = rtrim ( $dirpath, "/" ); // Trim any trailing slash
$position = strpos( $dirpath, "/" ); // Divide at first slash
$server = substr( $dirpath, 0, $position );
$path = substr( $dirpath, $position );
$conn = ftp_connect( $server );
ftp_login( $conn, "anonymous", "" );
// See if we need special handling
if ( isset( $exceptions[ $package ] ) )
{
$specials = explode( ":", $exceptions[ $package ] );
foreach ( $specials as $i )
{
list( $op, $regexp ) = explode( "=", $i );
switch ($op)
{
case "UPDIR":
// Remove last dir from $path
$position = strrpos( $path, "/" );
$path = substr( $path, 0, $position );
// Get dir listing
$lines = ftp_rawlist ($conn, $path);
$max = find_max( $lines, $regexp, $regexp );
break;
case "DOWNDIR":
// Append found directory
$path .= "/$max";
break;
default:
echo "Error in specials array for $package\n";
return -5;
break;
}
}
}
$lines = ftp_rawlist ($conn, $path);
ftp_close( $conn );
*/
}
else // http(s)
{
// Customize http directories as needed
if ( $package == "tzdata" )
{
// Remove two directories
$dirpath = rtrim ( $dirpath, "/" ); // Trim any trailing slash
$position = strrpos( $dirpath, "/" );
$dirpath = substr ( $dirpath, 0, $position );
$position = strrpos( $dirpath, "/" );
$dirpath = substr ( $dirpath, 0, $position );
}
$lines = http_get_file( $dirpath );
if ( ! is_array( $lines ) ) return -6;
} // End fetch
if ( isset( $regex[ $package ] ) )
{
// Custom search for latest package name
foreach ( $lines as $l )
{
$ver = preg_replace( $regex[ $package ], "$1", $l );
if ( $ver == $l ) continue;
return $ver; // Return first match of regex
}
return -7; // This is an error
}
if ( $package == "perl" ) // Custom for perl
{
$tmp = array();
foreach ( $lines as $l )
{
if ( preg_match( "/sperl/", $l ) ) continue; // Don't want this
$ver = preg_replace( "/^.*perl-([\d\.]+\d)\.tar.*$/", "$1", $l );
if ( $ver == $l ) continue;
list( $s1, $s2, $rest ) = explode( ".", $ver );
if ( $s2 % 2 == 1 ) continue; // Remove odd minor versions
array_push( $tmp, $l );
}
$lines = $tmp;
}
if ( $package == "attr" ||
$package == "acl" )
{
return find_max( $lines, "/$package/", "/^.*$package-([\d\.-]*\d).tar.*$/" );
}
if ( $package == "e2fsprogs" )
return find_max( $lines, "/v\d/", "/^.*v(\d[\d\.]+\d).*$/" );
if ( $package == "eudev" )
return find_max( $lines, "/Release/", "/^.*Release (\d[\d\.]+\d).*$/" );
if ( $package == "expect" )
return find_max( $lines, "/expect/", "/^.*expect(\d[\d\.]+\d).tar.*$/" );
if ( $package == "elfutils" )
return find_max( $lines, "/^\d/", "/^(\d[\d\.]+\d)\/.*$/" );
if ( $package == "XML-Parser" )
{
$max = find_max( $lines, "/$package/", "/^.*$package-([\d\._]*\d).tar.*$/" );
# 2.44_01 is a developer release
if ( $max == "2.44_01" ) { return "2.44"; }
return $max;
}
if ( $package == "tcl" )
return find_max( $lines, "/tcl\d/", "/^.*tcl(\d\.[\d\.]*\d)-src.*$/" );
if ( $package == "ninja" )
return find_max( $lines, "/v\d/", "/^.*v(\d[\d\.]*\d).*$/" );
if ( $package == "gmp" )
return find_max( $lines, "/$package/", "/^.*$package-([\d\._]*\d[a-z]?).tar.*$/" );
if ( $package == "dbus" )
return find_even_max( $lines, "/$package/", "/^.*$package-([\d\.]+).tar.*$/" );
if ( $package == "file" )
{
$max = find_max( $lines, "/FILE5/", "/^.*FILE(5_\d+)*$/" );
return str_replace( "_", ".", $max );
}
if ( $package == "procps-ng" )
return find_max( $lines, "/v\d/", "/^.*v([\d\.]+)$/" );
if ( $package == "psmisc" )
return find_max( $lines, "/v\d/", "/^.*v([\d\.]+).tar.*$/" );
if ( $package == "grub" )
return find_max( $lines, "/grub/", "/^.*grub-([\d\.]+).tar.xz.*$/" );
if ( $package == "Jinja" )
return find_max( $lines, "/Jinja/", "/^.*Jinja2 ([\d\.]+).*$/" );
if ( $package == "openssl" )
return find_max( $lines, "/openssl/", "/^.*openssl-([\d\.p]*\d.?).tar.*$/" );
if ( $package == "vim" )
return find_max( $lines, "/v\d\./", "/^.*v([\d\.]+).*$/" );
if ( $package == "zstd" )
return find_max( $lines, "/Zstandard v/", "/^.*v([\d\.]+).*$/" );
// Most packages are in the form $package-n.n.n
// Occasionally there are dashes (e.g. 201-1)
return find_max( $lines, "/$package/", "/^.*$package-([\d\.-]*\d)\.tar.*$/" );
}
function get_current()
{
global $dirs;
global $vers;
// Fetech from git and get wget-list
$current = array();
#$lfssvn = "svn://svn.linuxfromscratch.org/LFS/trunk";
$lfsgit = "git://git.linuxfromscratch.org/lfs.git";
$tmpdir = exec( "mktemp -d /tmp/lfscheck.XXXXXX" );
$cdir = getcwd();
chdir( $tmpdir );
#exec ( "svn --quiet export $lfssvn LFS" );
exec ( "git clone $lfsgit LFS" );
# Make version.ent
chdir( "$tmpdir/LFS" );
exec ( "./git-version.sh systemd" );
chdir( $cdir );
$PAGE = "$tmpdir/LFS/chapter03/chapter03.xml";
$STYLESHEET = "$tmpdir/LFS/stylesheets/wget-list.xsl";
exec( "xsltproc --xinclude --nonet $STYLESHEET $PAGE", $current );
exec( "rm -rf $tmpdir" );
foreach ( $current as $line )
{
$file = basename( $line ) . "\n";
if ( preg_match( "/patch$/", $file ) ) { continue; } // Skip patches
$file = preg_replace( "/bz2/", '', $file ); // The 2 confusses the regex
$file = rtrim( $file );
$pkg_pattern = "/(\D*).*/";
//$pattern = "/\D*(\d.*\d)\D*/";
$pattern = "/\D*(\d.*\d)\D*/";
if ( preg_match( "/e2fsprogs/", $file ) )
{
$pattern = "/e2\D*(\d.*\d)\D*/";
$pkg_pattern = "/(e2\D*).*/";
}
else if ( preg_match( "/tzdata/", $file ) )
{
$pattern = "/\D*(\d.*[a-z])\.tar\D*/";
}
else if ( preg_match( "/openssl/", $file ) )
{
$pattern = "/\D*(\d.*\d.*).tar.*$/";
}
else if ( preg_match( "/gmp/", $file ) )
{
$pattern = "/\D*(\d.*[a-z]*)\.tar\D*/";
}
else if ( preg_match( "/systemd-man-pages/", $file ) ) continue;
else if ( preg_match( "/python/" , $file ) ) continue;
$version = preg_replace( $pattern, "$1", $file ); // Isolate version
$version = preg_replace( "/^\d-/", "", $version ); // Remove leading #-
// Touch up package names
$pkg_name = preg_replace( $pkg_pattern, "$1", $file );
$pkg_name = trim( $pkg_name, "-" );
if ( preg_match( "/bzip|iproute/", $pkg_name ) ) { $pkg_name .= "2"; }
if ( preg_match( "/^m$/" , $pkg_name ) ) { $pkg_name .= "4"; }
if ( preg_match( "/shadow/" , $pkg_name ) ) { $pkg_name = "shadow"; }
$dirs[ $pkg_name ] = dirname( $line );
$vers[ $pkg_name ] = $version;
}
}
function mail_to_lfs()
{
global $date;
global $vers;
global $dirs;
$to = "lfs-book@lists.linuxfromscratch.org";
$from = "bdubbs@linuxfromscratch.org";
$subject = "LFS Package Currency Check - $date GMT";
$headers = "From: bdubbs@linuxfromscratch.org";
$message = "Package LFS Upstream Flag\n\n";
foreach ( $dirs as $pkg => $dir )
{
//if ( $pkg != "gmp" ) continue; //debug
$v = get_packages( $pkg, $dir );
$flag = ( $vers[ $pkg ] != $v ) ? "*" : "";
// Pad for output
$pad = " ";
$p = substr( $pkg . $pad, 0, 15 );
$l = substr( $vers[ $pkg ] . $pad, 0, 10 );
$c = substr( $v . $pad, 0, 10 );
$message .= "$p $l $c $flag\n";
}
exec ( "echo '$message' | mailx -r $from -s '$subject' $to" );
}
function html()
{
global $date;
global $vers;
global $dirs;
echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<title>LFS Package Currency Check - $date</title>
<style type='text/css'>
h1, h2 {
text-align : center;
}
table {
border-width : 1px;
border-spacing : 0px;
border-style : outset;
border-color : gray;
border-collapse : separate;
background-color: white;
margin : 0px auto;
}
table th {
border-width : 1px;
padding : 2px;
border-style : inset;
border-color : gray;
background-color: white;
}
table td {
border-width : 1px;
padding : 2px;
border-style : inset;
border-color : gray;
background-color: white;
}
</style>
</head>
<body>
<h1>LFS Package Currency Check</h1>
<h2>As of $date GMT</h1>
<table>
<tr><th>LFS Package</th> <th>LFS Version</th> <th>Latest</th> <th>Flag</th></tr>\n";
// Get the latest version of each package
foreach ( $dirs as $pkg => $dir )
{
$v = get_packages( $pkg, $dir );
$flag = ( $vers[ $pkg ] != $v ) ? "*" : "";
echo "<tr><td>$pkg</td> <td>${vers[ $pkg ]}</td> <td>$v</td> <td>$flag</td></tr>\n";
}
echo "</table>
</body>
</html>\n";
}
function write_to_stdout()
{
global $date;
global $vers;
global $dirs;
echo "
LFS Package Currency Check
As of $date GMT
LFS Package LFS Version Latest Flag\n";
// Get the latest version of each package
foreach ( $dirs as $pkg => $dir )
{
$p_name = sprintf( "%-15s", $pkg ); // package name formatted
$b_version = $vers[ $pkg ]; // book version
$b_string = sprintf( "%-11s", $b_version ); // book version formatted
$latest = get_packages( $pkg, $dir ); // latest version
$l_string = sprintf( "%-6s", $latest ); // latest version formatted
$flag = ( $b_version != $latest ) ? "*" : "";
echo "$p_name $b_string $l_string $flag\n";
}
}
get_current(); // Get what is in the book
mail_to_lfs();
//html(); // Write html output
//write_to_stdout(); // For debugging
?>

481
lfs-latest.php Normal file
View File

@ -0,0 +1,481 @@
#! /usr/bin/php
<?php
$dirs = array();
$vers = array();
date_default_timezone_set( "GMT" );
$date = date( "Y-m-d H:i:s" );
// Special cases
$exceptions = array();
//$exceptions[ 'gmp' ] = "UPDIR=/.*(gmp-\d[\d\.-]*\d).*/:DOWNDIR=";
$regex = array();
//$regex[ 'bzip2' ] = "/^.*current version is ([\d\.]+).*$/";
$regex[ 'check' ] = "/^.*Check (\d[\d\.]+\d).*$/";
$regex[ 'intltool' ] = "/^.*Latest version is (\d[\d\.]+\d).*$/";
$regex[ 'less' ] = "/^.*current released version is less-(\d+).*$/";
$regex[ 'mpfr' ] = "/^mpfr-([\d\.]+)\.tar.*$/";
$regex[ 'Python' ] = "/^.*Latest Python 3.*Python (3[\d\.]+\d).*$/";
$regex[ 'systemd' ] = "/^.*v([\d]+)$/";
//$regex[ 'sysvinit' ] = "/^.*sysvinit-([\d\.]+)dsf\.tar.*$/";
$regex[ 'tzdata' ] = "/^.*tzdata([\d]+[a-z]).*$/";
$regex[ 'xz' ] = "/^.*xz-([\d\.]*\d).*$/";
$regex[ 'zlib' ] = "/^.*zlib ([\d\.]*\d).*$/";
function find_max( $lines, $regex_match, $regex_replace )
{
$a = array();
if ( ! is_array( $lines ) ) return -1;
foreach ( $lines as $line )
{
if ( ! preg_match( $regex_match, $line ) ) continue;
// Isolate the version and put in an array
$slice = preg_replace( $regex_replace, "$1", $line );
if ( $slice == $line ) continue;
array_push( $a, $slice );
}
// SORT_NATURAL requires php-5.4.0 or later
rsort( $a, SORT_NATURAL ); // Max version is at the top
return ( isset( $a[0] ) ) ? $a[0] : -2;
}
function find_even_max( $lines, $regex_match, $regex_replace )
{
$a = array();
foreach ( $lines as $line )
{
if ( ! preg_match( $regex_match, $line ) ) continue;
// Isolate the version and put in an array
$slice = preg_replace( $regex_replace, "$1", $line );
if ( "x$slice" == "x$line" ) continue;
// Skip odd numbered minor versions and minors > 80
list( $major, $minor, $rest ) = explode( ".", $slice . ".0" );
if ( $minor % 2 == 1 ) continue;
if ( $minor > 80 ) continue;
array_push( $a, $slice );
}
rsort( $a, SORT_NATURAL ); // Max version is at the top
return ( isset( $a[0] ) ) ? $a[0] : -2;
}
function http_get_file( $url )
{
if ( ! preg_match( "/sourceforge/", $url ) &&
! preg_match( "/psmisc/", $url ) )
{
exec( "curl --location --silent --max-time 30 $url", $dir );
$s = implode( "\n", $dir );
$dir = strip_tags( $s );
return explode( "\n", $dir );
}
else
{
exec( "links -dump $url 2>/dev/null", $lines );
return $lines;
}
}
function max_parent( $dirpath, $prefix )
{
// First, remove a directory
$dirpath = rtrim ( $dirpath, "/" ); // Trim any trailing slash
$position = strrpos( $dirpath, "/" );
$dirpath = substr ( $dirpath, 0, $position );
$lines = http_get_file( $dirpath );
$regex_match = "#${prefix}[\d\.]+/#";
$regex_replace = "#^.*(${prefix}[\d\.]+)/.*$#";
$max = find_max( $lines, $regex_match, $regex_replace );
return "$dirpath/$max";
}
function get_packages( $package, $dirpath )
{
global $exceptions;
global $regex;
//if ( $package != "psmisc" ) return 0; // Debug
if ( $package == "bc" ) $dirpath = "https://github.com/gavinhoward/bc/releases";
if ( $package == "check" ) $dirpath = "https://github.com/libcheck/check/releases";
if ( $package == "e2fsprogs" ) $dirpath = "http://sourceforge.net/projects/e2fsprogs/files/e2fsprogs";
if ( $package == "expat" ) $dirpath = "http://sourceforge.net/projects/expat/files";
if ( $package == "elfutils" ) $dirpath = "https://sourceware.org/ftp/elfutils";
if ( $package == "expect" ) $dirpath = "http://sourceforge.net/projects/expect/files";
if ( $package == "file" ) $dirpath = "https://github.com/file/file/releases";
if ( $package == "flex" ) $dirpath = "https://github.com/westes/flex/releases";
if ( $package == "gcc" ) $dirpath = max_parent( $dirpath, "gcc-" );
if ( $package == "iana-etc" ) $dirpath = "https://github.com/Mic92/iana-etc/releases";
if ( $package == "intltool" ) $dirpath = "https://launchpad.net/intltool/trunk";
if ( $package == "meson" ) $dirpath = "https://github.com/mesonbuild/meson/releases";
if ( $package == "mpc" ) $dirpath = "https://ftp.gnu.org/gnu/mpc";
if ( $package == "mpfr" ) $dirpath = "http://mpfr.loria.fr/mpfr-current";
if ( $package == "ninja" ) $dirpath = "https://github.com/ninja-build/ninja/releases";
if ( $package == "procps-ng" ) $dirpath = "https://gitlab.com/procps-ng/procps/-/tags";
if ( $package == "psmisc" ) $dirpath = "https://gitlab.com/psmisc/psmisc/-/tags";
if ( $package == "Python" ) $dirpath = "https://www.python.org/downloads/source/";
if ( $package == "shadow" ) $dirpath = "https://github.com/shadow-maint/shadow/releases";
if ( $package == "systemd" ) $dirpath = "https://github.com/systemd/systemd/releases";
if ( $package == "tcl" ) $dirpath = "http://sourceforge.net/projects/tcl/files";
if ( $package == "util-linux" ) $dirpath = max_parent( $dirpath, "v." );
if ( $package == "vim" ) $dirpath = "https://github.com/vim/vim/releases";
if ( $package == "zstd" ) $dirpath = "https://github.com/facebook/zstd/releases";
//if ( $package == "vim" ) $dirpath = "ftp://ftp.vim.org/pub/vim/unix";
// Check for ftp
if ( preg_match( "/^ftp/", $dirpath ) )
{
$dirpath = substr( $dirpath, 6 ); // Remove ftp://
$dirpath = rtrim ( $dirpath, "/" ); // Trim any trailing slash
$position = strpos( $dirpath, "/" ); // Divide at first slash
$server = substr( $dirpath, 0, $position );
$path = substr( $dirpath, $position );
$conn = ftp_connect( $server );
ftp_login( $conn, "anonymous", "" );
// See if we need special handling
if ( isset( $exceptions[ $package ] ) )
{
$specials = explode( ":", $exceptions[ $package ] );
foreach ( $specials as $i )
{
list( $op, $regexp ) = explode( "=", $i );
switch ($op)
{
case "UPDIR":
// Remove last dir from $path
$position = strrpos( $path, "/" );
$path = substr( $path, 0, $position );
// Get dir listing
$lines = ftp_rawlist ($conn, $path);
$max = find_max( $lines, $regexp, $regexp );
break;
case "DOWNDIR":
// Append found directory
$path .= "/$max";
break;
default:
echo "Error in specials array for $package\n";
return -5;
break;
}
}
}
$lines = ftp_rawlist ($conn, $path);
ftp_close( $conn );
}
else // http
{
// Customize http directories as needed
if ( $package == "tzdata" )
{
// Remove two directories
$dirpath = rtrim ( $dirpath, "/" ); // Trim any trailing slash
$position = strrpos( $dirpath, "/" );
$dirpath = substr ( $dirpath, 0, $position );
$position = strrpos( $dirpath, "/" );
$dirpath = substr ( $dirpath, 0, $position );
}
//if ( $package == "bzip2" )
//{
// // Remove one directory
// $dirpath = rtrim ( $dirpath, "/" ); // Trim any trailing slash
// $position = strrpos( $dirpath, "/" );
// $dirpath = substr ( $dirpath, 0, $position );
//}
$lines = http_get_file( $dirpath );
if ( ! is_array( $lines ) ) return -6;
} // End fetch
//print_r($lines);
if ( isset( $regex[ $package ] ) )
{
// Custom search for latest package name
foreach ( $lines as $l )
{
$ver = preg_replace( $regex[ $package ], "$1", $l );
if ( $ver == $l ) continue;
return $ver; // Return first match of regex
}
return -7; // This is an error
}
if ( $package == "perl" ) // Custom for perl
{
$tmp = array();
foreach ( $lines as $l )
{
if ( preg_match( "/sperl/", $l ) ) continue; // Don't want this
$ver = preg_replace( "/^.*perl-([\d\.]+\d)\.tar.*$/", "$1", $l );
if ( $ver == $l ) continue;
list( $s1, $s2, $rest ) = explode( ".", $ver );
if ( $s2 % 2 == 1 ) continue; // Remove odd minor versions
array_push( $tmp, $l );
}
$lines = $tmp;
}
if ( $package == "attr" ||
$package == "acl" )
{
return find_max( $lines, "/$package/", "/^.*$package-([\d\.-]*\d).tar.*$/" );
}
if ( $package == "e2fsprogs" )
return find_max( $lines, "/v\d/", "/^.*v(\d[\d\.]+\d).*$/" );
if ( $package == "expect" )
return find_max( $lines, "/expect/", "/^.*expect(\d[\d\.]+\d).tar.*$/" );
if ( $package == "elfutils" )
return find_max( $lines, "/^\d/", "/^(\d[\d\.]+\d)\/.*$/" );
if ( $package == "XML-Parser" )
{
$max = find_max( $lines, "/$package/", "/^.*$package-([\d\._]*\d).tar.*$/" );
# 2.44_01 is a developer release
if ( $max == "2.44_01" ) { return "2.44"; }
return $max;
}
if ( $package == "tcl" )
return find_max( $lines, "/tcl/", "/^.*tcl(\d[\d\.]*\d)-src.*$/" );
if ( $package == "ninja" )
return find_max( $lines, "/v\d/", "/^.*v(\d[\d\.]*\d).*$/" );
if ( $package == "gmp" )
return find_max( $lines, "/$package/", "/^.*$package-([\d\._]*\d[a-z]?).tar.*$/" );
if ( $package == "dbus" )
return find_even_max( $lines, "/$package/", "/^.*$package-([\d\.]+).tar.*$/" );
if ( $package == "file" )
{
$max = find_max( $lines, "/FILE5/", "/^.*FILE(5_\d+)*$/" );
return str_replace( "_", ".", $max );
}
if ( $package == "procps-ng" )
return find_max( $lines, "/v\d/", "/^.*v([\d\.]+)$/" );
if ( $package == "psmisc" )
return find_max( $lines, "/v\d/", "/^.*v([\d\.]+) .*$/" );
if ( $package == "grub" )
return find_max( $lines, "/grub/", "/^.*grub-(\d\..*).tar.xz.*$/" );
if ( $package == "openssl" )
return find_max( $lines, "/openssl/", "/^.*openssl-([\d\.p]*\d.?).tar.*$/" );
if ( $package == "vim" )
return find_max( $lines, "/v\d\./", "/^.*v([\d\.]+).*$/" );
if ( $package == "zstd" )
return find_max( $lines, "/Zstandard v/", "/^.*v([\d\.]+).*$/" );
// Most packages are in the form $package-n.n.n
// Occasionally there are dashes (e.g. 201-1)
return find_max( $lines, "/$package/", "/^.*$package-([\d\.-]*\d)\.tar.*$/" );
}
function get_current()
{
global $dirs;
global $vers;
// Fetech from svn and get wget-list
$current = array();
$lfssvn = "svn://svn.linuxfromscratch.org/LFS/trunk";
$tmpdir = exec( "mktemp -d /tmp/lfscheck.XXXXXX" );
$cdir = getcwd();
chdir( $tmpdir );
exec ( "svn --quiet export $lfssvn LFS" );
chdir( $cdir );
$PAGE = "$tmpdir/LFS/BOOK/chapter03/chapter03.xml";
$STYLESHEET = "$tmpdir/LFS/BOOK/stylesheets/wget-list.xsl";
exec( "xsltproc --xinclude --nonet $STYLESHEET $PAGE", $current );
exec( "rm -rf $tmpdir" );
foreach ( $current as $line )
{
$file = basename( $line ) . "\n";
if ( preg_match( "/patch$/", $file ) ) { continue; } // Skip patches
$file = preg_replace( "/bz2/", '', $file ); // The 2 confusses the regex
$file = rtrim( $file );
$pkg_pattern = "/(\D*).*/";
//$pattern = "/\D*(\d.*\d)\D*/";
$pattern = "/\D*(\d.*\d)\D*/";
if ( preg_match( "/e2fsprogs/", $file ) )
{
$pattern = "/e2\D*(\d.*\d)\D*/";
$pkg_pattern = "/(e2\D*).*/";
}
else if ( preg_match( "/tzdata/", $file ) )
{
$pattern = "/\D*(\d.*[a-z])\.tar\D*/";
}
else if ( preg_match( "/openssl/", $file ) )
{
$pattern = "/\D*(\d.*\d.*).tar.*$/";
}
else if ( preg_match( "/gmp/", $file ) )
{
$pattern = "/\D*(\d.*[a-z]*)\.tar\D*/";
}
else if ( preg_match( "/systemd-man-pages/", $file ) ) continue;
else if ( preg_match( "/python/" , $file ) ) continue;
$version = preg_replace( $pattern, "$1", $file ); // Isolate version
$version = preg_replace( "/^\d-/", "", $version ); // Remove leading #-
// Touch up package names
$pkg_name = preg_replace( $pkg_pattern, "$1", $file );
$pkg_name = trim( $pkg_name, "-" );
if ( preg_match( "/bzip|iproute/", $pkg_name ) ) { $pkg_name .= "2"; }
if ( preg_match( "/^m$/" , $pkg_name ) ) { $pkg_name .= "4"; }
if ( preg_match( "/shadow/" , $pkg_name ) ) { $pkg_name = "shadow"; }
$dirs[ $pkg_name ] = dirname( $line );
$vers[ $pkg_name ] = $version;
}
}
function mail_to_lfs()
{
global $date;
global $vers;
global $dirs;
//$to = "bruce.dubbs@gmail.com";
$to = "lfs-book@lists.linuxfromscratch.org";
$from = "bdubbs@linuxfromscratch.org";
$subject = "LFS Package Currency Check - $date GMT";
$headers = "From: bdubbs@anduin.linuxfromscratch.org";
$message = "Package LFS Upstream Flag\n\n";
foreach ( $dirs as $pkg => $dir )
{
//if ( $pkg != "gmp" ) continue; //debug
$v = get_packages( $pkg, $dir );
$flag = ( $vers[ $pkg ] != $v ) ? "*" : "";
// Pad for output
$pad = " ";
$p = substr( $pkg . $pad, 0, 15 );
$l = substr( $vers[ $pkg ] . $pad, 0, 10 );
$c = substr( $v . $pad, 0, 10 );
$message .= "$p $l $c $flag\n";
}
exec ( "echo '$message' | mailx -r $from -s '$subject' $to" );
//echo $message;
}
function html()
{
global $date;
global $vers;
global $dirs;
echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<title>LFS Package Currency Check - $date</title>
<style type='text/css'>
h1, h2 {
text-align : center;
}
table {
border-width : 1px;
border-spacing : 0px;
border-style : outset;
border-color : gray;
border-collapse : separate;
background-color: white;
margin : 0px auto;
}
table th {
border-width : 1px;
padding : 2px;
border-style : inset;
border-color : gray;
background-color: white;
}
table td {
border-width : 1px;
padding : 2px;
border-style : inset;
border-color : gray;
background-color: white;
}
</style>
</head>
<body>
<h1>LFS Package Currency Check</h1>
<h2>As of $date GMT</h1>
<table>
<tr><th>LFS Package</th> <th>LFS Version</th> <th>Latest</th> <th>Flag</th></tr>\n";
// Get the latest version of each package
foreach ( $dirs as $pkg => $dir )
{
$v = get_packages( $pkg, $dir );
$flag = ( $vers[ $pkg ] != $v ) ? "*" : "";
echo "<tr><td>$pkg</td> <td>${vers[ $pkg ]}</td> <td>$v</td> <td>$flag</td></tr>\n";
}
echo "</table>
</body>
</html>\n";
}
get_current(); // Get what is in the book
mail_to_lfs();
//html(); // Write html output
?>

22
make-aux-files.sh Normal file
View File

@ -0,0 +1,22 @@
#!/bin/bash
rm -f lfs-bootscripts*.tar.?z*
# Get base file name and move bootscripts directory to that name
version=`grep "ENTITY lfs-bootscripts-version" packages.ent | head -n1| cut -d'"' -f2`
mv bootscripts lfs-bootscripts-$version
# Create the tarball and clean up
tar -cJf lfs-bootscripts-$version.tar.xz --exclude .svn lfs-bootscripts-$version
mv lfs-bootscripts-$version bootscripts
#rm -f udev-config*.bz2
# Get file name and move udev config directory to that name
#version=`grep "ENTITY udev-config " packages.ent |cut -d'"' -f2`
#mv udev-config $version
# Create the tarball and clean up
#tar -cjf $version.tar.bz2 --exclude .svn $version
#mv $version udev-config

39
obfuscate.sh Normal file
View File

@ -0,0 +1,39 @@
#!/bin/bash
# obfuscate.sh
# obfuscate email addresses in XML/HTML
# Script written (and slight perl modification) by Archaic <archaic AT linuxfromscratch D0T org>
# Modified from "sed -i" to old style "sed -e" by Manuel Canales <manuel AT linuxfromscratch D0T org>
# to prevent hangs on very long files, like nonckunked books.
# Original Perl expression by Anderson Lizardo <lizardo AT linuxfromscratch D0T org>
# Released under the GNU General Public License
#
# This script currently only seeks out mailto: addresses. If those same
# addresses also appear in plaintext, we need to obfuscate those as well.
#
# This script was made for a very specific purpose so I was a bit lazy in
# writing the regex's.
#
# Please send comments, enhancements, etc. to the above address
#set -e # Bail on all errors
# First, ensure that we are given a file to process
# if [ $# -lt 1 ]; then
# echo -e "\nYou must provide an input file."
# exit 1
# fi
# Nothing like a backup plan!
#cp "$1" "$1".bak
for i in `grep -o '"mailto:.*@.*"' ${1} |sed -e 's|^"mailto:||' -e 's|"$||'`; do
link=`echo $i | perl -pe 's/[^\n]/"\\\&#".ord($&)."\;"/ge'`
plaintext=`echo $i | sed -e 's|@| AT |' -e 's|\.| D0T |g'`
cp ${1}{,.tmp}
sed -e "s|mailto:$i|mailto:$link|" \
-e "s|$i|$plaintext|" ${1}.tmp > ${1}
rm ${1}.tmp
done
#rm $FILE.tmp
#exit 0

778
packages.ent Normal file
View File

@ -0,0 +1,778 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Notes:
For empty *-home entities use " " not ""
Packages sizes allways in KB
Allowed deviation in SBUs : 10%
Allowed deviation in disk usage : 2%
Suffixes:
*-tmp-* Package info for Temporary Tools
*-fin-* Package info for Final System
*-cfg-* Package info for System Configuration
*-knl-* Package info for Kernel stuff
-->
<!ENTITY acl-version "2.3.1">
<!ENTITY acl-size "348 KB">
<!ENTITY acl-url "&savannah;/releases/acl/acl-&acl-version;.tar.xz">
<!ENTITY acl-md5 "95ce715fe09acca7c12d3306d0f076b2">
<!ENTITY acl-home "&savannah-nongnu;/projects/acl">
<!ENTITY acl-fin-du "6.1 MB">
<!ENTITY acl-fin-sbu "0.1 SBU">
<!ENTITY attr-version "2.5.1">
<!ENTITY attr-size "456 KB">
<!ENTITY attr-url "&savannah;/releases/attr/attr-&attr-version;.tar.gz">
<!ENTITY attr-md5 "ac1c5a7a084f0f83b8cace34211f64d8">
<!ENTITY attr-home "&savannah-nongnu;/projects/attr">
<!ENTITY attr-fin-du "4.1 MB">
<!ENTITY attr-fin-sbu "less than 0.1 SBU">
<!ENTITY autoconf-version "2.71">
<!ENTITY autoconf-size "1,263 KB">
<!ENTITY autoconf-url "&gnu;autoconf/autoconf-&autoconf-version;.tar.xz">
<!ENTITY autoconf-md5 "12cfa1687ffa2606337efe1a64416106">
<!ENTITY autoconf-home "&gnu-software;autoconf/">
<!ENTITY autoconf-fin-du "24 MB">
<!ENTITY autoconf-fin-sbu-tests "6.8">
<!ENTITY autoconf-fin-sbu "less than 0.1 SBU (about &autoconf-fin-sbu-tests; SBU with tests)">
<!ENTITY automake-version "1.16.5">
<!ENTITY am-minor-version "1.16">
<!ENTITY automake-size "1,565 KB">
<!ENTITY automake-url "&gnu;automake/automake-&automake-version;.tar.xz">
<!ENTITY automake-md5 "4017e96f89fca45ca946f1c5db6be714">
<!ENTITY automake-sha256 "80facc09885a57e6d49d06972c0ae1089c5fa8f4d4c7cfe5baea58e5085f136d">
<!ENTITY automake-home "&gnu-software;automake/">
<!ENTITY automake-fin-du "115 MB">
<!ENTITY automake-fin-sbu "less than 0.1 SBU (about 8.3 SBU with tests)">
<!ENTITY bash-version "5.1.16">
<!ENTITY bash-size "10,277 KB">
<!ENTITY bash-url "&gnu;bash/bash-&bash-version;.tar.gz">
<!ENTITY bash-md5 "c17b20a09fc38d67fb303aeb6c130b4e">
<!ENTITY bash-home "&gnu-software;bash/">
<!ENTITY bash-tmp-du "64 MB">
<!ENTITY bash-tmp-sbu "0.4 SBU">
<!ENTITY bash-fin-du "50 MB">
<!ENTITY bash-fin-sbu "1.5 SBU">
<!ENTITY bc-version "5.2.5">
<!ENTITY bc-size "428 KB">
<!ENTITY bc-url "https://github.com/gavinhoward/bc/releases/download/&bc-version;/bc-&bc-version;.tar.xz">
<!ENTITY bc-md5 "7b154ecc65aa07164c09de9fd88c7fc6">
<!ENTITY bc-home "https://git.yzena.com/gavin/bc">
<!ENTITY bc-fin-du "7.1 MB">
<!ENTITY bc-fin-sbu "less than 0.1 SBU">
<!ENTITY binutils-version "2.38">
<!ENTITY binutils-size "23,098 KB">
<!ENTITY binutils-url "&gnu;binutils/binutils-&binutils-version;.tar.xz">
<!ENTITY binutils-md5 "6e39cad1bb414add02b5b1169c18fdc5">
<!ENTITY binutils-home "&gnu-software;binutils/">
<!ENTITY binutils-tmpp1-du "620 MB">
<!ENTITY binutils-tmpp1-sbu "1 SBU">
<!ENTITY binutils-tmpp2-du "520 MB">
<!ENTITY binutils-tmpp2-sbu "1.3 SBU">
<!ENTITY binutils-fin-du "4.6 GB">
<!ENTITY binutils-fin-sbu "6.1 SBU">
<!ENTITY bison-version "3.8.2">
<!ENTITY bison-size "2,752 KB">
<!ENTITY bison-url "&gnu;bison/bison-&bison-version;.tar.xz">
<!ENTITY bison-md5 "c28f119f405a2304ff0a7ccdcc629713">
<!ENTITY bison-home "&gnu-software;bison/">
<!ENTITY bison-tmp-du "50 MB">
<!ENTITY bison-tmp-sbu "0.3 SBU">
<!ENTITY bison-fin-du "53 MB">
<!ENTITY bison-fin-sbu "6.3 SBU">
<!ENTITY bzip2-version "1.0.8">
<!ENTITY bzip2-size "792 KB">
<!ENTITY bzip2-url "https://www.sourceware.org/pub/bzip2/bzip2-&bzip2-version;.tar.gz">
<!ENTITY bzip2-md5 "67e051268d0c475ea773822f7500d0e5">
<!ENTITY bzip2-home "https://sourceware.org/bzip2/">
<!ENTITY bzip2-fin-du "7.2 MB">
<!ENTITY bzip2-fin-sbu "less than 0.1 SBU">
<!ENTITY check-version "0.15.2">
<!ENTITY check-size "760 KB">
<!ENTITY check-url "&github;/libcheck/check/releases/download/&check-version;/check-&check-version;.tar.gz">
<!ENTITY check-md5 "50fcafcecde5a380415b12e9c574e0b2">
<!ENTITY check-home "https://libcheck.github.io/check">
<!ENTITY check-fin-du "12 MB">
<!ENTITY check-fin-sbu "0.1 SBU (about 3.8 SBU with tests)">
<!ENTITY coreutils-version "9.1">
<!ENTITY coreutils-size "5,570 KB">
<!ENTITY coreutils-url "&gnu;coreutils/coreutils-&coreutils-version;.tar.xz">
<!ENTITY coreutils-md5 "8b1ca4e018a7dce9bb937faec6618671">
<!ENTITY coreutils-home "&gnu-software;coreutils/">
<!ENTITY coreutils-tmp-du "158 MB">
<!ENTITY coreutils-tmp-sbu "0.6 SBU">
<!ENTITY coreutils-fin-du "153 MB">
<!ENTITY coreutils-fin-sbu "2.6 SBU">
<!ENTITY dbus-version "1.14.0">
<!ENTITY dbus-size "1,332 KB">
<!ENTITY dbus-url "https://dbus.freedesktop.org/releases/dbus/dbus-&dbus-version;.tar.xz">
<!ENTITY dbus-md5 "ddd5570aff05191dbee8e42d751f1b7d">
<!ENTITY dbus-home "https://www.freedesktop.org/wiki/Software/dbus">
<!ENTITY dbus-fin-du "18 MB">
<!ENTITY dbus-fin-sbu "0.1 SBU">
<!ENTITY dejagnu-version "1.6.3">
<!ENTITY dejagnu-size "608 KB">
<!ENTITY dejagnu-url "&gnu;dejagnu/dejagnu-&dejagnu-version;.tar.gz">
<!ENTITY dejagnu-md5 "68c5208c58236eba447d7d6d1326b821">
<!ENTITY dejagnu-home "&gnu-software;dejagnu/">
<!ENTITY dejagnu-tmp-du "6.9 MB">
<!ENTITY dejagnu-tmp-sbu "less than 0.1 SBU">
<!ENTITY diffutils-version "3.8">
<!ENTITY diffutils-size "1,548 KB">
<!ENTITY diffutils-url "&gnu;diffutils/diffutils-&diffutils-version;.tar.xz">
<!ENTITY diffutils-md5 "6a6b0fdc72acfe3f2829aab477876fbc">
<!ENTITY diffutils-home "&gnu-software;diffutils/">
<!ENTITY diffutils-tmp-du "27 MB">
<!ENTITY diffutils-tmp-sbu "0.2 SBU">
<!ENTITY diffutils-fin-du "34 MB">
<!ENTITY diffutils-fin-sbu "0.6 SBU">
<!ENTITY e2fsprogs-version "1.46.5">
<!ENTITY e2fsprogs-size "9,307 KB">
<!ENTITY e2fsprogs-url "https://downloads.sourceforge.net/project/e2fsprogs/e2fsprogs/v&e2fsprogs-version;/e2fsprogs-&e2fsprogs-version;.tar.gz">
<!ENTITY e2fsprogs-md5 "3da91854c960ad8a819b48b2a404eb43">
<!ENTITY e2fsprogs-home "http://e2fsprogs.sourceforge.net/">
<!ENTITY e2fsprogs-fin-du "93 MB">
<!ENTITY e2fsprogs-fin-sbu "4.4 SBU on a spinning disk, 1.3 SBU on an SSD">
<!ENTITY elfutils-version "0.187"> <!-- libelf -->
<!ENTITY elfutils-size "9,024 KB">
<!ENTITY elfutils-url "https://sourceware.org/ftp/elfutils/&elfutils-version;/elfutils-&elfutils-version;.tar.bz2">
<!ENTITY elfutils-md5 "cc04f07b53a71616b22553c0a458cf4b">
<!ENTITY elfutils-home "https://sourceware.org/elfutils/">
<!ENTITY elfutils-fin-du "116 MB">
<!ENTITY elfutils-fin-sbu "0.9 SBU">
<!ENTITY eudev-version "3.2.11">
<!ENTITY eudev-size "2,075 KB">
<!ENTITY eudev-url "https://github.com/eudev-project/eudev/releases/download/v&eudev-version;/eudev-&eudev-version;.tar.gz">
<!ENTITY eudev-md5 "417ba948335736d4d81874fba47a30f7">
<!ENTITY eudev-fin-du "83 MB">
<!ENTITY eudev-fin-sbu "0.2 SBU">
<!ENTITY expat-version "2.4.8">
<!ENTITY expat-size "444 KB">
<!ENTITY expat-url "&sourceforge;expat/expat-&expat-version;.tar.xz">
<!ENTITY expat-md5 "0584a7318a4c007f7ec94778799d72fe">
<!ENTITY expat-home "https://libexpat.github.io/">
<!ENTITY expat-fin-du "12 MB">
<!ENTITY expat-fin-sbu "0.1 SBU">
<!ENTITY expect-version "5.45.4">
<!ENTITY expect-size "618 KB">
<!ENTITY expect-url "&sourceforge;expect/expect&expect-version;.tar.gz">
<!ENTITY expect-md5 "00fce8de158422f5ccd2666512329bd2">
<!ENTITY expect-home "https://core.tcl.tk/expect/">
<!ENTITY expect-tmp-du "3.9 MB">
<!ENTITY expect-tmp-sbu "0.2 SBU">
<!ENTITY file-version "5.41">
<!ENTITY file-size "1040 KB">
<!ENTITY file-url "https://astron.com/pub/file/file-&file-version;.tar.gz">
<!ENTITY file-md5 "18233bb0a0089dfdc7dfbc93b96f231b">
<!ENTITY file-home "https://www.darwinsys.com/file/">
<!ENTITY file-tmp-du "32 MB">
<!ENTITY file-tmp-sbu "0.1 SBU">
<!ENTITY file-fin-du "15 MB">
<!ENTITY file-fin-sbu "0.1 SBU">
<!ENTITY findutils-version "4.9.0">
<!ENTITY findutils-size "1,999 KB">
<!ENTITY findutils-url "&gnu;findutils/findutils-&findutils-version;.tar.xz">
<!ENTITY findutils-md5 "4a4a547e888a944b2f3af31d789a1137">
<!ENTITY findutils-home "&gnu-software;findutils/">
<!ENTITY findutils-tmp-du "42 MB">
<!ENTITY findutils-tmp-sbu "0.2 SBU">
<!ENTITY findutils-fin-du "51 MB">
<!ENTITY findutils-fin-sbu "0.9 SBU">
<!ENTITY flex-version "2.6.4">
<!ENTITY flex-size "1,386 KB">
<!ENTITY flex-url "&github;/westes/flex/releases/download/v&flex-version;/flex-&flex-version;.tar.gz">
<!ENTITY flex-md5 "2882e3179748cc9f9c23ec593d6adc8d">
<!ENTITY flex-home "&github;/westes/flex">
<!ENTITY flex-fin-du "32 MB">
<!ENTITY flex-fin-sbu "0.4 SBU">
<!ENTITY gawk-version "5.1.1">
<!ENTITY gawk-size "3,075 KB">
<!ENTITY gawk-url "&gnu;gawk/gawk-&gawk-version;.tar.xz">
<!ENTITY gawk-md5 "83650aa943ff2fd519b2abedf8506ace">
<!ENTITY gawk-home "&gnu-software;gawk/">
<!ENTITY gawk-tmp-du "45 MB">
<!ENTITY gawk-tmp-sbu "0.2 SBU">
<!ENTITY gawk-fin-du "43 MB">
<!ENTITY gawk-fin-sbu "0.4 SBU">
<!ENTITY gcc-version "12.1.0">
<!ENTITY gcc-size "78,875 KB">
<!ENTITY gcc-url "&gnu;gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.xz">
<!ENTITY gcc-md5 "ed45b55ee859ada4b25a1e76e0c4d966">
<!ENTITY gcc-sha256 "62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b">
<!ENTITY gcc-home "https://gcc.gnu.org/">
<!ENTITY gcc-tmpp1-du "3.8 GB">
<!ENTITY gcc-tmpp1-sbu "11 SBU">
<!ENTITY gcc-tmpp2-du "4.5 GB">
<!ENTITY gcc-tmpp2-sbu "14 SBU">
<!ENTITY gcc-fin-du "4.6 GB ">
<!ENTITY gcc-fin-sbu "160 SBU (with tests)">
<!ENTITY libquadmath-version "0.0.0">
<!ENTITY libstdcpp-version "6.0.30">
<!ENTITY libitm-version "1.0.0">
<!ENTITY libatomic-version "1.2.0">
<!ENTITY libstdcpp-tmpp1-du "818 MB">
<!ENTITY libstdcpp-tmpp1-sbu "0.4 SBU">
<!ENTITY libstdcpp-tmpp2-du "1.1 GB">
<!ENTITY libstdcpp-tmpp2-sbu "0.8 SBU">
<!ENTITY gdbm-version "1.23">
<!ENTITY gdbm-size "1,092 KB">
<!ENTITY gdbm-url "&gnu;gdbm/gdbm-&gdbm-version;.tar.gz">
<!ENTITY gdbm-md5 "8551961e36bf8c70b7500d255d3658ec">
<!ENTITY gdbm-home "&gnu-software;gdbm/">
<!ENTITY gdbm-fin-du "13 MB">
<!ENTITY gdbm-fin-sbu "0.1 SBU">
<!ENTITY gettext-version "0.21">
<!ENTITY gettext-size "9,487 KB">
<!ENTITY gettext-url "&gnu;gettext/gettext-&gettext-version;.tar.xz">
<!ENTITY gettext-md5 "40996bbaf7d1356d3c22e33a8b255b31">
<!ENTITY gettext-home "&gnu-software;gettext/">
<!ENTITY gettext-tmp-du "280 MB">
<!ENTITY gettext-tmp-sbu "1.6 SBU">
<!ENTITY gettext-fin-du "233 MB">
<!ENTITY gettext-fin-sbu "2.7 SBU">
<!ENTITY glibc-version "2.35">
<!ENTITY glibc-size "17,741 KB">
<!ENTITY glibc-url "&gnu;glibc/glibc-&glibc-version;.tar.xz">
<!ENTITY glibc-md5 "dd571c67d85d89d7f60b854a4e207423">
<!ENTITY glibc-home "&gnu-software;libc/">
<!ENTITY glibc-tmp-du "818 MB">
<!ENTITY glibc-tmp-sbu "4.3 SBU">
<!ENTITY glibc-fin-du "2.8 GB">
<!ENTITY glibc-fin-sbu "24 SBU">
<!--<!ENTITY libthread_db-version "1.0">-->
<!ENTITY gmp-version "6.2.1">
<!ENTITY gmp-size "1,980 KB">
<!ENTITY gmp-url "&gnu;gmp/gmp-&gmp-version;.tar.xz">
<!ENTITY gmp-md5 "0b82665c4a92fd2ade7440c13fcaa42b">
<!ENTITY gmp-home "&gnu-software;gmp/">
<!ENTITY gmp-fin-du "52 MB">
<!ENTITY gmp-fin-sbu "1.0 SBU">
<!ENTITY gperf-version "3.1">
<!ENTITY gperf-size "1,188 KB">
<!ENTITY gperf-url "&gnu;gperf/gperf-&gperf-version;.tar.gz">
<!ENTITY gperf-md5 "9e251c0a618ad0824b51117d5d9db87e">
<!ENTITY gperf-home "&gnu-software;gperf/">
<!ENTITY gperf-fin-du "6.0 MB">
<!ENTITY gperf-fin-sbu "less than 0.1 SBU">
<!ENTITY grep-version "3.7">
<!ENTITY grep-size "1,603 KB">
<!ENTITY grep-url "&gnu;grep/grep-&grep-version;.tar.xz">
<!ENTITY grep-md5 "7c9cca97fa18670a21e72638c3e1dabf">
<!ENTITY grep-home "&gnu-software;grep/">
<!ENTITY grep-tmp-du "26 MB">
<!ENTITY grep-tmp-sbu "0.2 SBU">
<!ENTITY grep-fin-du "36 MB">
<!ENTITY grep-fin-sbu "0.9 SBU">
<!ENTITY groff-version "1.22.4">
<!ENTITY groff-size "4,044 KB">
<!ENTITY groff-url "&gnu;groff/groff-&groff-version;.tar.gz">
<!ENTITY groff-md5 "08fb04335e2f5e73f23ea4c3adbf0c5f">
<!ENTITY groff-home "&gnu-software;groff/">
<!ENTITY groff-fin-du "88 MB">
<!ENTITY groff-fin-sbu "0.5 SBU">
<!ENTITY grub-version "2.06">
<!ENTITY grub-size "6,428 KB">
<!ENTITY grub-url "https://ftp.gnu.org/gnu/grub/grub-&grub-version;.tar.xz">
<!ENTITY grub-md5 "cf0fd928b1e5479c8108ee52cb114363">
<!ENTITY grub-home "&gnu-software;grub/">
<!ENTITY grub-fin-du "158 MB">
<!ENTITY grub-fin-sbu "0.7 SBU">
<!ENTITY gzip-version "1.12">
<!ENTITY gzip-size "807 KB">
<!ENTITY gzip-url "&gnu;gzip/gzip-&gzip-version;.tar.xz">
<!ENTITY gzip-md5 "9608e4ac5f061b2a6479dc44e917a5db">
<!ENTITY gzip-home "&gnu-software;gzip/">
<!ENTITY gzip-tmp-du "11 MB">
<!ENTITY gzip-tmp-sbu "0.1 SBU">
<!ENTITY gzip-fin-du "20 MB">
<!ENTITY gzip-fin-sbu "0.1 SBU">
<!ENTITY iana-etc-version "20220207">
<!ENTITY iana-etc-size "580 KB">
<!ENTITY iana-etc-url "https://github.com/Mic92/iana-etc/releases/download/&iana-etc-version;/iana-etc-&iana-etc-version;.tar.gz">
<!ENTITY iana-etc-md5 "81d865ce7fe4240d5abed48c3ca5fa9f">
<!ENTITY iana-etc-home "https://www.iana.org/protocols">
<!ENTITY iana-etc-fin-du "4.7 MB">
<!ENTITY iana-etc-fin-sbu "less than 0.1 SBU">
<!ENTITY inetutils-version "2.2">
<!ENTITY inetutils-size "1,494 KB">
<!ENTITY inetutils-url "&gnu;inetutils/inetutils-&inetutils-version;.tar.xz">
<!ENTITY inetutils-md5 "de8c1b49cbde2b30e481c61c65357ad4">
<!ENTITY inetutils-sha256 "01b9a4bc73a47e63f6e8a07b76122d9ad2a2e46ebf14870e9c91d660b5647a22">
<!ENTITY inetutils-home "&gnu-software;inetutils/">
<!ENTITY inetutils-fin-du "30 MB">
<!ENTITY inetutils-fin-sbu "0.3 SBU">
<!ENTITY intltool-version "0.51.0">
<!ENTITY intltool-size "159 KB">
<!ENTITY intltool-url "https://launchpad.net/intltool/trunk/&intltool-version;/+download/intltool-&intltool-version;.tar.gz">
<!ENTITY intltool-md5 "12e517cac2b57a0121cda351570f1e63">
<!ENTITY intltool-home "https://freedesktop.org/wiki/Software/intltool">
<!ENTITY intltool-fin-du "1.5 MB">
<!ENTITY intltool-fin-sbu "less than 0.1 SBU">
<!ENTITY iproute2-version "5.17.0">
<!ENTITY iproute2-size "851 KB">
<!ENTITY iproute2-url "&kernel;linux/utils/net/iproute2/iproute2-&iproute2-version;.tar.xz">
<!ENTITY iproute2-md5 "8ade96ee93f37fba7e1beec89f1a54bf">
<!ENTITY iproute2-home "&kernel;linux/utils/net/iproute2/">
<!ENTITY iproute2-fin-du "15 MB">
<!ENTITY iproute2-fin-sbu "0.2 SBU">
<!ENTITY jinja2-version "3.1.2">
<!ENTITY jinja2-size "262 KB">
<!ENTITY jinja2-url "https://files.pythonhosted.org/packages/source/J/Jinja2/Jinja2-&jinja2-version;.tar.gz">
<!ENTITY jinja2-md5 "d31148abd89c1df1cdb077a55db27d02">
<!ENTITY jinja2-home "https://jinja.palletsprojects.com/en/3.0.x/">
<!ENTITY jinja2-fin-du "3.7 MB">
<!ENTITY jinja2-fin-sbu "less than 0.1 SBU">
<!ENTITY kbd-version "2.4.0">
<!ENTITY kbd-size "1,095 KB">
<!ENTITY kbd-url "https://www.kernel.org/pub/linux/utils/kbd/kbd-&kbd-version;.tar.xz">
<!ENTITY kbd-md5 "3cac5be0096fcf7b32dcbd3c53831380">
<!ENTITY kbd-home "https://kbd-project.org/">
<!ENTITY kbd-fin-du "33 MB">
<!ENTITY kbd-fin-sbu "0.1 SBU">
<!ENTITY kmod-version "29">
<!ENTITY kmod-size "548 KB">
<!ENTITY kmod-url "&kernel;linux/utils/kernel/kmod/kmod-&kmod-version;.tar.xz">
<!ENTITY kmod-md5 "e81e63acd80697d001c8d85c1acb38a0">
<!ENTITY kmod-home " ">
<!ENTITY kmod-fin-du "12 MB">
<!ENTITY kmod-fin-sbu "0.1 SBU">
<!ENTITY less-version "590">
<!ENTITY less-size "348 KB">
<!ENTITY less-url "https://www.greenwoodsoftware.com/less/less-&less-version;.tar.gz">
<!ENTITY less-md5 "f029087448357812fba450091a1172ab">
<!ENTITY less-home "https://www.greenwoodsoftware.com/less/">
<!ENTITY less-fin-du "4.2 MB">
<!ENTITY less-fin-sbu "less than 0.1 SBU">
<!ENTITY lfs-bootscripts-version "20220327"> <!-- Scripts depend on this format -->
<!ENTITY lfs-bootscripts-size "BOOTSCRIPTS-SIZE KB">
<!ENTITY lfs-bootscripts-url "&downloads-root;lfs-bootscripts-&lfs-bootscripts-version;.tar.xz">
<!ENTITY lfs-bootscripts-md5 "BOOTSCRIPTS-MD5SUM">
<!ENTITY lfs-bootscripts-home " ">
<!ENTITY lfs-bootscripts-cfg-du "BOOTSCRIPTS-INSTALL-KB KB">
<!ENTITY lfs-bootscripts-cfg-sbu "less than 0.1 SBU">
<!ENTITY libcap-version "2.64">
<!ENTITY libcap-size "172 KB">
<!ENTITY libcap-url "&kernel;linux/libs/security/linux-privs/libcap2/libcap-&libcap-version;.tar.xz">
<!ENTITY libcap-md5 "14fb1fa596f58596bdef0bb5033d2586">
<!ENTITY libcap-home "https://sites.google.com/site/fullycapable/">
<!ENTITY libcap-fin-du "2.7 MB">
<!ENTITY libcap-fin-sbu "less than 0.1 SBU">
<!ENTITY libffi-version "3.4.2">
<!ENTITY libffi-size "1,320 KB">
<!ENTITY libffi-url "https://github.com/libffi/libffi/releases/download/v&libffi-version;/libffi-&libffi-version;.tar.gz">
<!ENTITY libffi-md5 "294b921e6cf9ab0fbaea4b639f8fdbe8">
<!ENTITY libffi-home "https://sourceware.org/libffi/">
<!ENTITY libffi-fin-du "10 MB">
<!ENTITY libffi-fin-sbu "1.9 SBU">
<!ENTITY libpipeline-version "1.5.6">
<!ENTITY libpipeline-size "954 KB">
<!ENTITY libpipeline-url "&savannah;/releases/libpipeline/libpipeline-&libpipeline-version;.tar.gz">
<!ENTITY libpipeline-md5 "829c9ba46382b0b3e12dd11fcbc1bb27">
<!ENTITY libpipeline-home "http://libpipeline.nongnu.org/">
<!ENTITY libpipeline-fin-du "9.7 MB">
<!ENTITY libpipeline-fin-sbu "0.1 SBU">
<!ENTITY libtool-version "2.4.7">
<!ENTITY libtool-size "996 KB">
<!ENTITY libtool-url "&gnu;libtool/libtool-&libtool-version;.tar.xz">
<!ENTITY libtool-md5 "2fc0b6ddcd66a89ed6e45db28fa44232">
<!ENTITY libtool-home "&gnu-software;libtool/">
<!ENTITY libtool-fin-du "43 MB">
<!ENTITY libtool-fin-sbu "1.5 SBU">
<!ENTITY linux-major-version "5">
<!ENTITY linux-minor-version "17">
<!ENTITY linux-patch-version "5">
<!--<!ENTITY linux-version "&linux-major-version;.&linux-minor-version;">-->
<!ENTITY linux-version "&linux-major-version;.&linux-minor-version;.&linux-patch-version;">
<!ENTITY linux-size "125,421 KB">
<!ENTITY linux-url "&kernel;linux/kernel/v&linux-major-version;.x/linux-&linux-version;.tar.xz">
<!ENTITY linux-md5 "2d9d725a716d27c82ea31d2b4e802158">
<!ENTITY linux-home "https://www.kernel.org/">
<!-- measured for 5.13.4 / gcc-11.1.0 on x86_64 : minimum is
allnoconfig rounded down to allow for ongoing cleanups,
max is allmodconfig -->
<!ENTITY linux-knl-du "1200 - 8800 MB (typically about 1700 MB)">
<!ENTITY linux-knl-sbu "1.5 - 130.0 SBU (typically about 12 SBU)">
<!ENTITY linux-headers-tmp-du "1.2 GB">
<!ENTITY linux-headers-tmp-sbu "0.1 SBU">
<!-- Removed in this book
<!ENTITY linux-headers-fin-du "1 GB">
<!ENTITY linux-headers-fin-sbu "0.1 SBU">-->
<!ENTITY m4-version "1.4.19">
<!ENTITY m4-size "1,617 KB">
<!ENTITY m4-url "&gnu;m4/m4-&m4-version;.tar.xz">
<!ENTITY m4-md5 "0d90823e1426f1da2fd872df0311298d">
<!ENTITY m4-home "&gnu-software;m4/">
<!ENTITY m4-tmp-du "31 MB">
<!ENTITY m4-tmp-sbu "0.2 SBU">
<!ENTITY m4-fin-du "49 MB">
<!ENTITY m4-fin-sbu "0.7 SBU">
<!ENTITY make-version "4.3">
<!ENTITY make-size "2,263 KB">
<!ENTITY make-url "&gnu;make/make-&make-version;.tar.gz">
<!ENTITY make-md5 "fc7a67ea86ace13195b0bce683fd4469">
<!ENTITY make-home "&gnu-software;make/">
<!ENTITY make-tmp-du "15 MB">
<!ENTITY make-tmp-sbu "0.1 SBU">
<!ENTITY make-fin-du "13 MB">
<!ENTITY make-fin-sbu "0.5 SBU">
<!ENTITY man-db-version "2.10.2">
<!ENTITY man-db-size "1,860 KB">
<!ENTITY man-db-url "&savannah;/releases/man-db/man-db-&man-db-version;.tar.xz">
<!ENTITY man-db-md5 "e327f7af3786d15e5851658ae7ef47ed">
<!ENTITY man-db-home "https://www.nongnu.org/man-db/">
<!ENTITY man-db-fin-du "39 MB">
<!ENTITY man-db-fin-sbu "0.3 SBU">
<!ENTITY man-pages-version "5.13">
<!ENTITY man-pages-size "1,752 KB">
<!ENTITY man-pages-url "&kernel;linux/docs/man-pages/man-pages-&man-pages-version;.tar.xz">
<!ENTITY man-pages-md5 "3ac24e8c6fae26b801cb87ceb63c0a30">
<!ENTITY man-pages-home "https://www.kernel.org/doc/man-pages/">
<!ENTITY man-pages-fin-du "33 MB">
<!ENTITY man-pages-fin-sbu "less than 0.1 SBU">
<!ENTITY markupsafe-version "2.1.1">
<!ENTITY markupsafe-size "20 KB">
<!ENTITY markupsafe-url "https://files.pythonhosted.org/packages/source/M/MarkupSafe/MarkupSafe-&markupsafe-version;.tar.gz">
<!ENTITY markupsafe-md5 "9809f9fdd98bc835b0c21aa8f79cbf30">
<!ENTITY markupsafe-home "https://palletsprojects.com/p/markupsafe/">
<!ENTITY markupsafe-fin-du "520 KB">
<!ENTITY markupsafe-fin-sbu "less than 0.1 SBU">
<!ENTITY meson-version "0.62.1">
<!ENTITY meson-size "1,988 KB">
<!ENTITY meson-url "&github;/mesonbuild/meson/releases/download/&meson-version;/meson-&meson-version;.tar.gz">
<!ENTITY meson-md5 "2f5301d0e7fd5544ab0004393ba44cbe">
<!ENTITY meson-home "https://mesonbuild.com">
<!ENTITY meson-fin-du "41 MB">
<!ENTITY meson-fin-sbu "less than 0.1 SBU">
<!ENTITY mpc-version "1.2.1">
<!ENTITY mpc-size "820 KB">
<!ENTITY mpc-url "https://ftp.gnu.org/gnu/mpc/mpc-&mpc-version;.tar.gz">
<!ENTITY mpc-md5 "9f16c976c25bb0f76b50be749cd7a3a8">
<!ENTITY mpc-home "http://www.multiprecision.org/">
<!ENTITY mpc-fin-du "21 MB">
<!ENTITY mpc-fin-sbu "0.3 SBU">
<!ENTITY mpfr-version "4.1.0">
<!ENTITY mpfr-size "1,490 KB">
<!ENTITY mpfr-url "https://ftp.gnu.org/gnu/mpfr/mpfr-&mpfr-version;.tar.xz">
<!ENTITY mpfr-md5 "bdd3d5efba9c17da8d83a35ec552baef">
<!ENTITY mpfr-home "https://www.mpfr.org/">
<!ENTITY mpfr-fin-du "38 MB">
<!ENTITY mpfr-fin-sbu "0.8 SBU">
<!ENTITY ncurses-version "6.3">
<!ENTITY ncurses-size "3,500 KB">
<!ENTITY ncurses-url "https://invisible-mirror.net/archives/ncurses/ncurses-&ncurses-version;.tar.gz">
<!ENTITY ncurses-md5 "a2736befde5fee7d2b7eb45eb281cdbe">
<!ENTITY ncurses-home "&gnu-software;ncurses/">
<!ENTITY ncurses-tmp-du "50 MB">
<!ENTITY ncurses-tmp-sbu "0.7 SBU">
<!ENTITY ncurses-fin-du "45 MB">
<!ENTITY ncurses-fin-sbu "0.4 SBU">
<!ENTITY ninja-version "1.10.2">
<!ENTITY ninja-size "209 KB">
<!ENTITY ninja-url "&github;/ninja-build/ninja/archive/v&ninja-version;/ninja-&ninja-version;.tar.gz">
<!ENTITY ninja-md5 "639f75bc2e3b19ab893eaf2c810d4eb4">
<!ENTITY ninja-home "https://ninja-build.org/">
<!ENTITY ninja-fin-du "64 MB">
<!ENTITY ninja-fin-sbu "0.2 SBU">
<!ENTITY openssl-version "3.0.3">
<!ENTITY openssl-size "14,706 KB">
<!ENTITY openssl-url "https://www.openssl.org/source/openssl-&openssl-version;.tar.gz">
<!ENTITY openssl-md5 "07e9048cd2b1a22668b13ec9cd093cb5">
<!ENTITY openssl-home "https://www.openssl.org/">
<!ENTITY openssl-fin-du "474 MB">
<!ENTITY openssl-fin-sbu "5.4 SBU">
<!ENTITY patch-version "2.7.6">
<!ENTITY patch-size "766 KB">
<!ENTITY patch-url "&gnu;patch/patch-&patch-version;.tar.xz">
<!ENTITY patch-md5 "78ad9937e4caadcba1526ef1853730d5">
<!ENTITY patch-home "https://savannah.gnu.org/projects/patch/">
<!ENTITY patch-tmp-du "12 MB">
<!ENTITY patch-tmp-sbu "0.1 SBU">
<!ENTITY patch-fin-du "12 MB">
<!ENTITY patch-fin-sbu "0.2 SBU">
<!ENTITY perl-version-major "5">
<!ENTITY perl-version-minor "34">
<!ENTITY perl-version-patch "1">
<!ENTITY perl-version-min "&perl-version-major;.&perl-version-minor;">
<!ENTITY perl-version "&perl-version-major;.&perl-version-minor;.&perl-version-patch;">
<!ENTITY perl-size "12,464 KB">
<!ENTITY perl-url "https://www.cpan.org/src/5.0/perl-&perl-version;.tar.xz">
<!ENTITY perl-md5 "7d2ece7f50775ea1ff739831935a24bd">
<!ENTITY perl-home "https://www.perl.org/">
<!ENTITY perl-tmp-du "272 MB">
<!ENTITY perl-tmp-sbu "1.6 SBU">
<!ENTITY perl-fin-du "226 MB">
<!ENTITY perl-fin-sbu "9.3 SBU">
<!ENTITY pkgconfig-version "0.29.2">
<!ENTITY pkgconfig-size "1,970 KB">
<!ENTITY pkgconfig-url "https://pkg-config.freedesktop.org/releases/pkg-config-&pkgconfig-version;.tar.gz">
<!ENTITY pkgconfig-md5 "f6e931e319531b736fadc017f470e68a">
<!ENTITY pkgconfig-home "https://www.freedesktop.org/wiki/Software/pkg-config">
<!ENTITY pkgconfig-fin-du "29 MB">
<!ENTITY pkgconfig-fin-sbu "0.3 SBU">
<!ENTITY procps-ng-version "4.0.0">
<!ENTITY procps-ng-size "979 KB">
<!ENTITY procps-ng-url "https://sourceforge.net/projects/procps-ng/files/Production/procps-ng-&procps-ng-version;.tar.xz">
<!ENTITY procps-ng-md5 "eedf93f2f6083afb7abf72188018e1e5">
<!ENTITY procps-ng-home "https://sourceforge.net/projects/procps-ng">
<!ENTITY procps-ng-fin-du "19 MB">
<!ENTITY procps-ng-fin-sbu "0.4 SBU">
<!ENTITY psmisc-version "23.4">
<!ENTITY psmisc-size "362 KB">
<!ENTITY psmisc-url "https://sourceforge.net/projects/psmisc/files/psmisc/psmisc-&psmisc-version;.tar.xz">
<!ENTITY psmisc-md5 "8114cd4489b95308efe2509c3a406bbf">
<!ENTITY psmisc-home "https://gitlab.com/psmisc/psmisc">
<!ENTITY psmisc-fin-du "5.6 MB">
<!ENTITY psmisc-fin-sbu "less than 0.1 SBU">
<!-- If python minor version changes, updates in python and
meson pages will be needed: python3.6 and python3.6m -->
<!ENTITY python-version "3.10.4">
<!ENTITY python-minor "3.10">
<!ENTITY python-size "18,890 KB">
<!ENTITY python-url "https://www.python.org/ftp/python/&python-version;/Python-&python-version;.tar.xz">
<!ENTITY python-md5 "21f2e113e087083a1e8cf10553d93599">
<!ENTITY python-home "https://www.python.org/">
<!ENTITY python-tmp-du "359 MB">
<!ENTITY python-tmp-sbu "1.2 SBU">
<!ENTITY python-fin-du "275 MB">
<!ENTITY python-fin-sbu "4.3 SBU">
<!ENTITY python-docs-url "https://www.python.org/ftp/python/doc/&python-version;/python-&python-version;-docs-html.tar.bz2">
<!ENTITY python-docs-md5 "f5dce93c8149e45324d87c5e05e5fcb9">
<!ENTITY python-docs-size "7,098 KB">
<!ENTITY readline-version "8.1.2">
<!ENTITY readline-soversion "8.1"><!-- used for stripping -->
<!ENTITY readline-size "2,923 KB">
<!ENTITY readline-url "&gnu;readline/readline-&readline-version;.tar.gz">
<!ENTITY readline-md5 "12819fa739a78a6172400f399ab34f81">
<!ENTITY readline-home "https://tiswww.case.edu/php/chet/readline/rltop.html">
<!ENTITY readline-fin-du "15 MB">
<!ENTITY readline-fin-sbu "0.1 SBU">
<!ENTITY sed-version "4.8">
<!ENTITY sed-size "1,317 KB">
<!ENTITY sed-url "&gnu;sed/sed-&sed-version;.tar.xz">
<!ENTITY sed-md5 "6d906edfdb3202304059233f51f9a71d">
<!ENTITY sed-home "&gnu-software;sed/">
<!ENTITY sed-tmp-du "20 MB">
<!ENTITY sed-tmp-sbu "0.1 SBU">
<!ENTITY sed-fin-du "31 MB">
<!ENTITY sed-fin-sbu "0.4 SBU">
<!ENTITY shadow-version "4.11.1">
<!ENTITY shadow-size "1,618 KB">
<!ENTITY shadow-url "&github;/shadow-maint/shadow/releases/download/v&shadow-version;/shadow-&shadow-version;.tar.xz">
<!ENTITY shadow-md5 "5a95ec069aa91508167d02fecafaa912">
<!ENTITY shadow-home "https://shadow-maint.github.io/shadow/">
<!ENTITY shadow-fin-du "49 MB">
<!ENTITY shadow-fin-sbu "0.2 SBU">
<!ENTITY sysklogd-version "1.5.1">
<!ENTITY sysklogd-size "88 KB">
<!ENTITY sysklogd-url "https://www.infodrom.org/projects/sysklogd/download/sysklogd-&sysklogd-version;.tar.gz">
<!ENTITY sysklogd-md5 "c70599ab0d037fde724f7210c2c8d7f8">
<!ENTITY sysklogd-home "https://www.infodrom.org/projects/sysklogd/">
<!ENTITY sysklogd-fin-du "0.6 MB">
<!ENTITY sysklogd-fin-sbu "less than 0.1 SBU">
<!ENTITY systemd-version "250">
<!--<!ENTITY systemd-stable "6b4878d">-->
<!-- The above entity is used whenever we move to a stable backport branch. In the event of a critical problem or kernel
change that is incompatible, we will switch to the backport branch until the next stable release. -->
<!ENTITY systemd-size "10,856 KB">
<!ENTITY systemd-url "&github;/systemd/systemd/archive/v&systemd-version;/systemd-&systemd-version;.tar.gz">
<!--<!ENTITY systemd-url "&anduin-sources;/systemd-&systemd-version;-&systemd-stable;.tar.xz">-->
<!ENTITY systemd-md5 "8929beb037c587ada4ed201f19756fe2">
<!ENTITY systemd-home "https://www.freedesktop.org/wiki/Software/systemd/">
<!ENTITY systemd-man-version "250">
<!ENTITY systemd-man-size "596 KB">
<!--<!ENTITY systemd-man-url "&anduin-sources;/systemd-man-pages-&systemd-version;-&systemd-stable;.tar.xz">-->
<!ENTITY systemd-man-url "&anduin-sources;/systemd-man-pages-&systemd-man-version;.tar.xz">
<!ENTITY systemd-man-md5 "af3aca39abe4e990cb2a9ac63dcdf506">
<!ENTITY systemd-fin-du "273 MB">
<!ENTITY systemd-fin-sbu "2.2 SBU">
<!ENTITY sysvinit-version "3.04">
<!ENTITY sysvinit-size "216 KB">
<!ENTITY sysvinit-url "&savannah;/releases/sysvinit/sysvinit-&sysvinit-version;.tar.xz">
<!ENTITY sysvinit-md5 "9a00e5f15dd2f038f10feee50677ebff">
<!ENTITY sysvinit-home "&savannah-nongnu;/projects/sysvinit">
<!ENTITY sysvinit-fin-du "1.4 MB">
<!ENTITY sysvinit-fin-sbu "less than 0.1 SBU">
<!ENTITY tar-version "1.34">
<!ENTITY tar-size "2,174 KB">
<!ENTITY tar-url "&gnu;tar/tar-&tar-version;.tar.xz">
<!ENTITY tar-md5 "9a08d29a9ac4727130b5708347c0f5cf">
<!ENTITY tar-home "&gnu-software;tar/">
<!ENTITY tar-tmp-du "38 MB">
<!ENTITY tar-tmp-sbu "0.2 SBU">
<!ENTITY tar-fin-du "40 MB">
<!ENTITY tar-fin-sbu "1.7 SBU">
<!ENTITY tcl-version "8.6.12">
<!ENTITY tcl-major-version "8.6">
<!ENTITY tcl-size "10,112 KB">
<!ENTITY tcl-url "https://downloads.sourceforge.net/tcl/tcl&tcl-version;-src.tar.gz">
<!ENTITY tcl-md5 "87ea890821d2221f2ab5157bc5eb885f">
<!ENTITY tcl-home "http://tcl.sourceforge.net/">
<!ENTITY tcl-docs-url "https://downloads.sourceforge.net/tcl/tcl&tcl-version;-html.tar.gz">
<!ENTITY tcl-docs-md5 "a0d1a5b60bbb68f2f0bd3066a19c527a">
<!ENTITY tcl-docs-size "1,176 KB">
<!ENTITY tcl-tmp-du "87 MB">
<!ENTITY tcl-tmp-sbu "3.4 SBU">
<!ENTITY texinfo-version "6.8">
<!ENTITY texinfo-size "4,848 KB">
<!ENTITY texinfo-url "&gnu;texinfo/texinfo-&texinfo-version;.tar.xz">
<!ENTITY texinfo-md5 "a91b404e30561a5df803e6eb3a53be71">
<!ENTITY texinfo-home "&gnu-software;texinfo/">
<!ENTITY texinfo-tmp-du "109 MB">
<!ENTITY texinfo-tmp-sbu "0.2 SBU">
<!ENTITY texinfo-fin-du "112 MB">
<!ENTITY texinfo-fin-sbu "0.6 SBU">
<!ENTITY tzdata-version "2022a">
<!ENTITY tzdata-size "416 KB">
<!ENTITY tzdata-url "https://www.iana.org/time-zones/repository/releases/tzdata&tzdata-version;.tar.gz">
<!ENTITY tzdata-md5 "081662184f3b902f8e5d96816568432e">
<!ENTITY tzdata-home "https://www.iana.org/time-zones">
<!ENTITY udev-lfs-version "udev-lfs-20171102">
<!ENTITY udev-lfs-size "11 KB">
<!ENTITY udev-lfs-url "&anduin-sources;/&udev-lfs-version;.tar.xz">
<!ENTITY udev-lfs-md5 "27cd82f9a61422e186b9d6759ddf1634">
<!ENTITY udev-lfs-home " ">
<!ENTITY util-linux-minor "2.38">
<!ENTITY util-linux-version "2.38"> <!-- 2.33.x -->
<!ENTITY util-linux-size "7,177 KB">
<!ENTITY util-linux-url "&kernel;linux/utils/util-linux/v&util-linux-minor;/util-linux-&util-linux-version;.tar.xz">
<!ENTITY util-linux-md5 "fffdc126809a6d4c1789a9efc1b96623">
<!ENTITY util-linux-home "https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/">
<!ENTITY util-linux-tmp-du "129 MB">
<!ENTITY util-linux-tmp-sbu "0.7 SBU">
<!ENTITY util-linux-fin-du "261 MB">
<!ENTITY util-linux-fin-sbu "1.1 SBU">
<!ENTITY vim-version "8.2.4814">
<!ENTITY vim-majmin "82">
<!ENTITY vim-docdir "vim/vim82">
<!ENTITY vim-size "10,486 KB">
<!--<!ENTITY vim-url "https://github.com/vim/vim/archive/v&vim-version;/vim-&vim-version;.tar.gz">-->
<!ENTITY vim-url "&anduin-sources;/vim-&vim-version;.tar.xz">
<!ENTITY vim-md5 "3ffc16fd72de90ab72f7d94dee30a806">
<!ENTITY vim-home "https://www.vim.org">
<!ENTITY vim-fin-du "206 MB">
<!ENTITY vim-fin-sbu "2.4 SBU">
<!-- From https://files.pythonhosted.org/packages/c0/6c/9f840c2e55b67b90745af06a540964b73589256cb10cc10057c87ac78fc2/wheel-0.37.1.tar.gz -->
<!ENTITY wheel-version "0.37.1">
<!ENTITY wheel-size "65 KB">
<!ENTITY wheel-url "&anduin-sources;/wheel-&wheel-version;.tar.gz">
<!ENTITY wheel-md5 "f490f1399e5903706cb1d4fbed9ecb28">
<!ENTITY wheel-home "https://pypi.org/project/wheel/">
<!ENTITY wheel-fin-du "268 KB">
<!ENTITY wheel-fin-sbu "less than 0.1 SBU">
<!ENTITY xml-parser-version "2.46">
<!ENTITY xml-parser-size "249 KB">
<!ENTITY xml-parser-url "https://cpan.metacpan.org/authors/id/T/TO/TODDR/XML-Parser-&xml-parser-version;.tar.gz">
<!ENTITY xml-parser-md5 "80bb18a8e6240fcf7ec2f7b57601c170">
<!ENTITY xml-parser-home "&github;/chorny/XML-Parser">
<!ENTITY xml-parser-fin-du "2.4 MB">
<!ENTITY xml-parser-fin-sbu "less than 0.1 SBU">
<!ENTITY xz-version "5.2.5">
<!ENTITY xz-size "1,122 KB">
<!ENTITY xz-url "https://tukaani.org/xz/xz-&xz-version;.tar.xz">
<!ENTITY xz-md5 "aa1621ec7013a19abab52a8aff04fe5b">
<!ENTITY xz-home "https://tukaani.org/xz">
<!ENTITY xz-tmp-du "15 MB">
<!ENTITY xz-tmp-sbu "0.1 SBU">
<!ENTITY xz-fin-du "15 MB">
<!ENTITY xz-fin-sbu "0.2 SBU">
<!ENTITY zlib-version "1.2.12">
<!ENTITY zlib-size "1259 KB">
<!ENTITY zlib-url "https://zlib.net/zlib-&zlib-version;.tar.xz">
<!ENTITY zlib-md5 "28687d676c04e7103bb6ff2b9694c471">
<!ENTITY zlib-home "https://www.zlib.net/">
<!ENTITY zlib-tmp-du "5.0 MB">
<!ENTITY zlib-tmp-sbu "less than 0.1 SBU">
<!ENTITY zlib-fin-du "5.0 MB">
<!ENTITY zlib-fin-sbu "less than 0.1 SBU">
<!ENTITY zstd-version "1.5.2">
<!ENTITY zstd-size "1,892 KB">
<!ENTITY zstd-url "https://github.com/facebook/zstd/releases/download/v&zstd-version;/zstd-&zstd-version;.tar.gz">
<!ENTITY zstd-md5 "072b10f71f5820c24761a65f31f43e73">
<!ENTITY zstd-home "https://facebook.github.io/zstd/">
<!ENTITY zstd-fin-du "55 MB">
<!ENTITY zstd-fin-sbu "1.1 SBU">

102
patches.ent Normal file
View File

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Start of Common Patches -->
<!ENTITY autoconf-fixes-patch "autoconf-&autoconf-version;-consolidated_fixes-1.patch">
<!ENTITY autoconf-fixes-patch-md5 "3c515415ecdd777990c91e8900279cb9">
<!ENTITY autoconf-fixes-patch-size "3.8 KB">
<!ENTITY bash-fixes-patch "bash-&bash-version;-upstream_fixes-1.patch">
<!ENTITY bash-fixes-patch-md5 "c1545da2ad7d78574b52c465ec077ed9">
<!ENTITY bash-fixes-patch-size "22 KB">
<!ENTITY binutils-lto-patch "binutils-&binutils-version;-lto_fix-1.patch">
<!ENTITY binutils-lto-patch-md5 "3df11b6123d5bbdb0fc83862a003827a">
<!ENTITY binutils-lto-patch-size "3.5 KB">
<!ENTITY bzip2-docs-patch "bzip2-&bzip2-version;-install_docs-1.patch">
<!ENTITY bzip2-docs-patch-md5 "6a5ac7e89b791aae556de0f745916f7f">
<!ENTITY bzip2-docs-patch-size "1.6 KB">
<!ENTITY coreutils-i18n-patch "coreutils-&coreutils-version;-i18n-1.patch">
<!ENTITY coreutils-i18n-patch-md5 "c1ac7edf095027460716577633da9fc5">
<!ENTITY coreutils-i18n-patch-size "166 KB">
<!--
<!ENTITY coreutils-chmod-patch "coreutils-&coreutils-version;-chmod_fix-1.patch">
<!ENTITY coreutils-chmod-patch-md5 "4709df88e68279e6ef357aa819ba5b1a">
<!ENTITY coreutils-chmod-patch-size "3.8 KB">
-->
<!--
<!ENTITY flex-fixes-patch "flex-&flex-version;-upstream_fixes-3.patch">
<!ENTITY flex-fixes-patch-md5 "b46f6b0380e502a3dfb8b503227cd680">
<!ENTITY flex-fixes-patch-size "3.4 KB">
-->
<!--
<!ENTITY file-upstream-fixes-patch "file-&file-version;-upstream_fixes-1.patch">
<!ENTITY file-upstream-fixes-md5 "d99090db596b9db2bed869662199a56a">
<!ENTITY file-upstream-fixes-patch-size "4.0 KB">
-->
<!--
<!ENTITY gcc-upstream-fixes-patch "gcc-&gcc-version;-upstream_fixes-1.patch">
<!ENTITY gcc-upstream-fixes-patch-md5 "27266d2a771f2ff812cb6ec9c8b456b4">
<!ENTITY gcc-upstream-fixes-patch-size "18.0 KB">
-->
<!ENTITY glibc-fhs-patch "glibc-&glibc-version;-fhs-1.patch">
<!ENTITY glibc-fhs-patch-md5 "9a5997c3452909b1769918c759eff8a2">
<!ENTITY glibc-fhs-patch-size "2.8 KB">
<!--
<!ENTITY glibc-upstream-patch "glibc-&glibc-version;-upstream_fixes-1.patch">
<!ENTITY glibc-upstream-patch-md5 "e602b6c3a332f4a06e2914e02ae2b295">
<!ENTITY glibc-upstream-patch-size "16 KB">
-->
<!ENTITY kbd-backspace-patch "kbd-&kbd-version;-backspace-1.patch">
<!ENTITY kbd-backspace-patch-md5 "f75cca16a38da6caa7d52151f7136895">
<!ENTITY kbd-backspace-patch-size "12 KB">
<!--
<!ENTITY libpipeline-checks-patch "libpipeline-&libpipeline-version;-check_fixes-3.patch">
<!ENTITY libpipeline-checks-patch-md5 "0cd71f98eadaee07647d021d2e4c8621">
<!ENTITY libpipeline-checks-patch-size "22 KB">
<!ENTITY meson-fix-patch "meson-&meson-version;-upstream_fix-2.patch">
<!ENTITY meson-fix-patch-md5 "dd0b2187d287abcb41c3dd7e497b7df3">
<!ENTITY meson-fix-patch-size "5.5 KB">
<!ENTITY ninja-limit-jobs-patch "ninja-&ninja-version;-add_NINJAJOBS_var-1.patch">
<!ENTITY ninja-limit-jobs-patch-md5 "f537a633532492e805aa342fa869ca45">
<!ENTITY ninja-limit-jobs-patch-size "2.5 KB">
-->
<!--
<!ENTITY perl-fix-patch "perl-&perl-version;-upstream_fixes-1.patch">
<!ENTITY perl-fix-patch-md5 "fb42558b59ed95ee00eb9f1c1c9b8056">
<!ENTITY perl-fix-patch-size "1.6 KB">
-->
<!--
<!ENTITY shadow-segfault-patch "shadow-&shadow-version;-useradd_segfault-1.patch">
<!ENTITY shadow-segfault-patch-md5 "66b299c0c9ac66fdb7c91b40df5984c0">
<!ENTITY shadow-segfault-patch-size "1.7 KB">
-->
<!ENTITY sysvinit-consolidated-patch "sysvinit-&sysvinit-version;-consolidated-1.patch">
<!ENTITY sysvinit-consolidated-patch-md5 "4900322141d493e74020c9cf437b2cdc">
<!ENTITY sysvinit-consolidated-patch-size "2.4 KB">
<!ENTITY systemd-upstream-fixes-patch "systemd-&systemd-version;-upstream_fixes-1.patch">
<!ENTITY systemd-upstream-fixes-patch-md5 "71eac6abdad5fba2039dcd011a9ae5b3">
<!ENTITY systemd-upstream-fixes-patch-size "20 KB">
<!ENTITY systemd-kernel-fixes-patch "systemd-&systemd-version;-kernel_5.17_fixes-1.patch">
<!ENTITY systemd-kernel-fixes-patch-md5 "34cee987b35d5d522fd3317e08057c1d">
<!ENTITY systemd-kernel-fixes-patch-size "2.7 KB">
<!ENTITY xz-upstream-fix-patch "xz-&xz-version;-upstream_fix-1.patch">
<!ENTITY xz-upstream-fix-patch-md5 "584c72ea3d8f7502b2770670f3090788">
<!ENTITY xz-upstream-fix-patch-size "3.7 KB">
<!ENTITY zstd-upstream-fixes-patch "zstd-&zstd-version;-upstream_fixes-1.patch">
<!ENTITY zstd-upstream-fixes-patch-md5 "a7e576e3f87415fdf388392b257cdcf3">
<!ENTITY zstd-upstream-fixes-patch-size "4 KB">

19
pdf-fixups.sh Normal file
View File

@ -0,0 +1,19 @@
#!/bin/bash
if [ $# -lt 1 ] ; then
echo "This script needs the location of the fo file to update"
exit 1
fi
FILE=$1
LINE=$( grep -n "DO NOT EDIT" $FILE | cut -f1 -d: )
LINE=$(( LINE - 1 ))
# Not needed
#sed -i -e "$LINE s/monospace/&\" font-size=\"9pt/" $FILE
sed -i -e "s/monospace/&\" font-size=\"9pt/g" $FILE
# Break a block of code at the right place
sed -i -e 's@gcc --version@<fo:block page-break-before="always"></fo:block>&@' $FILE

24
process-scripts.sh Normal file
View File

@ -0,0 +1,24 @@
#!/bin/bash
# Boot scripts
for s in bootscripts/lfs/init.d/* \
bootscripts/lfs/sysconfig/* \
bootscripts/lfs/lib/services/* \
bootscripts/lfs/sbin/* \
udev-lfs/*.rules
do
script=$(basename $s)
# Skip directories
[ $script == 'network-devices' ] && continue
#[ $script == 'services' ] && continue
# Disambiguate duplicate file names
[ $s == 'bootscripts/lfs/sysconfig/rc' ] && script='rc-sysinit';
[ $s == 'bootscripts/lfs/sysconfig/modules' ] && script='modules-sysinit';
[ $s == 'bootscripts/lfs/sysconfig/udev_retry' ] && script='config-udev-retry';
sed -e 's/\&/\&amp\;/g' -e 's/</\&lt\;/g' -e 's/>/\&gt\;/g' \
-e "s/'/\&apos\;/g" -e 's/"/\&quot\;/g' -e 's/\t/ /g' \
$s > appendices/${script}.script
done

16
tidy.conf Normal file
View File

@ -0,0 +1,16 @@
indent-spaces: 2
wrap: 78
tab-size: 8
#input-encoding: UTF-8
#output-encoding: UTF-8
char-encoding: utf8
write-back: yes
markup: yes
indent: yes
uppercase-tags: no
logical-emphasis: no
tidy-mark: no
numeric-entities: no
show-warnings: no
quiet: yes
newline: LF