Bug 178400 - [patch] mail/postgrey shebangfix
Summary: [patch] mail/postgrey shebangfix
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: Guido Falsi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-07 15:40 UTC by Nikolai Lifanov
Modified: 2013-05-12 15:30 UTC (History)
0 users

See Also:


Attachments
postgrey.shar (6.97 KB, text/plain)
2013-05-07 15:40 UTC, Nikolai Lifanov
no flags Details
postgrey_shebangfix.patch.txt (776 bytes, text/plain; charset=windows-1252)
2013-05-08 04:29 UTC, ports.maintainer
no flags Details
postgrey.diff (1.56 KB, patch)
2013-05-09 12:36 UTC, Guido Falsi
no flags Details | Diff
postgrey.diff (1.35 KB, patch)
2013-05-09 16:59 UTC, Guido Falsi
no flags Details | Diff
postgrey.diff.txt (1.35 KB, text/plain; charset=windows-1252)
2013-05-12 02:37 UTC, ports.maintainer
no flags Details
postgrey.diff.txt (1.38 KB, text/plain; charset=windows-1252)
2013-05-12 06:40 UTC, ports.maintainer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolai Lifanov 2013-05-07 15:40:00 UTC
	postgrey hardcodes perl location as "/usr/bin/perl".
	This doesn't account for situations where perl package is compiled
	without the symlink OPTION, which is necessary when /usr is read-only.

	The user, after every package installation has to replace the shebang
	with the appropriate location before restarting the service, or
	otherwise the MTA that uses postgrey might end up rejecting all mail.

	Until now, there was no easy way to stop users that install the package
	from shooting themselves in the foot.

Fix: See the patch attached. It makes use of USES=shebangfix to solve the
	problem. Also, I converted the Makefile header.
How-To-Repeat: 	* compile perl without USE_PERL option
	* compile postgrey
	* install postgrey
	* use postgrey with an MTA
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-05-07 15:40:07 UTC
Maintainer of mail/postgrey,

Please note that PR ports/178400 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/178400

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-05-07 15:40:08 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 ports.maintainer 2013-05-07 19:44:33 UTC
Instead of a shar of the entire port, please submit a diff.
Comment 4 Nikolai Lifanov 2013-05-07 20:24:42 UTC
On 05/07/2013 02:44 PM, Darren Pilgrim wrote:
> Instead of a shar of the entire port, please submit a diff.

Here you go:

-# New ports collection makefile for:    postgrey
-# Date created:				24 August 2004
-# Whom:					Will Andrews <will@FreeBSD.org>
-#
-# $FreeBSD: head/mail/postgrey/Makefile 300896 2012-07-14 13:54:48Z
beat $
-#
+# Created by: Will Andrews <will@FreeBSD.org>
+# $FreeBSD$

 PORTNAME=	postgrey
 PORTVERSION=	1.34
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	mail
 MASTER_SITES=	http://postgrey.schweikert.ch/pub/ \
 		http://postgrey.schweikert.ch/pub/old/
@@ -41,6 +37,9 @@
 GROUPS=		${PGY_GROUPNAME}
 MAN1=		${PORTNAME}.1 policy-test.1 postgreyreport.1

