In the line
ConfigureParams, you set some parameters so that all files will be installed in the right directory. The
--prefix option says that the /sw directory tree should be used. The
--datadir options are responsible for the right placement of the manpages and the documentation. In the install phase, we have to copy the list of files after
DocFiles to the documentation directory. To install gnuvd, Fink has to execute the
make install command.
To find for yourself which steps you have to make in the different phases with a specific program, you have to read the INSTALL file. The gnuvd package is a simple example, but Fink packages can be more difficult to make.
Now save this file as gnuvd.info. The first thing we do is validate it with the
fink validate command. This will check whether our info file follows the guidelines for Fink packages:
fink validate gnuvd.infoWarning: Length of package description exceeds 45 characters. (gnuvd.info)
It looks rather OK. You shouldn't get an error, just a warning. The description you wrote in the info file will be displayed by the
fink list command, so it should be very short and informative, preferably less than 45 characters. Shorten the description to: "Dutch dictionary using the Van Dale website." That should be clear.
fink validate doesn't complain anymore, so the package file seems OK.
The next step is trying to build the package. You copy (as
root, so with
sudo) the gnuvd.info file to /sw/fink/dists/local/main/finkinfo/ to make it available to Fink. Then you download the file with the source code in /sw/src. Go in Terminal.app to /sw/src and type:
sudo wget http://www.djcbsoftware.nl/code/gnuvd/gnuvd-1.0.2.tar.gzPassword: --14:03:57-- http://www.djcbsoftware.nl/code/gnuvd/gnuvd-1.0.2.tar.gz => `gnuvd-1.0.2.tar.gz' Resolving www.djcbsoftware.nl... 220.127.116.11 Connecting to www.djcbsoftware.nl|18.104.22.168|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 136,078 (133K) [application/x-tar] 100%[====================================>] 136,078 135.17K/s 14:03:58 (134.79 KB/s) - `gnuvd-1.0.2.tar.gz' saved [136078/136078]
fink build gnuvd
If all goes fine, you end up with something like this:
Figure 1. We have built the gnuvd package.
Now the directory /sw/fink/dists/local/main/binary-darwin-powerpc/ contains our binary package gnuvd_1.0.2-1_darwin-powerpc.deb. Let's inspect the package contents. This can be done with the command
Figure 2. The contents of our gnuvd package
This looks OK too: all files will be installed under /sw, as they should be. For a last check, validate the deb file:
fink validate gnuvd_1.0.2-1_darwin-powerpc.debValidating .deb file gnuvd_1.0.2-1_darwin-powerpc.deb...
If you don't get an error, you should be able to install the binary package:
fink install gnuvdPassword: Information about 5135 packages read in 1 seconds. The following package will be installed or updated: gnuvd /sw/bin/dpkg-lockwait -i /sw/fink/dists/local/main/binary-darwin-powerpc/gnuvd_1.0.2-1_darwin-powerpc.deb Selecting previously deselected package gnuvd. (Reading database ... 18964 files and directories currently installed.) Unpacking gnuvd (from .../gnuvd_1.0.2-1_darwin-powerpc.deb) ... Setting up gnuvd (1.0.2-1) ...
And now you're able to use the new package:
gnuvd inleiding`in|lei|ding (de ~ (v.)) 1 tekst, woorden ter voorbereiding op de eigenlijke tekst of het eigenlijke verhaal => aanloop, introductie, preambule 2 korte voordracht over een bepaald onderwerp
Now you only have to submit the info file to Fink's Package Submission Tracker. A package reviewer will take a look at it and add it to the Fink tree if the package seems usable. Users can install your package then by just typing
fink install gnuvd.
This was a very simple package to make. For more difficult cases, I suggest you read the Fink documentation. You can find more complete information on the Fink website, especially the packaging tutorial and the packaging manual.
In this article I've discussed more advanced ways to work with packages. You saw how to build binary packages and how to distribute them with a dedicated server. You saw how to detect dependencies and how to create a new source package. In this way, you can help the Fink community to build an even greater repository of Unix software for Mac OS X.
Koen Vervloesem has a master's degree in computer science and has been freelancing as an IT journalist since 2000, primarily for Dutch IT magazines.
Return to the Mac DevCenter
Darwin ports are great
2006-02-22 13:46:11 BrunoVernay [View]
<b>It's a wasted effort to hate a Program</b>
2005-12-02 12:43:14 martshal [View]
<b>It's a wasted effort to hate a Program</b>
2006-01-09 08:48:50 CSShawn [View]
2005-11-30 05:19:27 leeg [View]
2005-11-30 05:04:04 hardcoreUFO [View]