preliminary attempt at one DTD

Chris jcore at sdf.lonestar.org
Wed Jun 20 06:09:27 PDT 2001


Hey everyone,

Attached is the beginnings of my first attempt at one of the DTDs for the new and improved ALFS.  Be warned that I've never written a DTD before (or ever really worked with XML for that matter), so I'm probably not using XML to its full advantage here (or maybe not using it correctly at all! I don't have a validating parser handy at the moment).  Having said that...

Most of the information about the the DTD is in comments inside the file.  It is still incomplete.  What it needs is elements and structures for defining how to compile a package.  Since the system profile DTD hasn't been written yet (and these two DTDs are going to rely heavily on each other) I didn't really get into that area.  I figured that I'd post it anyway since there doesn't seem to be anything else that's been chosen yet.  Perhaps if you guys like the direction that I'm going in with this someone can set me up with CVS access and we can get to work!

Here's a little bit of how the current DTD would work in practice...

<?xml version="1.0"?>
<package>
	<author email="jcore at sdf.lonestar.org">Chris Forno</author>
	<date>2001-06-20</date>
	<brief>
		<name>bogus</name>
		<version>1.0</version>
		<license>public domain</license>
		<date>2000-01-01</date>
	</brief>
	<deps>
		<natural>en-US</natural>
		<programming>C</programming>
		<requires>boguslib</requires>
		<requires>ncurses</requires>
	</deps>
	<psize>10000</psize>
	<isize>30532</isize>
	<codebase>reference.to.bogus-1.0.tar.gz</codebase>
	<readme><![CDATA[This is a totally bogus file!
There is absolutely nothing here to help you.]]></readme>
</package>

Note that I expect this to change dramatically once I get a better grasp of XML (or someone helps out ;)).
-- 
Chris
-------------- next part --------------
<!-- unofficial Automated Linux from Scratch (ALFS) package description DTD
     version: 0.1
     date: 2001-06-20
     author: Chris Forno (jcore at sdf.lonestar.org) -->

<!-- This DTD is intended to facilitate the description of source code package.  It provides elements for describing a package's attributes, its role in a complete system, and the steps necessary to compile and run it.  When multiple (XML) package descriptions, one (XML) system description, and (user supplied) configuration information are combined, ALFS should have all of the information necessary to build a complete LFS system. -->

<!-- element names -->

<!ENTITY % Doctype "package">
<!ENTITY % Author "author">
<!ENTITY % Brief "brief">
<!ENTITY % Name "name">
<!ENTITY % Version "version">
<!ENTITY % License "license">
<!ENTITY % ReleaseDate "date">
<!ENTITY % Dependencies "deps">
<!ENTITY % RequiredPackage "requires">
<!ENTITY % NaturalLanguage "natural">
<!ENTITY % ProgrammingLanguage "programming">
<!ENTITY % PackageSize "psize">
<!ENTITY % InstalledSize "isize">
<!ENTITY % Readme "readme">
<!ENTITY % Codebase "codebase">


<!-- attribute list entities -->

<!ENTITY % Email "email">


<!-- element descriptions -->

<!-- name of an author -->
<!ELEMENT %Author; (#PCDATA)>
<!ATTLIST %Author;
    %Email; CDATA #IMPLIED >

<!-- the name or title of the source package -->
<!ELEMENT %Name; (#PCDATA)>

<!-- the license that the package is released under -->
<!ELEMENT %License; (#PCDATA)>

<!-- a general release date (FIXME: A standard (preferably ISO) date convention should be chosen for this element. -->
<!ELEMENT %ReleaseDate; (#PCDATA)>

<!-- a package that is required for the current package to build and run properly -->
<!-- FIXME: This should probably use some sort of linking (rather than simple text) to refer to another ALFS package description. -->
<!ELEMENT %RequiredPackage; (#PCDATA)>

<!-- the natural (spoken) language a package is written for -->
<!-- FIXME: Standard abbreviations (ISO 693 or the like) should be used, but the only way I can see of forcing this is to use a combination of notations and attributes and use only one language tag (rather than multiple language tags). -->
<!ELEMENT %NaturalLanguage; (#PCDATA)>

<!-- the programming language a package is written in -->
<!-- FIXME: This element may also need to be changed (along with NaturalLanguage) to enforce standard language names. -->
<!ELEMENT %ProgrammingLanguage; (#PCDATA)>

<!-- the size of a package (in bytes) in compressed (and archived) form -->
<!-- FIXME: This may actually differ, depending on where alfs is getting the package from (and what archive method that source is using. -->
<!ELEMENT %PackageSize; (#PCDATA)>

<!-- the (estimated) size of a package (in bytes) once it is compiled and placed on a filesystem -->
<!-- FIXME: This element suffers from some ambiguity.  The InstalledSize is used to help ALFS determine if there's appropriate disk space on the target filesystem, so it should reflect the size of the package after a typical installation procedure is run (described elsewhere in the package description XML file).  The problem is that there's a large number of options that can greatly affect the installed size of a package.  The package DTD may need to be changed to handle this (I just don't know how!). -->
<!ELEMENT %InstalledSize; (#PCDATA)>

<!-- a README file (provided by the package) that explains a little bit about the package to someone unfamiliar with it -->
<!-- FIXME: Is there licensing issues with including a README outside of the context of the package?  I wouldn't think so.  If there was, perhaps we could provide a method of extracting the README for viewing from the archive file as shell script commands or something. -->
<!-- Note: Be sure to use [CDATA[ ]] to avoid problems with the special characters in the README. -->
<!ELEMENT %Readme; (#PCDATA)>

<!-- the location of the package -->
<!-- FIXME: Again, this is probably something that would be better handled with linking of some type. -->
<!ELEMENT %Codebase; (#PCDATA)>


<!-- content substitutions -->

<!-- a brief description of the package; all elements are required -->
<!ENTITY % %Brief; "(%Name;, %Version;, %License;, %ReleaseDate;)">

<!-- dependencies of the package; some elements are optional -->
<!ENTITY % %Dependencies; "(%NaturalLangage;+, %ProgrammingLanguage;+, %RequiredPackage;*)">

<!-- the whole salami
     the author(s) and release date in this context refer to the package description itself (the actual XML file) and not the package (the source archive). -->
<!ENTITY % block "(%Author;+, %ReleaseDate;, %Brief;, %Dependencies;, %PackageSize;, %InstalledSize;, %Codebase;, %Readme;?)">

<!-- document root -->
<!ELEMENT %Doctype; (%block;)>


More information about the alfs-discuss mailing list