summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiziano Müller <dev-zero@gentoo.org>2008-12-16 16:21:07 +0000
committerTiziano Müller <dev-zero@gentoo.org>2008-12-16 16:21:07 +0000
commit79b71ea3792adbd09a5af331ff61a6b71a1a05f3 (patch)
treeaf3acf084000636e63672050e38b4f83a76adb4a /app-admin
parentMarking ffmpeg-0.4.9_p20081014 ppc64 for bug 245285 (diff)
downloadgentoo-2-79b71ea3792adbd09a5af331ff61a6b71a1a05f3.tar.gz
gentoo-2-79b71ea3792adbd09a5af331ff61a6b71a1a05f3.tar.bz2
gentoo-2-79b71ea3792adbd09a5af331ff61a6b71a1a05f3.zip
Initial commit. Eselect module written by Łukasz Michalik with a few changes made by me.
(Portage version: 2.2_rc17/cvs/Linux 2.6.27.8 x86_64)
Diffstat (limited to 'app-admin')
-rw-r--r--app-admin/eselect-boost/ChangeLog11
-rw-r--r--app-admin/eselect-boost/eselect-boost-0.1.ebuild22
-rw-r--r--app-admin/eselect-boost/files/boost.eselect-0.1205
-rw-r--r--app-admin/eselect-boost/metadata.xml9
4 files changed, 247 insertions, 0 deletions
diff --git a/app-admin/eselect-boost/ChangeLog b/app-admin/eselect-boost/ChangeLog
new file mode 100644
index 000000000000..e814e4a07543
--- /dev/null
+++ b/app-admin/eselect-boost/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for app-admin/eselect-boost
+# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-boost/ChangeLog,v 1.1 2008/12/16 16:21:07 dev-zero Exp $
+
+*eselect-boost-0.1 (16 Dec 2008)
+
+ 16 Dec 2008; Tiziano Müller <dev-zero@gentoo.org>
+ +files/boost.eselect-0.1, +metadata.xml, +eselect-boost-0.1.ebuild:
+ Initial commit. Eselect module written by Łukasz Michalik with a few
+ changes made by me.
+
diff --git a/app-admin/eselect-boost/eselect-boost-0.1.ebuild b/app-admin/eselect-boost/eselect-boost-0.1.ebuild
new file mode 100644
index 000000000000..b1ce9a91bcfd
--- /dev/null
+++ b/app-admin/eselect-boost/eselect-boost-0.1.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-boost/eselect-boost-0.1.ebuild,v 1.1 2008/12/16 16:21:07 dev-zero Exp $
+
+inherit multilib
+
+DESCRIPTION="boost module for eselect"
+HOMEPAGE="http://www.gentoo.org/proj/en/eselect/"
+SRC_URI=""
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=">=app-admin/eselect-1.0.5"
+
+src_install() {
+ local mdir="/usr/share/eselect/modules"
+ dodir ${mdir}
+ sed -e "s|%LIBDIR%|$(get_libdir)|g" "${FILESDIR}/boost.eselect-${PVR}" > "${D}${mdir}/boost.eselect" || die "failed to install"
+}
diff --git a/app-admin/eselect-boost/files/boost.eselect-0.1 b/app-admin/eselect-boost/files/boost.eselect-0.1
new file mode 100644
index 000000000000..c749e1e45de7
--- /dev/null
+++ b/app-admin/eselect-boost/files/boost.eselect-0.1
@@ -0,0 +1,205 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id: boost.eselect-0.1,v 1.1 2008/12/16 16:21:07 dev-zero Exp $
+
+# This eclass-module has been initially written by Łukasz Michalik <lmi@ift.uni.wroc.pl>
+# Corrections and extensions by Tiziano Müller <dev-zero@gentoo.org>
+
+DESCRIPTION="Manage boost installations"
+
+_boost_tools="bcp bjam compiler_status inspect library_status process_jam_log quickbook wave"
+
+find_targets() {
+ local f
+ for f in "${ROOT}"/usr/include/boost-[[:digit:]]* ; do
+ [[ -d "${f}" ]] && echo $(basename "${f}")
+ done
+}
+
+remove_installation() {
+ local link
+ for link in "${ROOT}/usr/include/boost" "${ROOT}/usr/share/boostbook" ; do
+ if [[ -L "${link}" ]] ; then
+ rm "${link}" || die -q "Couldn't remove \"${link}\" symlink"
+ else
+ [[ -e "${link}" ]] && die -q "\${link}\" exists and isn't a symlink"
+ fi
+ done
+
+ pushd "${ROOT}/usr/%LIBDIR%" 1>/dev/null
+ local lib
+ for lib in libboost_*.{a,so} ; do
+ [[ -L "${lib}" && "${lib}" != libboost_*[[:digit:]]_[[:digit:]][[:digit:]].@(a|so) ]] || continue
+ rm "${lib}" || die -q "Unable to remove \"/usr/%LIBDIR%/${lib}\" symlink"
+ done
+ popd 1>/dev/null
+
+ pushd "${ROOT}"/usr/bin 1>/dev/null
+ local tool
+ for tool in ${_boost_tools} ; do
+ [[ -L "${tool}" ]] && ( rm "${tool}" || die -q "Unable to remove \"/usr/bin/${tool}\" symlink" )
+ done
+ popd 1>/dev/null
+
+ local mod="mpi.so"
+ for moddir in "${ROOT}"/usr/%LIBDIR%/python*/site-packages ; do
+ if [ -L "${moddir}/${mod}" ] ; then
+ rm "${moddir}/${mod}" || die -q "Unable to remove \"${moddir}/${mod}\" symlink"
+ else
+ [[ -e "${moddir}/${mod}" ]] && die -q "\"${moddir}/${mod}\" exists and isn't a symlink"
+ fi
+ done
+}
+
+set_installation() {
+ [[ -z "${2}" ]] && die -q "Too few parameters to set_installation()"
+ local target="${1}"
+ local version="${2}"
+
+ if [[ -d "${ROOT}/usr/include/${target}" ]] ; then
+ pushd "${ROOT}/usr/include" 1>/dev/null
+ ln -s "${target}/boost" boost || die -q "Couldn't create symlink \"/usr/include/boost\""
+ popd 1>/dev/null
+
+ pushd "${ROOT}/usr/share/" 1>/dev/null
+ [[ -d "boostbook-${version}" ]] && \
+ ( ln -s "boostbook-${version}" "boostbook" || die -q "Couldn't create symlink \"/usr/bin/${tool}\"" )
+ popd 1>/dev/null
+
+ pushd "${ROOT}/usr/%LIBDIR%" 1>/dev/null
+ local lib
+ for lib in libboost_*-"${version}".{a,so} ; do
+ [[ -e "${lib}" ]] && \
+ ( ln -s "${lib}" "${lib//-${version}}" || die -q "Couldn't create symlink \"/usr/%LIBDIR%/${lib}\"" )
+ done
+ popd 1>/dev/null
+
+ pushd "${ROOT}/usr/bin/" 1>/dev/null
+ local tool
+ for tool in ${_boost_tools} ; do
+ [[ -e "${tool}" ]] && die -q "\"/usr/bin/${tool}\" exists and isn't a symlink"
+ [[ -e "${tool}-${version}" ]] && \
+ ( ln -s "${tool}-${version}" "${tool}" || die -q "Couldn't create symlink \"/usr/bin/${tool}\"" )
+ done
+ popd 1>/dev/null
+
+ local mod="mpi.so"
+ for moddir in "${ROOT}"/usr/%LIBDIR%/python*/site-packages ; do
+ pushd "${moddir}" 1>/dev/null
+ [[ -e "${mod}" ]] && die -q "\"${moddir}/${mod}\" exists and isn't a symlink"
+ [[ -e "mpi_${version}/mpi.so" ]] && \
+ ( ln -s "mpi_${version}/${mod}" "${mod}" || die -q "Couldn't create symlink \"${moddir}/${mod}\"" )
+ popd 1>/dev/null
+ done
+
+ else
+ die -q "Target \"${target}\" doesn't appear to be valid!"
+ fi
+}
+
+### show action ###
+
+describe_show() {
+ echo "Show the current boost version used"
+}
+
+do_show() {
+ local include
+
+ write_list_start "Current boost version:"
+ if [[ -L "${ROOT}"/usr/include/boost ]] ; then
+ include=$(basename $(dirname $(canonicalise "${ROOT}"/usr/include/boost )))
+ write_kv_list_entry "${include%/}" ""
+ else
+ write_kv_list_entry "(unset)" ""
+ fi
+}
+
+### list action ###
+
+describe_list() {
+ echo "List available boost versions"
+}
+
+do_list() {
+ local targets=( $(find_targets ) )
+ write_list_start "Available boost versions:"
+ if [[ -n "${targets[@]}" ]] ; then
+ local i
+ for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do
+ [[ "${targets[${i}]}" == $(basename $(dirname $(canonicalise "${ROOT}"/usr/include/boost))) ]] && \
+ targets[${i}]="${targets[${i}]} $(highlight '*' )"
+ done
+ write_numbered_list "${targets[@]}"
+ else
+ write_kv_list_entry "(none found)" ""
+ fi
+}
+
+### set action ###
+
+describe_set() {
+ echo "Set a new boost version"
+}
+
+describe_set_parameters() {
+ echo "<target>"
+}
+
+describe_set_options() {
+ echo "target : Target name or number (from 'list' action)"
+}
+
+do_set() {
+ if [[ -z "${1}" ]] ; then
+ # no parameter
+ die -q "You didn't tell me what to set the version to"
+ fi
+
+ local target="${1}"
+ if is_number "${target}" ; then
+ targets=($(find_targets))
+ target="${targets[$((${target} - 1))]}"
+ fi
+ local version="${target//boost-}"
+
+ if [[ -L "${ROOT}"/usr/include/boost ]] ; then
+ if ! remove_installation ; then
+ die -q "Couldn't unset existing installation"
+ elif ! set_installation "${target}" "${version}" ; then
+ die -q "Couldn't set a new installation"
+ fi
+ elif [[ -e "${ROOT}"/usr/include/boost ]] ; then
+ die -q "Sorry, existing boost installation confuses me"
+ else
+ set_installation "${target}" "${version}" || die -q "Couldn't set a new version"
+ fi
+}
+
+### update action ###
+
+describe_update() {
+ echo "Automaticly update boost version used"
+}
+
+do_update() {
+ local current=
+ if [[ -L "${ROOT}/usr/include/boost" ]]; then
+ current=$(basename $(canonicalise "${ROOT}/usr/include/boost") )
+ if [[ ! -e $(canonicalise "${ROOT}/usr/include/boost") ]]; then
+ # clean up dead symlinks
+ remove_installation || die -q "Couldn't remove existing installation"
+ fi
+ elif [[ -e "${ROOT}/usr/include/boost" ]]; then
+ die -q "Sorry, \"/usr/include/boost\" exists but is not a symlink"
+ fi
+
+ local targets=($(find_targets))
+ if [[ ${#targets[@]} -gt 0 ]]; then
+ remove_installation || die -q "Couldn't remove existing installation"
+ local target="${targets[@]:(-1)}"
+ set_installation "${target}" "${target//boost-}" || die -q "Couldn't set a new symlink"
+ else
+ die -q "No slotted boost version found"
+ fi
+}
diff --git a/app-admin/eselect-boost/metadata.xml b/app-admin/eselect-boost/metadata.xml
new file mode 100644
index 000000000000..64e111f55791
--- /dev/null
+++ b/app-admin/eselect-boost/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>cpp</herd>
+ <maintainer>
+ <email>dev-zero@gentoo.org</email>
+ <name>Tiziano Müller</name>
+ </maintainer>
+</pkgmetadata>