Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jul 2014 09:16:05 +0000 (UTC)
From:      Marc Fonvieille <blackend@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r362306 - head/misc/freebsd-doc-en
Message-ID:  <201407200916.s6K9G5kp033206@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: blackend (doc committer)
Date: Sun Jul 20 09:16:05 2014
New Revision: 362306
URL: http://svnweb.freebsd.org/changeset/ports/362306
QAT: https://qat.redports.org/buildarchive/r362306/

Log:
  - Fix use of DESTDIRNAME variable [1]
  - Fix image links for HTML file: links are generated at build with
    absolute path, make these paths relative.  This should allow a
    proper display of the HTML version of the docs.
  
  Submitted by:	wblock [1]
  Approved by:	doceng (implicit)

Modified:
  head/misc/freebsd-doc-en/Makefile

Modified: head/misc/freebsd-doc-en/Makefile
==============================================================================
--- head/misc/freebsd-doc-en/Makefile	Sun Jul 20 09:02:14 2014	(r362305)
+++ head/misc/freebsd-doc-en/Makefile	Sun Jul 20 09:16:05 2014	(r362306)
@@ -3,6 +3,7 @@
 
 PORTNAME=	freebsd-doc
 PORTVERSION=	45106
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	misc docs
 MASTER_SITES=	LOCAL/blackend
@@ -24,7 +25,11 @@ MAKE_ARGS=	FORMATS="${DOCFORMAT}" \
 		DOCOWN=${SHAREOWN} \
 		DOCGRP=${SHAREGRP}
 MAKE_JOBS_UNSAFE=	yes
-DESTDIRNAME=	${STAGEDIR}${PREFIX}/${DOCBASE}
+
+# To populate correctly the stage directory
+TMPDESTDIR=	${STAGEDIR}${DESTDIR}/${PREFIX}/${DOCBASE}
+DESTDIRNAME=	TMPDESTDIR
+
 PLIST=		${WRKDIR}/pkg-plist
 NEED_ROOT=	yes
 
@@ -78,4 +83,14 @@ PLIST_FORMATS+=	extras common
 pre-build:
 	${CAT} ${PLIST_FORMATS:S,^,${.CURDIR}/pkg-plist.,} > ${PLIST}
 
+# For HTML files, images links are hardcoded during the build
+# with absolute pathnames.  Make these pathnames relative.
+post-build:
+.if ${PORT_OPTIONS:MHTML} || ${PORT_OPTIONS:MHTML_SPLIT}
+	${FIND} ${WRKSRC} -name "*.html" -exec \
+		${REINPLACE_CMD} -e 's,img src=\"${WRKSRC}.*share/images,img src=\"../..,g' {} \;
+	${FIND} ${WRKSRC} -name "*.html" -exec \
+		${REINPLACE_CMD} -e 's,img src=\"${WRKSRC}.*imagelib,img src=\"imagelib,g' {} \;
+.endif
+
 .include <bsd.port.mk>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407200916.s6K9G5kp033206>