Bug 151797 - [PATCH] mail/postgrey: respect PGY_DIR and PREFIX
Summary: [PATCH] mail/postgrey: respect PGY_DIR and PREFIX
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-28 15:10 UTC by Po-Chuan Hsieh
Modified: 2010-10-30 07:00 UTC (History)
1 user (show)

See Also:


Attachments
postgrey-1.33_1.patch (1.17 KB, patch)
2010-10-28 15:10 UTC, Po-Chuan Hsieh
no flags Details | Diff
postgrey.patch (1.04 KB, patch)
2010-10-29 12:57 UTC, darren
no flags Details | Diff
postgrey.patch (1.04 KB, patch)
2010-10-29 13:20 UTC, Mel Pilgrim
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Po-Chuan Hsieh freebsd_committer freebsd_triage 2010-10-28 15:10:07 UTC
- Respect PGY_DIR and PREFIX
  We should apply PGY_DIR / PREFIX substitution to more files.
  Ex: postgreyreport is unawared of ${PGY_DIR}/postgrey.db.
- Bump PORTREVISION

Port maintainer (ports.maintainer@evilphi.com) is cc'd.

Generated with FreeBSD Port Tools 0.99

How-To-Repeat: 
% cat /var/log/maillog | /usr/local/sbin/postgreyreport
ERROR: can't find database /var/spool/postgrey/postgrey.db: No such file or directory

% cat /var/log/maillog | /usr/local/sbin/postgreyreport --dbdir /var/db/postgrey
   xx.xx.xx.xx unknown xxx@xxx.xxx
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2010-10-28 15:10:15 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sunpoet

