Bug 158862 - [patch] mail/offlineimap: some improvements
Summary: [patch] mail/offlineimap: some improvements
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: Sergei Kolobov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-13 07:40 UTC by Eygene Ryabinkin
Modified: 2011-08-16 07:40 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eygene Ryabinkin freebsd_committer freebsd_triage 2011-07-13 07:40:08 UTC
Some improvements:
 - respect NOPORTEXAMPLES;
 - make HTML documentation from .rst sources on-demand;
 - add some new mirrors for the distfile.

Fix: 

The patch is available at
  http://codelabs.ru/fbsd/ports/notmy/offlineimap/6.3.3-portexamples-and-htmldocs.diff

Tinderbox logs:
 - http://gpf.codelabs.ru/tb-logs/mine-9/offlineimap-6.3.3_1.log
 - http://gpf.codelabs.ru/tb-logs/mine-8/offlineimap-6.3.3_1.log
 - http://gpf.codelabs.ru/tb-logs/mine-7/offlineimap-6.3.3_1.log
How-To-Repeat: 
N/A
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-07-13 07:40:23 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sergei

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Pan Tsu 2011-07-13 09:12:47 UTC
I think it can be simplified a bit (many ifdefs removed)

- no need to ifdef out PORTDOCS/PORTEXAMPLES assignments (see add-plist-docs)
- no need to use .for for a variable, substitution works on every word
- RSTDOCS can probably removed, used only twice

and improved

- keep ifdefs in one place, SUB_LIST is not used before bsd.port.post.mk
- move licenses before options to keep portlint happy

--- a.diff begins here ---
diff --git a/mail/offlineimap/Makefile b/mail/offlineimap/Makefile
index 39df333..1382c5e 100644
--- a/mail/offlineimap/Makefile
+++ b/mail/offlineimap/Makefile
@@ -17,12 +17,13 @@ DISTNAME=	${GITHUB_USER}-${PORTNAME}-v${DISTVERSION}-0-g3b09695
 MAINTAINER=	sergei@FreeBSD.org
 COMMENT=	Powerful IMAP/Maildir synchronization and reader support
 
-OPTIONS=	HTMLDOCS "Generate HTML documentation" Off
-
 LICENSE=	GPLv2 GPLv3
 LICENSE_COMB=	dual
+
 LICENSE_FILE_GPLv2=${WRKSRC}/COPYING
 
+OPTIONS=	HTMLDOCS "Generate HTML documentation" Off
+
 WRKSRC=		${WRKDIR}/${GITHUB_USER}-${PORTNAME}-cf325d5
 SUB_FILES=	pkg-message
 
@@ -31,36 +32,25 @@ GITHUB_USER=	nicolas33
 USE_PYTHON=	yes
 USE_PYDISTUTILS=	yes
 
-# This is needed for pkg-message.in
-.if defined(NOPORTEXAMPLES)
-SUB_LIST+=	PORTEXAMPLES="@comment "
-.else
-SUB_LIST+=	PORTEXAMPLES=""
-.endif
-
-RSTDOCS=	Changelog.rst README.rst SubmittingPatches.rst \
+PORTDOCS=	${DOCS:T}
+PORTEXAMPLES=	${EXAMPLES}
+DOCS=		Changelog.rst README.rst SubmittingPatches.rst \
 		docs/FAQ.rst docs/INSTALL.rst docs/MANUAL.rst docs/UPGRADE.rst
 EXAMPLES=	offlineimap.conf offlineimap.conf.minimal
 
 .include <bsd.port.options.mk>
 
-.if !defined(NOPORTDOCS)
-PORTDOCS=	${DOCS:T}
-.endif
-.if !defined(NOPORTEXAMPLES)
-PORTEXAMPLES=	${EXAMPLES}
+.if !defined(NOPORTDOCS) && defined(WITH_HTMLDOCS)
+BUILD_DEPENDS+=	rst2html:${PORTSDIR}/textproc/py-docutils
+DOCS:=		${DOCS} ${DOCS:M*.rst:S/rst/html/}
 .endif
 
