Differences between revisions 2 and 7 (spanning 5 versions)
Revision 2 as of 2008-07-16 17:25:16
Size: 856
Comment: add a sample spkg-install
Revision 7 as of 2008-12-22 22:56:36
Size: 1801
Comment: clean up the directory structure some more
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= ToDo = = SPKG Howto =
Line 3: Line 3:
There are usually a number of things to do for all spkgs, but none of them by == SPKG directory structure ==

 * src directory: '''vanilla''' upstream, but there are a few exceptions
 * SPKG.txt: describes the spkg in wiki format, each new revision needs an updated changelog entry or an automatic "needs work" at review time
 * spkg-install: the install script - see below for an example and some style tips
 * spkg-check: runs the test suite - this is somewhat optional since not all spkgs have test suites. If possible do create such a script since it helps isolate bugs in upstream packages
 * patches: for patches against upstream. Each file foo.extension needs to have a diff against the original file, i.e. foo.extension.patch for easy rebases against new upstream. Updated files should be copied into the right place in src at the start of spkg-install. Please document all patches in SPKG.txt, i.e. what they do, if they are platform specific, if they should be pushed upstream

== Important things to consider ==

There are usually a number of things to do for all spkgs:
Line 13: Line 23:
= A Sample spkg-install = == A Sample spkg-install ==
Line 25: Line 35:
./configure --prefix=$SAGE_LOCAL ./configure --prefix="$SAGE_LOCAL"

SPKG Howto

SPKG directory structure

  • src directory: vanilla upstream, but there are a few exceptions

  • SPKG.txt: describes the spkg in wiki format, each new revision needs an updated changelog entry or an automatic "needs work" at review time
  • spkg-install: the install script - see below for an example and some style tips
  • spkg-check: runs the test suite - this is somewhat optional since not all spkgs have test suites. If possible do create such a script since it helps isolate bugs in upstream packages
  • patches: for patches against upstream. Each file foo.extension needs to have a diff against the original file, i.e. foo.extension.patch for easy rebases against new upstream. Updated files should be copied into the right place in src at the start of spkg-install. Please document all patches in SPKG.txt, i.e. what they do, if they are platform specific, if they should be pushed upstream

Important things to consider

There are usually a number of things to do for all spkgs:

  • ensure that "make install" is non-parallel, i.e. do a "export MAKE=make"
  • SAGE_LOCAL check (#633)
  • add spkg-check (#299)
  • add proper SPKG.txt to all packages
  • /usr/bin/env bash (#1638)
  • add md5sums for spkgs (#329)
  • set LDFLAGS on OSX (#3349)

A Sample spkg-install

if [ "$SAGE_LOCAL" = "" ]; then
   echo "SAGE_LOCAL undefined ... exiting";
   echo "Maybe run 'sage -sh'?"
   exit 1
fi

cd src

./configure --prefix="$SAGE_LOCAL"
if [ $? -ne 0 ]; then
   echo "Error configuring PACKAGE_NAME."
   exit 1
fi

make
if [ $? -ne 0 ]; then
   echo "Error building PACKAGE_NAME."
   exit 1
fi

make install
if [ $? -ne 0 ]; then
   echo "Error installing PACKAGE_NAME."
   exit 1
fi