[jhalfs] branch trunk updated: Various updates for pacman PM

"Git Owner" ([email protected] via alfs-discuss Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.automated
Message-ID <165512842485.18473.1860142272587401673@rivendell.linuxfromscratch.org>
This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch trunk
in repository jhalfs.

The following commit(s) were added to refs/heads/trunk by this push:
     new 55e82d2  Various updates for pacman PM
55e82d2 is described below

commit 55e82d2ae0411c3e82a9605577d1aceb8aced011
Author: Pierre Labastie <[email protected]>
AuthorDate: Sun Jun 12 22:54:14 2022 +0200

    Various updates for pacman PM
    
    - update versions and instructions in packageManager.xml.pacman.
      Also remove the pages for old books.
    - Fix packInstall.sh.pacman, so that restarting after a failure
      is possible
    - Change LFS/lfs.xsl so that destdir install use symlinks for
      /lib, /sbin, and /bin. Remove also absolete commands for old
      books
    - fix gcc script in book parser
---
 LFS/lfs.xsl                       |  46 ++++----
 common/libs/func_book_parser      |   9 +-
 pkgmngt/packInstall.sh.pacman     |  13 ++-
 pkgmngt/packageManager.xml.pacman | 218 +++++---------------------------------
 4 files changed, 61 insertions(+), 225 deletions(-)

diff --git a/LFS/lfs.xsl b/LFS/lfs.xsl
index f7fee54..c1ccdcc 100644
--- a/LFS/lfs.xsl
+++ b/LFS/lfs.xsl
@@ -10,13 +10,13 @@
 
   <!-- use package management ?
        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 chapter08-10
   -->
   <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.
+       y = yes, wrap install commands of chapter08-10 into a bash function.
                 note that pkgmngt must be 'y' in this case
   -->
   <xsl:param name="wrap-install" select='"n"'/>
@@ -187,26 +187,13 @@ otherwise it is in /bin.-->
     <!-- Inclusion of package manager scriptlets -->
     <xsl:if test="$pkgmngt='y' and
                   following-sibling::sect1[1][@id='ch-tools-stripping' or @id='ch-tools-cleanup']">
-      <xsl:choose>
-        <xsl:when test="$bashdir='/tools'">
-          <xsl:apply-templates
-            select="document('packageManager.xml')//sect1[
-                                              contains(@id,'ch-tools')]"
-            mode="pkgmngt">
-            <xsl:with-param name="order" select="$order+1"/>
-            <xsl:with-param name="dirname" select="$dirname"/>
-          </xsl:apply-templates>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:apply-templates
-            select="document('packageManager.xml')//sect1[
-                                              contains(@id,'ch-chroot')]"
-            mode="pkgmngt">
-            <xsl:with-param name="order" select="$order+1"/>
-            <xsl:with-param name="dirname" select="$dirname"/>
-          </xsl:apply-templates>
-        </xsl:otherwise>
-      </xsl:choose>
+      <xsl:apply-templates
+        select="document('packageManager.xml')//sect1[
+                                          contains(@id,'ch-chroot')]"
+        mode="pkgmngt">
+        <xsl:with-param name="order" select="$order+1"/>
+        <xsl:with-param name="dirname" select="$dirname"/>
+      </xsl:apply-templates>
     </xsl:if>
     <xsl:if test="$pkgmngt='y' and
                   following-sibling::sect1[2][@id='ch-system-strippingagain' or @id='ch-system-stripping']">
@@ -245,14 +232,19 @@ otherwise it is in /bin.-->
         </xsl:when>
         <xsl:otherwise>
 <!-- We cannot know which directory(ies) are needed by the package. Create a
-     reasonable bunch of them. Should be close to "Creating Directories".-->
-          <xsl:text>mkdir -pv $PKG_DEST/{bin,boot,etc,lib,sbin}
+     reasonable bunch of them. Should be close to "Creating Directories".
+     Create also symlinks from /lib, /bin, /sbin to their counterpart
+     in usr, so that the package only has files in /usr-->
+          <xsl:text>mkdir -pv $PKG_DEST/{boot,etc}
 mkdir -pv $PKG_DEST/usr/{bin,include,lib/pkgconfig,sbin}
 mkdir -pv $PKG_DEST/usr/share/{doc,info,bash-completion/completions}
 mkdir -pv $PKG_DEST/usr/share/man/man{1..8}
 case $(uname -m) in
  x86_64) mkdir -v $PKG_DEST/lib64 ;;
 esac