+USES=shebangfix
+SHEBANG_FILES=	${WRKSRC}/postgrey
+
 post-patch:
 	@${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_*
Comment 5 ports.maintainer 2013-05-08 04:29:55 UTC
Thanks for the diff!  There were some minor issues with it:

- You shouldn't reset the CVS tag
- Don't need to bump to PORTREVISION

The first is documented.  The second is a judgement call.  The change is 
a no-op for the vast majority of users, so I'm not going to bug them 
with an upgrade cycle.  Please confirm the attached patch works for you.
Comment 6 Nikolai Lifanov 2013-05-08 14:49:12 UTC
On 05/07/2013 11:29 PM, Darren Pilgrim wrote:
> Thanks for the diff!  There were some minor issues with it:
> 
> - You shouldn't reset the CVS tag - Don't need to bump to
> PORTREVISION
> 
> The first is documented.  The second is a judgement call.  The
> change is a no-op for the vast majority of users, so I'm not going
> to bug them with an upgrade cycle.  Please confirm the attached
> patch works for you.

I can confirm that the attached patch works for me.
On another thought, bumping PORTREVISION is not appropriate here,
since this change affect the functionality of existing (working)
installations.

Thanks!
Comment 7 Guido Falsi freebsd_committer freebsd_triage 2013-05-08 17:07:04 UTC
Responsible Changed
From-To: freebsd-ports-bugs->madpilot

I'll take it.
Comment 8 Mark Linimon 2013-05-08 22:21:23 UTC
----- Forwarded message from Darren Pilgrim <ports.maintainer@evilphi.com> -----

Date: Wed, 08 May 2013 13:01:24 -0700
From: Darren Pilgrim <ports.maintainer@evilphi.com>
To: madpilot@FreeBSD.org
Cc: freebsd-ports-bugs@FreeBSD.org
Subject: Re: ports/178400: [patch] mail/postgrey shebangfix
User-Agent: Mozilla/5.0 (Windows NT 6.1;
	rv:17.0) Gecko/20130107 Thunderbird/17.0.2

Looks like the patch works for Nikokai.  Please commit the patch I
provided.  Thanks!

_______________________________________________
freebsd-ports-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports-bugs
To unsubscribe, send any mail to "freebsd-ports-bugs-unsubscribe@freebsd.org"


----- End forwarded message -----
Comment 9 Mark Linimon freebsd_committer freebsd_triage 2013-05-08 22:21:28 UTC
State Changed
From-To: feedback->open

Maintainer approved.
Comment 10 Guido Falsi freebsd_committer freebsd_triage 2013-05-09 12:36:21 UTC
Hi!

While checking this patch I noticed a few more things to fix:

- port really needs perl also during install
- NOPORTDOCS is deprecated, the optionsng equivalent should be used
- WWW: line in pkg-descr must have a single space after the colon

I'm attaching a further patch also addressing these points.

Can you Darren please approve it?

Thanks in advance.

-- 
Guido Falsi <madpilot@FreeBSD.org>
Comment 11 Guido Falsi freebsd_committer freebsd_triage 2013-05-09 12:36:52 UTC
State Changed
From-To: open->feedback

Ask for maintainer approval.
Comment 12 Nikolai Lifanov 2013-05-09 13:59:40 UTC
On 05/09/2013 07:36 AM, Guido Falsi wrote:
> Hi!
> 
> While checking this patch I noticed a few more things to fix:
> 
> - port really needs perl also during install - NOPORTDOCS is
> deprecated, the optionsng equivalent should be used - WWW: line in
> pkg-descr must have a single space after the colon
> 
> I'm attaching a further patch also addressing these points.
> 
> Can you Darren please approve it?
> 
> Thanks in advance.
> 

Good spotting of NOPORTDOCS conversion.
However, shouldn't USE_PERL5_RUN and/or the p5-* run dependencies
already make sure that perl is present during install?
Note: you don't need perl for "make" target to succeed, so perl
shouldn't be a build dependency.
Comment 13 Guido Falsi freebsd_committer freebsd_triage 2013-05-09 16:59:29 UTC
On 05/09/13 14:59, Nikolai Lifanov wrote:
> On 05/09/2013 07:36 AM, Guido Falsi wrote:
>> Hi!
>>
>> While checking this patch I noticed a few more things to fix:
>>
>> - port really needs perl also during install - NOPORTDOCS is
>> deprecated, the optionsng equivalent should be used - WWW: line in
>> pkg-descr must have a single space after the colon
>>
>> I'm attaching a further patch also addressing these points.
>>
>> Can you Darren please approve it?
>>
>> Thanks in advance.
>>
>
> Good spotting of NOPORTDOCS conversion.
> However, shouldn't USE_PERL5_RUN and/or the p5-* run dependencies
> already make sure that perl is present during install?
> Note: you don't need perl for "make" target to succeed, so perl
> shouldn't be a build dependency.
>

Sorry, you're right. My mistake.

Attaching a fixed patch.

Thanks.

-- 
Guido Falsi <madpilot@FreeBSD.org>
Comment 14 ports.maintainer 2013-05-12 02:37:28 UTC
On 2013-05-09 04:36, Guido Falsi wrote:
> While checking this patch I noticed a few more things to fix:
[...]

I approve the patch attached to this email.
Comment 15 ports.maintainer 2013-05-12 06:40:04 UTC
On 2013-05-11 18:37, Darren Pilgrim wrote:
> On 2013-05-09 04:36, Guido Falsi wrote:
>> While checking this patch I noticed a few more things to fix:
> [...]
>
> I approve the patch attached to this email.

Patch was missing bits needed to actually enable OPTIONSng.  Please 
commit this patch instead:
Comment 16 Guido Falsi freebsd_committer freebsd_triage 2013-05-12 15:20:34 UTC
On 05/12/13 07:40, Darren Pilgrim wrote:
> On 2013-05-11 18:37, Darren Pilgrim wrote:
>> On 2013-05-09 04:36, Guido Falsi wrote:
>>> While checking this patch I noticed a few more things to fix:
>> [...]
>>
>> I approve the patch attached to this email.
>
> Patch was missing bits needed to actually enable OPTIONSng.  Please
> commit this patch instead:
>


Just a note that OPTIONS_DEFINE is not strictly needed to have working 
optionsng. the DOCS option is exposed for all the ports and enabled by 
default. It can be manipulated through make.conf, for example.

Not all ports expose it with the dialog interface, it's maintainer's 
choice. Some maintainers have expressed they actually don't want it to 
be exposed as the only option of their port through the dialog interface.

So both patches could be correct. The maintainer has already expressed 
his preference though :)

