diff options
Diffstat (limited to 'app-eselect/eselect-mpost')
-rw-r--r-- | app-eselect/eselect-mpost/Manifest | 3 | ||||
-rw-r--r-- | app-eselect/eselect-mpost/eselect-mpost-0.3.ebuild | 30 | ||||
-rw-r--r-- | app-eselect/eselect-mpost/files/mpost.eselect-0.3 | 147 | ||||
-rw-r--r-- | app-eselect/eselect-mpost/metadata.xml | 8 |
4 files changed, 188 insertions, 0 deletions
diff --git a/app-eselect/eselect-mpost/Manifest b/app-eselect/eselect-mpost/Manifest new file mode 100644 index 000000000000..e24ee84600e4 --- /dev/null +++ b/app-eselect/eselect-mpost/Manifest @@ -0,0 +1,3 @@ +AUX mpost.eselect-0.3 3728 BLAKE2B 24404fd63aa87c430319512d2598ff37c2f342d7966606fd7a861ba8016103257859384932261f7705a26db3ef197ecf89471b2c28829921ce2e77dc2e2d92f1 SHA512 b2cd807c3ebf7933410dddc9a56129a6ecb284cb163510aac7340ca44ce4dd42e69953b24e002da3898b3961f2a661a27615fefec79b5ffed04dac5637c41b01 +EBUILD eselect-mpost-0.3.ebuild 750 BLAKE2B 43ecf0faedbf6cea4f7ce8530a9d3bbcc009ef05836b13b830715972e70fcf30681046f02f2d18d64efb5d2d18e9abc9c1d5cbf2c8f043c5519cc0a0b212d158 SHA512 59ba90f7fb2ee6c32fc96da262f76f64a95ee9ed6f892d6750247797ed83a679d92df1477386837e65ca1553917012880a5c9c5c80e6d7b902db79929bfb1cb3 +MISC metadata.xml 245 BLAKE2B ee3a163cfe0a4bc59c0dfb46f9ddb580e2d259b4d0e33cb4e684eb9e6d4b901bf97c6edd891f3b75a613a782f1b89318d0ee3ec9bee4e34c4441d9e8f4267678 SHA512 1653777623e2c15e1ce13229e396723b2cc9c214983e0f8592de98c01a31badc6c38c6735ed44f937d145883b43fb6f049af3eddb9ff96b18c96ccf8f67dd690 diff --git a/app-eselect/eselect-mpost/eselect-mpost-0.3.ebuild b/app-eselect/eselect-mpost/eselect-mpost-0.3.ebuild new file mode 100644 index 000000000000..2d44f0282075 --- /dev/null +++ b/app-eselect/eselect-mpost/eselect-mpost-0.3.ebuild @@ -0,0 +1,30 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=0 + +inherit eutils + +DESCRIPTION="mpost module for eselect" +HOMEPAGE="https://www.gentoo.org/proj/en/eselect/" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ia64 ~ppc ~ppc64 s390 sh sparc x86 ~x86-fbsd" +IUSE="" + +DEPEND="" +# Depend on texlive-core-2008 that allows usage of this module, otherwise it +# will not work so nicely. +RDEPEND=">=app-admin/eselect-1.2.3 + >=app-text/texlive-core-2008" + +src_install() { + local MODULEDIR="/usr/share/eselect/modules" + local MODULE="mpost" + dodir ${MODULEDIR} + insinto ${MODULEDIR} + newins "${FILESDIR}/${MODULE}.eselect-${PVR}" ${MODULE}.eselect \ + || die "failed to install" +} diff --git a/app-eselect/eselect-mpost/files/mpost.eselect-0.3 b/app-eselect/eselect-mpost/files/mpost.eselect-0.3 new file mode 100644 index 000000000000..4b772d175000 --- /dev/null +++ b/app-eselect/eselect-mpost/files/mpost.eselect-0.3 @@ -0,0 +1,147 @@ +# -*-eselect-*- vim: ft=eselect +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +DESCRIPTION="Manage /usr/bin/mpost implementations" +MAINTAINER="ml@gentoo.org" +SVN_DATE='$Date: 2015/03/31 16:51:56 $' +VERSION=$(svn_date_to_version "${SVN_DATE}" ) + +# find a list of mpost symlink targets, best first +find_targets() { + local f + for f in "${ROOT}"/usr/bin/mpost-*; do + if [[ -f ${f} ]] ; then + echo "${f##*/mpost-}" + fi + done | sort +} + +# find version number of currently symlinked version +identify_target() { + local f + f="$(canonicalise "${ROOT}"/usr/bin/mpost)" + echo "${f##*/mpost-}" +} + +# try to remove the mpost symlink +remove_symlinks() { + rm -f "${ROOT}"/usr/bin/mpost &>/dev/null +} + +# set the mpost symlink +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/mpost-${target}" ]] ; then + remove_symlinks + ln -s "mpost-${target}" "${ROOT}/usr/bin/mpost" || \ + die "Could not set ${target} /usr/bin/mpost symlink" + echo "Updating TeX formats" + "${ROOT}"/usr/bin/fmtutil-sys --all &>/dev/null || write_warning_msg "Could not update TeX formats for some reason, mpost may not work properly." + else + die -q "Target \"${target}\" doesn't appear to be valid!" + fi +} + +### show action ### + +describe_show() { + echo "Show the current mpost version" +} + +do_show() { + [[ -z "${@}" ]] || die -q "Too many parameters" + + write_list_start "Current mpost version:" + if [[ -L "${ROOT}/usr/bin/mpost" ]] ; then + write_kv_list_entry "$(identify_target)" "" + elif [[ -e "${ROOT}/usr/bin/mpost" ]] ; then + write_kv_list_entry "(not a symlink)" "" + else + write_kv_list_entry "(unset)" "" + fi +} + +### list action ### + +describe_list() { + echo "List available mpost versions" +} + +do_list() { + [[ -z "${@}" ]] || die -q "Too many parameters" + + local i targets current + targets=( $(find_targets ) ) + current=$(identify_target) + for (( i = 0; i < ${#targets[@]}; i++ )); do + [[ ${targets[i]} = ${current} ]] \ + && targets[i]=$(highlight_marker "${targets[i]}") + done + write_list_start "Available mpost versions:" + write_numbered_list -m "(none found)" "${targets[@]}" +} + +### set action ### + +describe_set() { + echo "Set a new mpost version" +} + +describe_set_options() { + echo "target : Target version number or index from 'list' action" +} + +describe_set_parameters() { + echo "<target>" +} + +do_set() { + if [[ -z "${1}" ]] ; then + die -q "You didn't give me a version number" + + elif [[ -n "${2}" ]] ; then + die -q "Too many parameters" + + elif [[ -L "${ROOT}/usr/bin/mpost" ]] ; then + if ! remove_symlinks ; then + die -q "Can't remove existing version symlink" + elif ! set_symlinks "${1}" ; then + die -q "Can't set new version" + fi + + elif [[ -e "${ROOT}/usr/bin/mpost" ]] ; then + die -q "${ROOT}/usr/bin/mpost seems to be from an old ebuild, please remove manually" + else + set_symlinks "${1}" || die -q "Can't set new version" + fi +} + +### update action ### + +describe_update() { + echo "Automatically update the mpost version number" +} + +describe_update_options() { + echo "--if-unset : Do not override currently selected version" +} + +do_update() { + [[ -z "${1}" ]] || ( [[ -z "${2}" ]] && [[ "${1}" == "--if-unset" ]] ) || \ + die -q "Usage error" + + if [[ -L "${ROOT}/usr/bin/mpost" ]] ; then + [[ ${1} == "--if-unset" ]] && return + remove_symlinks || die -q "Can't remove existing symlink" + fi + if [[ -e "${ROOT}/usr/bin/mpost" ]] ; then + die -q "${ROOT}/usr/bin/mpost seems to be from an old ebuild, please remove manually" + elif ! [[ -z $(find_targets ) ]] ; then + set_symlinks 1 || die -q "Can't set a new version" + fi +} diff --git a/app-eselect/eselect-mpost/metadata.xml b/app-eselect/eselect-mpost/metadata.xml new file mode 100644 index 000000000000..13170c3184d8 --- /dev/null +++ b/app-eselect/eselect-mpost/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="project"> + <email>tex@gentoo.org</email> + <name>Gentoo TeX Project</name> +</maintainer> +</pkgmetadata> |