+ln -sv usr/sbin $PKG_DEST
+ln -sv usr/bin  $PKG_DEST
+ln -sv usr/lib  $PKG_DEST
 </xsl:text>
         </xsl:otherwise>
       </xsl:choose>
@@ -299,17 +291,18 @@ SECONDS=${PREV_SEC}
 rm -fv $PKG_DEST/sbin/nologin
 </xsl:text>
           </xsl:if>
-<!-- remove empty directories -->
+<!-- remove empty directories and symlinks-->
           <xsl:text>for dir in $PKG_DEST/usr/share/man/man{1..8} \
            $PKG_DEST/usr/share/bash-completion{/completions,} \
            $PKG_DEST/usr/share/{doc,info,man,} \
            $PKG_DEST/usr/lib/pkgconfig \
            $PKG_DEST/usr/{lib,bin,sbin,include} \
-           $PKG_DEST/{boot,etc,lib,bin,sbin}; do
+           $PKG_DEST/{boot,etc}; do
   [ -d "$dir" ] &amp;&amp; [ -z "$(ls $dir)" ] &amp;&amp; rmdir -v $dir
 done
 [ -d $PKG_DEST/lib64 ] &amp;&amp; [ -z "$(ls $PKG_DEST/lib64)" ] &amp;&amp;
   rmdir -v $PKG_DEST/lib64
+rm -v $PKG_DEST/{lib,bin,sbin}
 <!-- prevent overwriting symlinks: if a package install something in
      these directories, it'll be lost if not using package management,
      since they are symlinks to tmpfs. So, remove it too if using PM. -->
@@ -1266,6 +1259,7 @@ PKGDIR=$(tar -tf $PACKAGE | head -n1 | sed 's@^./@@;s@/.*@@')
 export PKGDIR VERSION PKG_DEST
 
 if [ -d "$PKGDIR" ]; then rm -rf $PKGDIR; fi
+if [ -d "$PKG_DEST" ]; then rm -rf $PKG_DEST; fi
 if [ -d "${PKGDIR%-*}-build" ]; then  rm -rf ${PKGDIR%-*}-build; fi
 </xsl:text>
     </xsl:if>
