Subject: qmail package -- review & suggestions welcome
To: None <>
From: Tomasz Luchowski <>
List: tech-pkg
Date: 08/12/2001 22:13:53

qmail is one of the most difficult apps to package in my experience
because of two reasons:
  o is requires qmail users at *compile* time, not at the install stage
    what one would expect
  o it sits in /var/qmail

First problem is partially solved by files/ script which creates
necessary groups and users. It requires root priviledges during the build process,
I could not found better way to do this, though. I tried to patch qmail sources not to check
for the users, but too many things depend on qmail users' uids grabbed during compilation

For now this part of qmail's Makefile checks whether we are building as root:

        @if [ `id -u` != 0 ]; then                              \
                ${ECHO} "Error: must be root to build qmail.";  \
                exit 1;                                         \

(it's located in pre-build target). It's obscure and I would be happy to hear
other ways to solve this require-root-privs-at-build-time problem.

I understand that pkgsrc policy is not to install files outside ${PREFIX}
if it is not necessary, but I'd vote for /var/qmail as qmail's location.
Every single qmail extension, tool, utility or anything looks for qmail there.

Moving qmail to ${PREFIX} wouldn't be easy because of qmail's directory structure:

zuntum@flis:/usr/pkgsrc/mail/qmail# ls /var/qmail
alias/   bin/     boot/    control/ doc/     man/     queue/   users/

Although bin, doc, man would be easy to move to approperiate places in ${PREFIX},
alias, boot, control, queue and users wouldn't found correct place to settle in
that easily.

But I experience another problem here. Installing to ${PREFIX}/qmail would work,
but when I would install it to /var/qmail, pkg_* tools wouldn't find files listed in PLIST.
I am not sure how to work-around it without leaving PLIST empty and doing rm -rf on /var/qmail
in post-deinstall target.

Thoughts, suggestions?

Current package can be found at -- please speak up
what should be fixed apart from issues mentioned here. This package links /var/qmail
to ${PREFIX}/qmail so normal PLIST is used, but unfortunatelly in obscure way.

Note: remove-users target isn't implemented properly, as it requires ${WRKDIR} existance.
Make sure you've done 'make extract' before executing this for now, I'll fix this later.

/* Tomasz Luchowski <> */