summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /app-eselect/eselect-lua
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'app-eselect/eselect-lua')
-rw-r--r--app-eselect/eselect-lua/eselect-lua-1.ebuild23
-rw-r--r--app-eselect/eselect-lua/files/lua.eselect-1150
-rw-r--r--app-eselect/eselect-lua/metadata.xml9
3 files changed, 182 insertions, 0 deletions
diff --git a/app-eselect/eselect-lua/eselect-lua-1.ebuild b/app-eselect/eselect-lua/eselect-lua-1.ebuild
new file mode 100644
index 00000000000..9a2c503dc71
--- /dev/null
+++ b/app-eselect/eselect-lua/eselect-lua-1.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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-eselect/eselect-lua/files/lua.eselect-1 b/app-eselect/eselect-lua/files/lua.eselect-1
new file mode 100644
index 00000000000..59abc87c848
--- /dev/null
+++ b/app-eselect/eselect-lua/files/lua.eselect-1
@@ -0,0 +1,150 @@
+# -*-eselect-*- vim: ft=eselect
+# Copyright 2014-2015 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-eselect/eselect-lua/metadata.xml b/app-eselect/eselect-lua/metadata.xml
new file mode 100644
index 00000000000..ffbaf993ff7
--- /dev/null
+++ b/app-eselect/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>
+