diff --git a/common/libs/func_book_parser b/common/libs/func_book_parser
index 268309a..c5d8c02 100644
--- a/common/libs/func_book_parser
+++ b/common/libs/func_book_parser
@@ -109,7 +109,14 @@ extract_commands() {         #
   # Remove flags requesting user action in some cases. Much easier here than
   # in the stylesheet...
   sed -i 's/-iv /-v /' "./${COMMANDS}/"chapter??/*kernel*
-
+  # If doing a destdir install (PM without wrap), the gcc instructions
+  # fail for two reasons: a missing dir, and gcc -dumpmachine returns a
+  # wrong string.
+  if [ "$PKGMNGT" = y ] && [ "$WRAP_INSTALL" = n ]; then
+    sed -e 's|(gcc|&/xgcc|' \
+        -e '/lto_plug/imkdir -pv $PKG_DEST/usr/lib/bfd-plugins' \
+        -i ./${COMMANDS}/chapter08/*gcc
+  fi
   echo "done"
 
   # Make the scripts executable.
diff --git a/pkgmngt/packInstall.sh.pacman b/pkgmngt/packInstall.sh.pacman
index 4397645..0b88cbc 100644
--- a/pkgmngt/packInstall.sh.pacman
+++ b/pkgmngt/packInstall.sh.pacman
@@ -30,13 +30,16 @@ pushd $PKG_DEST
 rm -fv ./usr/share/info/dir  # recommended since this directory is already there
                              # on the system
 # Right now, we have the files in the current directory. They should be moved
-# to /sources/$PACKAGE/src.
-mkdir -p ../$PACKAGE/src
+# to /sources/$PACKAGE/src. Also, in case there was a failure before, clean
+# /sources/$PACKAGE
+rm -rf /sources/$PACKAGE
+mkdir -p /sources/$PACKAGE/src
+
 # We'll build as user builder. We need this directory to be owned by that user.
-chown -R builder ../$PACKAGE
-mv * ../$PACKAGE/src
+chown -R builder /sources/$PACKAGE
+mv * /sources/$PACKAGE/src
 chown -R builder $PKG_DEST
-chmod -R o+r ../$PACKAGE
+chmod -R o+r /sources/$PACKAGE
 
 cat > PKGBUILD <<EOF
 pkgname=( '$PACKAGE' )
diff --git a/pkgmngt/packageManager.xml.pacman b/pkgmngt/packageManager.xml.pacman
index d4c6af9..e306efb 100644
--- a/pkgmngt/packageManager.xml.pacman
+++ b/pkgmngt/packageManager.xml.pacman
@@ -9,18 +9,18 @@ book if you prefer. That slightly changes the aspect if you render
 it in html -->
 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY libarchive-version "3.4.3">
-<!ENTITY curl-version       "7.71.1">
-<!ENTITY fakeroot-version   "1.24">
-<!ENTITY pacman-version     "5.2.2">
+<!ENTITY libarchive-version "3.6.1">
+<!ENTITY curl-version       "7.83.1">
+<!ENTITY fakeroot-version   "1.29">
+<!ENTITY pacman-version     "6.0.1">
 <!ENTITY libarchive-url "https://github.com/libarchive/libarchive/releases/download/v&libarchive-version;/libarchive-&libarchive-version;.tar.xz">
-<!ENTITY curl-url       "https://curl.haxx.se/download/curl-&curl-version;.tar.xz">
+<!ENTITY curl-url       "https://curl.se/download/curl-&curl-version;.tar.xz">
 <!ENTITY fakeroot-url   "http://deb.debian.org/debian/pool/main/f/fakeroot/fakeroot_&fakeroot-version;.orig.tar.gz">
-<!ENTITY pacman-url     "https://sources.archlinux.org/other/pacman/pacman-&pacman-version;.tar.gz">
-<!ENTITY curl-md5       "b54b386057846ce3edd3584b19741569">
-<!ENTITY libarchive-md5 "4b216ea3015ecf8ae555a2026f9a6b73">
-<!ENTITY fakeroot-md5   "964e5f438f1951e5a515dd54edd50fa6">
-<!ENTITY pacman-md5     "3a9b078a83996a3272844807b91959c6">
+<!ENTITY pacman-url     "https://sources.archlinux.org/other/pacman/pacman-&pacman-version;.tar.xz">
+<!ENTITY curl-md5       "08c6d9c25d9cf8d17be28363753e42ca">
+<!ENTITY libarchive-md5 "9465f7995649c9ea84854a7fd8c76f30">
+<!ENTITY fakeroot-md5   "cab9604a7dc1d58346e0d15bb285bd0f">
+<!ENTITY pacman-md5     "f71e6f06867749735960d0c1d199d375">
 <!ENTITY % general-entities SYSTEM "BOOK/general.ent">
 %general-entities;
 ]>
@@ -54,173 +54,7 @@ Do not change  anything, except the url and the md5 checksum. -->
 </sect1>
 -->
 
-<!-- Do not change the next line. The name of the scriptlet will be taken
-from the dbhtml instruction: it is the name of the file less .html, with
-xxx-x-added before (x, digits).-->
-<sect1 id="ch-tools-libarchive" role="wrap">
-  <?dbhtml filename="libarchive.html"?>
-
-  <sect1info condition="script">
-    <productname>libarchive</productname>
-    <productnumber>&libarchive-version;</productnumber>
-    <address>&libarchive-url;</address>
-  </sect1info>
-
-  <title>Libarchive-&libarchive-version;</title>
-
-  <sect2 role="installation">
-    <title/>
-<screen><userinput remap="configure">./configure --prefix=/tools \
-            --without-bz2lib \
-            --without-xml2   \
-            --enable-bsdtar=static \
-            --enable-bsdcpio=static</userinput></screen>
-<screen><userinput remap="make">make</userinput></screen>
-<screen><userinput remap="install">make install</userinput></screen>
-  </sect2>
-
-</sect1>
-
-<sect1 id="ch-tools-openssl" role="wrap">
-  <?dbhtml filename="openssl.html"?>
-
-  <sect1info condition="script">
-    <productname>openssl</productname>
-    <productnumber>&openssl-version;</productnumber>
-    <address>&openssl-url;</address>
-  </sect1info>
-
-  <title>openssl-&openssl-version;</title>
-
-  <sect2 role="installation">
-    <title/>
-<screen><userinput remap="configure">./config --prefix=/tools            \
-         --openssldir=/tools/etc/ssl \
-         --libdir=lib</userinput></screen>
-<screen><userinput remap="make">make</userinput></screen>
-<screen><userinput remap="install">make install</userinput></screen>
-  </sect2>
-
-</sect1>
-
-<sect1 id="ch-tools-curl" role="wrap">
-  <?dbhtml filename="curl.html"?>
-
-  <sect1info condition="script">
-    <productname>curl</productname>
-    <productnumber>&curl-version;</productnumber>
-    <address>&curl-url;</address>
-  </sect1info>
-
-  <title>Curl-&curl-version;</title>
-
-  <sect2 role="installation">
-    <title/>
-<screen><userinput remap="configure">./configure --prefix=/tools \
-            --disable-static</userinput></screen>
-<screen><userinput remap="make">make</userinput></screen>
-<screen><userinput remap="install">make install</userinput></screen>
-  </sect2>
-
-</sect1>
-
-<sect1 id="ch-tools-libcap" role="wrap">
-  <?dbhtml filename="libcap.html"?>
-
-  <sect1info condition="script">
-    <productname>libcap</productname>
-    <productnumber>&libcap-version;</productnumber>
-    <address>&libcap-url;</address>
-  </sect1info>
-
-  <title>libcap-&libcap-version;</title>
-
-  <sect2 role="installation">
-    <title/>
-<screen><userinput remap="make">make lib=lib prefix=/tools GOLANG=no PAM_CAP=no</userinput></screen>
-<screen><userinput remap="install">make lib=lib prefix=/tools GOLANG=no PAM_CAP=no install</userinput></screen>
-  </sect2>
-
-</sect1>
-
-<sect1 id="ch-tools-fakeroot" role="wrap">
-  <?dbhtml filename="fakeroot.html"?>
-
-  <sect1info condition="script">
-    <productname>fakeroot</productname>
-    <productnumber>&fakeroot-version;</productnumber>
-    <address>&fakeroot-url;</address>
-  </sect1info>
-
-  <title>fakeroot-&fakeroot-version;</title>
-
-  <sect2 role="installation">
-    <title/>
-<screen><userinput remap="configure">./configure --prefix=/tools</userinput></screen>
-<screen><userinput remap="make">make</userinput></screen>
-<screen><userinput remap="install">make install</userinput></screen>
-  </sect2>
-
-</sect1>
-
-<sect1 id="ch-tools-pkgmngt" role="wrap">
-  <?dbhtml filename="pacman.html"?>
-
-  <sect1info condition="script">
-    <productname>pacman</productname>
-    <productnumber>&pacman-version;</productnumber>
-    <address>&pacman-url;</address>
-  </sect1info>
-
-  <title>Pacman-&pacman-version;</title>
-
-  <sect2 role="installation">
-    <title/>
-<!-- You can use any number of remap="pre", "configure", "make", "test", "install"
-<screen><userinput remap="something">Instructions</userinput></screen>.
-They are executed in that order. "pre" can be used for patching for example.
-In case testing is enabled, the instructions flagged test are logged to a different
-file (test-log). If testing is not enabled, they are not executed at all. Do not
-put line breaks before and after your instructions. <userinput> without
-remap attribute are considered configuration instructions and executed last. You
-can also use remap="adjust" for the same purpose. -->
-<screen><userinput remap="configure">mkdir build
-cd build
-meson --prefix=/tools                        \
-      --sysconfdir=/tools/etc                \
-      --localstatedir=/tools/var             \
-      -Dcrypto=openssl                       \
-      -Ddoc=disabled                         \
-      -Dgpgme=disabled                       \
-      -Dpkg_config_path=/tools/lib/pkgconfig</userinput></screen>
-
-<screen><userinput remap="make">ninja</userinput></screen>
-
-<screen><userinput remap="install">ninja install</userinput></screen>
-
-<screen><userinput>sed -e 's@/usr@/tools@g' \
-    -e 's/\([^!]\)strip/\1!strip/' \
-    -e 's/\([^!]\)libtool/\1!libtool/' \
-    -e 's/\([^!]\)zipman/\1!zipman/' \
-    -i /tools/etc/makepkg.conf
-cat &gt;&gt; /tools/etc/makepkg.conf &lt;&lt; EOF
-BUILDDIR=/sources
-PKGDEST=/var/lib/packages
-PACKAGER="Pierre Labastie &lt;[email protected]&gt;"
-EOF
-cat &gt;&gt; /tools/etc/pacman.conf &lt;&lt; EOF
-DBPath   = /var/lib/pacman/
-CacheDir = /var/cache/pacman/pkg/
-LogFile  = /var/log/pacman.log
-SigLevel = Never
-# Repository: do not add one now: repo-add needs openssl.
-EOF</userinput></screen>
-
-  </sect2>
-
-</sect1>
-
-<!-- version for new book: needs ninja and meson, which needs
+<!-- pacman now needs ninja and meson, which needs
      Python rebuilt with libffi and zlib. Needs also pkg-config -->
 <sect1 id="ch-chroot-libarchive" role="wrap">
   <?dbhtml filename="libarchive.html"?>
@@ -284,7 +118,8 @@ EOF</userinput></screen>
   <sect2 role="installation">
     <title/>
 <screen><userinput remap="configure">./configure --prefix=/usr \
-            --disable-static</userinput></screen>
+    --disable-static \
+    --with-openssl</userinput></screen>
 <screen><userinput remap="make">make</userinput></screen>
 <screen><userinput remap="install">make install</userinput></screen>
   </sect2>
@@ -304,13 +139,9 @@ EOF</userinput></screen>
 
   <sect2 role="installation">
     <title/>
-<screen><userinput remap="pre">sed -i '/install.*STACAPLIBNAME/d' libcap/Makefile</userinput></screen>
-<screen><userinput remap="make">make lib=lib</userinput></screen>
-<screen><userinput remap="install">make lib=lib PKGCONFIGDIR=/usr/lib/pkgconfig install
-chmod -v 755 /lib/libcap.so.&libcap-version;
-mv -v /lib/libpsx.a /usr/lib
-rm -v /lib/libcap.so
-ln -sfv ../../lib/libcap.so.2 /usr/lib/libcap.so</userinput></screen>
+<screen><userinput remap="pre">sed -i '/install -m.*STA/d' libcap/Makefile</userinput></screen>
+<screen><userinput remap="make">make prefix=/usr lib=lib</userinput></screen>
+<screen><userinput remap="install">make lib=lib prefix=/usr install</userinput></screen>
   </sect2>
 
 </sect1>
@@ -351,8 +182,7 @@ ln -sfv ../../lib/libcap.so.2 /usr/lib/libcap.so</userinput></screen>
 <screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
 <screen><userinput remap="make">make</userinput></screen>
 <screen><userinput remap="install">make install
-mv -v /usr/lib/libz.so.* /lib
-ln -sfv ../../lib/$(readlink /usr/lib/libz.so) /usr/lib/libz.so</userinput></screen>
+rm -fv /usr/lib/libz.a</userinput></screen>
   </sect2>
 
 </sect1>
@@ -370,7 +200,7 @@ ln -sfv ../../lib/$(readlink /usr/lib/libz.so) /usr/lib/libz.so</userinput></scr
 
   <sect2 role="installation">
     <title/>
-<screen><userinput remap="configure">./configure --prefix=/usr --disable-static --with-gcc-arch=native</userinput></screen>
+<screen><userinput remap="configure">./configure --prefix=/usr --disable-static --with-gcc-arch=native --disable-exec-static-tramp</userinput></screen>
 <screen><userinput remap="make">make</userinput></screen>
 <screen><userinput remap="install">make install</userinput></screen>
   </sect2>
@@ -522,10 +352,10 @@ find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \;
 find man -name Makefile.in -exec sed -i 's/passwd\.5 / /'   {} \;
 sed -e 's:#ENCRYPT_METHOD DES:ENCRYPT_METHOD SHA512:' \
     -e 's:/var/spool/mail:/var/mail:'                 \
-    -i etc/login.defs
-sed -i 's/1000/999/' etc/useradd</userinput></screen>
+    -e '/PATH=/{s@/sbin:@@;s@/bin:@@}'                \
+    -i etc/login.defs</userinput></screen>
 <screen><userinput remap="configure">touch /usr/bin/passwd
-./configure --sysconfdir=/etc \
+./configure --sysconfdir=/etc --disable-static \
             --with-group-name-max-length=32</userinput></screen>
 <screen><userinput remap="make">make</userinput></screen>
 <screen><userinput remap="install">make install</userinput></screen>
@@ -604,10 +434,12 @@ sets of instructions end up in the same file, which is usually not a problem.
   <sect2 role="installation">
     <title/>
 <screen><userinput remap="configure">./configure --prefix=/usr \
-            --disable-static \
-            --enable-threaded-resolver</userinput></screen>
+            --disable-static --with-openssl \
+            --enable-threaded-resolver \
+            --with-ca-path=/etc/ssl/certs</userinput></screen>
 <screen><userinput remap="make">make</userinput></screen>
 <screen><userinput remap="install">make DESTDIR=$PKG_DEST install
+rm -rf docs/examples/.deps
 find docs \( -name "Makefile*" -o -name "*.1" -o -name "*.3" \) -exec rm {} \;
 install -v -d -m755 $PKG_DEST/usr/share/doc/curl-&curl-version;
 cp -v -R docs/*     $PKG_DEST/usr/share/doc/curl-&curl-version;</userinput></screen>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

-- 
http://lists.linuxfromscratch.org/sympa/info/alfs-discuss
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.