diff options
author | Dustin Polke <dustin.polke@uni-siegen.de> | 2011-09-15 10:07:36 +0200 |
---|---|---|
committer | Dustin Polke <dustin.polke@uni-siegen.de> | 2011-09-15 14:28:45 +0200 |
commit | 7f6f5ebe9a336f7c615941c242b2b1eef6107203 (patch) | |
tree | ab63e6badaaa31883e1a6af61593089f950f6ee6 /eclass | |
parent | [x11-misc/cairo-dock-plugins] Add blockers for upcoming split-up of cairo-doc... (diff) | |
download | DuPol-7f6f5ebe9a336f7c615941c242b2b1eef6107203.tar.gz DuPol-7f6f5ebe9a336f7c615941c242b2b1eef6107203.tar.bz2 DuPol-7f6f5ebe9a336f7c615941c242b2b1eef6107203.zip |
Add cairo-dock.eclass used by new cairo-dock related ebuilds.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/cairo-dock.eclass | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/eclass/cairo-dock.eclass b/eclass/cairo-dock.eclass new file mode 100644 index 0000000..b316d38 --- /dev/null +++ b/eclass/cairo-dock.eclass @@ -0,0 +1,95 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +# @ECLASS: cairo-dock.eclass +# @MAINTAINER: +# dustin.polke@uni-siegen.de +# +# @CODE@ +# Authors: Dustin Polke <dustin.polke@uni-siegen.de>. +# @CODE@ +# @BLURB: Helper eclass for cairo-dock installation. +# @DESCRIPTION: +# Provide helper functions for cairo-dock and split cairo-dock-plugins ebuilds. + +inherit versionator + +# @ECLASS-VARIABLE: CD_P +# @DESCRIPTION: +# Upstream's name of the package +: ${CD_P:=${PN}-$(replace_version_separator 3 '~' )} + +# @ECLASS-VARIABLE: CDP_P +# @INTERNAL +# @DESCRIPTION: +# Upstream's name of the plugin package +: ${CDP_P:=${PN%-*}-$(replace_version_separator 3 '~' )} + +# @ECLASS-VARIABLE: CD_PV_MAJ_MIN +# @INTERNAL +# @DESCRIPTION: +# Major and minor numbers of the version number. +: ${CD_PV_MAJ_MIN:=$(get_version_component_range 1-2)} + +# @ECLASS-VARIABLE: CD_PV_MAJ_MIN_MIC +# @INTERNAL +# @DESCRIPTION: +# Major, minor, and micro numbers of the version number. +: ${CD_PV_MAJ_MIN_MIC:=$(get_version_component_range 1-3)} + +# @ECLASS-VARIABLE: CD_TYPE +# @INTERNAL +# @DESCRIPTION: +# Defines package type. +if [ "${CDP_P%-*}" == "cairo-dock-plugins" ]; then + CD_TYPE="plug-ins" + CD_P="${CDP_P}" +else + CD_TYPE="core" +fi + +# @ECLASS-VARIABLE: CD_PLUGINS +# @DESCRIPTION: +# Names of all plugins to be handled by the ebuild. + +SRC_URI="http://launchpad.net/cairo-dock-${CD_TYPE}/${CD_PV_MAJ_MIN}/${CD_PV_MAJ_MIN_MIC}/+download/${CD_P}.tar.gz" + +S="${WORKDIR}"/${CD_P} + +# @FUNCTION: cairo-dock_src_unpack +# @DESCRIPTION: +# For plugins, unpack only code for plugins to be build; otherwise run +# default_src_unpack. +# Don't unpack CMakeLists.txt if ${FILESDIR}/${P}-CMakeLists.txt exists. +cairo-dock_src_unpack() { + if [ "${CD_TYPE}" == "plug-ins" ]; then + local target targets + [ "${PN}" == "cairo-dock-plugins-core" ] && \ + targets+=( "${CDP_P}/po" ) + for target in ${CD_PLUGINS[@]}; do + targets+=( "${CDP_P}/${target}" ) + done + [ ! -f "${FILESDIR}"/${P}-CMakeLists.txt ] && \ + targets+=( "${CDP_P}/CMakeLists.txt" ) + einfo tar xzf "${DISTDIR}"/${CDP_P}.tar.gz ${targets[@]} + tar xzf "${DISTDIR}"/${CDP_P}.tar.gz ${targets[@]} || die + else + default_src_unpack + fi +} + +# @FUNCTION: cairo-dock_src_unpack +# @DESCRIPTION: +# Apply CMakeLists.patch if it exists, and +# use ${FILESDIR}/${P}-CMAkeLists.txt if exits. +# Enable verbose building. +cairo-dock_src_prepare() { + if [ -f "${FILESDIR}"/${P}-CMakeLists.patch ]; then + epatch "${FILESDIR}"/${P}-CMakeLists.patch + else + einfo "Copy CMakeLists.txt from '${FILESDIR}'" + cp {"${FILESDIR}"/${P}-,"${S}"/}CMakeLists.txt || die + fi + mycmakeargs=( "-DCMAKE_VERBOSE_MAKEFILE=TRUE" ) +} |