Thinking forward LFS-7.0

Thomas Trepl thomas at equinox.homelinux.org
Sun Mar 27 00:32:20 PDT 2011


On Sunday 27 March 2011 04:36:57 DJ Lucas wrote:
> On 03/14/2011 08:56 PM, Bruce Dubbs wrote:
> > I really don't have a problem with adding DESTDIR in Chapter 6.  In most
> > cases I suspect it would only require a few more cp commands and an
> > explanation in the Package Management section.  For BLFS to follow would
> > be a much larger effort.
Not really - except you expect DESTDIR in every single page. That would be a 
huge effort.  But when adding new or changind existing pages we could add it. 
The most difficult pack on the way thru my working list was PHP, but also ok. 
Lets see what X and KDE brings up. All in all I think it would be nice 
enhancement but needs to be discussed on blfs-dev.
> 
> Just wanted to show a single sample before I go too far with it. I
> wanted to get anyone's input on how the page should look, flow, and
> read. Anything different, explanation, leading text, or just keep it
> simple like below? Also need to work in some additional text regarding
> the package management page, but as you can see, not much for change in
> the packages themselves.
> 
> Index: chapter06/autoconf.xml
> ===================================================================
> --- chapter06/autoconf.xml    (revision 9491)
> +++ chapter06/autoconf.xml    (working copy)
> @@ -57,10 +57,30 @@
>       that use Automake. For full test coverage, Autoconf can be re-tested
>       after Automake has been installed.</para>
> 
> - <para>Install the package:</para>
> + <para>Install the package into the temporary directory:</para>
> 
> -<screen><userinput remap="install">make install</userinput></screen>
> +<screen><userinput remap="install">make DESTDIR="$PWD/package_dir"
> install &&
> +rm package_dir/usr/share/info/dir</userinput></screen>
> 
> + <!-- Begin extra sample that I used last time -->
> + <para>Create a list of installed files (This is only for book editors,
> but +    I figured I'd drop it in as an example of what could be done with
> it):</para>
> +
> +<screen><userinput remap="install">cd package_dir
> +for dir in `find . -type d`
> +do
> +    ls -ld $dir | sed -e "s@ ./@ /@" -e "/ .\$/d"
> +done > ../../autoconf-&autoconf-version;-contents.txt &&
> +for file in `find . -type f`
> +do
> +    ls -l $file | sed "s@ ./@ /@"
> +done > ../../autoconf-&autoconf-version;-contents.txt</userinput></screen>
> + <!-- End sample -->
> +
> + <para>Install the package with the following commands:</para>
> +
> +<screen><userinput remap="install">cp -R * / &&
> +install-info /usr/share/info/*.info</userinput></screen>
> </sect2>
> 
> <sect2 id="contents-autoconf" role="content">
> ============================================
> Simple enough? :-)  This is pretty much the gist of everything in LFS.
> The little sample addition was for my own use, but figured I'd leave it
> in there for others if they wanted to use something similar.
> 
> -- DJ Lucas
I'd prefer such a simple approach. That is easy to understand and has no heavy 
impact on what LFS is for: Showing how to build an OS. But readers may get an 
idea what could be possible using that technique.
I think the part with additional actions (where you generate the list of 
dirs/files) should be differently tagged (<userinput remap="binpackready"> or 
so). Such actions are totally optional and everyone may want to do different 
things there (as it has not really to do with the installation of the pack 
itself) - tar it up could be such an action. The "cp -R /" is now the real 
install command what previously the "make install" was, and the "install-info 
..." is a post-install requirement. That all may needs to be sepearated 
somehow. So it seems to me that there are several different parts which even 
could be executed on quite different times:

1a) CMMI to the DESTDIR
1b) Cleanup in DESTDIR like removing usr/share/info/dir if exists
2) Optional actions on DESTDIR like filelists / taring etc.
3a) Pre-install like creating users which may own files
3b) Copy DESTDIR to /   (or untar to /)
3c) Post-install like install-info

IMHO separating the 3a, 3b, 3c would be quite essential for script generators 
to be able to handle those separartly - maybe something like this:.

---------------
<screen><userinput remap="install-ph1">make DESTDIR="$PWD/package_dir"
install &&
rm package_dir/usr/share/info/dir</userinput></screen>

<!-- Begin extra sample that I used last time -->
<para>Create a list of installed files (This is only for book editors, but I 
figured I'd drop it in as an example of what could be done with
it):</para>

<screen><userinput remap="install-ph2">cd package_dir
for dir in `find . -type d`
do
    ls -ld $dir | sed -e "s@ ./@ /@" -e "/ .\$/d"
done > ../../autoconf-&autoconf-version;-contents.txt &&
for file in `find . -type f`
do
    ls -l $file | sed "s@ ./@ /@"
done > ../../autoconf-&autoconf-version;-contents.txt</userinput></screen>
 <!-- End sample -->

<para>Install the package with the following commands:</para>

<screen><userinput remap="install-ph3b">cp -R * / </userinput></screen>

<para>Now configure the newly installed package</para>

<screen><userinput remap="install-ph3c">install-info 
/usr/share/info/*.info</userinput></screen>
</sect2>
---------------

--
Thomas



More information about the lfs-dev mailing list