diff options
author | Matti Bickel <mabi@gentoo.org> | 2014-04-22 21:31:39 +0000 |
---|---|---|
committer | Matti Bickel <mabi@gentoo.org> | 2014-04-22 21:31:39 +0000 |
commit | aedded3916b969988b75da58db15cf588e3b4e8d (patch) | |
tree | 7d8b9666fdcbb3a15bef6a959842c0991b7c9048 | |
parent | Introduce slotted versions of lua. Use with eselect to define the "main" vers... (diff) | |
download | historical-aedded3916b969988b75da58db15cf588e3b4e8d.tar.gz historical-aedded3916b969988b75da58db15cf588e3b4e8d.tar.bz2 historical-aedded3916b969988b75da58db15cf588e3b4e8d.zip |
Introduce slotted versions of lua. Use with eselect to define the "main" version.
Package-Manager: portage-2.2.10/cvs/Linux x86_64
Manifest-Sign-Key: 0xDDF971F118EEA5E6!
-rw-r--r-- | app-admin/eselect-lua/ChangeLog | 10 | ||||
-rw-r--r-- | app-admin/eselect-lua/Manifest | 26 | ||||
-rw-r--r-- | app-admin/eselect-lua/eselect-lua-1.ebuild | 23 | ||||
-rw-r--r-- | app-admin/eselect-lua/files/lua.eselect-1 | 150 | ||||
-rw-r--r-- | app-admin/eselect-lua/metadata.xml | 9 |
5 files changed, 218 insertions, 0 deletions
diff --git a/app-admin/eselect-lua/ChangeLog b/app-admin/eselect-lua/ChangeLog new file mode 100644 index 000000000000..8154ea563a89 --- /dev/null +++ b/app-admin/eselect-lua/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for app-admin/eselect-lua +# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-lua/ChangeLog,v 1.1 2014/04/22 21:31:35 mabi Exp $ + +*eselect-lua-1 (22 Apr 2014) + + 22 Apr 2014; Matti Bickel <mabi@gentoo.org> +eselect-lua-1.ebuild, + +files/lua.eselect-1, +metadata.xml: + Introduce slotted versions of lua. Use with eselect to define the "main" + version. diff --git a/app-admin/eselect-lua/Manifest b/app-admin/eselect-lua/Manifest new file mode 100644 index 000000000000..16c62b8113ad --- /dev/null +++ b/app-admin/eselect-lua/Manifest @@ -0,0 +1,26 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +AUX lua.eselect-1 3197 SHA256 7c89e563cd0da76961c9c39f97bc101e5313f2153e0ee349eeebf9dc42841b41 SHA512 19110dcb746c724c704e9ffa69adacda93570590723a057c01d917a6d13ff3d714bd798266bcb0e6b10aea09293fba0724ba8f345823ed58eaf6448e88b42afb WHIRLPOOL 16044ea338857de229c00c0667b1d8cf4e2eec8c381b324a49164a1ccc6022c8041e47466081ae35867b3ea3c46434e6596343c7f2d113f35b0a93fe15bf1567 +EBUILD eselect-lua-1.ebuild 697 SHA256 4de0dfecf346b881b64220b3c54711be5cc92a307801cd809bedac3c7c305cfd SHA512 85eda2865551c737aac0fdf1543c61b90b61dc400b6b8bcef1e078a45746d230fc7e6997af320d93ba281051f8e947475f516826c57029227ec6716fece1bf83 WHIRLPOOL 825431a64d5e0c759178b25d5bc03a6d8cbfb6baf4d664659c2a89b61c2330fe893d92e31d1e323530139fd5dddddb970e4400ee84d382c5f621f7d8c9ac6ce8 +MISC ChangeLog 437 SHA256 052bf4b04a40e6d9f38d86114f12bd65fdd48118338c4e71858148fd6ac24932 SHA512 0b8441e9900b503491f6711d62bc30c51f0c2ba0827a4c8c143e86d976de9bddb14cdba028bf89f519cdd8bacd39aebb57199ec1a437336305d5cd9c82f447ba WHIRLPOOL 8edc38dbb5dc2d1a268c1b94e79ca66ba21f890ebefbaa557f1d97965b55efcf267e77f187c5b6eebbfb718ce1fa5c3e070ff16da4ad66fcb08a39f6773d3824 +MISC metadata.xml 267 SHA256 bff0c39f5e4191e65b8c057f503e09ab6651029953189db1ac2bfbe1786a202d SHA512 dd707a0bdf1c3a8992fc9ccee92c1d7be23943bcdebf5aa59e13448c88257da5ee4c7677056e2d537fab069c96b2efef5ea1c846c53b047c0037442a63e6c1c5 WHIRLPOOL 1321399adb9f8430a838d292d08197a3200a68dba3f096e363a0c6d41f90f9acd203eb3aebb21b4d3618752c0abf0689a547cadbcb1452dcbd2fcf327ab0f22f +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.22 (GNU/Linux) + +iQJ8BAEBCABmBQJTVvvsXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w +ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNzE1M0M4QzQxMzM4REREMjMzQjg4NUZE +REY5NzFGMTE4RUVBNUU2AAoJEN35cfEY7qXml6kQAJEEHkxFbvHQXeHCkjsL2hqK +mjdGpww8LP+qs8hTSdWAka390Wvll1nM9Cn15gL6v5yOur9NM6Wl3mw4jdgrFe56 +58jJEPA4fiu+K7SPiT6TCn4tFqLTHfPrGS6GxhxWpOBA/jEI6xaZkuL4ecyna2No +9uL5n9GH1TGOjArc/o5/7y/zCkwLKYVz1DXs6bdJhZ2lXKjgg+etmceJZDK6LWmA +DLspzFURjsntMC8UlBLQ6B41loHJ4qkdYiXwsE/6OZ4/e2h5QyvoXf4H4aw3NgHW +1w79M4tcdUNdgXQB9R8FGKLFInJ+Lmc5xBGg1tzQGpqGKpwJqLHvTqZyjshWe1LP +W50Nd2BB2WQdP2WMlc/xnKtWhfIn8iizQ+z6VwjhJw8amwP/AgvaZ4doggJcC4q9 +D2rEdRQXloRqG0jYrt1WS/pYxaW4OUfMNY5c5+qh0G0Q5cj7NRyso8xgJ1ZCw45B +rZUy94Tk+qbgg9AdeB168vyUyKCvfwUU8nlMC12o42uQZcfsp/X63/siTSEHa98i +NuKw3VHbMdCL3USk0s0FMGQGtnEKGjFe9z8bAfaMdUoBQwtiVWmBkKRre1Zw5OqT +uL3RfvkZSMyiiYMC+uSGewhaHHzzD8b0fx/klnu3rZ/s36EvuIkleB0f0WNEKTp5 +gstJrIXrw/VHySiDCwLt +=Cs+4 +-----END PGP SIGNATURE----- diff --git a/app-admin/eselect-lua/eselect-lua-1.ebuild b/app-admin/eselect-lua/eselect-lua-1.ebuild new file mode 100644 index 000000000000..fdbcfeef9558 --- /dev/null +++ b/app-admin/eselect-lua/eselect-lua-1.ebuild @@ -0,0 +1,23 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-lua/eselect-lua-1.ebuild,v 1.1 2014/04/22 21:31:35 mabi Exp $ + +EAPI=5 + +DESCRIPTION="Lua eselect module" +HOMEPAGE="http://www.gentoo.org" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="" + +DEPEND=">=app-admin/eselect-1.2.4" +RDEPEND="${DEPEND}" + +S="${WORKDIR}" + +src_install() { + insinto /usr/share/eselect/modules/ + newins "${FILESDIR}"/lua.eselect-${PV} lua.eselect +} diff --git a/app-admin/eselect-lua/files/lua.eselect-1 b/app-admin/eselect-lua/files/lua.eselect-1 new file mode 100644 index 000000000000..43c8627b5be4 --- /dev/null +++ b/app-admin/eselect-lua/files/lua.eselect-1 @@ -0,0 +1,150 @@ +# -*-eselect-*- vim: ft=eselect +# Copyright 2014-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +inherit config multilib + +DESCRIPTION="Manage lua symlinks" +MAINTAINER="mabi@gentoo.org" + +HEADER_FILES="lauxlib.h luaconf.h lua.h lua.hpp lualib.h" + +remove_symlinks() { + rm -f "${EROOT}"/usr/bin/{lua,luac} &>/dev/null + for dir in $(get_libdirs) ; do + rm -f "${EROOT}"${dir}/liblua.so &>/dev/null && \ + rm -f "${EROOT}"${dir}/pkgconfig/lua.pc &>/dev/null + done + for f in $HEADER_FILES ; do + rm -f "${EROOT}"/usr/include/$f + done + rm -f "${EROOT}"/usr/share/man/man1/{lua,luac}.1{,.gz,.bz2,.lzma} &>/dev/null +} + +set_symlinks() { + local ver=$1 + ln -s "${EROOT}"/usr/bin/lua{$ver,} + ln -s "${EROOT}"/usr/bin/luac{$ver,} + for dir in $(get_libdirs) ; do + ln -s "${dir}"/liblua{$ver,}.so + ln -s "${dir}"/pkgconfig/lua{$ver,}.pc + done + for orig in "${EROOT}"/usr/share/man/man1/lua*$ver.1* ; do + ln -s "${orig}" "${orig//$ver}" + done + for f in $HEADER_FILES ; do + ln -s "${EROOT}"/usr/include/lua$ver/$f "${EROOT}"/usr/include + done +} + +get_libdirs() { + local dir libdirs + for dir in $(list_libdirs); do + [[ -L ${EROOT}/usr/${dir} ]] && continue + ls "${EROOT}"/usr/${dir}/liblua*.* > /dev/null 2>&1 || continue + + libdirs+=' '/usr/${dir} + done + echo ${libdirs:-/usr/lib} +} + +find_targets() { + local dirs + local prefix="${EROOT}/usr/bin/lua" + for f in ${prefix}5* ; do + dirs="${dirs} ${f##$prefix}" + done + echo $dirs +} + +resolv_target() { + local targets=( $(find_targets) ) + if is_number $1; then + [[ $1 -le ${#targets[@]} && $1 -gt 0 ]] && echo "${targets[ $(( $1 - 1 )) ]}" + elif has $1 ${targets[@]}; then + echo $1 + fi +} + +get_active_version() { + readlink -e "${EROOT}"/usr/bin/lua | sed -ne "s:.*/usr/bin/lua\([\d.-]*\):\1:p" +} + +## Actual actions + +## set action + +describe_set() { + echo "Sets the current version of lua" +} + +describe_set_parameters() { + echo '<target>' +} + +describe_set_options() { + echo 'target: Target name or number (from "list" action)' +} + + +do_set() { + local target=$(resolv_target $1) + if [[ -z "${target}" ]]; then + die -q "You need to specify a version" + fi + remove_symlinks + set_symlinks $target +} + +## List action + +describe_list() { + echo 'Lists available lua versions' +} + +do_list() { + local targets + local a + targets=( $(find_targets) ) + a=$(get_active_version) + for (( i = 0; i < ${#targets[@]}; i++ )) ; do + [[ $a == ${targets[i]} ]] && targets[i]=$(highlight_marker "${targets[i]}") + done + write_numbered_list -m '(none found)' "${targets[@]}" +} + +## Show action + +describe_show() { + echo 'Show the active lua version' +} + +do_show() { + get_active_version +} + +## update action + +describe_update() { + echo 'Automatically update the lua version' +} + +describe_update_options() { + echo 'ifunset : Do not override existing implementation' +} + +do_update() { + [[ -n ${1} && ! ( ${1} == ifunset || ${1} == '--if-unset' ) ]] && \ + die -q 'Usage error' + + [[ ( ${1} == ifunset || ${1} == '--if-unset' ) && -n $(get_active_version) ]] && \ + return + + remove_symlinks + + local targets=( $(find_targets) ) + if [[ -n ${#targets[@]} ]] ; then + local target=${targets[${#targets[@]} - 1]} + set_symlinks $target || echo 'Nothing to update' + fi +} diff --git a/app-admin/eselect-lua/metadata.xml b/app-admin/eselect-lua/metadata.xml new file mode 100644 index 000000000000..ffbaf993ff7c --- /dev/null +++ b/app-admin/eselect-lua/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>mabi@gentoo.org</email> + </maintainer> + <longdescription lang="en">Lua eselect module</longdescription> +</pkgmetadata> + |