Profile syntax

Gerard Beekmans gerard at linuxfromscratch.org
Wed Oct 18 17:29:21 PDT 2000


Below you find a copy of the syntax of the tags we've come up with. This does 
not include any fdisk related stuff, we'll wait with that for later since 
it's a rather complex thing in itself.

This file gives you the tags we want to use and the attributes allowed. It 
does not describe "if you use attribute A you must use B as well and C is 
then now allowed" in full detail, that we will deal with very soon.

This is semi-final. After you guys have given your valueable input we'll mark 
it "final syntax" and we'll see what other tags and constructions are needed 
to finish chapters 7 through 9.

-----------------------------------------


Authors:    Jesse Tie Ten Quee (highos at highos dot com)
            Gerard Beekmans (gerard at linuxfromscratch dot com)
            Bryan Dumm (bdumm at bobby dot bcpub dot com)
            (And of course, everyone on alfs-profile at linuxfromscratch.org)
Version:    0.0.2
Subject:    Profile Syntax


Getting started:
================

The ALFS Profile is based heavily on XML, this descriptes the basic syntax 
we plan on using (and writting a DTD)

Single and double quotes are allowed, we've only used double here.




Calling external commands:
--------------------------

(note: We _stronly_ believe this should be rarelly used, but is supported)

Used for executing external system commands (make, patch, configure, etc)

Tag name:  system_command
Tag value: command to execute

Allowed attributes:
	param1		- first paramter
	param2		- second parameter
	param3		- third parameter
	paramx		- xth paramter

Example:

<system_command param1="-N" param2="-p" param3="-i"
	param4="file.patch">patch</system_command>

Note:

A different approach would be:

Allowed attributes:
	params		- All parameters

Example:
	<system_command params="-Np1 -i file.patch">patch</system_command>


A no tag value scenario:

	params (or param1 param2 param3 paramx)
	command

	<system_command params="-a -b -c" command="dothis" />




Search and Replace:
-------------------

If you want to replace a certain string in a file, this is what you could use.

Tag name:  search_replace
Tag value: file to operate on

Allowed attributes:
	find		- string to look for
	replace		- string to replace the 'find' string with

Example:

    <search_replace find="termcap" replace="ncurses">Makefile</search_replace>


A no tag value scenario:
	find
	replace
	file

<searh_replace find="termcap" replace="ncurses" file="Makefile" />


Mounting a Partition:
---------------------

Tag name:  mount
Tag value: mount point

Allowed attributes:
	device		- the device to mount
	fs			- file system type

Example:

<mount device="/dev/hda1" fs="ext2">/mnt/lfs</mount>

A no tag value scenario:

	device	
	fs
	point

<mount device="/dev/hda1" fs="ext2" point="/mnt/lfs />



Making directories:
-------------------

Tag name:  mkdir
Tag value: directory/directories to make

Allowed attributes:
	None so far	

Example:

    <mkdir>/mnt/lfs/bin</mkdir>
    <mkdir>bin boot etc sbin usr</mkdir>



Creating Links:
---------------

Used for creating hard or soft links.

Tag name:  link
Tag value: destination

Allowed attributes:
	source		- source to link from
	type		- type of link


Example:

	<link source="share/man" type="symbolic">man</link>
	<link source="share/info" type="hard">info</link>

No tag value scenario:
	source
	destination
	type

    <link source="share/info" destination="info" type="symbolic" />



Setting Permissions:
-----------------------------

Used for setting permissions:

Tag name:  permissions
Tag value: file(s) or directory(ies) to set permissions on

Allowed attributes:

	set		- permission value: either alphanumeric or octal values

Example:

	<permissions set="go+r">/root</permissions>
	<permissions set="1777">/usr/tmp /var/tmp</permissions

No tag value scenario:

	set
	target	- file(s) or directory(ies) to set permissions on

	<permissions set="1777" target="/tmp" />




Moving files/directories around:
--------------------------------

Tag name:  move
Tag value: target(s) to move

Allowed attributes:
	source	- source to move from
	
Example:

	<move source="/mnt/lfs/usr/bin/bash">/mnt/lfs/bin</move>

No tag value scenario:

	source
	destination - destination to move source to

	<move source="m/nt/lfs/usr/bin/bash" destination"/mnt/lfs/bin" />



Text file dump:
---------------


Dumping information to a text file on the system.

Tag name:  textdump
Tag value: content to dump

Allowed attributes:
	file	- where to dump the output to

Example:


    <textdump file="configparms">
    slibdir=/lib
    sysconfdir=/etc
    </textdump>




Package Installation:
=====================

Tag name:  package
Tag value: subtags that make up the installation of a package

Allowed attributes:
	name		- package name
	version		- package version
	toplevel	- toplevel directory of package
	buildir		- build directory

Allowed subtags:

	preconfigure	- used to do things before you run configure script
	configure		- run configure script
	prebuild		- used to do things before you build the package
	build			- build the package (run make)
	preinstall		- used to do things before you install a package
	install			- install the package (make install)
	postinstall		- used to do things after you install a package


We tried to cover all possibilities of when we would need these tags, you 
will problably not use all of them, just at least half.


Example:

    Simple package;

    <package name="ed" version="0.2" toplevel="ed-0.2">
        <configure>
            <system_command val1="--prefix=/usr">configure</system_command>
        </configure>

        <build>
            <system_command>make</system_command>
        </build>

        <install>
            <system_command val1="install">make</system_command>
        </install>

        <postinstall>
            <move source="/usr/bin/ed">/bin</move>
            <move source="/usr/bin/red">/bin</move>
        </postinstall>
    </package>

    Average package;

(Note: This is iffy, mainly because toplevel= and build=, have to be
looked into) 

    <package name="glibc" version="2.1.3" toplevel="glibc-2.1.3" 
build="glibc-build">
        <preconfigure>
            <textdump file="configparms">
            slibdir=/lib
            sysconfdir=/etc
            </textdump>

            <system_command val1="-Np1 -i" val2="../glibc-2.1.3.patch">
				patch</system_command>
        </preconfigure>

        <configure>
            <system_command val1="--prefix=/usr" val2="--enable-add-ons" 
				val3="--with-header=/mnt/lfs/usr/include">
				configure</system_command>
        </configure>

        <build>
            <system_command>make</system_command>
        </build>

        <install>
            <system_command val1="install_root=/mnt/lfs" 
				val2="install">make</system_command>
            <system_command val1="install_root=/mnt/lfs" 
				val2="localedata/install-locales">make</system_command>
        </install>
    </package>

    Custom (HIghoS) package;
    (note: <collection_system_files> is a custom function/element)

    <package name="ed" version="0.2" toplevel="ed-0.2">
        <configure>
            <system_command val1="--prefix=/usr">./configure</system_command>
        </configure>

        <build>
            <system_command>make</system_command>
        </build>

        <preinstall>
            <collect_system_files file="sys.files" />
        </preinstall>

        <install>
            <system_command val1="install">make</sustem_command>
        </install>

        <postinstall>
            <collect_system_files file="sys.files~" />
            <system_command val1="sys.files*" redirect="ouput" 
				val2="ed.files">diff</system_command>
        </postinstall>
    </package>



-- 
Gerard Beekmans
www.linuxfromscratch.org

-*- If Linux doesn't have the solution, you have the wrong problem -*-

-- 
Unsubscribe: send email to alfs-profile-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message




More information about the alfs-discuss mailing list