aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Junghans <kleiner_otti@gmx.de>2010-01-10 13:37:22 +0100
committerChristoph Junghans <kleiner_otti@gmx.de>2010-01-10 13:37:22 +0100
commit5fb2df2dd4d3e9fbc7a8360b15fa3c12c5f4cceb (patch)
tree13c943713b2c33a8b5ea6999278d2eda3226c8f7 /app-admin
parentNew package sci-misc/flashdot (diff)
downloadsci-5fb2df2dd4d3e9fbc7a8360b15fa3c12c5f4cceb.tar.gz
sci-5fb2df2dd4d3e9fbc7a8360b15fa3c12c5f4cceb.tar.bz2
sci-5fb2df2dd4d3e9fbc7a8360b15fa3c12c5f4cceb.zip
app-admin/eselect-gnuplot: needed for gnuplot[multislot]
(Portage version: 2.1.6.13/git/Linux i686) (Signed Manifest commit)
Diffstat (limited to 'app-admin')
-rw-r--r--app-admin/eselect-gnuplot/ChangeLog10
-rw-r--r--app-admin/eselect-gnuplot/Manifest14
-rw-r--r--app-admin/eselect-gnuplot/eselect-gnuplot-0.1.ebuild19
-rw-r--r--app-admin/eselect-gnuplot/files/gnuplot.eselect-0.1247
-rw-r--r--app-admin/eselect-gnuplot/metadata.xml9
5 files changed, 299 insertions, 0 deletions
diff --git a/app-admin/eselect-gnuplot/ChangeLog b/app-admin/eselect-gnuplot/ChangeLog
new file mode 100644
index 000000000..afec1fcaa
--- /dev/null
+++ b/app-admin/eselect-gnuplot/ChangeLog
@@ -0,0 +1,10 @@
+# ChangeLog for app-admin/eselect-gnuplot
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*eselect-gnuplot-0.1 (10 Jan 2010)
+
+ 10 Jan 2010; Christoph Junghans <kleiner_otti@gmx.de>
+ +files/gnuplot.eselect-0.1, +eselect-gnuplot-0.1.ebuild, +metadata.xml:
+ initial commit, needed for gnuplot[multislot]
+
diff --git a/app-admin/eselect-gnuplot/Manifest b/app-admin/eselect-gnuplot/Manifest
new file mode 100644
index 000000000..3129cbe45
--- /dev/null
+++ b/app-admin/eselect-gnuplot/Manifest
@@ -0,0 +1,14 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+AUX gnuplot.eselect-0.1 5863 RMD160 ecbb9971a6f4c2369b7de1156d8f310af7f7c2b2 SHA1 32e935ca444f0e297087244f315010ca8c2f52b3 SHA256 2d23b7c404d61e768e8e24791f4e3821a5e5d7f52acabbc1762f7e931c9395bd
+EBUILD eselect-gnuplot-0.1.ebuild 534 RMD160 d75c7fb4181fca5acdeb5086446e8ad76d46c72c SHA1 c97d6a5c50bccb02dd23ad425be6a2fbdb8cc2c6 SHA256 55274023d5c53670e31e47e3cf7ac2525616070fdf9ff2dd3cb609b562b5c04c
+MISC ChangeLog 341 RMD160 85d0066682560d7058c26c7d4c2f862e7da0b8c6 SHA1 7c2b1790ba6954e83f1a6dc41732705f0c42dfd4 SHA256 7189bc14572fb17474c8d8250c3c7af57c3c5daec03c3b53b491acf7f524263e
+MISC metadata.xml 250 RMD160 ff402e35d8390d995241aa4cb84330fef9e79eb5 SHA1 7619a58cc3999440b8dcb8097bc90124a8d4a086 SHA256 084c4a4ffe31a477da6e8db92f952fb15e214a3672a672626bf6b38b79e844e8
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.11 (GNU/Linux)
+
+iEYEARECAAYFAktJygIACgkQy0OE/ans1/nl1QCcCMkGN227sfxi8DlQx2McmFz0
+dPIAnikMWTmOvo4up9H6N9OL5xaVKnSj
+=nN0Y
+-----END PGP SIGNATURE-----
diff --git a/app-admin/eselect-gnuplot/eselect-gnuplot-0.1.ebuild b/app-admin/eselect-gnuplot/eselect-gnuplot-0.1.ebuild
new file mode 100644
index 000000000..b2c7f5350
--- /dev/null
+++ b/app-admin/eselect-gnuplot/eselect-gnuplot-0.1.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-vi/eselect-vi-1.1.6.ebuild,v 1.1 2008/10/06 13:59:02 hawking Exp $
+
+DESCRIPTION="Manages the /usr/bin/gnuplot symlink"
+HOMEPAGE="http://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+RDEPEND=">=app-admin/eselect-1.2.8"
+
+src_install() {
+ insinto /usr/share/eselect/modules
+ newins "${FILESDIR}/gnuplot.eselect-${PVR}" gnuplot.eselect || die
+}
diff --git a/app-admin/eselect-gnuplot/files/gnuplot.eselect-0.1 b/app-admin/eselect-gnuplot/files/gnuplot.eselect-0.1
new file mode 100644
index 000000000..4d4b4ac5c
--- /dev/null
+++ b/app-admin/eselect-gnuplot/files/gnuplot.eselect-0.1
@@ -0,0 +1,247 @@
+# Copyright 2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id: $
+
+DESCRIPTION="Manage /usr/bin/gnuplot implementations"
+MAINTAINER="kleiner_otti@gmx.de"
+SVN_DATE='$Date: $'
+VERSION='0.1'
+TEX_UPDATE="no"
+
+# find a list of gnuplot symlink targets, best first
+find_targets() {
+ local f
+ for f in $( cd "${ROOT}/usr/bin"; ls gnuplot-?.? | sort -r ); do
+ [[ -f "${ROOT}/usr/bin/${f}" ]] && echo ${f}
+ done
+}
+
+have()
+{
+ unset -v have
+ PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type $1 >&/dev/null && have="yes"
+}
+
+rm_tex_symlinks() {
+ local x
+ for x in ${ROOT}/usr/share/texmf-site/tex/latex/gnuplot/*; do
+ [ -d "${x}" ] && continue
+ if [ -L "${x}" ]; then
+ rm -f "${x}" &>/dev/null
+ TEX_UPDATE="yes"
+ continue
+ fi
+ die -q "${x} confuses me"
+ done
+}
+
+# try to remove the gnuplot symlinks
+remove_symlinks() {
+ rm -f "${ROOT}"/usr/bin/gnuplot &>/dev/null && \
+ rm -f "${ROOT}"/usr/share/man/man1/gnuplot.1{,.gz,.bz2} &>/dev/null && \
+ rm -f "${ROOT}"/usr/share/info/gnuplot.info{,.gz,.bz2} &>/dev/null && \
+ rm_tex_symlinks
+}
+
+# set a man page symlink
+set_man_symlink() {
+ local target="${1}" link_name="${2}" x extension
+
+ for x in ".1" ".1.bz2" ".1.gz" ; do
+ if [[ -e /usr/share/man/man1/${target}${x} ]] ; then
+ extension="${x}"
+ break
+ fi
+ done
+
+ if [[ -z "${extension}" ]] ; then
+ echo "Couldn't find a man page for ${target}; skipping." 1>&2
+ return 1
+ fi
+
+ ln -s "${target}${extension}" \
+ "${ROOT}/usr/share/man/man1/${link_name}${extension}"
+}
+
+# set a info page symlink
+set_info_symlink() {
+ local target="${1}" link_name="${2}" x extension
+
+ for x in ".info.bz2" ".info.gz" ; do
+ if [[ -e /usr/share/info/${target}${x} ]] ; then
+ extension="${x}"
+ break
+ fi
+ done
+
+ if [[ -z "${extension}" ]] ; then
+ echo "Couldn't find a info page for ${target}; skipping." 1>&2
+ return 1
+ fi
+
+ ln -s "${target}${extension}" \
+ "${ROOT}/usr/share/info/${link_name}${extension}"
+}
+
+#link tex files to gnuplot dir
+#useful because lower dir level is found first
+set_tex_symlink() {
+ local target="${1}" x
+
+ for x in /usr/share/texmf-site/tex/latex/gnuplot/${target#gnuplot-}/* ; do
+ [ -e "${x}" ] &&
+ ln -s "${target#gnuplot-}/${x##*/}" \
+ "/usr/share/texmf-site/tex/latex/gnuplot/${x##*/}" && TEX_UPDATE="yes"
+ done
+}
+
+# set the gnuplot symlinks
+set_symlinks() {
+ local target="${1}" targets
+ if is_number "${target}" && [[ ${target} -ge 1 ]] ; then
+ targets=( $(find_targets ) )
+ target=${targets[$(( ${target} - 1 ))]}
+ fi
+ if [[ -f "${ROOT}/usr/bin/${target}" ]] ; then
+ remove_symlinks
+
+ # it's okay if these fail
+ set_man_symlink "${target}" "gnuplot"
+ set_info_symlink "${target}" "gnuplot"
+ set_tex_symlink "${target}"
+
+ # it's not okay if these fail
+ ln -s "${ROOT}/usr/bin/${target}" "${ROOT}/usr/bin/gnuplot" || \
+ die "Couldn't set ${target} /usr/bin/gnuplot symlink"
+ else
+ die -q "Target \"${1}\" doesn't appear to be valid!"
+ fi
+}
+
+### show action ###
+
+describe_show() {
+ echo "Show the current gnuplot implementation"
+}
+
+do_show() {
+ [[ -z "${@}" ]] || die -q "Too many parameters"
+
+ write_list_start "Current gnuplot implementation:"
+ if [[ -L "${ROOT}/usr/bin/gnuplot" ]] ; then
+ write_kv_list_entry "$(basename $(canonicalise ${ROOT}/usr/bin/gnuplot ) )" ""
+ elif [[ -e "${ROOT}/usr/bin/gnuplot" ]] ; then
+ write_kv_list_entry "(not a symlink)" ""
+ else
+ write_kv_list_entry "(unset)" ""
+ fi
+}
+
+### list action ###
+
+describe_list() {
+ echo "List available gnuplot implementations"
+}
+
+do_list() {
+ [[ -z "${@}" ]] || die -q "Too many parameters"
+
+ local i targets
+ targets=( $(find_targets ) )
+ if [[ -n ${targets[@]} ]] ; then
+ for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do
+ [[ ${targets[${i}]} == $(basename $(canonicalise ${ROOT}/usr/bin/gnuplot ) ) ]] && \
+ targets[${i}]="${targets[${i}]} $(highlight '*' )"
+ done
+ write_list_start "Available gnuplot implementations:"
+ write_numbered_list "${targets[@]}"
+ else
+ write_kv_list_entry "(none found)" ""
+ fi
+}
+
+### set action ###
+
+describe_set() {
+ echo "Set a new gnuplot implementation provider"
+}
+
+describe_set_options() {
+ echo "target : Target name or number (from 'list' action)"
+}
+
+describe_set_parameters() {
+ echo "<target>"
+}
+
+do_set() {
+ if [[ -z "${1}" ]] ; then
+ die -q "You didn't give me a provider name"
+
+ elif [[ -n "${2}" ]] ; then
+ die -q "Too many parameters"
+
+ elif [[ -L "${ROOT}/usr/bin/gnuplot" ]] ; then
+ if ! remove_symlinks ; then
+ die -q "Can't remove existing provider"
+ elif ! set_symlinks "${1}" ; then
+ die -q "Can't set new provider"
+ fi
+
+ elif [[ -e "${ROOT}/usr/bin/gnuplot" ]] ; then
+ die -q "Sorry, ${ROOT}/usr/bin/gnuplot confuses me"
+
+ else
+ set_symlinks "${1}" || die -q "Can't set a new provider"
+ fi
+ if [ "$TEX_UPDATE" = "yes" ]; then
+ have texmf-update || die -q "texmf-update is missing"
+ texmf-update || die -q "texmf-update failed"
+ fi
+}
+
+### update action ###
+
+describe_update() {
+ echo "Automatically update the gnuplot provider"
+}
+
+describe_update_options() {
+ echo "--if-unset : Do not override existing implementation"
+ echo "--no-texupdate : Do not run texmf-update"
+}
+
+do_update() {
+ local if_unset=false texupdate=true
+ while [[ $# > 0 ]]; do
+ case $1 in
+ --if-unset)
+ if_unset=true
+ ;;
+ --no-texupdate)
+ texupdate=false
+ ;;
+ *)
+ die -q "Unrecognized option '$1'"
+ ;;
+ esac
+ shift
+ done
+
+ if [[ -L "${ROOT}/usr/bin/gnuplot" ]] ; then
+ ${if_unset} && return
+ remove_symlinks || die -q "Can't remove existing link"
+ fi
+ if [[ -e "${ROOT}/usr/bin/gnuplot" ]] ; then
+ die -q "Can't set a new provider"
+ elif ! [[ -z $(find_targets ) ]] ; then
+ set_symlinks 1 || die -q "Can't set a new provider"
+ fi
+ if $texupdate && [ "$TEX_UPDATE" = "yes" ]; then
+ have texmf-update || die -q "texmf-update is missing"
+ texmf-update || die -q "texmf-update failed"
+ fi
+}
+
+# vim: set ft=eselect :
+
diff --git a/app-admin/eselect-gnuplot/metadata.xml b/app-admin/eselect-gnuplot/metadata.xml
new file mode 100644
index 000000000..fe314e811
--- /dev/null
+++ b/app-admin/eselect-gnuplot/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>sci</herd>
+<maintainer>
+<email>kleiner_otti@gmx.de</email>
+<name>Christoph Junghans</name>
+</maintainer>
+</pkgmetadata>