freebsd-ports/Keywords/xmlcatmgr.ucl
Baptiste Daroussin 963854440c Add a new keywork xmlcatmgr
It simplifies the handling of the XML and SMGL catalog
It brings a big of consistency by always specifying the catalog path absolute
instead of mixing absolute and relative path.
The keyword is also written a PKG_ROOTDIR friendly to simplify cross installing

Reviewed by:	hrs
Differential Revision:	https://reviews.freebsd.org/D6539
2016-05-24 22:32:49 +00:00

34 lines
721 B
Text

# $FreeBSD$
actions: [file]
arguments: true
post-install: <<EOD
case "%@" in
/*) cat="%@" ;;
*) cat="%D/%@" ;;
esac
case "%@" in
*.xml)
xmlcatmgr_cmd="xmlcatmgr -c ${PKG_ROOTDIR}%D/share/xml/catalog.ports add nextCatalog"
;;
*)
xmlcatmgr_cmd="xmlcatmgr -sc ${PKG_ROOTDIR}%D/share/sgml/catalog.ports add CATALOG"
;;
esac
${xmlcatmgr_cmd} ${cat}
EOD
post-deinstall: <<EOD
case "%@" in
/*) cat="%@" ;;
*) cat="%D/%@" ;;
esac
case "%@" in
*.xml)
xmlcatmgr_cmd="xmlcatmgr -c ${PKG_ROOTDIR}%D/share/xml/catalog.ports remove nextCatalog"
;;
*)
xmlcatmgr_cmd="xmlcatmgr -sc ${PKG_ROOTDIR}%D/share/sgml/catalog.ports remove CATALOG"
;;
esac
${xmlcatmgr_cmd} ${cat}
EOD