Available Languages: | English |

Create a Fink Package - Quick Start

This document is for people who want to create a package for fink. It complements the Packaging Manual, which is a more detailed and comprehensive document.

In this document we'll make two fink packages. The first one will be maxwell and the second GNU Stow.

Contents

1 Making the Maxwell Pacakge

1.1 Basics

First Maxwell. Lets open our editor and get started. We know the package name, its version and where to grab the source tarball from. So we'll type this into our editor window:

Package: maxwell
Version: 0.5.1
Revision: 1
Source: mirror:sourceforge:%n/%n-%v.tar.gz

So we have the name and version which are easy to understand, but what of these other two fields? Revision is the "version" of the fink package, Version, on the other hand is the upstream source version. Since this is the first time we have attempted to make a maxwell-0.5.1 package, it is revision 1.

The Source field is where fink will grab the source tarball from. Because Sourceforge has a system where packages are mirrored around the world, and since fink knows about it, we use mirror:sourceforge:. %n expands to the package name, maxwell, and %i expands to the package version, 0.5.1.

Now we can save this as maxwell.info in /sw/fink/dists/local/main/finkinfo/. That done, we can see how we are doing by using fink validate.

finkdev% fink validate maxwell.info 
Validating package file maxwell.info...
Error: Required field "Maintainer" missing. (maxwell.info)

Oops, looks like we missed a couple of fields. Lets add some more:

Maintainer: John Doe <jdoe@example.com>
HomePage: http://maxwell.sourceforge.net
License: MIT

We add ourselves as the maintainer of the fink maxwell package and add it's homepage, looking at the sourceforge project page, we see that it is MIT Licensed, so we add that too. Now lets try again:

finkdev% fink validate maxwell.info
Validating package file maxwell.info...
Warning: Unknown license "MIT". (maxwell.info)
Error: No MD5 checksum specified for "source". (maxwell.info)
Error: No package description supplied. (maxwell.info)

Aaargh! We seem to be getting worse, not better, never mind, head off over to the packaging manual to see what is allowed for License, and we see that we can just change MIT to OSI-Approved, as the MIT license is, indeed, approved by the OSI. We can also grab a one line description of the package from the homepage. So we change those:

License: OSI-Approved
Description: Mac OS X S.M.A.R.T. Tool

But what to do about that warning about MD5 checksums? Well, why don't we just ask fink to fetch the source?

finkdev% fink fetch maxwell
/usr/bin/sudo /sw/bin/fink  fetch maxwell
Reading package info...
Updating package index... done.
Information about 3377 packages read in 30 seconds.
WARNING: No MD5 specified for Source of package maxwell-0.5.1-1 Maintainer: John Doe <jdoe@example.com>
curl -f -L -O http://distfiles.opendarwin.org/maxwell-0.5.1.tar.gz
  % Total    % Received % Xferd  Average Speed          Time             Curr.
                                 Dload  Upload Total    Current  Left    Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:00 --:--:--     0
curl: (22) The requested URL returned error: 404
### execution of curl failed, exit code 22
Downloading the file "maxwell-0.5.1.tar.gz" failed.

(1)      Give up
(2)      Retry the same mirror
(3)      Retry another mirror from your continent
(4)      Retry another mirror
(5)      Retry using next mirror set "sourceforge"

How do you want to proceed? [3] 5
curl -f -L -O http://west.dl.sourceforge.net/sourceforge/maxwell/maxwell-0.5.1.tar.gz
  % Total    % Received % Xferd  Average Speed          Time             Curr.
                                 Dload  Upload Total    Current  Left    Speed
100  7856  100  7856    0     0  19838      0  0:00:00  0:00:00  0:00:00 6511k

So we can now get the md5 by running md5 /sw/src/maxwell-0.5.1.tar.gz, and add it to the .info file:

Source-MD5: ce5c354b2fed4e237524ad0bc59997a3

And now we find that fink validate passes, yippee!

1.2 Build

Now we can build the package, let's just try it:

finkdev% fink build maxwell
/usr/bin/sudo /sw/bin/fink  build maxwell
Reading package info...
Updating package index... done.
Information about 3498 packages read in 32 seconds.
The following package will be built:
 maxwell
gzip -dc /sw/src/maxwell-0.5.1.tar.gz | /sw/bin/tar -xvf -  --no-same-owner --no-same-permissions 
maxwell-0.5.1/
maxwell-0.5.1/LICENSE
maxwell-0.5.1/Makefile
maxwell-0.5.1/maxwell.8
maxwell-0.5.1/maxwell.c
maxwell-0.5.1/README
./configure --prefix=/sw 
Can't exec "./configure": No such file or directory at /sw/lib/perl5/Fink/Services.pm line 403.

Hmm, well that did not go all that well. Let's read the README and see what it says...

To build type 'make'.

To install in /usr/local type 'sudo make install', to install elsewhere, type 
'sudo make install prefix=/elsewhere'

Ah hah, so we can't use the default compilescript and installscript here, we need our own, that's easily resolved:

CompileScript: make
InstallScript: <<
#! /bin/sh -ev
make install prefix=%i
<<

Copyright Notice

Copyright (c) 2001 Christoph Pfisterer, Copyright (c) 2001-2004 The Fink Project. You may distribute this document in print for private purposes, provided the document and this copyright notice remain complete and unmodified. Any commercial reproduction and any online publication requires the explicit consent of the author.


Generated from $Fink: packaging.en.xml,v 1.33 2004/06/23 22:22:52 dmrrsn Exp $