To test out the procedure for creating packages, I decided to start out easy, with gnump3d.

The program is very simple, installing is just a matter of extracting and typing "make install". This works fine.

However, when I try to install from the package made with checkinstall, some directories in /var do not get created. The script fails (quietly) to make /var/log/gnump3d and /var/cache/gnump3d. The other files are created okay.

you may need to check ./configure --help and make sure you are setting the correct values. For example most of our appliactions are installed to /usr but most make files try to install to /usr/local so you would need to run you configure script like this ./configure --prefix=usr to override the default value. The same goes for the /var value

This one does not even use .configure. Seems like the installer just copies ASCII files (perl scripts and modules) to various locations on the drive. Like I said, just running "make install" in the extracted directory results in a functioning application.

I presume the file "makefile" is what controls the actions. It contains "prefix =/usr". I made a change in it to create an rc.file, and that got picked up by checkinstall.

When I look inside the resulting .tlz file, I see /etc, /install and /usr, and the files that get copied in the process, but no /var.

you should examine the resulting directories to see if /var is somewhere in the wrong location. You can also do a make --help on some applications to see what arguments it takes. And what exactly are you expecting to end up in /var?

After that, all the files should be installed to /tmp/package-gnump3d, and you can then just package them up with the makepkg command.If that doesn't work, then the Makefile might not support a DESTDIR install...at which point a patch might be necessary for it to work.

However, I made some progress using the following steps:1: Create an initial package by following the steps outlined in the packaging howto.2: Extract the contents of the package to a new directory.3: Edit doinst.sh with commands to create the directories.4: Create a new package from these files with makepkg.

Now the package installs everything and as far as I can see, the program behaves the same way as if I use "make install".

Sometimes you have to do what you have to do. If it works, that is the main thing.

So the makefile had no reference of DESTDIR?

I often will search the makefile for DESTDIR or destdir before packaging because some aren't written that way. Some will have some sort of alternate prefix at the beginning of the string that you can use instead.

Did you create the destination directory first? The temp directory must be created before you can install to it.

After you run make install as root, quickly run 'find /usr -not -type d -cmin -5 > pkglist' and see what comes up. That method only functions properly provided you run it promptly after installation, and if you haven't installed or changed anything else in /usr in the last five minutes.

If that was the case, I would see it inside the tlz package, right? It does not show up there. Nor in /usr/var on the hdd.

I tried a slightly different approach in step 3 mentioned above. Instead of modifying doinst.sh, I just created the missing directories and set the permissions. New package built and installed fine. Guess there are many ways of doing this.