-- 
Guido Falsi <madpilot@FreeBSD.org>
Comment 17 Guido Falsi freebsd_committer freebsd_triage 2013-05-12 15:29:54 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!
Comment 18 dfilter service freebsd_committer freebsd_triage 2013-05-12 15:29:54 UTC
Author: madpilot
Date: Sun May 12 14:29:46 2013
New Revision: 317962
URL: http://svnweb.freebsd.org/changeset/ports/317962

Log:
  - Add USES=shebangfix
  - Convert to new options framework
  - Use space for WWW line in pkg-descr
  - Trim Makefile headers
  
  PR:		ports/178400
  Submitted by:	Nikolai Lifanov <lifanov@mail.lifanov.com>

Modified:
  head/mail/postgrey/Makefile   (contents, props changed)
  head/mail/postgrey/pkg-descr   (contents, props changed)

Modified: head/mail/postgrey/Makefile
==============================================================================
--- head/mail/postgrey/Makefile	Sun May 12 14:05:52 2013	(r317961)
+++ head/mail/postgrey/Makefile	Sun May 12 14:29:46 2013	(r317962)
@@ -1,9 +1,5 @@
-# New ports collection makefile for:    postgrey
-# Date created:				24 August 2004
-# Whom:					Will Andrews <will@FreeBSD.org>
-#
+# Created by: Will Andrews <will@FreeBSD.org>
 # $FreeBSD$
-#
 
 PORTNAME=	postgrey
 PORTVERSION=	1.34
@@ -41,6 +37,14 @@ USERS=		${PGY_USERNAME}
 GROUPS=		${PGY_GROUPNAME}
 MAN1=		${PORTNAME}.1 policy-test.1 postgreyreport.1
 
+USES=		shebangfix
+SHEBANG_FILES=	${WRKSRC}/postgrey
+
+OPTIONS_DEFINE=	DOCS
+OPTIONS_DEFAULT=DOCS
+
+.include <bsd.port.options.mk>
+
 post-patch:
 	@${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_*
@@ -61,7 +65,7 @@ do-install:
 	${INSTALL_DATA} ${WRKSRC}/postgrey_${i} ${PREFIX}/etc/postfix/dist-postgrey_${i}
 .endfor
 
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 	@${INSTALL} -d ${DOCSDIR}
 	@cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
 .endif

Modified: head/mail/postgrey/pkg-descr
==============================================================================
--- head/mail/postgrey/pkg-descr	Sun May 12 14:05:52 2013	(r317961)
+++ head/mail/postgrey/pkg-descr	Sun May 12 14:29:46 2013	(r317962)
@@ -1,4 +1,4 @@
 Postgrey is a program which implements greylisting and is
 designed to work with the Postfix MTA.
 
-WWW:  http://postgrey.schweikert.ch/
+WWW: http://postgrey.schweikert.ch/
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"