.opm file format

Opium's package format consist of an xml-like header on the beginning of ny number of concattenantion of any number (perferably 0) of binary files.

The root tag of the XML is an <opium> tag. Everything else must be contained in this tag. The following table lists what attributes are defined in each tag and what their intended effects are. All children are optional unless specified as required, all attributes are required unless specified as optional. Children may occur multiple times unless specified as single, attributes must occur only once.
TagChildrenAttributeVaulesDescription
opium Package, Slice, Person   Root tag
package Description, Default-slices (required, single), Person   Specifies global package information
name *CDATA Name of the package
URL URL Package home page (optional)
Version *CDATA The version of the package
slice Content, Description, Script, Requires, Provides, Person   Specifies a package slice
flavour *CDATA Specifies the flavour of the slice
name *CDATA Name of the slice
URL URL Slice home page (optional)
Version *CDATA Version of the package this slice is a part of (optional)
Package *CDATA Package this slice is a part of
Type config, doc, script, binary, source Type of information in the slice
Architecture *CDATA Architecture the binaries will work on, only if type==binary
Person    Details of a person associated with a package/slice
name *CDATA Person's name (optional)
email *CDATA Person's email address (optional)
type opm-maintainer,*CDATA Person's association with the package/slice. If this is opm-maintainer, then the person will be automatically emailed if opium finds the .opm file to be broken
homepage URL Person's homepage (optional)
Description *CDATA (required)   Description of a package/slice
Language *CDATA Language the description is in
Short *CDATA Short version of description text
default-slices*CDATA   Comma seperated list of slices to install by default
content Content, *CDATA (required)   Specifies the content of the slice. Any child content nodes specify alternative sources of the same content.
type url, tar If type==url, then the content specifies the URL to download content from. If type==tar the content specifies offset,size,filename of the tar file (ie the tar file will be generated with dd if=file.opm of=filename bs=1 skip=offset count=size
script *CDATA (required)   Specifies a script to be run at some time
type pre-install, post-insall, pre-uninstall, post-uninstall, prereq, build Specifies the type of script this is
requires Requires, *CDATA (required)   Specifies a requirement for the package/slice. Embedded requires are alternatives (ie any one of them must be met)
Recommend Yes,No If yes, this is a recommendation not a requirement (optional - assumed no if ommitted)
type package, slice, file, file-regexp, script, provides Type of requisit. Content is packagename, packagename-slicename, filename, a regexp to match the filename, or a script that must return true, respectively
version *CDATA (Optional)Exact string to match version of package/slice/file.
version-range lower,upper (optional)Range of acceptible versions
version-regexp *CDATA (optional)Regexp that must match the version
provides Requires   A thing that this slice provides which other things may require. If requires are specified inside a provides, then it is taken to mean "Will provide this if this is present and not otherwise"
name *CDATA Name of the provision

Contrived example

This example is contrived to use as many of the tags as possible. It is not meant to be a sensible example.

<!-- opium tag to surround everything
<opium>
<!-- this specifies details of the opium package
 <package name="opium" url="http://www.earth.li/~mike/oakley.html" version="0.0">
  <description language="english" short="Opium package">
   Opium is the oakley linux package manager.  Blah blah.
  </description>
<!-- by default, install the main and docs slices
  <default-slices>main,docs</default-slices>
  <person name="Mike Ricketts" email="mike@earth.li"
	    type="author" homepage="http://www.earth.li/~mike/"/>
 </package>

<!-- one flavour, "static" of the main slice providing binaries
 <slice flavour="static" name="main" url="some_url" version="0.1"
	  package="opium" type="binary" architecture="i386">
<!-- give url of content, but provide a tar file in case URL is not available
  <content type="url">ftp://url-to-static-i386-binaries/
   <content type="tar">102400,100,opium-0.1-i386-static</content>
  </content>
  <description language="english" short="opium i386 static binaries">
   Opium static binaries for intel and intel-like CPUs.  Or something.
  </description>
<!-- after installing, run /bin/opium --fix-db
  <script type="post-install">#!/bin/sh
  /bin/opium --fix-db
  </script>
<!-- recommend either Black Magic (of any version matching .*ping.*) or /bin/opium
  <requires recommend="yes" type="package" version-regexp=".*ping.*">Black magic
   <requires type="file" version-range="0.0,">/bin/opium</requires>
  </requires>
<!-- provide PackageManager only if false evaluates to true
  <provides name="PackageManager">
   <requires type="script">#!/bin/sh
   false
   </requires>
  </provides>
  <person name="nobody" type="compiler"/>
 </slice>

<!-- minimal slice for the english documentation
 <slice flavour="english" name="docs" package="opium" type="doc">
  <content type="utl">ftp://url-to-docs/</content>
 </slice>

<!-- person to email if this opm is broken
 <person email="mike@earth.li" type="opm-maintainer"/>
</opium>
 

Mike Ricketts
Last modified: Thu Feb 8 00:04:25 GMT 2001