Subject: Re: mail/imap-uw build problems on Darwin
To: Georg Schwarz <georg.schwarz@freenet.de>
From: Mark E. Perkins <perkinsm@bway.net>
List: tech-pkg
Date: 10/30/2005 07:37:30
On 10/30/05 02:41, Georg Schwarz wrote:
>>I will send-pr all of this, but can someone explain how to use pkgsrc to
>>apply a patch conditionally?
> 
> 
> I think you could change the patch in question to use appropriate ifdefs,
> i.e. #ifdef __NetBSD__    #else
> 

Responding to various messages in turn.....

OK.... Since the file in question is actually a Makefile
(.../src/osdep/unix/Makefile.gss), that translates to .if and such. So I
hacked Makefile.gss as shown below, and it works (it's ugly and could be
done better, but it works).

------ new code for Makefile.gss ------

.if ${OPSYS} == "NetBSD"
gss:
        echo "#include \"kerb_mit.c\"" >> auths.c
        echo "-I/usr/include/krb5" >> OSCFLAGS
        echo "-lgssapi -lkrb5 -lasn1 -lcrypto ${GSS_EXTRA_LDFLAGS}
-lcom_err -lroken" >> LDFLAGS
.elif ${OPSYS} == "Darwin"
GSSDIR=/usr/local
GSSCFLAGS= -I$(GSSDIR)/include
-DGSS_C_NT_HOSTBASED_SERVICE=gss_nt_service_name
GSSOLDLDFLAGS= -L$(GSSDIR)/lib -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err
GSSNEWLDFLAGS= -L$(GSSDIR)/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err

gss:    # GSSAPI Kerberos V flags
        echo $(GSSCFLAGS) >> OSCFLAGS
        sh -c '(test -f $(GSSDIR)/lib/libk5crypto.a) && echo
$(GSSNEWLDFLAGS) || echo $(GSSOLDLDFLAGS)' >> LDFLAGS
        echo "#include \"kerb_mit.c\"" >> auths.c
.else
echo sorry >> LDFLAGS
.endif