From ab807b56be9c705bd88131b3333daffa4c3a388e Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Thu, 26 Jan 2012 16:21:47 +0100 Subject: [PATCH] add dev-tex/latexmk-430 --- dev-tex/latexmk/Manifest | 3 ++ dev-tex/latexmk/files/completion.bash-2 | 45 +++++++++++++++++++++++++ dev-tex/latexmk/latexmk-430.ebuild | 31 +++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 dev-tex/latexmk/Manifest create mode 100644 dev-tex/latexmk/files/completion.bash-2 create mode 100644 dev-tex/latexmk/latexmk-430.ebuild diff --git a/dev-tex/latexmk/Manifest b/dev-tex/latexmk/Manifest new file mode 100644 index 0000000..1029fc7 --- /dev/null +++ b/dev-tex/latexmk/Manifest @@ -0,0 +1,3 @@ +AUX completion.bash-2 1538 RMD160 f6812016ca7deab23c84cab39988e6555bd6f76a SHA1 b708bcc9e3d52c6967d9cda3cb8c6787d06dcc56 SHA256 f6949d450638d1be147bf5ece9488fd9445ffe47244c27643ff2a5df42aa1905 +DIST latexmk-430.zip 348721 RMD160 d9ab8b556335a61272626457bca95307225bae84 SHA1 e0f30e961f8c218015c071d3c809e8aa70a56916 SHA256 f5a2980cb81973e0b72ac629f9c8e2dd1761a13cddb44c06eeaf5113344864a8 +EBUILD latexmk-430.ebuild 922 RMD160 7963a094a7396cb8dd28e26f9cdc83eed5330d67 SHA1 7c7529c0b1e720bf4800bcdafdd2dc7a4c30bd30 SHA256 346fe7a8c3d3befe79394e5aee164b13263b97d50fab5041ace83cdc19353ca0 diff --git a/dev-tex/latexmk/files/completion.bash-2 b/dev-tex/latexmk/files/completion.bash-2 new file mode 100644 index 0000000..a24b7a8 --- /dev/null +++ b/dev-tex/latexmk/files/completion.bash-2 @@ -0,0 +1,45 @@ +#! /bin/bash + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# bash_completion for latexmk +# +# +# Author: Christoph Junghans +# ottxor@gentoo.org +# +# Revision history: +# 0.1 26-05-10 --- initial version +# 0.2 15-02-11 --- clean up +# +# HOWTO: +# source this file to enable it + +_latexmk() +{ + local cur output aopts opts prev + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + output=$( $1 -help 2> /dev/null) + #options with args ,pattern: ^ (-XXX) .*$ + aopts=" $( echo " $output" | sed -n 's/^[[:space:]]\+\(-[^[:space:]]\+\)[[:space:]]\+<[^>]\+>.*$/\1/p' | sort -u | tr '\n' ' ')" + #if previous option in in $aopts + if [[ -n "$prev" ]] && [[ -z "${aopts//* $prev *}" ]]; then + #argument of $prev ,pattern: ^ -XXX ().*$ + opts=$(echo "$output" | sed -n "s/^[[:space:]]\+$prev[[:space:]]\+\(<[^>]\+>\).*\$/\1/p") + COMPREPLY=( $( compgen -W '$opts' -- $cur ) ) + elif [[ "$cur" == -* ]]; then + #all options, pattern: ^ (-XXX).*$ + opts=$( echo "$output" | sed -n 's/^[[:space:]]\+\(-[^[:space:]]\+\).*$/\1/p'| sort -u ) + COMPREPLY=( $( compgen -W '$opts' -- $cur ) ) + else + #filenames *.tex and dirs, rest is done by '-o filenames' below + COMPREPLY=( $( eval compgen -f -X "!*.tex" -- ${cur} ) $( compgen -d -- $cur ) ) + fi +} + +complete -F _latexmk -o filenames latexmk diff --git a/dev-tex/latexmk/latexmk-430.ebuild b/dev-tex/latexmk/latexmk-430.ebuild new file mode 100644 index 0000000..aae992f --- /dev/null +++ b/dev-tex/latexmk/latexmk-430.ebuild @@ -0,0 +1,31 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-tex/latexmk/latexmk-427a.ebuild,v 1.2 2011/11/02 15:33:18 aballier Exp $ + +EAPI=4 + +inherit bash-completion-r1 + +DESCRIPTION="Perl script for automatically building LaTeX documents." +HOMEPAGE="http://www.phys.psu.edu/~collins/software/latexmk/" +SRC_URI="http://www.phys.psu.edu/~collins/software/latexmk/${P}.zip" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~ppc-macos ~x64-macos ~x86-macos" +IUSE="" + +RDEPEND="virtual/latex-base + dev-lang/perl" +DEPEND="${RDEPEND} + app-arch/unzip" + +S=${WORKDIR} + +src_install() { + newbin latexmk.pl latexmk + doman latexmk.1 + dodoc CHANGES README latexmk.pdf latexmk.ps latexmk.txt + dodoc -r example_rcfiles extra-scripts + newbashcomp "${FILESDIR}"/completion.bash-2 ${PN} +} -- 2.39.5