diff options
Diffstat (limited to 'app-emacs/nxml-libvirt-schemas')
6 files changed, 114 insertions, 0 deletions
diff --git a/app-emacs/nxml-libvirt-schemas/ChangeLog b/app-emacs/nxml-libvirt-schemas/ChangeLog new file mode 100644 index 000000000000..2e6cd172a30e --- /dev/null +++ b/app-emacs/nxml-libvirt-schemas/ChangeLog @@ -0,0 +1,13 @@ +# ChangeLog for app-emacs/nxml-libvirt-schemas +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-emacs/nxml-libvirt-schemas/ChangeLog,v 1.1 2009/12/16 19:12:59 flameeyes Exp $ + +*nxml-libvirt-schemas-0.7.4 (16 Dec 2009) + + 16 Dec 2009; Diego E. Pettenò <flameeyes@gentoo.org> + +files/60nxml-libvirt-schemas-gentoo.el, + +nxml-libvirt-schemas-0.7.4.ebuild, +files/Makefile-trang, + +files/schemas.xml, +metadata.xml: + Initial import of nxml-mode schemas for libvirt; it requires patches + backported from the upstream tree for the files to properly validate. + diff --git a/app-emacs/nxml-libvirt-schemas/files/60nxml-libvirt-schemas-gentoo.el b/app-emacs/nxml-libvirt-schemas/files/60nxml-libvirt-schemas-gentoo.el new file mode 100644 index 000000000000..6f41677d3ac0 --- /dev/null +++ b/app-emacs/nxml-libvirt-schemas/files/60nxml-libvirt-schemas-gentoo.el @@ -0,0 +1,8 @@ + +;;; nxml-svg-schemas site-lisp configuration + +;; This must be executed after rng-schema-locating-files +;; is set in rng-loc (which is part of nxml-mode). +(eval-after-load "rng-loc" + '(add-to-list 'rng-schema-locating-files + "@SITEETC@/schemas.xml")) diff --git a/app-emacs/nxml-libvirt-schemas/files/Makefile-trang b/app-emacs/nxml-libvirt-schemas/files/Makefile-trang new file mode 100644 index 000000000000..699cf676ff45 --- /dev/null +++ b/app-emacs/nxml-libvirt-schemas/files/Makefile-trang @@ -0,0 +1,6 @@ +# -*- makefile -*- + +all: $(patsubst %.rng,%.rnc,$(wildcard *.rng)) + +%.rnc: %.rng + trang -I rng -O rnc $< $@ diff --git a/app-emacs/nxml-libvirt-schemas/files/schemas.xml b/app-emacs/nxml-libvirt-schemas/files/schemas.xml new file mode 100644 index 000000000000..47936ab24a16 --- /dev/null +++ b/app-emacs/nxml-libvirt-schemas/files/schemas.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"> + <!-- As far as I can see there is no way to apply more than one to + search for a file, so we're going to use some very generic + locating rules… yes it's bad, but upstream libvirt doesn't + intend to change that anytime soon. + --> + + <documentElement localName="domain" uri="domain.rnc" /> + <documentElement localName="pool" uri="storagepool.rnc" /> + <documentElement localName="network" uri="network.rnc" /> +</locatingRules> diff --git a/app-emacs/nxml-libvirt-schemas/metadata.xml b/app-emacs/nxml-libvirt-schemas/metadata.xml new file mode 100644 index 000000000000..35b21eb5f8de --- /dev/null +++ b/app-emacs/nxml-libvirt-schemas/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>emacs</herd> + <herd>virtualization</herd> + <maintainer> + <email>flameeyes@gentoo.org</email> + </maintainer> +</pkgmetadata> diff --git a/app-emacs/nxml-libvirt-schemas/nxml-libvirt-schemas-0.7.4.ebuild b/app-emacs/nxml-libvirt-schemas/nxml-libvirt-schemas-0.7.4.ebuild new file mode 100644 index 000000000000..f15370450154 --- /dev/null +++ b/app-emacs/nxml-libvirt-schemas/nxml-libvirt-schemas-0.7.4.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emacs/nxml-libvirt-schemas/nxml-libvirt-schemas-0.7.4.ebuild,v 1.1 2009/12/16 19:12:59 flameeyes Exp $ + +BACKPORTS=2 + +EAPI=2 + +inherit elisp eutils + +MY_P="libvirt-${PV}" + +DESCRIPTION="Extension for nxml-mode with libvirt schemas" +HOMEPAGE="http://www.libvirt.org/" + +SRC_URI="http://libvirt.org/sources/${MY_P}.tar.gz + mirror://gentoo/${MY_P}-backports-${BACKPORTS}.tar.bz2" + +# This is the license of the package, but the schema files are +# provided without license, maybe it's bad. +LICENSE="LGPL-2.1" + +SLOT="0" + +KEYWORDS="~amd64 ~x86" +IUSE="" + +RDEPEND="|| ( >=app-emacs/nxml-mode-20041004-r3 >=virtual/emacs-23 )" + +# Yes this requires Java, but I'd rather not repackage this, if you +# know something better in C, I'll be glad to use that. +DEPEND="app-text/trang" + +SITEFILE=60${PN}-gentoo.el + +S="${WORKDIR}/${MY_P}" + +src_prepare() { + EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" EPATCH_SOURCE="${WORKDIR}/patches" epatch +} + +src_compile() { + emake -C docs/schemas -f "${FILESDIR}/Makefile-trang" || die "trang failed" +} + +src_test() { + # No we don't need tests here… trang will take care of checking + # the well-formedness of the schema files for us + : +} + +src_install() { + insinto ${SITEETC}/${PN} + doins "${FILESDIR}/schemas.xml" docs/schemas/*.rnc || die "install failed" + elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die +} + +pkg_postinst () { + elisp-site-regen + + if [ $(emacs -batch -q --eval "(princ (fboundp 'nxml-mode))") = nil ]; then + ewarn "This package needs nxml-mode. You should either install" + ewarn "app-emacs/nxml-mode, or use \"eselect emacs\" to select" + ewarn "an Emacs version >= 23." + fi +} |