Bug 191728 - [PATCH] mail/postfix-logwatch: fix StageDir
Summary: [PATCH] mail/postfix-logwatch: fix StageDir
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: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-08 01:56 UTC by takefu
Modified: 2014-12-03 15:51 UTC (History)
3 users (show)

See Also:


Attachments
postfix-logwatch.patch (2.48 KB, patch)
2014-07-08 22:32 UTC, takefu
no flags Details | Diff
postfix-logwatch2.patch (2.72 KB, patch)
2014-07-09 23:25 UTC, takefu
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description takefu 2014-07-08 01:56:38 UTC
diff -ruN /usr/ports/mail/postfix-logwatch/Makefile ./Makefile
--- /usr/ports/mail/postfix-logwatch/Makefile	2014-07-04 18:12:57.000000000 +0900
+++ ./Makefile	2014-07-08 10:20:24.000000000 +0900
@@ -7,7 +7,7 @@
 MASTER_SITES=	SF/logreporters/${PORTNAME}/release/${PORTVERSION}
 EXTRACT_SUFX=	.tgz

-MAINTAINER= ports@FreeBSD.org
+MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Postfix MTA log parser

 LICENSE=	MIT
@@ -16,36 +16,35 @@
 PORTDOCS=	Bugs Changes README
 PORTEXAMPLES=	${PORTNAME}.conf ${PORTNAME}.conf-topn

-MAN1=		${PORTNAME}.1
-
-USES=		perl5
+USES=		perl5 shebangfix
 USE_PERL5=	run
 NO_BUILD=	yes
+SHEBANG_FILES=	${PORTNAME}
+
+.include <bsd.port.options.mk>

-NO_STAGE=	yes
 post-patch:
 	@cd ${WRKSRC} && ${REINPLACE_CMD} -e '\
 		s!/usr/local/etc!${ETCDIR}! \
 		' ${PORTNAME} ${PORTNAME}.1 README

 do-install:
-	${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
-	${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${MANPREFIX}/man/man1
-	@${CP} ${WRKSRC}/${PORTNAME}.conf ${WRKSRC}/${PORTNAME}.conf.sample
-	@${MKDIR} ${ETCDIR}
-	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf.sample ${ETCDIR}
+	${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
+	${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${STAGEDIR}${MANPREFIX}/man/man1
+	@${MKDIR} ${STAGEDIR}${ETCDIR}
+	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf ${STAGEDIR}${ETCDIR}/${PORTNAME}.conf.sample

 post-install:
 	@if [ ! -f ${ETCDIR}/${PORTNAME}.conf ]; then \
-		${CP} -p ${ETCDIR}/${PORTNAME}.conf.sample ${ETCDIR}/${PORTNAME}.conf; \
+		${CP} -p ${STAGEDIR}${ETCDIR}/${PORTNAME}.conf.sample ${STAGEDIR}${ETCDIR}/${PORTNAME}.conf; \
 	fi
-.if !defined(NOPORTDOCS)
-	@${MKDIR} ${DOCSDIR}
-	cd ${WRKSRC} && ${INSTALL_MAN} ${PORTDOCS} ${DOCSDIR}
+.if ${PORT_OPTIONS:MDOCS}
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	cd ${WRKSRC} && ${INSTALL_MAN} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
 .endif
-.if !defined(NOPORTEXAMPLES)
-	@${MKDIR} ${EXAMPLESDIR}
-	cd ${WRKSRC} && ${INSTALL_DATA} ${PORTEXAMPLES} ${EXAMPLESDIR}
+.if ${PORT_OPTIONS:MEXAMPLES}
+	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+	cd ${WRKSRC} && ${INSTALL_DATA} ${PORTEXAMPLES} ${STAGEDIR}${EXAMPLESDIR}
 .endif

 .include <bsd.port.mk>
diff -ruN /usr/ports/mail/postfix-logwatch/pkg-plist ./pkg-plist
--- /usr/ports/mail/postfix-logwatch/pkg-plist	2014-01-23 00:16:56.000000000 +0900
+++ ./pkg-plist	2014-07-08 10:44:55.000000000 +0900
@@ -3,3 +3,4 @@
 @exec if [ ! -f %B/postfix-logwatch.conf ] ; then cp -p %B/%f %B/postfix-logwatch.conf; fi
 @dirrmtry %%ETCDIR%%
 bin/postfix-logwatch
+man/man1/postfix-logwatch.1.gz
---
Comment 1 Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-07-08 14:33:53 UTC
Please attach a diff to the bug.
Comment 2 takefu 2014-07-08 22:32:36 UTC
Created attachment 144527 [details]
postfix-logwatch.patch
Comment 3 Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-07-08 22:36:38 UTC
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: %%ETCDIR%%/postfix-logwatch.conf
Comment 4 takefu 2014-07-08 23:30:09 UTC
Sorry!

I will replace the one file.


--- /usr/ports/mail/postfix-logwatch/pkg-plist  2014-01-23 00:16:56.000000000 +0900
+++ ./pkg-plist 2014-07-09 08:24:30.000000000 +0900
@@ -1,5 +1,4 @@
-@unexec if cmp -s %D/%%ETCDIR%%/postfix-logwatch.conf.sample %D/%%ETCDIR%%/postfix-logwatch.conf; then rm -f %D/%%ETCDIR%%/postfix-logwatch.conf; fi
-%%ETCDIR%%/postfix-logwatch.conf.sample
-@exec if [ ! -f %B/postfix-logwatch.conf ] ; then cp -p %B/%f %B/postfix-logwatch.conf; fi
+@sample %%ETCDIR%%/postfix-logwatch.conf.sample
 @dirrmtry %%ETCDIR%%
 bin/postfix-logwatch
+man/man1/postfix-logwatch.1.gz
---




(In reply to Raphael Kubo da Costa from comment #3)
> ====> Checking for pkg-plist issues (check-plist)
> ===> Parsing plist
> ===> Checking for items in STAGEDIR missing from pkg-plist
> Error: Orphaned: %%ETCDIR%%/postfix-logwatch.conf
Comment 5 Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-07-09 18:04:06 UTC
Again, it would be very helpful if you could submit a proper patch :)
Comment 6 takefu 2014-07-09 23:25:13 UTC
Created attachment 144547 [details]
postfix-logwatch2.patch

差分の差替。
Comment 7 commit-hook freebsd_committer freebsd_triage 2014-07-10 19:12:08 UTC
A commit references this bug:

Author: rakuco
Date: Thu Jul 10 19:12:04 UTC 2014
New revision: 361484
URL: http://svnweb.freebsd.org/changeset/ports/361484

Log:
  - Support staging.
  - Use the @sample keyword in the plist.

  PR:		191728
  Submitted by:	takefu@airport.fm

Changes:
  head/mail/postfix-logwatch/Makefile
  head/mail/postfix-logwatch/pkg-plist
Comment 8 Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-07-10 19:12:43 UTC
Committed, thank you.