Packaging Tutorial - 1. How to Start
Please note: In this document we assume that
fink is installed into
/sw - the default location. If you see a codeblock similar to
it means that you have to type
somecommand into Terminal.app or
any other terminal on your Mac.
First you should learn a few basic concept about how to build Fink packages. We suggest you:
- Have a look at Using Fink: A Developer's How To (2MB pdf file) - slides from a presentation at the O'Reilly Mac OS X Conference.
- Read and try to understand the example here.
Look at other, similar packages in your
/sw/fink/dists/unstable/main/finkinfo/directory or in the online CVS repository and take one (or several) info file(s) as a starting point.
- Search the Package Submission Tracker if somebody else already tried to package the same and the Package Request Tracker if there is a matching request. You might find valuable information there.
- Maybe browse the Packaging Manual if you think you need more detailed information.
Save your new info file (and patch file - if needed) into your
/sw/fink/dists/local/main/finkinfo/ directory. The file should be named
packagename is the name of your package. If this directory doesn't
exist you need to create it manually.
Make sure you are running an up-to-date
fink tool by running
finkdev% fink selfupdate
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
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/packagename.info
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
If you use the
-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
man fink for details.
You may also want to use the
-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
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.
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.
- If feasible add multiple items one at a time to the same tracker item (e.g. info and patch files).
Add a note whether your package is intended for the
10.4tree, or both,
section(graphics, sci, etc.) you feel it belongs in, and
that you have run the command
fink validateon your info and deb files.
Groupfield of the tracker item to
Undergoing Validationwhen you create the new tracker. Also change it back to
Undergoing Validationwhenever you fixed problems package reviewers found in your submission.
Categoryfield of the tracker item to the correct value.