Bug 179730 - (Possible) change to textproc/slides
Summary: (Possible) change to textproc/slides
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: John Marino
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-19 19:40 UTC by John Marino
Modified: 2013-09-11 08:03 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 John Marino 2013-06-19 19:40:00 UTC
This PR is related to ports/179696 and ports/179725 and ports/179729

This is the 4th of 4 ports that use xmlcatmgr during install.
It is the only port that doesn't generate an error during package install.

This is because the generated catalog is not referenced in the pkg-plist, but there is an attempt to unlink it upon package removal.

The end result is okay, but it's not clean.

Fix: 

It's not absolutely required, but it is suggested to convert this port like the other three:

1) put "catalog" on the pkg-plist
2) remove the unexec for "catalog", it's not needed
3) generate "catalog" in the do-install target, not the PKG_INSTALL script.

see the other 3 related PRs for how to do this.
Comment 1 John Marino freebsd_committer freebsd_triage 2013-07-18 09:07:57 UTC
Responsible Changed
From-To: freebsd-ports-bugs->marino

I can handle it as a committer.
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-09-11 07:34:58 UTC
Author: marino
Date: Wed Sep 11 06:34:50 2013
New Revision: 326943
URL: http://svnweb.freebsd.org/changeset/ports/326943

Log:
  textproc/slides: move catalog generation into package
  
  Recently textproc/docbook-xsl, and textproc/docbook-xsl-ns and
  textproc/website were modified such that the xmlcatmgr catalog was
  created during the build (once) and packaged.  Before it was
  accidently built and package and then created again during the
  package install script that it had.  So the catalog creation was
  removed from pkg-install.in script.
  
  textproc/slides really was set up in the same way but it wasn't
  emitting errors because the pkg-plist was slightly different.
  However, in the interest of uniformity, textproc/slides was updated
  to match the others.
  
  The missing dependency on xmlcatmgr was added and the header trimmed
  as well.
  
  PR:		ports/179730
  Submitted by:	marino

Modified:
  head/textproc/slides/Makefile
  head/textproc/slides/files/pkg-install.in
  head/textproc/slides/pkg-plist

Modified: head/textproc/slides/Makefile
==============================================================================
--- head/textproc/slides/Makefile	Wed Sep 11 06:27:41 2013	(r326942)
+++ head/textproc/slides/Makefile	Wed Sep 11 06:34:50 2013	(r326943)
@@ -1,27 +1,21 @@
-# New ports collection makefile for:   slides
-# Date Created:        2004-04-29 13:49:33
-# Whom:                Jean-Baptiste Quenot <jb.quenot@caraldi.com>
-#
-# ex:ts=22:sw=22
-#
+# Created by: Jean-Baptiste Quenot <jb.quenot@caraldi.com>
 # $FreeBSD$
-#
-# Based on the textproc/website port
-#
 
 PORTNAME=	slides
 PORTVERSION=	3.3.1
+PORTREVISION=	1
 CATEGORIES=	textproc
 MASTER_SITES=	SF/docbook/OldFiles
 
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Doctype and stylesheets for making slides
 
+BUILD_DEPENDS=	xmlcatmgr:${PORTSDIR}/textproc/xmlcatmgr
 RUN_DEPENDS=	${LOCALBASE}/share/xsl/docbook/catalog:${PORTSDIR}/textproc/docbook-xsl
 RUN_DEPENDS+=	${LOCALBASE}/share/xml/docbook/4.3/catalog.xml:${PORTSDIR}/textproc/docbook-xml-430
 
-XMLDIR=	${LOCALBASE}/share/xml
-INSTDIR=	share/xsl/${PORTNAME}
+XMLDIR=		${LOCALBASE}/share/xml
+INSTDIR=	share/xsl/slides
 PINSTDIR=	${PREFIX}/${INSTDIR}
 COPYDIRS=	browser graphics schema xsl
 
@@ -31,14 +25,25 @@ PKGDEINSTALL=	${WRKSRC}/pkg-deinstall
 NO_BUILD=	yes
 XMLCATMGR=	${LOCALBASE}/bin/xmlcatmgr
 CATALOG_PORTS=	${XMLDIR}/catalog.ports
+CATALOG_XSL=	${WRKSRC}/catalog
 MYEXAMPLESDIR=	tests
 MYDOCSDIR=	doc
 
+DXVERSIONS=	3.3.1 3.2.0 3.1.0 3.0.0 3.0b2 3.0b1 2.1b2 2.1b1 2.0a2 2.0a1 \
+		current
+
+REPLACE_EXPR=	-e 's,@INSTDIR@,${INSTDIR},g ; \
+	    s,@XMLCATMGR@,${XMLCATMGR},g ; \
+	    s,@CATALOG_PORTS_XML@,${CATALOG_PORTS},g ; \
+	    s,@PORTNAME@,slides,g'
+
+.include <bsd.port.options.mk>
+
 post-patch:
 	${FIND} ${WRKSRC} -name '*.orig' -delete
 
 do-install:
-.ifndef NOPORTDOCS
+.if ${PORT_OPTIONS:MDOCS}
 	${MKDIR} ${EXAMPLESDIR}
 	(cd ${WRKSRC}/${MYEXAMPLESDIR} && ${TAR} -cf - . |\
 	    ${TAR} -xf - -C${EXAMPLESDIR})
@@ -46,14 +51,31 @@ do-install:
 	(cd ${WRKSRC}/${MYDOCSDIR} && ${TAR} -cf - . |\
 	    ${TAR} -xf - -C${DOCSDIR})
 .endif
