Back to SPiBuildExternal -- SPI Workbook

SPI EXTERNAL SOFTWARES BUILD HOWTO Version 2.0

Foreword: This document present the XML/XSLT version of the spi build tools for external area. An older writting of this document presented the previous version of spi build tools which is quite different.

General

Building external softwares for SPI is done through a set of scripts in order to automatize the whole process as much as possible.

The process is controled by the package management tool "pacman", using configurations and build files automatically generated from an user wrote XML script.

The package installation is trigered by a pacman installation command. The appropriated pacman description file is fetched from the pacman cache. This file contains the installation instructions. Usually they are made of two steps. First is downloading the source archive of the package from the pacman cache (so the archive has to be uploaded on the cache first), and then invoquing the spi build script. Those two scripts are generated by the user wrote XML source script. If everythings work well, the package is fully installed at the end of this process.

The following explains how to write the XML script and use it to install a package.

Source archive installation

If it's not yet the case, the source archive has first to be downloaded in /afs/cern.ch/sw/lcg/external/tarFiles/ It should be then softlinked from the pacman cache by a 'make' made in the cache:
$ cd /afs/cern.ch/sw/lcg/external/pacman/cache
$ make

XML spi script writting

The script used by the installer are located under: /afs/cern.ch/sw/lcg/contrib/ypatois/public/spi_build_external/

IMPORTANT NOTE: Writing in this area should only be done through CVS as described in SpiBuildInstallOnAFS. Script redaction and tests have to be done by checking out spi_build_external code in a private area and commiting only relevant changes.

The XML script contains two parts: a description part in < meta > and a build instructions part in < build > .

The build script has to be wrote under xml/generic, unless it is specific to a given plateform, in that case it should be under xml/< platform > . Every platform script will be generated from generic unless a platform-specific XML file has been wrote.

Its naming should be < package >-< version >.xml , eg, foo-1_2_3.xml for package foo at version 1.2.3.

Advanced users: to write a generic xml script to be derivated, use underscore and an 'x' somewhere in the version. Eg, the generic script for foo would be called foo_x.xml . It is useless to write the meta in such a script (just put an empty < meta /> tag) because they are not inherited.

In the most basic case, just derivating from default.xml is enough, for foo version 1.2.3, the script could be:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE package SYSTEM "dtd/package.dtd">

<package name="foo" version="1.2.3" inherit="../default">
  <meta>
    <description>Package foo version 1.2.3 .</description>
    <url>http://www.foo.net/download/foo-1.2.3.tgz</url>
    <file>foo-1.2.3.tgz</file>
  </meta>


  <build>
    <buildinfo>Pure GNU install.</buildinfo>
  </build>
</package>

In more difficult cases, the derivation is less trivial, and the < build > section will contains < sequence > instructions. See existing modules for examples.

Generation of pacman and python build files from XML

Once the XML file has been created, tested, tagged and checkout at the right location (as described in SpiBuildInstallOnAFS), it can be used to generates the actual pacman and python scripts.

To compile the xml in the corresponding pacman and python scripts, type 'make' in the spi-build-external directory.

$ cd /afs/cern.ch/sw/lcg/contrib/ypatois/public/spi_build_external/
$ make touch (if new package)
$ make

WARNING: This requiere recent versions of libxml2 and libxslt to be installed in your python system which is neither the case on CERN's RH7.3 or slc3 machines. On slc3 machines you own, apt-get install libxml2 libxslt is enough to fix this problem.

To copy the pacman script in the cache, go to the cache and type make again:

$ cd /afs/cern.ch/sw/lcg/external/pacman/cache
$ make

Installation environment setup

IMPORTANT NOTE: To find the right build machine to use, see Installation of SBE section "Build Machine used".

  • Go to the right directory on the build machine (usually something like /build/spi/< platform > )
  • Execute:
    $ source build-setup.(c)sh

That should be enough.

If not, see the more detailled instructions in document Installation of SBE .

Installation

Back in the pacman area, issue the command:
$ pacman -get /afs/cern.ch/sw/lcg/external/pacman/cache:fool-1_2_3

If everything works well, congratulations smile

NOTE: Installing in a test area before real install might be usefull for debugging. Only modifying the SPI_TOPDIR is enough, eg, SPI_TOPDIR=/build/spi/< platform >/tests/ is already setup on several build machines. After successfully passing the tests, dont forget to desinstall the software (at least in pacman database, use -remove ) to be able to install it under external.

6- Removing packages

In case of need (eg. installation failure), it may be usefull to remove a package. The right command is:
$ pacman -remove foo-1_2_3

Warning: For now, this command does NOT remove files installed by "make install" (under SPI_TOPDIR), that could be done, but looks more annoying than usefull.

-- Main.ypatois - 29 Nov 2004

Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r10 - 2005-05-02 - YannickPatois
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    SPI All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback