From 99970171b4689a84fc0c57955981a04c531a692d Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin Date: Wed, 13 Jul 2011 09:28:12 +0400 Subject: [PATCH] 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. Signed-off-by: Eygene Ryabinkin --- mail/offlineimap/Makefile | 43 ++++++++++++++++++++++++++++---- mail/offlineimap/files/pkg-message.in | 8 +++--- mail/offlineimap/pkg-plist | 13 ---------- 3 files changed, 41 insertions(+), 23 deletions(-) diff --git a/mail/offlineimap/Makefile b/mail/offlineimap/Makefile index 27f8884..6a5677d 100644 --- a/mail/offlineimap/Makefile +++ b/mail/offlineimap/Makefile @@ -10,40 +10,71 @@ DISTVERSION= 6.3.3 PORTREVISION= 1 CATEGORIES= mail python MASTER_SITES= http://download.github.com/ \ - ${MASTER_SITE_LOCAL} -MASTER_SITE_SUBDIR= sergei -DISTNAME= nicolas33-${PORTNAME}-v${DISTVERSION}-0-g3b09695 + http://dist.codelabs.ru/fbsd/offlineimap/ \ + LOCAL/rea/offlineimap +DISTNAME= ${GITHUB_USER}-${PORTNAME}-v${DISTVERSION}-0-g3b09695 MAINTAINER= sergei@FreeBSD.org COMMENT= Powerful IMAP/Maildir synchronization and reader support LICENSE= GPLv2 GPLv3 LICENSE_COMB= dual + LICENSE_FILE_GPLv2=${WRKSRC}/COPYING -WRKSRC= ${WRKDIR}/nicolas33-${PORTNAME}-cf325d5 +OPTIONS= HTMLDOCS "Generate HTML documentation" Off + +WRKSRC= ${WRKDIR}/${GITHUB_USER}-${PORTNAME}-cf325d5 SUB_FILES= pkg-message +GITHUB_USER= nicolas33 + USE_PYTHON= yes USE_PYDISTUTILS= yes -DOCS= *.rst docs/*.rst +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 +PORTDOCS= ${DOCS:T} +PORTEXAMPLES= ${EXAMPLES} + +.include + +.if !defined(NOPORTDOCS) && defined(WITH_HTMLDOCS) +BUILD_DEPENDS+= rst2html:${PORTSDIR}/textproc/py-docutils +DOCS:= ${DOCS} ${DOCS:M*.rst:S/.rst$/.html/} +.endif + +# This is needed for pkg-message.in +.if defined(NOPORTEXAMPLES) +SUB_LIST+= PORTEXAMPLES="@comment " +.else +SUB_LIST+= PORTEXAMPLES="" +.endif pre-fetch: # get github download ticket if [ ! -f ${DISTDIR}/${DISTFILES} ]; then \ ${FETCH_BINARY} -s >/dev/null \ - http://github.com/nicolas33/${PORTNAME}/tarball/v${DISTVERSION}; \ + http://github.com/${GITHUB_USER}/${PORTNAME}/tarball/v${DISTVERSION}; \ fi +post-build: +.if !defined(NOPORTDOCS) && defined(WITH_HTMLDOCS) +.for r in ${DOCS:M*.rst} + rst2html ${WRKSRC}/${r} ${WRKSRC}/${r:R}.html +.endfor +.endif + post-install: .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR} .endif +.if !defined(NOPORTEXAMPLES) @${MKDIR} ${EXAMPLESDIR} cd ${WRKSRC} && ${INSTALL_DATA} ${EXAMPLES} ${EXAMPLESDIR} +.endif @${CAT} ${PKGMESSAGE} .include diff --git a/mail/offlineimap/files/pkg-message.in b/mail/offlineimap/files/pkg-message.in index ee7feab..98249c2 100644 --- a/mail/offlineimap/files/pkg-message.in +++ b/mail/offlineimap/files/pkg-message.in @@ -1,8 +1,8 @@ ########################################################################### -# -# Please copy sample configuration file from -# %%EXAMPLESDIR%%/offlineimap.conf.minimal -# to ~/.offlineimaprc and edit to suit your needs. +%%PORTEXAMPLES%%# +%%PORTEXAMPLES%%# Please copy sample configuration file from +%%PORTEXAMPLES%%# %%EXAMPLESDIR%%/offlineimap.conf.minimal +%%PORTEXAMPLES%%# to ~/.offlineimaprc and edit to suit your needs. # # WARNING: if you are upgrading from pre-3.99.12 version, please be sure # to check the manual for changes in configuration file format diff --git a/mail/offlineimap/pkg-plist b/mail/offlineimap/pkg-plist index f25a41d..d39b95f 100644 --- a/mail/offlineimap/pkg-plist +++ b/mail/offlineimap/pkg-plist @@ -103,16 +103,3 @@ bin/offlineimap %%PYTHON_SITELIBDIR%%/offlineimap/threadutil.pyc %%PYTHON_SITELIBDIR%%/offlineimap/threadutil.pyo @dirrm %%PYTHON_SITELIBDIR%%/offlineimap -%%PORTDOCS%%%%DOCSDIR%%/Changelog.draft.rst -%%PORTDOCS%%%%DOCSDIR%%/Changelog.maint.rst -%%PORTDOCS%%%%DOCSDIR%%/Changelog.rst -%%PORTDOCS%%%%DOCSDIR%%/FAQ.rst -%%PORTDOCS%%%%DOCSDIR%%/INSTALL.rst -%%PORTDOCS%%%%DOCSDIR%%/MANUAL.rst -%%PORTDOCS%%%%DOCSDIR%%/README.rst -%%PORTDOCS%%%%DOCSDIR%%/SubmittingPatches.rst -%%PORTDOCS%%%%DOCSDIR%%/UPGRADE.rst -%%PORTDOCS%%@dirrm %%DOCSDIR%% -%%EXAMPLESDIR%%/offlineimap.conf -%%EXAMPLESDIR%%/offlineimap.conf.minimal -@dirrm %%EXAMPLESDIR%% -- 1.7.5.4