+	${XMLCATMGR} -c "${CATALOG_XSL}" create
+.for dxversion in ${DXVERSIONS}
+	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteSystem \
+		http://docbook.sourceforge.net/release/slides/${dxversion}/xsl \
+		"file://${PINSTDIR}/xsl"
+	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
+		http://docbook.sourceforge.net/release/slides/${dxversion}/xsl \
+		"file://${PINSTDIR}/xsl"
+	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteSystem \
+		http://docbook.sourceforge.net/release/slides/${dxversion}/schema/dtd \
+		"file://${PINSTDIR}/schema/dtd"
+	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
+		http://docbook.sourceforge.net/release/slides/${dxversion}/schema/dtd \
+		"file://${PINSTDIR}/schema/dtd"
+	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteSystem \
+		http://docbook.sourceforge.net/release/slides/${dxversion} \
+		"file://${PINSTDIR}/schema/dtd"
+	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
+		http://docbook.sourceforge.net/release/slides/${dxversion} \
+		"file://${PINSTDIR}/schema/dtd"
+.endfor
 	${MKDIR} ${PINSTDIR}
-	(cd ${WRKSRC} && ${TAR} -cf - VERSION ${COPYDIRS} |\
+	(cd ${WRKSRC} && ${TAR} -cf - VERSION catalog ${COPYDIRS} |\
 	    ${TAR} -xf - -C${PINSTDIR})
 
-REPLACE_EXPR=	-e 's,@INSTDIR@,${INSTDIR},g ; \
-	    s,@XMLCATMGR@,${XMLCATMGR},g ; \
-	    s,@CATALOG_PORTS_XML@,${CATALOG_PORTS},g ; \
-	    s,@PORTNAME@,${PORTNAME},g'
 post-install:
 	@${SED} ${REPLACE_EXPR} < ${FILESDIR}/pkg-install.in > ${PKGINSTALL}
 	@${SED} ${REPLACE_EXPR} < ${FILESDIR}/pkg-deinstall.in > ${PKGDEINSTALL}

Modified: head/textproc/slides/files/pkg-install.in
==============================================================================
--- head/textproc/slides/files/pkg-install.in	Wed Sep 11 06:27:41 2013	(r326942)
+++ head/textproc/slides/files/pkg-install.in	Wed Sep 11 06:34:50 2013	(r326943)
@@ -20,34 +20,6 @@ if [ "$2" != "POST-INSTALL" ]; then
     exit 0
 fi
 
-VERSIONS='current 3.3.1 3.2.0 3.1.0 3.0.0 3.0b2 3.0b1 2.1b2 2.1b1 2.0a2 2.0a1'
-
-if [ ! -f ${CATALOG_XSL} ]; then
-    ${XMLCATMGR} -c "${CATALOG_XSL}" create
-fi
-
-for version in ${VERSIONS}
-do
-    ${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteSystem \
-        http://docbook.sourceforge.net/release/${PORTNAME}/$version/xsl \
-        "file://${XSL_DIR}/xsl"
-    ${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
-        http://docbook.sourceforge.net/release/${PORTNAME}/$version/xsl \
-        "file://${XSL_DIR}/xsl"
-    ${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteSystem \
-        http://docbook.sourceforge.net/release/${PORTNAME}/$version/schema/dtd \
-        "file://${XSL_DIR}/schema/dtd"
-    ${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
-        http://docbook.sourceforge.net/release/${PORTNAME}/$version/schema/dtd \
-        "file://${XSL_DIR}/schema/dtd"
-    ${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteSystem \
-        http://docbook.sourceforge.net/release/${PORTNAME}/$version \
-        "file://${XSL_DIR}/schema/dtd"
-    ${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
-        http://docbook.sourceforge.net/release/${PORTNAME}/$version \
-        "file://${XSL_DIR}/schema/dtd"
-done
-
 ${XMLCATMGR} -c "${CATALOG_PORTS_XML}" add delegateSystem \
     http://docbook.sourceforge.net/release/${PORTNAME}/ \
     "file://${CATALOG_XSL}"

Modified: head/textproc/slides/pkg-plist
==============================================================================
--- head/textproc/slides/pkg-plist	Wed Sep 11 06:27:41 2013	(r326942)
+++ head/textproc/slides/pkg-plist	Wed Sep 11 06:34:50 2013	(r326943)
@@ -143,7 +143,7 @@ share/xsl/slides/xsl/xhtml/tables.xsl
 share/xsl/slides/xsl/xhtml/vslides.xsl
 share/xsl/slides/xsl/xhtml/w3c.xsl
 share/xsl/slides/VERSION
-@unexec rm -f %D/share/xsl/slides/catalog 2>&1 >/dev/null || true
+share/xsl/slides/catalog
 @dirrm share/xsl/slides/browser
 @dirrm share/xsl/slides/graphics/active
 @dirrm share/xsl/slides/graphics/inactive
@@ -160,6 +160,6 @@ share/xsl/slides/VERSION
 @dirrm share/xsl/slides/xsl/xhtml
 @dirrm share/xsl/slides/xsl
 @dirrm share/xsl/slides
-@unexec test -d %D/share/xsl && rmdir %D/share/xsl 2>/dev/null || true
+@dirrmtry share/xsl
 %%PORTDOCS%%@dirrm %%EXAMPLESDIR%%
 %%PORTDOCS%%@dirrm %%DOCSDIR%%
_______________________________________________
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"
Comment 3 John Marino freebsd_committer freebsd_triage 2013-09-11 08:03:29 UTC
State Changed
From-To: open->closed

Committed. Thanks!