Porg style package management:
- Add new variable WRAP_INSTALL in COnfig.in and jhalfs - Generates the install commands inside a wrapper function - Add files packInstall.sh.porg and packageManager.xml.porg - TODO: update README.PACKAGE... - TODO: make new templates in pkgmngt and document them
This commit is contained in:
parent
33ff403b33
commit
df42c7cff7
8 changed files with 332 additions and 68 deletions
63
Config.in
63
Config.in
|
@ -827,27 +827,50 @@ menu "--- Build Settings"
|
||||||
#--- End Test Suites
|
#--- End Test Suites
|
||||||
endmenu # test settings
|
endmenu # test settings
|
||||||
|
|
||||||
#--- Package Management
|
#--- Package Management
|
||||||
config PKGMNGT
|
config PKGMNGT
|
||||||
bool "Package management"
|
bool "Package management"
|
||||||
depends BOOK_LFS || BOOK_LFS_SYSD
|
depends BOOK_LFS || BOOK_LFS_SYSD
|
||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
#-- Use package management
|
#-- Use package management
|
||||||
#
|
#
|
||||||
# If set, the packages in the final phase are built
|
# If set, you'll have to choose between
|
||||||
# in a separate directory, PKG_DEST.
|
# two package management styles:
|
||||||
# You should provide a bash function for packing
|
# - Build and install:
|
||||||
# and installing the package.
|
# the packages in the final phase are built
|
||||||
# Also, you have to provide the instructions
|
# in a separate directory, PKG_DEST.
|
||||||
# to build the package manager during the
|
# You should provide a bash function for
|
||||||
# temporary tools phase, in the form of a
|
# packaing and installing the package.
|
||||||
# sect1 of the book identical to a package
|
# - Preload a library before install:
|
||||||
# sect1. See README.PACKAGE_MANAGEMENT
|
# Run the install instructions inside a
|
||||||
#
|
# wrapper command, which monitors the
|
||||||
# For now, this only works with LFS
|
# installed files.
|
||||||
|
#
|
||||||
|
# Also, you have to provide the instructions
|
||||||
|
# to build the package manager during the
|
||||||
|
# temporary tools phase, in the form of a
|
||||||
|
# sect1 of the book identical to a package
|
||||||
|
# sect1. See README.PACKAGE_MANAGEMENT
|
||||||
|
#
|
||||||
|
# For now, this only works with LFS
|
||||||
|
choice
|
||||||
|
depends PKGMNGT
|
||||||
|
prompt "Package management style"
|
||||||
|
default PKG_PACK
|
||||||
|
|
||||||
#--- End package management
|
config PKG_PACK
|
||||||
|
bool "Build and pack (pacman or dpkg style)"
|
||||||
|
|
||||||
|
config LIB_LOAD
|
||||||
|
bool "Preload a library before installing (porg style)"
|
||||||
|
endchoice
|
||||||
|
|
||||||
|
config WRAP_INSTALL
|
||||||
|
bool
|
||||||
|
default y if LIB_LOAD
|
||||||
|
default n if PKG_PACK
|
||||||
|
#--- End package management
|
||||||
|
|
||||||
#--- Installed files logs
|
#--- Installed files logs
|
||||||
config INSTALL_LOG
|
config INSTALL_LOG
|
||||||
|
|
156
LFS/lfs.xsl
156
LFS/lfs.xsl
|
@ -14,7 +14,14 @@
|
||||||
n = no, original behavior
|
n = no, original behavior
|
||||||
y = yes, add PKG_DEST to scripts in install commands of chapter06-08
|
y = yes, add PKG_DEST to scripts in install commands of chapter06-08
|
||||||
-->
|
-->
|
||||||
<xsl:param name="pkgmngt" select="n"/>
|
<xsl:param name="pkgmngt" select="'n'"/>
|
||||||
|
|
||||||
|
<!-- Package management with "porg style" ?
|
||||||
|
n = no, same as pkgmngt description above
|
||||||
|
y = yes, wrap install commands of chapter06-08 into a bash function.
|
||||||
|
note that pkgmngt must be 'y' in this case
|
||||||
|
-->
|
||||||
|
<xsl:param name="wrap-install" select='"n"'/>
|
||||||
|
|
||||||
<!-- Run test suites?
|
<!-- Run test suites?
|
||||||
0 = none
|
0 = none
|
||||||
|
@ -28,29 +35,29 @@
|
||||||
n = no, I want to build the full system and review the logs
|
n = no, I want to build the full system and review the logs
|
||||||
y = yes, bomb at the first test suite failure to can review the build dir
|
y = yes, bomb at the first test suite failure to can review the build dir
|
||||||
-->
|
-->
|
||||||
<xsl:param name="bomb-testsuite" select="n"/>
|
<xsl:param name="bomb-testsuite" select="'n'"/>
|
||||||
|
|
||||||
<!-- Install vim-lang package? OBSOLETE should always be 'n'-->
|
<!-- Install vim-lang package? OBSOLETE should always be 'n'-->
|
||||||
<xsl:param name="vim-lang" select="n"/>
|
<xsl:param name="vim-lang" select="'n'"/>
|
||||||
|
|
||||||
<!-- Time zone -->
|
<!-- Time zone -->
|
||||||
<xsl:param name="timezone" select="GMT"/>
|
<xsl:param name="timezone" select="'GMT'"/>
|
||||||
|
|
||||||
<!-- Page size -->
|
<!-- Page size -->
|
||||||
<xsl:param name="page" select="letter"/>
|
<xsl:param name="page" select="'letter'"/>
|
||||||
|
|
||||||
<!-- Locale settings -->
|
<!-- Locale settings -->
|
||||||
<xsl:param name="lang" select="C"/>
|
<xsl:param name="lang" select="'C'"/>
|
||||||
|
|
||||||
<!-- Install the whole set of locales -->
|
<!-- Install the whole set of locales -->
|
||||||
<xsl:param name='full-locale' select='n'/>
|
<xsl:param name='full-locale' select='"n"'/>
|
||||||
|
|
||||||
<!-- Hostname -->
|
<!-- Hostname -->
|
||||||
<xsl:param name='hostname' select='"HOSTNAME"'/>
|
<xsl:param name='hostname' select='"HOSTNAME"'/>
|
||||||
|
|
||||||
<!-- Network parameters: interface, ip, gateway, prefix, broadcast, domain
|
<!-- Network parameters: interface, ip, gateway, prefix, broadcast, domain
|
||||||
and nameservers -->
|
and nameservers -->
|
||||||
<xsl:param name='interface' select='eth0'/>
|
<xsl:param name='interface' select="'eth0'"/>
|
||||||
<xsl:param name='ip' select='"10.0.2.9"'/>
|
<xsl:param name='ip' select='"10.0.2.9"'/>
|
||||||
<xsl:param name='gateway' select='"10.0.2.2"'/>
|
<xsl:param name='gateway' select='"10.0.2.2"'/>
|
||||||
<xsl:param name='prefix' select='24'/>
|
<xsl:param name='prefix' select='24'/>
|
||||||
|
@ -180,7 +187,13 @@
|
||||||
descendant::screen[not(@role) or
|
descendant::screen[not(@role) or
|
||||||
@role != 'nodump']/userinput[
|
@role != 'nodump']/userinput[
|
||||||
@remap='install']">
|
@remap='install']">
|
||||||
<xsl:text>mkdir -pv $PKG_DEST/{boot,etc,lib,bin,sbin}
|
<xsl:choose>
|
||||||
|
<xsl:when test="$wrap-install='y'">
|
||||||
|
<xsl:text>wrapInstall '
|
||||||
|
</xsl:text>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<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/{lib,bin,sbin,include}
|
||||||
mkdir -pv $PKG_DEST/usr/share/{doc,info,man}
|
mkdir -pv $PKG_DEST/usr/share/{doc,info,man}
|
||||||
mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
|
mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
|
||||||
|
@ -189,10 +202,13 @@ case $(uname -m) in
|
||||||
x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
|
x86_64) ln -sv lib $PKG_DEST/lib64 && ln -sv lib $PKG_DEST/usr/lib64 ;;
|
||||||
esac
|
esac
|
||||||
</xsl:text>
|
</xsl:text>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:if test="../@id = 'ch-system-glibc' and
|
<xsl:if test="../@id = 'ch-system-glibc' and
|
||||||
@role='installation' and
|
@role='installation' and
|
||||||
$pkgmngt = 'y'">
|
$pkgmngt = 'y' and
|
||||||
|
$wrap-install = 'n'">
|
||||||
<xsl:text>mkdir -pv $PKG_DEST/usr/include/{rpc,rpcsvc}
|
<xsl:text>mkdir -pv $PKG_DEST/usr/include/{rpc,rpcsvc}
|
||||||
</xsl:text>
|
</xsl:text>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
@ -204,27 +220,54 @@ esac
|
||||||
descendant::screen[not(@role) or
|
descendant::screen[not(@role) or
|
||||||
@role != 'nodump']/userinput[
|
@role != 'nodump']/userinput[
|
||||||
@remap='install']">
|
@remap='install']">
|
||||||
<xsl:if test="../@id = 'ch-system-man-pages'">
|
<xsl:choose>
|
||||||
|
<xsl:when test="$wrap-install='y'">
|
||||||
|
<xsl:if test="../@id = 'ch-system-man-pages'">
|
||||||
<!-- these files are provided by the shadow package -->
|
<!-- 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>rm -fv /usr/share/man/{man3/getspnam.3,man5/passwd.5}
|
||||||
</xsl:text>
|
</xsl:text>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<!-- Attr man/man2 pages are already installed by man-pages. As of
|
<!-- Attr man/man2 pages are already installed by man-pages. As of
|
||||||
March 2013, they are the same pages.
|
March 2013, they are the same pages.
|
||||||
November 2015: now they are more accurate
|
November 2015: now they are more accurate
|
||||||
in man-pages, and the man5 section is also in man-pages... -->
|
in man-pages, and the man5 section is also in man-pages... -->
|
||||||
<xsl:if test="../@id = 'ch-system-attr'">
|
<xsl:if test="../@id = 'ch-system-attr'">
|
||||||
<xsl:text>rm -fv $PKG_DEST/usr/share/man/man2/*
|
<xsl:text>rm -fv /usr/share/man/man2/*
|
||||||
|
rm -fv /usr/share/man/man5/*
|
||||||
|
</xsl:text>
|
||||||
|
</xsl:if>
|
||||||
|
<!-- nologin is installed by util-linux. remove it from shadow -->
|
||||||
|
<xsl:if test="../@id = 'ch-system-shadow'">
|
||||||
|
<xsl:text>rm -fv /usr/share/man/man8/nologin.8
|
||||||
|
rm -fv /sbin/nologin
|
||||||
|
</xsl:text>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:text>'
|
||||||
|
packInstall
|
||||||
|
</xsl:text>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<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.
|
||||||
|
November 2015: now they are more accurate
|
||||||
|
in man-pages, and the man5 section is also in man-pages... -->
|
||||||
|
<xsl:if test="../@id = 'ch-system-attr'">
|
||||||
|
<xsl:text>rm -fv $PKG_DEST/usr/share/man/man2/*
|
||||||
rm -fv $PKG_DEST/usr/share/man/man5/*
|
rm -fv $PKG_DEST/usr/share/man/man5/*
|
||||||
</xsl:text>
|
</xsl:text>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<!-- nologin is installed by util-linux. remove it from shadow -->
|
<!-- nologin is installed by util-linux. remove it from shadow -->
|
||||||
<xsl:if test="../@id = 'ch-system-shadow'">
|
<xsl:if test="../@id = 'ch-system-shadow'">
|
||||||
<xsl:text>rm -fv $PKG_DEST/usr/share/man/man8/nologin.8
|
<xsl:text>rm -fv $PKG_DEST/usr/share/man/man8/nologin.8
|
||||||
rm -fv $PKG_DEST/sbin/nologin
|
rm -fv $PKG_DEST/sbin/nologin
|
||||||
</xsl:text>
|
</xsl:text>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:text>rm -fv $PKG_DEST/{,usr/}lib64
|
<xsl:text>rm -fv $PKG_DEST/{,usr/}lib64
|
||||||
rm -fv $PKG_DEST/usr/{man,doc,info}
|
rm -fv $PKG_DEST/usr/{man,doc,info}
|
||||||
for dir in $PKG_DEST/usr/share/man/man{1..8}; do
|
for dir in $PKG_DEST/usr/share/man/man{1..8}; do
|
||||||
[[ -z $(ls $dir) ]] && rmdir -v $dir
|
[[ -z $(ls $dir) ]] && rmdir -v $dir
|
||||||
|
@ -241,6 +284,8 @@ done
|
||||||
packInstall
|
packInstall
|
||||||
rm -rf $PKG_DEST
|
rm -rf $PKG_DEST
|
||||||
</xsl:text>
|
</xsl:text>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:if test="$testsuite='3' and
|
<xsl:if test="$testsuite='3' and
|
||||||
../@id='ch-tools-glibc' and
|
../@id='ch-tools-glibc' and
|
||||||
|
@ -309,7 +354,7 @@ cd $PKGDIR
|
||||||
mode="pkgmngt"/>
|
mode="pkgmngt"/>
|
||||||
<xsl:if test="$dirname = 'chapter06'">
|
<xsl:if test="$dirname = 'chapter06'">
|
||||||
<xsl:text>packInstall
|
<xsl:text>packInstall
|
||||||
rm -rf $PKG_DEST
|
rm -rf "$PKG_DEST"
|
||||||
</xsl:text>
|
</xsl:text>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:apply-templates
|
<xsl:apply-templates
|
||||||
|
@ -452,7 +497,26 @@ exit
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise><!--pkgmngt = 'y'-->
|
<xsl:when test="$wrap-install='y'">
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="./literal">
|
||||||
|
<xsl:call-template name="output-wrap">
|
||||||
|
<xsl:with-param name="commands" select="text()[1]"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:apply-templates select="literal"/>
|
||||||
|
<xsl:call-template name="output-wrap">
|
||||||
|
<xsl:with-param name="commands" select="text()[2]"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:call-template name="output-wrap">
|
||||||
|
<xsl:with-param name="commands" select="string()"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:text>
</xsl:text>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise><!--pkgmngt = 'y' and wrap-install='n'-->
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="./literal">
|
<xsl:when test="./literal">
|
||||||
<xsl:call-template name="outputpkgdest">
|
<xsl:call-template name="outputpkgdest">
|
||||||
|
@ -476,7 +540,7 @@ exit
|
||||||
tzdata. -->
|
tzdata. -->
|
||||||
<xsl:when test="contains(string(),'tzdata') and $pkgmngt='y'">
|
<xsl:when test="contains(string(),'tzdata') and $pkgmngt='y'">
|
||||||
<xsl:text>
|
<xsl:text>
|
||||||
OLD_PKG_DEST=$PKG_DEST
|
OLD_PKG_DEST="$PKG_DEST"
|
||||||
OLD_PKGDIR=$PKGDIR
|
OLD_PKGDIR=$PKGDIR
|
||||||
PKG_DEST=$(dirname $OLD_PKG_DEST)/001-tzdata
|
PKG_DEST=$(dirname $OLD_PKG_DEST)/001-tzdata
|
||||||
PKGDIR=$(dirname $PKGDIR)/tzdata-</xsl:text>
|
PKGDIR=$(dirname $PKGDIR)/tzdata-</xsl:text>
|
||||||
|
@ -485,12 +549,28 @@ PKGDIR=$(dirname $PKGDIR)/tzdata-</xsl:text>
|
||||||
'.tar')"/>
|
'.tar')"/>
|
||||||
<xsl:text>
|
<xsl:text>
|
||||||
</xsl:text>
|
</xsl:text>
|
||||||
<xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/>
|
<xsl:choose>
|
||||||
<xsl:text>ZONEINFO=$PKG_DEST</xsl:text>
|
<xsl:when test="$wrap-install='n'">
|
||||||
<xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/>
|
<xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/>
|
||||||
<xsl:text>
|
<xsl:text>ZONEINFO=$PKG_DEST</xsl:text>
|
||||||
|
<xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/>
|
||||||
|
<xsl:text>
|
||||||
packInstall
|
packInstall
|
||||||
rm -rf $PKG_DEST
|
rm -rf $PKG_DEST
|
||||||
|
</xsl:text>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise><!-- wrap-install='y' -->
|
||||||
|
<xsl:copy-of select="substring-before(string(),'ZONEINFO=')"/>
|
||||||
|
<xsl:text>
|
||||||
|
wrapInstall '
|
||||||
|
ZONEINFO=</xsl:text>
|
||||||
|
<xsl:copy-of select="substring-after(string(),'ZONEINFO=')"/>
|
||||||
|
<xsl:text>'
|
||||||
|
packInstall
|
||||||
|
</xsl:text>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
<xsl:text>
|
||||||
PKG_DEST=$OLD_PKG_DEST
|
PKG_DEST=$OLD_PKG_DEST
|
||||||
unset OLD_PKG_DEST
|
unset OLD_PKG_DEST
|
||||||
PKGDIR=$OLD_PKGDIR
|
PKGDIR=$OLD_PKGDIR
|
||||||
|
@ -732,4 +812,26 @@ unset OLD_PKGDIR
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:variable name="APOS">'</xsl:variable>
|
||||||
|
<xsl:template name="output-wrap">
|
||||||
|
<xsl:param name="commands" select="''"/>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="contains($commands,string($APOS))">
|
||||||
|
<xsl:call-template name="output-wrap">
|
||||||
|
<xsl:with-param name="commands"
|
||||||
|
select="substring-before($commands,string($APOS))"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
<xsl:text>'\''</xsl:text>
|
||||||
|
<xsl:call-template name="output-wrap">
|
||||||
|
<xsl:with-param name="commands"
|
||||||
|
select="substring-after($commands,string($APOS))"/>
|
||||||
|
</xsl:call-template>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:otherwise>
|
||||||
|
<xsl:value-of select="$commands"/>
|
||||||
|
</xsl:otherwise>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|
|
@ -157,26 +157,27 @@ extract_commands() { #
|
||||||
$BOOK/stylesheets/lfs-xsl/profile.xsl \
|
$BOOK/stylesheets/lfs-xsl/profile.xsl \
|
||||||
$BOOK/index.xml
|
$BOOK/index.xml
|
||||||
|
|
||||||
xsltproc --nonet \
|
xsltproc --nonet \
|
||||||
--stringparam testsuite $TEST \
|
--stringparam testsuite $TEST \
|
||||||
--stringparam bomb-testsuite $BOMB_TEST \
|
--stringparam bomb-testsuite $BOMB_TEST \
|
||||||
--stringparam vim-lang $VIMLANG \
|
--stringparam vim-lang $VIMLANG \
|
||||||
--stringparam full-locale $FULL_LOCALE \
|
--stringparam full-locale $FULL_LOCALE \
|
||||||
--stringparam timezone $TIMEZONE \
|
--stringparam timezone $TIMEZONE \
|
||||||
--stringparam page $PAGE \
|
--stringparam page $PAGE \
|
||||||
--stringparam lang $LANG \
|
--stringparam lang $LANG \
|
||||||
--stringparam pkgmngt $PKGMNGT \
|
--stringparam pkgmngt $PKGMNGT \
|
||||||
--stringparam hostname $HOSTNAME \
|
--stringparam wrap-install $WRAP_INSTALL \
|
||||||
--stringparam interface $INTERFACE \
|
--stringparam hostname $HOSTNAME \
|
||||||
--stringparam ip $IP_ADDR \
|
--stringparam interface $INTERFACE \
|
||||||
--stringparam gateway $GATEWAY \
|
--stringparam ip $IP_ADDR \
|
||||||
--stringparam prefix $PREFIX \
|
--stringparam gateway $GATEWAY \
|
||||||
--stringparam broadcast $BROADCAST \
|
--stringparam prefix $PREFIX \
|
||||||
--stringparam domain $DOMAIN \
|
--stringparam broadcast $BROADCAST \
|
||||||
--stringparam nameserver1 $DNS1 \
|
--stringparam domain $DOMAIN \
|
||||||
--stringparam nameserver2 $DNS2 \
|
--stringparam nameserver1 $DNS1 \
|
||||||
--output ./${PROGNAME}-commands/ \
|
--stringparam nameserver2 $DNS2 \
|
||||||
$XSL \
|
--output ./${PROGNAME}-commands/ \
|
||||||
|
$XSL \
|
||||||
/tmp/lfs-full.xml >>$LOGDIR/$LOG 2>&1
|
/tmp/lfs-full.xml >>$LOGDIR/$LOG 2>&1
|
||||||
|
|
||||||
rm /tmp/lfs-full.xml
|
rm /tmp/lfs-full.xml
|
||||||
|
|
|
@ -41,7 +41,7 @@ inline_doc
|
||||||
local -r CLFS3_book="$BOOK_common $BOOK_clfsX PLATFORM MIPS_LEVEL"
|
local -r CLFS3_book="$BOOK_common $BOOK_clfsX PLATFORM MIPS_LEVEL"
|
||||||
|
|
||||||
# Build Settings by book
|
# Build Settings by book
|
||||||
local -r LFS_build="$BUILD_chroot VIMLANG $BUILD_common PKGMNGT FULL_LOCALE"
|
local -r LFS_build="$BUILD_chroot VIMLANG $BUILD_common PKGMNGT FULL_LOCALE WRAP_INSTALL"
|
||||||
local -r HLFS_build="$BUILD_chroot $BUILD_common"
|
local -r HLFS_build="$BUILD_chroot $BUILD_common"
|
||||||
local -r CLFS_build="$BUILD_chroot VIMLANG $BUILD_common"
|
local -r CLFS_build="$BUILD_chroot VIMLANG $BUILD_common"
|
||||||
local -r CLFS2_build="STRIP VIMLANG $BUILD_common"
|
local -r CLFS2_build="STRIP VIMLANG $BUILD_common"
|
||||||
|
|
|
@ -115,6 +115,7 @@ define get_pkg_root2
|
||||||
echo "export PKG_DEST=$(SRC)/$@" >> envars; \
|
echo "export PKG_DEST=$(SRC)/$@" >> envars; \
|
||||||
echo "source packInstall.sh" >> envars; \
|
echo "source packInstall.sh" >> envars; \
|
||||||
echo "export -f packInstall" >> envars; \
|
echo "export -f packInstall" >> envars; \
|
||||||
|
echo "export -f wrapInstall" >> envars; \
|
||||||
fi;
|
fi;
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
1
jhalfs
1
jhalfs
|
@ -123,6 +123,7 @@ COMPARE=${COMPARE:-n}
|
||||||
RUN_FARCE=${RUN_FARCE:-n}
|
RUN_FARCE=${RUN_FARCE:-n}
|
||||||
RUN_ICA=${RUN_ICA:-n}
|
RUN_ICA=${RUN_ICA:-n}
|
||||||
PKGMNGT=${PKGMNGT:-n}
|
PKGMNGT=${PKGMNGT:-n}
|
||||||
|
WRAP_INSTALL=${WRAP_INSTALL:-n}
|
||||||
BOMB_TEST=${BOMB_TEST:-n}
|
BOMB_TEST=${BOMB_TEST:-n}
|
||||||
STRIP=${STRIP:=n}
|
STRIP=${STRIP:=n}
|
||||||
REPORT=${REPORT:=n}
|
REPORT=${REPORT:=n}
|
||||||
|
|
56
pkgmngt/packInstall.sh.porg
Normal file
56
pkgmngt/packInstall.sh.porg
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
# $Id:$
|
||||||
|
# functions for recording installation of a package and make a tarball,
|
||||||
|
# or using fakeroot type commands for install, then packing and installing
|
||||||
|
# the package.
|
||||||
|
# We only have access to variables PKGDIR and PKG_DEST. Other variables could
|
||||||
|
# be set in the environment
|
||||||
|
|
||||||
|
wrapInstall() {
|
||||||
|
# a bash command is passed as an argument (that may be a compound command).
|
||||||
|
# It is executed by this function, after various set-ups...
|
||||||
|
|
||||||
|
local PCKGVRS=$(basename $PKGDIR)
|
||||||
|
local TGTPKG=$(basename $PKG_DEST)
|
||||||
|
local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3\}-//' |
|
||||||
|
sed 's/^[0-9]\{1\}-//')
|
||||||
|
# version is only accessible from PKGDIR name. Since the format of the
|
||||||
|
# name is not normalized, several hacks are necessary...
|
||||||
|
case $PCKGVRS in
|
||||||
|
expect*|tcl*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*//') ;;
|
||||||
|
vim*|unzip*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;;
|
||||||
|
tidy*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]*\)/\1cvs/') ;;
|
||||||
|
docbook-xml) local VERSION=4.5 ;;
|
||||||
|
*) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*[-_]\([0-9]\)/\1/' |
|
||||||
|
sed 's/_/./g');;
|
||||||
|
# the last sed above is because some package managers do not want a '_'
|
||||||
|
# in version.
|
||||||
|
esac
|
||||||
|
|
||||||
|
porg -lp ${PACKAGE}-${VERSION} sh << PORG_EOF
|
||||||
|
$*
|
||||||
|
PORG_EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
#----------------
|
||||||
|
packInstall() {
|
||||||
|
|
||||||
|
# With porg, we need only the package name to make the tarball
|
||||||
|
local TGTPKG=$(basename $PKG_DEST)
|
||||||
|
local PACKAGE=$(echo ${TGTPKG} | sed 's/^[0-9]\{3\}-//' |
|
||||||
|
sed 's/^[0-9]\{1\}-//')
|
||||||
|
local PCKGVRS=$(basename $PKGDIR)
|
||||||
|
case $PCKGVRS in
|
||||||
|
expect*|tcl*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*//') ;;
|
||||||
|
vim*|unzip*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]\)\([0-9]\)/\1.\2/') ;;
|
||||||
|
tidy*) local VERSION=$(echo $PCKGVRS | sed 's/^[^0-9]*\([0-9]*\)/\1cvs/') ;;
|
||||||
|
docbook-xml) local VERSION=4.5 ;;
|
||||||
|
*) local VERSION=$(echo ${PCKGVRS} | sed 's/^.*[-_]\([0-9]\)/\1/' |
|
||||||
|
sed 's/_/./g');;
|
||||||
|
# the last sed above is because some package managers do not want a '_'
|
||||||
|
# in version.
|
||||||
|
esac
|
||||||
|
# Building the binary package
|
||||||
|
porgball ${PACKAGE}
|
||||||
|
# The package is in the current directory
|
||||||
|
mv -v ${PACKAGE}-${VERSION}.porg* /var/lib/packages
|
||||||
|
}
|
80
pkgmngt/packageManager.xml.porg
Normal file
80
pkgmngt/packageManager.xml.porg
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" >
|
||||||
|
|
||||||
|
<article>
|
||||||
|
|
||||||
|
<sect1 id="package">
|
||||||
|
<title>Package Information</title>
|
||||||
|
<para>Download: <ulink url="https://sourceforge.net/projects/porg/files/porg-0.10.tar.gz"/></para>
|
||||||
|
<para>MD5 sum: <literal>2eceb8a73bb188dbb06b12d90cabdbb4</literal></para>
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="ch-tools-pkgmngt" role="wrap">
|
||||||
|
<?dbhtml filename="porg.html"?>
|
||||||
|
<title>Porg in tools</title>
|
||||||
|
<sect2 role="installation">
|
||||||
|
<title>Instructions</title>
|
||||||
|
<screen><userinput remap="configure">./configure --prefix=/tools \
|
||||||
|
--disable-grop \
|
||||||
|
--with-porg-logdir=/tools/var/porg</userinput></screen>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
<parameter>--disable-grop</parameter> is needed to prevent the sytem from
|
||||||
|
trying to build the graphical interface, and
|
||||||
|
<parameter>--with-porg-logdir=...</parameter> is needed because
|
||||||
|
<command>make install</command> insists on creating a directory in
|
||||||
|
<filename class="directory">/var</filename>, where we do not want
|
||||||
|
to write.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<screen><userinput remap="make">make</userinput></screen>
|
||||||
|
|
||||||
|
<screen><userinput remap="install">make install</userinput></screen>
|
||||||
|
|
||||||
|
<screen><userinput>cat >> /tools/etc/porgrc << EOF
|
||||||
|
# Porg logdir on LFS system
|
||||||
|
LOGDIR=/var/lib/porg
|
||||||
|
EOF
|
||||||
|
sed -e '/EXCLUDE/{s/^#//;s@$@:/sources:/home@}' \
|
||||||
|
-i /tools/etc/porgrc</userinput></screen>
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="ch-pkgmngt-creatingdirs">
|
||||||
|
|
||||||
|
<title>Directories</title>
|
||||||
|
<screen><userinput>mkdir -pv /var/lib/porg
|
||||||
|
mkdir -pv /var/lib/packages</userinput></screen>
|
||||||
|
|
||||||
|
</sect1>
|
||||||
|
<sect1 id="ch-pkgmngt-createfiles">
|
||||||
|
<title>Files</title>
|
||||||
|
<para><command>porgball</command> needs <filename>porgrc</filename>
|
||||||
|
in <filename class="directory">/etc</filename>:</para>
|
||||||
|
<screen><userinput>cp /tools/etc/porgrc /etc</userinput></screen>
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
<sect1 id="ch-system-pkgmngt" role="wrap">
|
||||||
|
<?dbhtml filename="porg.html"?>
|
||||||
|
<title>Final Porg</title>
|
||||||
|
<sect2 role="installation">
|
||||||
|
<title>Instructions</title>
|
||||||
|
|
||||||
|
<screen><userinput remap="configure">./configure --prefix=/usr \
|
||||||
|
--disable-grop \
|
||||||
|
--sysconfdir=/etc \
|
||||||
|
--with-porg-logdir=/var/lib/porg</userinput></screen>
|
||||||
|
|
||||||
|
<screen><userinput remap="make">make</userinput></screen>
|
||||||
|
|
||||||
|
<screen><userinput remap="install">porg -lD "make install"</userinput></screen>
|
||||||
|
|
||||||
|
<screen><userinput>sed -e '/EXCLUDE/{s/^#//;s@$@:/sources:/home@}' \
|
||||||
|
-i /etc/porgrc</userinput></screen>
|
||||||
|
</sect2>
|
||||||
|
|
||||||
|
</sect1>
|
||||||
|
</article>
|
Reference in a new issue