RFC: ALFS profile syntax, version 2

flake at sedum.tommyk.com flake at sedum.tommyk.com
Thu Sep 13 21:27:57 PDT 2001


Hi,

    OK, I haven't worked on this, nor has there been discussion on this in weeks (months?)  Let's have some!  :)

~Jason

-- 
-------------- next part --------------
Title:		Profile Syntax Documentation
Version:	0.1.0
Author:		Jason Gurtz <jason(at)tommyk(dot)com>
-----------------------------------------------------

INTRODUCTION:
	This is the second go at designing a workable syntax for the ALFS project.  It is still XML based, however, we hope this new version will better take advantage of the benefits XML offers.  As usual, this is a work in progress.  Comments should be directed to alfs-discuss at linuxfromscratch.org  Eventually, each package will have it's own profile, "pkgName.xml," that will be called by a master, "system," profile.  For now, to get things going, everything will be in one profile, "profile.xml." 

SYNOPSIS:
	Each package to be installed is enclosed in the "<package></package>" tag set.  There are various sub tag sets, some of which are mandatory, and some not.  It is good, although optional, practise to use <!ENTITY>'s to hold comonly changed values.  These should be defined at the very start of the profile.  This is quite similar to the usage of variables in C, with the notable lack of any typing.
	Comments are allowed and encouraged and are of the standard XML <!-- myComment --> type

DETAILED SYNTAX:

	EXAMPLE USAGE:

<?xml version="1.0"?>

<!DOCTYPE entities [

<!ENTITY buildDir "/usr/src">
<!ENTITY packagesDir "/usr/src/3.0">

<!-- Packages -->

<!ENTITY ed-version "0.2">
<!ENTITY ed-package "ed-0.2.tar.bz2">
<!ENTITY ed-dir "ed-0.2">

]>

<alfs xmlns="http://alfs.linuxfromscratch.org/xml">

    <package>
	<name>ed</name>
	<version>0.2</version>

	<prebuild>
	    <unpack>
		<src>&packagesDir;/&ed-package;</src>
		<dest>&buildDir;</dest>
	    </unpack>

	    <configure>
		<dir>&buildDir;/&ed-dir;</dir>
		<param>--prefix=/usr</param>
	    </configure>
	</prebuild>

	<build>
	    <make>
		<dir>&buildDir;/&ed-dir;</dir>
	    </make>
	</build>

	<postbuild>
	    <make>
		<dir>&buildDir;/&ed-dir;</dir>
		<param>install</param>
	    </make>

	    <remove>&buildDir;/&ed-dir;</remove>
	</postbuild>
    </package>

</alfs>

<!-- End of Example -->


	TAG DETAIL: (for now, in order of first appearance)

Name:			Entity
Syntax(declaration):	<!ENTITY name "value">
Syntax(calling):	&variable;
Usage Mandatory:	No
Usage notes:
	In the above example the declaration is setting edVersion=0.2.  It should be noted that the variable and value are alpha-numeric strings.  An entity is called by prefixing the entity name with an ampersand, `&', and sufixing it with a semi-colon, `;'.  In the above example, all instances of &edVersion; are replaced by 0.2.


Name:			ALFS
Syntax:			<alfs xmlns="http://url.to.xml/name/space"></alfs>
Usage Mandatory:	Yes
Usage Notes:		The Package tag is a child of this tag.


Name:			Package
Syntax:			<package></package>
Usage Mandatory:	Yes
Member Of:		N/A
Usage Notes:
	This tag set wraps around tags specifying instructions for building an entire package.

