Skip site navigation (1)Skip section navigation (2)
Date:      2 Jul 2003 19:57:33 -0000
From:      Rui Lopes <rui@ruilopes.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        des@FreeBSD.org
Subject:   ports/54042: [PATCH] for updating textproc/docbook-xsl
Message-ID:  <20030702195733.20636.qmail@ns.webtt.biz>
Resent-Message-ID: <200307022000.h62K0Wv3083871@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         54042
>Category:       ports
>Synopsis:       [PATCH] for updating textproc/docbook-xsl
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 02 13:00:32 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Rui Lopes
>Release:        FreeBSD 5.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD disty 5.1-RELEASE FreeBSD 5.1-RELEASE #0: Fri Jun 6 19:30:44 WEST 2003 root@disty:/usr/obj/usr/src/sys/DEBUGGER i386


	
>Description:
* fixed port (current docbook-xml moved the catalog to 4.2/catalog.xml)
* created the xsl catalog under xsl/docbook/catalog
* added an entry in xml catalog for xsl docbook
	
>How-To-Repeat:
	
>Fix:

	

--- docbook-xsl.patch begins here ---
# * fixed port (current docbook-xml moved the catalog to 4.2/catalog.xml)
# * created the xsl catalog under xsl/docbook/catalog
# * added an entry in xml catalog for xsl docbook
#
# test with:
# xmlcatalog /usr/local/share/xml/catalog http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl
#
# -- Rui Lopes <rui@ruilopes.com>
diff -ruN docbook-xsl.orig/Makefile docbook-xsl/Makefile
--- docbook-xsl.orig/Makefile	Tue Jul  1 20:12:06 2003
+++ docbook-xsl/Makefile	Wed Jul  2 12:21:19 2003
@@ -14,15 +14,20 @@
 MAINTAINER=	des@freebsd.org
 COMMENT=	XSL DocBook stylesheets
 
-RUN_DEPENDS=	${XMLDIR}/docbook/catalog:${PORTSDIR}/textproc/docbook-xml \
+RUN_DEPENDS=	${XMLDIR}/docbook/4.2/catalog.xml:${PORTSDIR}/textproc/docbook-xml \
 		${XMLDIR}/sdocbook/catalog:${PORTSDIR}/textproc/sdocbook-xml
 
 XMLDIR=		${LOCALBASE}/share/xml
-INSTDIR=	${PREFIX}/share/xsl/docbook
+INSTDIR=	share/xsl/docbook
+PINSTDIR=	${PREFIX}/${INSTDIR}
 COPYDIRS=	common fo extensions html htmlhelp images \
 		javahelp lib manpages params template xhtml
+PKGINSTALL=	${WRKSRC}/pkg-install
+PKGDEINSTALL=	${WRKSRC}/pkg-deinstall
 
 NO_BUILD=	yes
+XMLCATMGR=	${LOCALBASE}/bin/xmlcatmgr
+CATALOG_PORTS=	${XMLDIR}/catalog.ports
 
 post-extract:
 	${FIND} ${WRKSRC} -name '.#*' -delete
@@ -33,8 +38,18 @@
 	(cd ${WRKSRC}/doc && ${TAR} -cf - . |\
 		${TAR} -xf - -C${DOCSDIR})
 .endif
-	${MKDIR} ${INSTDIR}
+	${MKDIR} ${PINSTDIR}
 	(cd ${WRKSRC} && ${TAR} -cf - VERSION ${COPYDIRS} |\
-		${TAR} -xf - -C${INSTDIR})
+		${TAR} -xf - -C${PINSTDIR})
+
+post-install:
+	@${SED} -e 's,@INSTDIR@,${INSTDIR},g ; \
+			s,@XMLCATMGR@,${XMLCATMGR},g ; \
+			s,@CATALOG_PORTS_XML@,${CATALOG_PORTS},g' \
+			< ${FILESDIR}/pkg-install.in > ${PKGINSTALL}
+	@${SED} -e 's,@XMLCATMGR@,${XMLCATMGR},g ; \
+			s,@CATALOG_PORTS_XML@,${CATALOG_PORTS},g' \
+			< ${FILESDIR}/pkg-deinstall.in > ${PKGDEINSTALL}
+	@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
 
 .include <bsd.port.mk>
