diff options
author | Mike Frysinger <vapier@gentoo.org> | 2007-06-16 08:07:34 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2007-06-16 08:07:34 +0000 |
commit | 01182363c7127a1c4b5914cfa4ffe1bdce832211 (patch) | |
tree | 7b0ec463938c88c0db5ce95607dd63c54be60fbe /app-portage | |
parent | move man page documentation to eclass (diff) | |
download | gentoo-2-01182363c7127a1c4b5914cfa4ffe1bdce832211.tar.gz gentoo-2-01182363c7127a1c4b5914cfa4ffe1bdce832211.tar.bz2 gentoo-2-01182363c7127a1c4b5914cfa4ffe1bdce832211.zip |
initial import
(Portage version: 2.1.3_rc2)
Diffstat (limited to 'app-portage')
-rw-r--r-- | app-portage/eclass-manpages/ChangeLog | 8 | ||||
-rw-r--r-- | app-portage/eclass-manpages/Manifest | 19 | ||||
-rw-r--r-- | app-portage/eclass-manpages/eclass-manpages-20070615.ebuild | 23 | ||||
-rw-r--r-- | app-portage/eclass-manpages/files/digest-eclass-manpages-20070615 | 0 | ||||
-rw-r--r-- | app-portage/eclass-manpages/files/eclass-to-manpage.awk | 155 | ||||
-rw-r--r-- | app-portage/eclass-manpages/metadata.xml | 8 |
6 files changed, 213 insertions, 0 deletions
diff --git a/app-portage/eclass-manpages/ChangeLog b/app-portage/eclass-manpages/ChangeLog new file mode 100644 index 000000000000..904ebff58a9f --- /dev/null +++ b/app-portage/eclass-manpages/ChangeLog @@ -0,0 +1,8 @@ +# ChangeLog for app-portage/eclass-manpages +# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-portage/eclass-manpages/ChangeLog,v 1.1 2007/06/16 08:07:34 vapier Exp $ + +*eclass-manpages-20070615 (16 Jun 2006) + + 16 Jun 2006; Mike Frysinger <vapier@gentoo.org> : + Initial import. Ebuild submitted by me. diff --git a/app-portage/eclass-manpages/Manifest b/app-portage/eclass-manpages/Manifest new file mode 100644 index 000000000000..1e81e16faf11 --- /dev/null +++ b/app-portage/eclass-manpages/Manifest @@ -0,0 +1,19 @@ +AUX eclass-to-manpage.awk 3302 RMD160 cc68151699f52c8c6b89f994111e46f4ddef5d65 SHA1 cad487b3241603b84ab9f789db714d069d6da8ae SHA256 ea6320b01e7761f4bb9b5ab0a95e31b6c9d51898336f811e5d26c35fc41f2167 +MD5 3375dd7bb366edc93293a92c4414cfa8 files/eclass-to-manpage.awk 3302 +RMD160 cc68151699f52c8c6b89f994111e46f4ddef5d65 files/eclass-to-manpage.awk 3302 +SHA256 ea6320b01e7761f4bb9b5ab0a95e31b6c9d51898336f811e5d26c35fc41f2167 files/eclass-to-manpage.awk 3302 +EBUILD eclass-manpages-20070615.ebuild 681 RMD160 c821d19b5032a82294d8c2786dfa36e2998c2a28 SHA1 d86d83de800f1b33e07988a1004caea4232799ba SHA256 9a4aaa97b852b1155ad6c0b816c80c3f06201735187c41b3da2731f5bf641967 +MD5 30245b1e4fa558bb9890e5d65e4ab682 eclass-manpages-20070615.ebuild 681 +RMD160 c821d19b5032a82294d8c2786dfa36e2998c2a28 eclass-manpages-20070615.ebuild 681 +SHA256 9a4aaa97b852b1155ad6c0b816c80c3f06201735187c41b3da2731f5bf641967 eclass-manpages-20070615.ebuild 681 +MISC ChangeLog 264 RMD160 1ec731fec5b95aef2c14cc209513deec5fd6e544 SHA1 620354f5e3e820ca6783fcb57b606703065b347e SHA256 c96eac83976c2557787468d6bc720f83bcdef88dc743da13351a4e4cb2664c16 +MD5 575c5f5abd0bf4fa86a21589663a702a ChangeLog 264 +RMD160 1ec731fec5b95aef2c14cc209513deec5fd6e544 ChangeLog 264 +SHA256 c96eac83976c2557787468d6bc720f83bcdef88dc743da13351a4e4cb2664c16 ChangeLog 264 +MISC metadata.xml 221 RMD160 c7e790cc8c28f4ca9133ba2b338459529c36c860 SHA1 c80a886ceee34829b6f6672b8151150aa32cd5fa SHA256 c14f949c7f32e005a8d6f8acf812b48f7e2b6c4f4b67339fb9b9127fd6e17f3f +MD5 04694881c674d5e9eca96bba6742fc2c metadata.xml 221 +RMD160 c7e790cc8c28f4ca9133ba2b338459529c36c860 metadata.xml 221 +SHA256 c14f949c7f32e005a8d6f8acf812b48f7e2b6c4f4b67339fb9b9127fd6e17f3f metadata.xml 221 +MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-eclass-manpages-20070615 0 +RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-eclass-manpages-20070615 0 +SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-eclass-manpages-20070615 0 diff --git a/app-portage/eclass-manpages/eclass-manpages-20070615.ebuild b/app-portage/eclass-manpages/eclass-manpages-20070615.ebuild new file mode 100644 index 000000000000..961f71c550b6 --- /dev/null +++ b/app-portage/eclass-manpages/eclass-manpages-20070615.ebuild @@ -0,0 +1,23 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-portage/eclass-manpages/eclass-manpages-20070615.ebuild,v 1.1 2007/06/16 08:07:34 vapier Exp $ + +DESCRIPTION="collection of Gentoo eclass manpages" +HOMEPAGE="http://www.gentoo.org/" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" +IUSE="" + +DEPEND="" +RDEPEND="" + +src_install() { + local e + for e in "${ECLASSDIR}"/*.eclass ; do + awk -f "${FILESDIR}"/eclass-to-manpage.awk ${e} > ${e##*/}.5 || rm -f ${e##*/}.5 + done + doman *.5 || die +} diff --git a/app-portage/eclass-manpages/files/digest-eclass-manpages-20070615 b/app-portage/eclass-manpages/files/digest-eclass-manpages-20070615 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/app-portage/eclass-manpages/files/digest-eclass-manpages-20070615 diff --git a/app-portage/eclass-manpages/files/eclass-to-manpage.awk b/app-portage/eclass-manpages/files/eclass-to-manpage.awk new file mode 100644 index 000000000000..3ce198ed59dc --- /dev/null +++ b/app-portage/eclass-manpages/files/eclass-to-manpage.awk @@ -0,0 +1,155 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-portage/eclass-manpages/files/eclass-to-manpage.awk,v 1.1 2007/06/16 08:07:34 vapier Exp $ + +# This awk converts the comment documentation found in elcasses +# into man pages for easier/nicer reading. +# +# If you wish to have multiple paragraphs in a description, then +# create comment lines which contain a single space. Paragraph +# parsing ends when te comment block does, or when a comment line +# without anything on it is encountered. +# +# The format of the eclass description: +# @ECLASS: foo.eclass +# @MAINTAINER: +# <required; list of contacts, one per line> +# @BLURB: <required; short description> +# @DESCRIPTION: +# <optional; long description> +# @EXAMPLE: +# <optional; example usage> + +# The format of functions: +# @FUNCTION: foo +# @USAGE: <required arguments to foo> [optional arguments to foo] +# @MAINTAINER: +# <optional; list of contacts, one per line> +# @DESCRIPTION: +# <required; blurb about this function> + +BEGIN { + state = "header" +} + +function warn(text) { + print FILENAME ": " text > "/dev/stderr" +} +function fail(text) { + warn(text) + exit(1) +} + +function eat_line() { + ret = $0 + sub(/^# @[A-Z]*: /,"",ret) + getline + return ret +} +function eat_paragraph() { + ret = "" + getline + while ($0 ~ /^# ([^@]|$)/) { + sub(/^# /,"",$0) + ret = ret "\n" $0 + getline + } + sub(/^\n/,"",ret) + return ret +} + +function man_text(p) { + return gensub(/-/, "\\-", "g", p) +} + +{ +if (state == "header") { +if ($0 ~ /^# @ECLASS:/) { + eclass = $3 + eclass_maintainer = "" + blurb = "" + desc = "" + example = "" + + # first the man page header + print ".TH \"" toupper(eclass) "\" 5 \"" strftime("%b %Y") "\" \"Portage\" \"portage\"" + + # now eat the global data + getline + if ($2 == "@MAINTAINER:") + eclass_maintainer = eat_paragraph() + if ($2 == "@BLURB:") + blurb = eat_line() + if ($2 == "@DESCRIPTION:") + desc = eat_paragraph() + if ($2 == "@EXAMPLE:") + example = eat_paragraph() + + # finally display it + print ".SH \"NAME\"" + print eclass " \\- " man_text(blurb) + print ".SH \"DESCRIPTION\"" + print man_text(desc) + if (example != "") { + print ".SH \"EXAMPLE\"" + print man_text(example) + } + + # sanity checks + if (blurb == "") + fail("no @BLURB found") + if (desc == "") + fail("no @DESCRIPTION found") + if (eclass_maintainer == "") + warn("no @MAINTAINER found") + + print ".SH \"FUNCTIONS\"" + + state = "functions" +} +} else if (state == "functions") { +if ($0 ~ /^# @FUNCTION:/) { + func_name = $3 + usage = "" + maintainer = "" + desc = "" + + # grab the docs + getline + if ($2 == "@USAGE:") + usage = eat_line() + if ($2 == "@MAINTAINER:") + maintainer = eat_paragraph() + if ($2 == "@DESCRIPTION:") + desc = eat_paragraph() + + # now print out the stuff + print ".TP" + print "\\fB" func_name "\\fR " man_text(usage) + print man_text(desc) + + if (blurb == "") + fail("no @BLURB found") + if (desc == "") + fail("no @DESCRIPTION found") +} +} +} + +END { +if (eclass == "") + fail("eclass not documented yet (no @ECLASS found)"); + +print ".SH \"REPORTING BUGS\"" +print "Please report bugs via http://bugs.gentoo.org/" +print ".SH \"SEE ALSO\"" +print ".BR ebuild (5)" +print ".SH \"FILES\"" +print ".BR /usr/portage/eclass/" eclass +#print ".SH \"AUTHORS\"" +# hmm, how to handle ? someone will probably whine if we dont ... +if (eclass_maintainer != "") { + print ".SH \"MAINTAINERS\"" + print man_text(eclass_maintainer) +} +} diff --git a/app-portage/eclass-manpages/metadata.xml b/app-portage/eclass-manpages/metadata.xml new file mode 100644 index 000000000000..ae35d4c27548 --- /dev/null +++ b/app-portage/eclass-manpages/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>portage</herd> +<maintainer> + <email>vapier@gentoo.org</email> +</maintainer> +</pkgmetadata> |