Name:			Name
Syntax:			<name>packageName</name> or <name />packageName
Usage Mandatory:	Yes
Member Of:		Package
Usage Notes:
	Every package has a name, and ALFS has to be able to referense the name of a package.  This tag introduces the optional sytax of the self ending tag, <someTag />, which requires less typing.  Note that usage of this style implies that `packageName' be on the same line as the tag.  The older style, with both a starting and ending tag, allows for a more free-form style in your code.

Name:			Version
Syntax:			<version>packageVersion</version or <version />packageVersion
Usage Mandatory:	Yes
Member Of:		Package
Usage Notes:
	PackageVersion is a freeform alphanumeric string.  It might be, "1.4.2," or "o.9c"


Name:			Pre Build	
Syntax:			<prebuild></prebuild>
Usage Mandatory:	No
Usage Notes:		The PreBuild, Build, and PostBuild tags are optional tags used for structuring of the profile syntax.  Their use is highly encouraged, however


Name:			Unpack
Syntax:			<unpack></unpack>
Usage Mandatory:	no
Member Of:		<package>
Usage Notes:		
	This Tag Set is a wrapper for package archive operations.  Mandatory sub-tags are the Source and Destination tags.

Name:			Source
Syntax:			<src>/path/to/sourceDirOrFile</src> or <src />/path/to/sourceDirOrfile
Usage Mandatory:	Parent
Member Of:		<unpack>, <link>, <copy>, <move>
Usage Notes:		This tag is used to specify the source is of a file operation.  When specifying a filename, include the full path to the file.  The parsed out value whould be somthing like, "/usr/src/ed-0.2.tar.bz2," in this case.


Name:			Destination
Syntax:			<dest>/path/to/destination</dest> or <dest />/path/to/destination
Usage Mandatory:	Parent
Member Of:		<unpack>, <copy>, <move>, <link>
Usage Notes:		
	Like the Source tag, except this tag is used to specify where the destination is of a file operation.


Name:			Configure
Syntax:			<configure></configure>
Usage Mandatory:	No
Member Of:		Pre Build
Requires:		Directory
Usage Notes:		The required Directory tag specifies where the ./configure command should be run.  Optionaly, single or multiple Parameter tags may be used to pass arguments to the ./configure command.
	

Name:			Directory
Syntax:			<dir>/path/to/directory</dir> or <dir />/path/to/directory
Usage Mandatory:	No
Member Of:		Configure, Make
Usage Notes:		
	

Name:			Param
Syntax:			<param>argToPass</param> or <param />argToPass
Usage Mandatory:	No
Member Of:		Configure, Make, Link, Execute
Usage Notes:		Each Parameter tag contains one argument.  Use multiple Parameter tags if you have more than one argumet to pass.  In the case of multiple Parameter tags, they are applied in order.  In other words, it's, "first come, first served."


Name:			Build	
Syntax:			<build></build>
Usage Mandatory:	No
Usage Notes:		The PreBuild, Build, and PostBuild tags are optional tags used for structuring of the profile syntax.  Their use is highly encouraged, however


Name:			Make
Syntax:			<make></make>
Usage Mandatory:	No
Usage Notes:		<make> uses the mandatory <dir /> tag as a mandatory subtag to find out where rto run the command 'make'  Optionaly, the use of the <param> tag allows easy addition of command-line arguments to make.


Name:			Post Build	
Syntax:			<postbuild></postbuild>
Usage Mandatory:	No
Usage Notes:		The PreBuild, Build, and PostBuild tags are optional tags used for structuring of the profile syntax.  Their use is highly encouraged, however.


Name:			Remove
Syntax:			<remove>/path/to/dirOrFile</remove> or <remove />/path/to/dirOrFile
Usage Mandatory:	No
Usage Notes:		Delete's a file or directory and it's contents.
	

Name:			Copy
Syntax:			<copy></copy>
Usage Mandatory:	No
Usage Notes:		Copy's a file or directory from one place to another.  The Source and Destination tags are mandatory children to this tag.


Name:			Link
Syntax:			<link></link>
Usage Mandatory:	No
Usage Notes:		Creates a link to a file or directory.  Source and Destination are mandatory children.  Use a Parameter tag, after the Source and Destination tags, to specfy '-s' to create a symbolic link.


Name:			Execute
Syntax:			<exec>/path/to/binOrScript</exec> or <exec />/path/to/binOrScript
Usage Mandatory:	No
Usage Notes:		Use this tag to execute standard UNIX commands.  Free-form use is allowed, but should be discouraged as much as possible.  Use as many Parameter tags as is neccesary to create your command.


Name:			
Syntax:			
Usage Mandatory:	
Usage Notes:		



# EOF


More information about the alfs-discuss mailing list