-.if !defined(NOPORTDOCS)
-.if defined(WITH_HTMLDOCS)
-BUILD_DEPENDS+=	rst2html:${PORTSDIR}/textproc/py-docutils
-.for r in ${RSTDOCS}
-DOCS+=	${r:R}.html
-.endfor
+# This is needed for pkg-message.in
+.if defined(NOPORTEXAMPLES)
+SUB_LIST+=	PORTEXAMPLES="@comment "
 .else
-DOCS+=	${RSTDOCS}
-.endif # WITH_HTMLDOCS
-.endif # NOPORTDOCS
+SUB_LIST+=	PORTEXAMPLES=""
+.endif
 
 pre-fetch:
 	# get github download ticket
@@ -71,7 +61,7 @@ pre-fetch:
 
 post-build:
 .if !defined(NOPORTDOCS) && defined(WITH_HTMLDOCS)
-.for r in ${RSTDOCS}
+.for r in ${DOCS:M*.rst}
 	rst2html ${WRKSRC}/${r} ${WRKSRC}/${r:R}.html
 .endfor
 .endif
--- a.diff ends here ---
Comment 3 Eygene Ryabinkin freebsd_committer freebsd_triage 2011-07-13 10:57:35 UTC
Wed, Jul 13, 2011 at 12:12:47PM +0400, Pan Tsu wrote:
> I think it can be simplified a bit (many ifdefs removed)
> 
> - no need to ifdef out PORTDOCS/PORTEXAMPLES assignments (see add-plist-docs)
> - no need to use .for for a variable, substitution works on every word


Yes, a goot catch.  I had changed the := line to
{{{
DOCS:=		${DOCS} ${DOCS:M*.rst:S/.rst$/.html/}
}}}
to avoid making spurious substitutions of 'rst' inside the
words, like would be with "pqrst.rst".

> - RSTDOCS can probably removed, used only twice


My first intention was to build HTML or RST docs, but perhaps your
way to add the HTML documentation and to keep RST in any case is
better.

Had moved the lines with PORTDOCS and PORTEXAMPLES after DOCS
and EXAMPLES.

The diff is still at
  http://codelabs.ru/fbsd/ports/notmy/offlineimap/6.3.3-portexamples-and-htmldocs.diff

Tinderbox builds are still fine,
 - http://gpf.codelabs.ru/tb-logs/mine-9/offlineimap-6.3.3_1.log
 - http://gpf.codelabs.ru/tb-logs/mine-8/offlineimap-6.3.3_1.log
 - http://gpf.codelabs.ru/tb-logs/mine-7/offlineimap-6.3.3_1.log

Thanks!
-- 
Eygene Ryabinkin                                        ,,,^..^,,,
[ Life's unfair - but root password helps!           | codelabs.ru ]
[ 82FE 06BC D497 C0DE 49EC  4FF0 16AF 9EAE 8152 ECFB | freebsd.org ]
Comment 4 dfilter service freebsd_committer freebsd_triage 2011-08-15 23:01:28 UTC
rea         2011-08-15 22:01:14 UTC

  FreeBSD ports repository

  Modified files:
    mail/offlineimap     Makefile pkg-plist 
    mail/offlineimap/files pkg-message.in 
  Log:
  OfflineIMAP: respect NOPORTEXAMPLES and build HTML documentation on-demand
  
  Also parametrize GitHub user name to avoid repeating ourselves
  and mirror distfile locally on CodeLabs and FreeBSD.
  
  PR: ports/158862
  Hints-from: Pan Tsu <inyaoo@gmail.com>
  Approved-by: garga (mentor), maintainer timeout (1 month)
  Feature-safe: yes
  
  Revision  Changes    Path
  1.35      +37 -6     ports/mail/offlineimap/Makefile
  1.2       +4 -4      ports/mail/offlineimap/files/pkg-message.in
  1.10      +1 -14     ports/mail/offlineimap/pkg-plist
_______________________________________________
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 5 Eygene Ryabinkin freebsd_committer freebsd_triage 2011-08-16 07:39:51 UTC
State Changed
From-To: open->closed

Committed, thanks to everyone worked on this!