From wtp@mud.pl  Tue May 11 05:23:03 2004
Return-Path: <wtp@mud.pl>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 348C616A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 11 May 2004 05:23:03 -0700 (PDT)
Received: from kryptos.mud.pl (201-moc-7.acn.waw.pl [212.76.58.201])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 115B343D3F
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 11 May 2004 05:22:59 -0700 (PDT)
	(envelope-from wtp@mud.pl)
Received: from localhost (localhost.lan.wtp3.org [127.0.0.1])
	by kryptos.mud.pl (Postfix) with ESMTP id 285D526403
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 11 May 2004 14:22:57 +0200 (CEST)
Received: from kryptos.mud.pl ([127.0.0.1])
 by localhost (kryptos.mud.pl [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 62630-03 for <FreeBSD-gnats-submit@freebsd.org>;
 Tue, 11 May 2004 14:22:55 +0200 (CEST)
Received: by kryptos.mud.pl (Postfix, from userid 1000)
	id 225BA263F8; Tue, 11 May 2004 14:22:55 +0200 (CEST)
Message-Id: <20040511122255.225BA263F8@kryptos.mud.pl>
Date: Tue, 11 May 2004 14:22:55 +0200 (CEST)
From: Krzysztof Stryjek <wtp+cyrus@wtp3.org>
Reply-To: Krzysztof Stryjek <wtp+cyrus@wtp3.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: add new make flag for cyrus-sasl2 ports
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         66521
>Category:       ports
>Synopsis:       add new make flag for cyrus-sasl2 ports
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ume
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 11 05:30:19 PDT 2004
>Closed-Date:    Wed May 12 09:14:54 PDT 2004
>Last-Modified:  Wed May 12 09:14:54 PDT 2004
>Originator:     Krzysztof Stryjek
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
private
>Environment:
System: FreeBSD kryptos.mud.pl 4.9-STABLE FreeBSD 4.9-STABLE #3: Tue Feb 24 16:33:39 CET 2004 toor@kryptos.mud.pl:/usr/obj/usr/src/sys/POOH i386

>Description:
	cyrus-sals2 is very useful port for making authentication. It is wide
used with postfix. So it's very useful to change it's default running
directory to on of postfix subdirectories (vide:
http://ezine.daemonnews.org/200306/postfix-sasl.html).

>How-To-Repeat:
	well, follow
http://prioris.mini.pw.edu.pl/~gregory/articles/errata.html
(i don't know why, but during writing this PR server at
prioris.mini.pw.edu.pl did not respond).

>Fix:

Here are patches for cyrus-sal2 ports Makefiles:

cyrus-sasl2:
------------------------------------------- cut here -----------------------------
--- Makefile.orig	Sat May  8 04:07:41 2004
+++ Makefile	Tue May 11 11:47:48 2004
@@ -51,8 +51,7 @@
 		--enable-static \
 		--enable-auth-sasldb \
 		--with-openssl=${OPENSSLBASE} \
-		--with-rc4=openssl \
-		--with-saslauthd
+		--with-rc4=openssl
 
 .if defined(WITH_BDB_VER)
 .if ${WITH_BDB_VER} == 3
@@ -176,6 +175,12 @@
 CONFIGURE_ARGS+=--disable-krb4
 EBONES=	"@comment "
 .endif
+
+.if !defined(SASLAUTHD_RUNPATH)
+SASLAUTHD_RUNPATH=/var/state/saslauthd
+.endif
+
+CONFIGURE_ARGS+=	--with-saslauthd=${SASLAUTHD_RUNPATH}
 
 CONFIGURE_ENV+=	LOCALBASE=${LOCALBASE} \
 		OPENSSLINC=${OPENSSLINC} \
------------------------------------------- cut here -----------------------------

cyrus-sasl2-saslauthd:
------------------------------------------- cut here -----------------------------
--- Makefile.orig	Sat May  8 04:07:41 2004
+++ Makefile	Tue May 11 11:45:12 2004
@@ -41,8 +41,7 @@
 		--enable-login \
 		--enable-auth-sasldb \
 		--with-openssl=${OPENSSLBASE} \
-		--with-rc4=openssl \
-		--with-saslauthd
+		--with-rc4=openssl
 
 .if defined(WITH_BDB_VER)
 .if ${WITH_BDB_VER} == 3
@@ -106,6 +105,12 @@
 CONFIGURE_ARGS+=--disable-krb4
 .endif
 
+.if !defined(SASLAUTHD_RUNPATH)
+SASLAUTHD_RUNPATH=/var/state/saslauthd
+.endif
+
+CONFIGURE_ARGS+=	--with-saslauthd=${SASLAUTHD_RUNPATH}
+
 CONFIGURE_ENV+=	LOCALBASE=${LOCALBASE} \
 		OPENSSLINC=${OPENSSLINC} \
 		OPENSSLLIB=${OPENSSLLIB} \
@@ -131,8 +136,8 @@
 	@${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
 		${FILESDIR}/saslauthd.sh > ${PREFIX}/etc/rc.d/saslauthd.sh
 	@${CHMOD} 755 ${PREFIX}/etc/rc.d/saslauthd.sh
-	${MKDIR} -m 770 /var/state/saslauthd
-	${CHOWN} ${CYRUS_USER}:mail /var/state/saslauthd
+	${MKDIR} -m 770 ${SASLAUTHD_RUNPATH}
+	${CHOWN} ${CYRUS_USER}:mail ${SASLAUTHD_RUNPATH}
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}/saslauthd
 .for file in ${DOCS}
------------------------------------------- cut here -----------------------------

I think it's better solution, that patching Makefiles before every building.

Greetings from Poland
wtp + cyrus (at) bsdguru (dot) org
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->ume 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue May 11 09:11:04 PDT 2004 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=66521 
State-Changed-From-To: open->closed 
State-Changed-By: ume 
State-Changed-When: Wed May 12 09:12:32 PDT 2004 
State-Changed-Why:  
I've just committed the change but I didn't use your patch. 

> cyrus-sals2 is very useful port for making authentication. It is 
> wide used with postfix. So it's very useful to change it's default 
> running directory to on of postfix subdirectories 

Yes, I know.  But, cyrus-sasl2 is not only for postfix. 
You can configure the loaction of runpath easily at runtime by 
specifying saslauthd_runpath in your /etc/rc.conf for saslauthd, and 
by specifying smtpd.conf for postfix.  So, changing default location 
of runpath at build time is little worth. 

> Here are patches for cyrus-sal2 ports Makefiles: 

Thanks but it is incomplete.  Thought you didn't touch pkg-plist, 
since we need pkg-plist to be in sync with installed things, it is 
hard to do mkdir against ${SASLAUTHD_RUNPATH}, and it is harmful to do 
rmdir automatically against ${SASLAUTHD_RUNPATH}.  So, I made not to 
mkdir runpath when it is not default location. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=66521 
>Unformatted:
