Newbie: problem using SUB_LIST in Makefile
Rainer Schwarze
rsc at admadic.de
Wed Nov 21 06:30:09 PST 2007
Hi,
I'd like to adjust a port and need to change SUB_LIST and a
./files/pkg-install.in script. I adjusted the SUB_LIST variable but the
variable-replacements are not done to the appropriate files. I'll
present parts of my files and ask a few questions at the end of my email.
(BTW: I'm working on the port mail/qmail-scanner, my system runs on
6.2-RELEASE)
This is a part of the Makefile:
--8<---Makefile-----
...
XWFLG=test
SUB_FILES= pkg-install pkg-message
SUB_LIST+= QS_USER=${QS_USER} \
QS_ID=${QS_ID} \
SPOOLDIR=${SPOOLDIR} \
XWRAPPER=${XWFLG}
.include <bsd.port.pre.mk>
.if defined(WITH_CWRAPPER)
SUB_LIST+= CWRAPPER=yes
.else
SUB_LIST+= CWRAPPER=no
.endif
...
--8<---Makefile-----
My ./files/pkg-install.in looks like that:
--8<---./files/pkg-install.in---
#!/bin/sh
PW="/usr/sbin/pw"
CHOWN="/usr/sbin/chown"
CHMOD="/bin/chmod"
MKDIR="/bin/mkdir -p"
NOLOGIN="/usr/sbin/nologin"
QS_USER=%%QS_USER%%
QS_ID=%%QS_ID%%
SPOOLDIR=%%SPOOLDIR%%
CWRAPPER=%%CWRAPPER%%
XWRAPPER=%%XWRAPPER%%
...
--8<---./files/pkg-install.in---
When I run make, the resulting ./work/pkg-install looks like that:
--8<---./work/pkg-install---
#!/bin/sh
PW="/usr/sbin/pw"
CHOWN="/usr/sbin/chown"
CHMOD="/bin/chmod"
MKDIR="/bin/mkdir -p"
NOLOGIN="/usr/sbin/nologin"
QS_USER=qscand
QS_ID=98
SPOOLDIR=/var/spool/qscand
CWRAPPER=%%CWRAPPER%%
XWRAPPER=%%XWRAPPER%%
...
--8<---./work/pkg-install---
So most of the SUB_LIST entries worked, only my ?WRAPPER entries did
not. Looks a bit like I am missing a very basic detail here...
Questions:
1) What could be the reason that even XWRAPPER is not handled when the
replacement is performed?
2) Is my approach of adding entries to SUB_LIST based on
WITH_.../WITHOUT_... correct? (Or is that impossible after including
bsd.port.pre.mk? As far as I understand, the WITH_.../WITHOUT_... are
available only after bsd.port.[*.]mk is included...?)
Thanks and best wishes,
Rainer
--
More information about the freebsd-ports
mailing list