Packaging Tutorial - 1. How to Start

1.1 Learn the Basics

Please note: In this document we assume that fink is installed into /sw - the default location. If you see a codeblock similar to

finkdev% somecommand

it means that you have to type somecommand into or any other terminal on your Mac.

First you should learn a few basic concept about how to build Fink packages. We suggest you:

1.2 Make your Package

Save your new info file (and patch file - if needed) into your /sw/fink/dists/local/main/finkinfo/ directory. The file should be named (and packagename.patch) where packagename is the name of your package. If this directory doesn't exist you need to create it manually.

Please note: Make sure you are running an up-to-date fink tool by running

finkdev% fink selfupdate

Now run

finkdev% fink configure

and set the verbosity level to the highest value and enable the unstable tree. After that you should check if fink found your package by typing:

finkdev% fink list packagename

If it doesn't show up in the list you might need to change your fink configuration file to include your local tree.

Maybe you also have to manually re-index your packages by typing:

finkdev% fink index

If you need more information read the Packaging Manual or use one or more of different help sources. You should also subscribe to the fink-devel mailing list.

1.3 Validate your Package

During validation of your package you should set the verbose level of fink to the highest possible value. Check the section on the fink configuration file about how to change the verbose level.

Check if your package passes validation by running:

finkdev% fink validate /sw/fink/dists/local/main/finkinfo/

If the validation passes try to build your package with:

finkdev% fink -m --build-as-nobody rebuild packagename

Watch the output of the build process carefully for errors or warnings. Especially make sure that everything is installed into the destination directory (which is located at /sw/src/root-packagename-%v-%r/sw) from where fink builds the binary package. Nothing should be installed directly into /sw.

If you use the --keep-build-dir or -k option to fink, it will keep the build directory. This is where fink expands the downloaded source and where the package gets built. This might help if you need to debug the build process. Type man fink for details.

You may also want to use the --keep-root-dir or -K option, it will keep the destination directory. This is where fink builds the installation tree for the package. Comparing build and destination directories may help you debugging the installation phase.

If the build succeeds check the content of the binary package with:

finkdev% dpkg -c /sw/fink/dists/local/main/binary-darwin-powerpc/packagename.deb

Check if all files that you think should be in the package are actually in the .deb file. Again: make sure that nothing is installed directly into /sw.

Now you can also validate the binary package by doing:

finkdev% fink validate /sw/fink/dists/local/main/binary-darwin-powerpc/packagename.deb

If all is well install the package with:

finkdev% fink install packagename

and test the functionality of your package.

If any of the above steps fail try to correct the errors and restart at the top with the fink validate step.

1.4 Submit your Package

If your package passes all the checks above you now can submit the info (and patch if necessary) file to the Package Submission Tracker.

A package reviewer should now take a look at your package submission and add it to the Fink unstable tree if the package seems ready. If not you will be asked to bring the package into compliance with the policy.


Next: 2. Example - the Maxwell Package