# Copyright 2007-2008 by the individual contributors of the genkdesvn project # Based in part upon the respective eclass in Gentoo which is: # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @ECLASS: gks-svn.eclass # @MAINTAINER: # genkdesvn-dev@mailstation.de # @BLURB: Eclass for writing KDE "live" ebuilds. # @DESCRIPTION: # This eclass provides all functions to handle live KDE ebuilds, # monolithic, split and extragear ebuilds. # # The eclass checks out to ${DISTDIR}/svn-src/KDE, and recreates the structure # of upstream's SVN repository locally. # @ECLASS-VARIABLE: NEED_KDE # @DESCRIPTION: # Defaults to "svn", also see: gks-base.eclass. if [[ -z ${NEED_KDE} ]]; then NEED_KDE="svn" fi # @ECLASS-VARIABLE: NEED_KDE_PRE # @DESCRIPTION: # This variable tells the eclass to set NEED_KDE and SLOT based on the PV of the # ebuild. # # Acceptable values for the PV when using this are: # - ${PV}_pre4 - Compile against the kde-4 SLOT # - ${PV}_pre9999 - Compile against the kde-svn SLOT if [[ -n ${NEED_KDE_PRE} ]]; then case ${PV##*_pre} in 4) SLOT="kde-4"; NEED_KDE=":${SLOT}";; 9999) SLOT="kde-svn"; NEED_KDE="svn";; *) die "Unknown package version." ;; esac fi # @ECLASS-VARIABLE: KMNAME # @DESCRIPTION: # Name of the parent-module (eg kdebase, kdepim, "extragear/base"). # You _must_ set it _before_ inheriting this eclass, (unlike the other parameters), # since it's used to set $ESVN_REPO_URI. # @ECLASS-VARIABLE: KMMODULE # @DESCRIPTION: # Specify exactly one subdirectory of $KMNAME here. Defaults to $PN. # You shouldn't set this for monolithic ebuilds. inherit subversion gks-base ${KMNAME:+gks-meta} EXPORT_FUNCTIONS pkg_setup src_unpack ESVN_MIRROR="svn://anonsvn.kde.org/home/kde" # Split ebuild, or extragear stuff if [[ -n ${KMNAME} ]]; then ESVN_PROJECT="KDE/${KMNAME}" if [[ -z ${KMNOMODULE} && -z ${KMMODULE} ]]; then KMMODULE="${PN}/" fi # Split kde-base/ ebuilds: (they reside in trunk/KDE) case ${KMNAME} in kdebase-*) ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/kdebase" ESVN_PROJECT="KDE/kdebase" ;; kdereview|kdesupport) ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}" ;; kde*) ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/${KMNAME}" ;; koffice) ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}" ;; extragear*|playground*) case ${PN} in *-plasma) ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}" ESVN_PROJECT="KDE/${KMNAME}/${KMMODULE}" ;; *) ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}" ;; esac ;; *) # Extragear material ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}" ;; esac else # kdelibs, kdepimlibs ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/${PN}" ESVN_PROJECT="KDE/${PN}" fi # @FUNCTION: gks-svn_pkg_setup # @DESCRIPTION: # This function calls gks-base_pkg_setup, then issues a warning about the # experimental nature of live ebuilds. gks-svn_pkg_setup() { gks-base_pkg_setup if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then echo ewarn "WARNING! This is an experimental ebuild of the ${KMNAME:-${PN}} KDE4 SVN tree." ewarn "Use at your own risk. File a bug at https://www2.mailstation.de/bugzilla if you" ewarn "run into problems. Or join #genkdesvn on the great Freenode IRC network." echo fi } # @FUNCTION: gks-svn_src_unpack # @DESCRIPTION: # Unpack SVN sources and apply patches. gks-svn_src_unpack() { local cleandir cleandir="${ESVN_STORE_DIR}/KDE/KDE" if [[ -d ${cleandir} ]]; then eerror "'${cleandir}' should never have been created. Either move it to" eerror "${ESVN_STORE_DIR}/${ESVN_PROJECT}/${ESVN_REPO_URI##*/} or remove" eerror "completely." die "'${cleandir}' is in the way." fi subversion_src_unpack gks-base_apply_patches }