diff -ruN docbook-xsl.orig/files/pkg-deinstall.in docbook-xsl/files/pkg-deinstall.in
--- docbook-xsl.orig/files/pkg-deinstall.in	Thu Jan  1 01:00:00 1970
+++ docbook-xsl/files/pkg-deinstall.in	Wed Jul  2 11:51:33 2003
@@ -0,0 +1,12 @@
+#!/bin/sh
+# This script will remove the docbook-xsl entries added to xml catalog.
+# -- Rui Lopes <rui@ruilopes.com>
+
+XMLCATMGR=@XMLCATMGR@
+CATALOG_PORTS_XML=@CATALOG_PORTS_XML@
+
+if [ "$2" != "POST-DEINSTALL" ]; then
+	exit 0
+fi
+
+${XMLCATMGR} -c "${CATALOG_PORTS_XML}" remove http://docbook.sourceforge.net/release/xsl/ 
diff -ruN docbook-xsl.orig/files/pkg-install.in docbook-xsl/files/pkg-install.in
--- docbook-xsl.orig/files/pkg-install.in	Thu Jan  1 01:00:00 1970
+++ docbook-xsl/files/pkg-install.in	Wed Jul  2 12:25:49 2003
@@ -0,0 +1,43 @@
+#!/bin/sh
+# This script will create the docbook-xsl catalog and will add entries to xml catalog.
+# WARNING: If you change this script, be sure to check pkg-deinstall.in!
+#
+# Based on http://xmlsoft.org/buildDocBookCatalog file.
+#
+# in vi/vim grab VERSIONS string with command:
+# !!echo -n "VERSIONS='current ";fetch -qo - http://cvs.sf.net/cgi-bin/viewcvs.cgi/docbook/xsl/VERSION|sed -nE 's/.*Version (.*) released./\1/gp'|sort|sed -e '1,3d'|paste -sd ' ' -|tr \\n \'
+#
+# -- Rui Lopes <rui@ruilopes.com>
+
+XMLCATMGR=@XMLCATMGR@
+CATALOG_PORTS_XML=@CATALOG_PORTS_XML@
+XSL_DIR=${PKG_PREFIX}/@INSTDIR@
+CATALOG_XSL=${XSL_DIR}/catalog
+
+if [ "$2" != "POST-INSTALL" ]; then
+	exit 0
+fi
+
+VERSIONS='current 1.39 1.40 1.41 1.42 1.43 1.44 1.45 1.46 1.47 1.48 1.49 1.50.0 1.50.1-EXP 1.50.1-EXP2 1.51.0 1.51.1 1.52.0 1.52.1 1.52.2 1.53.0 1.54.0 1.54.1 1.55.0 1.56.0 1.56.1 1.57.0 1.58.0 1.58.1 1.59.0 1.59.1 1.59.2 1.60.0 1.60.1 1.60.1 1.61.0 1.61.1 1.61.2 1.61.3'
+
+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/xsl/$version \
+		"file://${XSL_DIR}"
+	${XMLCATMGR} -c "${CATALOG_XSL}" add rewriteURI \
+		http://docbook.sourceforge.net/release/xsl/$version \
+		"file://${XSL_DIR}"
+done
+
+${XMLCATMGR} -c "${CATALOG_PORTS_XML}" add delegateSystem \
+	http://docbook.sourceforge.net/release/xsl/ \
+	"file://${CATALOG_XSL}"
+${XMLCATMGR} -c "${CATALOG_PORTS_XML}" add delegateURI \
+	http://docbook.sourceforge.net/release/xsl/ \
+	"file://${CATALOG_XSL}"
+
diff -ruN docbook-xsl.orig/pkg-plist docbook-xsl/pkg-plist
--- docbook-xsl.orig/pkg-plist	Tue Jul  1 20:12:06 2003
+++ docbook-xsl/pkg-plist	Wed Jul  2 18:03:29 2003
@@ -1328,6 +1328,7 @@
 share/xsl/docbook/xhtml/toc.xsl
 share/xsl/docbook/xhtml/verbatim.xsl
 share/xsl/docbook/xhtml/xref.xsl
+@unexec rm -f %D/share/xsl/docbook/catalog
 @dirrm share/xsl/docbook/xhtml
 @dirrm share/xsl/docbook/template
 @dirrm share/xsl/docbook/params
--- docbook-xsl.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



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