Fink packaging tutorial


Fink is a great way to install software on Mac OS X. Basically, it is a port of the Debian Package Manager.

So you want to contribute your own packages?

Since creating Fink package is not that much more effort than compiling the software from source, you can kill to birds with one stone. Below is a Makefile that supports the process:


PACKAGES = $(patsubst,%.deb,$(INFOS))

DEBPATH = /sw/fink/dists/local/main/binary-darwin-*
LOCALDIST = /sw/fink/dists/local/main/finkinfo/

all: $(PACKAGES)

        rm -f $(PACKAGES) *~

        make $(patsubst,%.CLEAN,$(INFOS))

         fink remove $(patsubst,%,$<)
         sudo rm -f $(DEBPATH)/$(patsubst,%,$<)*.deb
         sudo rm -f $(LOCALDIST)/$<

       echo "Copying files...:"
       sudo install $< $(LOCALDIST)
       sudo install $(patsubst,%.patch,$<) $(LOCALDIST) || true
       echo "Validating $< ..."
       fink -v validate $<
       echo "Trying to build as user nobody"
       fink -m --build-as-nobody rebuild $(patsubst,%,$<)
       echo "Validating $@ ..."
       fink -v validate $(DEBPATH)/$(patsubst,%,$<)*.deb
       echo "Contents of package:"
       dpkg -c $(DEBPATH)/$(patsubst,%,$<)*.deb
       echo "Installing $@ ..."
       fink install $(patsubst,%,$<)
       ln $(DEBPATH)/$(patsubst,%,$<)*.deb $@

Important Links