Making a standalone GPT package

Let's say you have a package that has the following build process:

./configure ---prefix=/path/to/install
make
make install

and you want to turn it into a GPT package. Let's assume it doesn't depend on any other GPT packages. How do we do it?

Adding the package metadata

First, we add a pkgdata/ subdirectory to the package. This is where GPT will find its metadata. Then, we create a file called pkgdata/pkg_data_src.gpt.in from the following template:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE gpt_package_metadata SYSTEM "package.dtd">

<gpt_package_metadata Format_Version="0.01" Name="package_name">

    <Aging_Version Major="1" Minor="0" Age="0"/>
    <Description>
        Your Package
    </Description>
    <Functional_Group>Anything you want>/Functional_Group>
    <Version_Stability Release="groovy" />

    <src_pkg >

        <Source_Dependencies Type="compile" >
        </Source_Dependencies>

        <Build_Environment >
            <cflags ></cflags>
            <external_includes ></external_includes>
            <pkg_libs ></pkg_libs>
            <external_libs ></external_libs>
        </Build_Environment>

        <With_Flavors build="no" />
        <Version_Label>0.1</Version_Label>

        <Build_Instructions>
            <Build_Step>./configure --prefix=INSTALLDIR_GPTMACRO</Build_Step>
            <Build_Step>make</Build_Step>
            <Build_Step>make install</Build_Step>
        </Build_Instructions>

    </src_pkg >

</gpt_package_metadata>

This will tell GPT that your package name is package_name, that it is version 1.0, and how it builds. If other packages are going to depend on your package, you should fill out the Build_Environment. The cflags are for any cflags that your package needs defined by people who include your headers. The external_includes are for system headers that need to be included when compiling against your package. pkg_libs are the linklines (like -lyour_lib) that must be specified to link against your package. External libs are for system libraries (like -lz or -lm) that must be specified to link against your package.

Testing the package metadata

You can test this against a Globus installation by running "$GLOBUS_LOCATION/sbin/gpt-build -srcdir=." from the top directory of your package. It should follow the build steps and install your package. It will say that you have a lot of EMPTY PACKAGES though, which means you're not quite done.

Adding a filelist for binaries

The last step is to create a filelist so GPT knows what to package up in binaries. You can usually figure this out by touching a file in $GLOBUS_LOCATION, installing your package, then finding all the new files:

$ touch $GLOBUS_LOCATION/timestamp
$ gpt-build -srcdir=.
$ cd $GLOBUS_LOCATION
$ find . -newer timestamp -type f > filelist

Put that filelist in your srcdir (one level above pkgdata/), and do another build. You should get fewer empty packages, and more to the point, you should now be able to grab your package in binary form:

$ $GLOBUS_LOCATION/sbin/gpt-pkg package_name

Double-check that the resulting .tar.gz under the binaries/ directory has all the files your package needs.

Congratulations!

Your source directory with the pkgdata/ subdir is now your source GPT package.