Submitter has GNATS access (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2010-10-28 15:10:18 UTC
Maintainer of mail/postgrey,

Please note that PR ports/151797 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/151797

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2010-10-28 15:10:19 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 darren 2010-10-29 12:57:48 UTC
Style nits, but this looks good.  Please apply my revised version 
(attached).  Thanks!
Comment 5 Mel Pilgrim 2010-10-29 13:20:19 UTC
Style nits, but this looks good.  Please apply my revised version
(attached).  Thanks! (Forgot to set the correct sender on my last)
Comment 6 Po-Chuan Hsieh freebsd_committer freebsd_triage 2010-10-29 15:53:44 UTC
On Fri, Oct 29, 2010 at 05:20:19AM -0700, Darren Pilgrim wrote:
> Style nits, but this looks good.  Please apply my revised version
> (attached).  Thanks! (Forgot to set the correct sender on my last)
> 


> --- Makefile.orig	2010-08-22 19:23:18.000000000 -0700
> +++ Makefile	2010-10-29 04:48:27.000000000 -0700
> @@ -7,6 +7,7 @@
>  
>  PORTNAME=	postgrey
>  PORTVERSION=	1.33
> +PORTREVISION=	1
>  CATEGORIES=	mail
>  MASTER_SITES=	http://postgrey.schweikert.ch/pub/ \
>  		http://postgrey.schweikert.ch/pub/old/
> @@ -21,7 +22,7 @@
>  		${SITE_PERL}/${PERL_ARCH}/Net/DNS.pm:${PORTSDIR}/dns/p5-Net-DNS
>  
>  USE_PERL5_RUN=	yes
> -USE_RC_SUBR=	postgrey
> +USE_RC_SUBR=	${PORTNAME}
>  NO_BUILD=	yes
>  POD2MAN?=	pod2man
>  PORTDOCS=	README Changes README.exim
> @@ -38,9 +39,8 @@
>  MAN1=		${PORTNAME}.1 policy-test.1 postgreyreport.1
>  
>  post-patch:
> -	@${REINPLACE_CMD} -e "s#/etc/#${PREFIX}/etc/#" ${WRKSRC}/postgrey
> -	@${REINPLACE_CMD} -e '/^my.*DEFAULT_DBDIR/s|/var/spool/postfix/postgrey|${PGY_DIR}|' \
> -	${WRKSRC}/postgrey
> +	@${REINPLACE_CMD} -e 's#/etc/postfix#${PREFIX}&#' ${WRKSRC}/postgrey ${WRKSRC}/postgrey_whitelist_*
> +	@${REINPLACE_CMD} -e 's#/var/spool/postfix/postgrey#${PGY_DIR}#' ${WRKSRC}/postgrey ${WRKSRC}/contrib/postgreyreport
>  
>  pre-install:
>  	@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL


Hi,

  I would like to mention that you use single quotes in sed patterns.
  It will make the substitution wrong. We do not like the strings
  ${PREFIX} and ${PGY_DIR} themselves but their values.
  
  BTW, there is still a missing "/etc/main.cf" in ${WRKSRC}/postgrey.
  The modified patch is attached.

Regards,
sunpoet

--- postgrey.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/mail/postgrey/Makefile,v
retrieving revision 1.25
diff -u -r1.25 Makefile
--- Makefile	23 Aug 2010 02:46:42 -0000	1.25
+++ Makefile	29 Oct 2010 14:49:12 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	postgrey
 PORTVERSION=	1.33
+PORTREVISION=	1
 CATEGORIES=	mail
 MASTER_SITES=	http://postgrey.schweikert.ch/pub/ \
 		http://postgrey.schweikert.ch/pub/old/
@@ -21,7 +22,7 @@
 		${SITE_PERL}/${PERL_ARCH}/Net/DNS.pm:${PORTSDIR}/dns/p5-Net-DNS
 
 USE_PERL5_RUN=	yes
-USE_RC_SUBR=	postgrey
+USE_RC_SUBR=	${PORTNAME}
 NO_BUILD=	yes
 POD2MAN?=	pod2man
 PORTDOCS=	README Changes README.exim
@@ -38,9 +39,9 @@
 MAN1=		${PORTNAME}.1 policy-test.1 postgreyreport.1
 
 post-patch:
-	@${REINPLACE_CMD} -e "s#/etc/#${PREFIX}/etc/#" ${WRKSRC}/postgrey
-	@${REINPLACE_CMD} -e '/^my.*DEFAULT_DBDIR/s|/var/spool/postfix/postgrey|${PGY_DIR}|' \
-	${WRKSRC}/postgrey
+	@${REINPLACE_CMD} -e 's#/etc/main.cf#/etc/postfix/main.cf#' ${WRKSRC}/postgrey
+	@${REINPLACE_CMD} -e "s#/etc/postfix#${PREFIX}&#" ${WRKSRC}/postgrey ${WRKSRC}/postgrey_whitelist_*
+	@${REINPLACE_CMD} -e "s#/var/spool/postfix/postgrey#${PGY_DIR}#" ${WRKSRC}/postgrey ${WRKSRC}/contrib/postgreyreport
 
 pre-install:
 	@${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
--- postgrey.patch ends here ---

-- 
   Sunpoet Po-Chuan Hsieh <sunpoet at sunpoet.net> <sunpoet at FreeBSD.org>
           4096R/CC57E36B 8AD8 68F2 7D2B 0A10 7E9B 8CC0 DC44 247E CC57 E36B
	                     http://people.FreeBSD.org/~sunpoet/pgpkeys.txt
Comment 7 Po-Chuan Hsieh freebsd_committer freebsd_triage 2010-10-29 19:50:33 UTC
Oops, I made a mistake.
Single quotes should be OK in Makefile.
I'll replace the double quotes with single quotes.
Thanks.

-sunpoet
Comment 8 Mel Pilgrim 2010-10-29 20:08:43 UTC
Sunpoet Po-Chuan Hsieh wrote:
>   BTW, there is still a missing "/etc/main.cf" in ${WRKSRC}/postgrey.
>   The modified patch is attached.

Good catch.  I hadn't thought to check for typos.  Yes, please use 
single quotes.  Otherwise, looks good, please commit.

Thanks!
Comment 9 dfilter service freebsd_committer freebsd_triage 2010-10-30 06:52:32 UTC
sunpoet     2010-10-30 05:52:27 UTC

  FreeBSD ports repository

  Modified files:
    mail/postgrey        Makefile distinfo 
  Log:
  - Respect PREFIX and PGY_DIR
  - Bump PORTREVISION
  - While I'm here, pet portlint for MD5 removal
  
  PR:             ports/151797
  Submitted by:   sunpoet (myself)
  Approved by:    Darren Pilgrim <darren@bluerosetech.com> (maintainer), pgollucci (mentor, implicit)
  
  Revision  Changes    Path
  1.26      +5 -4      ports/mail/postgrey/Makefile
  1.15      +0 -1      ports/mail/postgrey/distinfo
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 10 Po-Chuan Hsieh freebsd_committer freebsd_triage 2010-10-30 06:52:37 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!