After excess flood I accidentally caused last time on #gentoo-kde trying to 
paste some links I decided to longer paste in KDE (damn klipper) any text 
contents to chat box...

Anyway - eclass changes:
- full SLOT="4.3" support
- "new" unstable snapshots support (upstream decided to rename tarballs to 
${KMNAME}-${PV}.svn${revision}.tar.bz2)
- added missing variable quoting in some places
- added debug-print-function to every exported (by eclass) function
- for KMNAME starting with extragear or playground - eclass inherited decides 
about ESVN_REPO_URI so that now it's possible to make "split" ebuilds for 
stuff in there (like plasmoids - example is kde-plasmoids/menubar-9999 in kde-
testing overlay) only inheriting kde4-meta ("monolithic" live ebuilds like 
let's say amarok inherit just kde4-base).

-- 
regards
MM




----------------------------------------------------------------------
Zostan mistrzem parkowania w Bombaju!
Zagraj >> http://link.interia.pl/f204e
--- /usr/portage/eclass/kde4-base.eclass	2009-02-02 22:36:03.000000000 +0100
+++ kde4-base.eclass	2009-02-03 23:02:06.000000000 +0100
@@ -1,6 +1,6 @@
-# Copyright 2007-2008 Gentoo Foundation
+# Copyright 2007-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.28 2009/02/02 21:35:08 scarabeus Exp $
+# $Header: $
 
 # @ECLASS: kde4-base.eclass
 # @MAINTAINER:
@@ -16,7 +16,7 @@
 inherit base cmake-utils eutils multilib kde4-functions
 
 get_build_type
-if [[ $BUILD_TYPE = live ]]; then
+if [[ ${BUILD_TYPE} = live ]]; then
 	inherit subversion
 fi
 
@@ -166,7 +166,7 @@
 	latest)
 		if [[ $KDEBASE = kde-base ]]; then
 			case ${PV} in
-				4.2.6*)
+				4.3* | 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*)
 					_kdedir="4.3"
 					_pv="-${PV}:4.3"
 					_pvn="-${PV}"
@@ -198,7 +198,7 @@
 					;;
 				*)
 					die "NEED_KDE=latest not supported for PV=${PV}" ;;
-				esac
+			esac
 			_operator=">="
 		else
 			# this creates dependency on any version of kde4
@@ -216,7 +216,7 @@
 		_pvn="-${NEED_KDE}"
 		export NEED_KDE="live"
 		;;
-	4.2.6*)
+	4.3 | 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*)
 		_kdedir="4.3"
 		_pv="-${NEED_KDE}:4.3"
 		_pvn="-${NEED_KDE}"
@@ -260,8 +260,8 @@
 if [[ ${NEED_KDE} != none ]]; then
 
 	#Set the SLOT
-	if [[ -n $KDEBASE ]]; then
-		if [[ $NEED_KDE = live ]]; then
+	if [[ -n ${KDEBASE} ]]; then
+		if [[ ${NEED_KDE} = live ]]; then
 			SLOT="live"
 		else
 			case ${KMNAME} in
@@ -286,6 +286,7 @@
 				*)
 					case ${PV} in
 						9999*) SLOT="live" ;;
+						4.3* | 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*) SLOT="4.3" ;;
 						4.2* | 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6*) SLOT="4.2" ;;
 						4.1* | 4.0.9* | 4.0.8*) SLOT="4.1" ;;
 						*) SLOT="4.1" ;;
@@ -309,21 +310,21 @@
 
 	# Adding kdelibs, kdepimlibs and kdebase-data deps to all other packages.
 	# We only need to add the dependencies if ${PN} is not "kdelibs" or "kdepimlibs"
-	if [[ $PN != kdelibs ]]; then
+	if [[ ${PN} != kdelibs ]]; then
 		DEPEND="${DEPEND}
 				kdeprefix? ( ${_operator}kde-base/kdelibs${_pv}[kdeprefix] )
 				!kdeprefix? ( ${_operator}kde-base/kdelibs${_pvn}[-kdeprefix] )"
 		RDEPEND="${RDEPEND}
 				kdeprefix? ( ${_operator}kde-base/kdelibs${_pv}[kdeprefix] )
 				!kdeprefix? ( ${_operator}kde-base/kdelibs${_pvn}[-kdeprefix] )"
-		if [[ $PN != kdepimlibs ]]; then
+		if [[ ${PN} != kdepimlibs ]]; then
 			DEPEND="${DEPEND}
 				kdeprefix? ( ${_operator}kde-base/kdepimlibs${_pv}[kdeprefix] )
 				!kdeprefix? ( ${_operator}kde-base/kdepimlibs${_pvn}[-kdeprefix] )"
 			RDEPEND="${RDEPEND}
 				kdeprefix? ( ${_operator}kde-base/kdepimlibs${_pv}[kdeprefix] )
 				!kdeprefix? ( ${_operator}kde-base/kdepimlibs${_pvn}[-kdeprefix] )"
-			if [[ $PN != kdebase-data ]]; then
+			if [[ ${PN} != kdebase-data ]]; then
 				RDEPEND="${RDEPEND}
 					kdeprefix? ( ${_operator}kde-base/kdebase-data${_pv}[kdeprefix] )
 					!kdeprefix? ( ${_operator}kde-base/kdebase-data${_pvn}[-kdeprefix] )"
@@ -337,9 +338,10 @@
 # koffice ebuild, the URI should be set in the ebuild itself
 case ${SLOT} in
 	live)
+		SRC_URI=""
 		ESVN_MIRROR=${ESVN_MIRROR:=svn://anonsvn.kde.org/home/kde}
 		# Split ebuild, or extragear stuff
-		if [[ -n $KMNAME ]]; then
+		if [[ -n ${KMNAME} ]]; then
 		    ESVN_PROJECT="${KMNAME}"
 			if [[ -z ${KMNOMODULE} && -z ${KMMODULE} ]]; then
 				KMMODULE="${PN}"
@@ -347,31 +349,22 @@
 			# Split kde-base/ ebuilds: (they reside in trunk/KDE)
 			case ${KMNAME} in
 				kdebase-*)
-					ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/kdebase/${KMNAME#kdebase-}/"
+					ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/kdebase/${KMNAME#kdebase-}"
 					;;
 				kdereview)
-					ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}/"
+					ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
 					;;
 				kde*)
 					ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/${KMNAME}"
 					;;
 				extragear*|playground*)
-					case ${PN} in
-						*-plasma)
-							ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}/"
-							ESVN_PROJECT="${KMNAME}/${KMMODULE}/"
-							;;
-						*)
-							ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}/"
-							;;
-					esac
-				;;
+					ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
+					;;
 				koffice)
 					ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
 					;;
 				*)
-					# Extragear material
-					ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}/"
+					ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
 					;;
 			esac
 		else
@@ -383,9 +376,14 @@
 		ESVN_UP_FREQ=${ESVN_UP_FREQ:-1}
 		;;
 	*)
-		if [[ -n $KDEBASE ]]; then
+		if [[ -n ${KDEBASE} ]]; then
 			if [[ -n ${KMNAME} ]]; then
-				_kmname=${KMNAME}
+				case ${KMNAME} in
+					kdebase-apps)
+						_kmname="kdebase" ;;
+					*)
+						_kmname=${KMNAME} ;;
+				esac
 			else
 				_kmname=${PN}
 			fi
@@ -408,8 +406,8 @@
 				;;
 			esac
 			fi
-				unset _kmname _kmname_pv
-			fi
+			unset _kmname _kmname_pv
+		fi
 		;;
 esac
 
@@ -432,7 +430,7 @@
 # errors and die if any required flags listed in $QT4_BUILT_WITH_USE_CHECK or
 # $KDE4_BUILT_WITH_USE_CHECK are missing.
 kde4-base_pkg_setup() {
-	debug-print-function $FUNCNAME "$@"
+	debug-print-function ${FUNCNAME} "$@"
 
 	# Don't set KDEHOME during compile, it will cause access violations
 	unset KDEHOME
@@ -441,7 +439,7 @@
 	# Computation based on NEED_KDE and KDE_MINIMAL
 	get_latest_kdedir
 
-	if [[ $NEED_KDE != none ]]; then
+	if [[ ${NEED_KDE} != none ]]; then
 		# Set PREFIX
 		if use kdeprefix; then
 			KDEDIR="/usr/kde/${_kdedir}"
@@ -453,7 +451,7 @@
 	fi
 	# Set the prefix based on KDEDIR
 	# Make it a consequence of kdeprefix
-	PREFIX=$KDEDIR
+	PREFIX=${KDEDIR}
 
 	unset _kdedir
 
@@ -461,7 +459,7 @@
 	[[ -n ${QT4_BUILT_WITH_USE_CHECK} || -n ${kde4_built_with_use_che...@]} ]] && \
 		die "built_with_use illegal in this EAPI!"
 
-	if [[ $BUILD_TYPE = live && -z $I_KNOW_WHAT_I_AM_DOING ]]; then
+	if [[ ${BUILD_TYPE} = live && -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
 		echo
 		elog "WARNING! This is an experimental live ebuild of ${KMNAME:-${PN}}"
 		elog "Use it at your own risk."
@@ -473,29 +471,18 @@
 # @FUNCTION: kde4-base_src_unpack
 # @DESCRIPTION:
 # This function unpacks the source tarballs for KDE4 applications.
-#
-# If no argument is passed to this function, then standard src_unpack is
-# executed. Otherwise, options are passed to base_src_unpack.
 kde4-base_src_unpack() {
-	debug-print-function $FUNCNAME "$@"
+	debug-print-function ${FUNCNAME} "$@"
 
-	if [[ $BUILD_TYPE = live ]]; then
+	if [[ ${BUILD_TYPE} = live ]]; then
 		migrate_store_dir
 		subversion_src_unpack
 	else
-		[[ -z $KDE_S ]] && KDE_S="${S}"
-		if [[ -z $* ]]; then
-			# Unpack first and deal with KDE patches after examing possible patch sets.
-			# To be picked up, patches need to conform to the guidelines stated before.
-			# Monolithic ebuilds will use the split ebuild patches.
-			[[ -d "${KDE_S}" ]] || unpack ${A}
-		fi
-		# Updated cmake dir
-		if [[ -d "${WORKDIR}/cmake" && -d "${KDE_S}/cmake" ]]; then
-			ebegin "Updating cmake/ directory..."
-			rm -rf "${KDE_S}/cmake" || die "Unable to remove old cmake/ directory"
-			ln -s "${WORKDIR}/cmake" "${KDE_S}/cmake" || die "Unable to symlink the new cmake/ directory"
-			eend 0
+		unpack "${A}" || die "Unpack ${A} failed"
+		# Detect real toplevel dir - issue with unstable snapshots
+		local topleveldir=`basename ${SRC_URI%.tar.*}`
+		if 	[[ "${topleveldir}" != "${P}" ]]; then
+			mv "${topleveldir}" "${P}" ]] || die "Died while moving \"${topleveldir}\" to \"${P}\""
 		fi
 	fi
 }
@@ -509,7 +496,7 @@
 	debug-print-function ${FUNCNAME} "$@"
 
 	# Only enable selected languages, used for KDE extragear apps.
-	if [[ -n $KDE_LINGUAS ]]; then
+	if [[ -n ${KDE_LINGUAS} ]]; then
 		enable_selected_linguas
 	fi
 
@@ -517,12 +504,12 @@
 	base_src_prepare
 
 	# Save library dependencies
-	if [[ -n $KMSAVELIBS ]] ; then
+	if [[ -n ${KMSAVELIBS} ]] ; then
 		save_library_dependencies
 	fi
 
 	# Inject library dependencies
-	if [[ -n $KMLOADLIBS ]] ; then
+	if [[ -n ${KMLOADLIBS} ]] ; then
 		load_library_dependencies
 	fi
 }
@@ -551,7 +538,7 @@
 	mycmakeargs="${mycmakeargs} -DKDE4_BUILD_TESTS=OFF"
 
 	# Set distribution name
-	[[ $PN = kdelibs ]] && mycmakeargs="${mycmakeargs} -DKDE_DISTRIBUTION_TEXT=Gentoo"
+	[[ ${PN} = kdelibs ]] && mycmakeargs="${mycmakeargs} -DKDE_DISTRIBUTION_TEXT=Gentoo"
 
 	# runpath linking
 	mycmakeargs="${mycmakeargs} -DKDE4_USE_ALWAYS_FULL_RPATH=ON"
@@ -564,13 +551,13 @@
 
 	# Set environment
 	QTEST_COLORED=1
-	QT_PLUGIN_PATH=${KDEDIR}/$(get_libdir)/kde4/plugins/
+	QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/"
 
 	# hardcode path to *.cmake KDE files
 	export PKG_CONFIG_PATH="${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}:}${KDEDIR}/$(get_libdir)/pkgconfig"
 
 	# additonal arguments for KOFFICE
-	if [[ $KMNAME = koffice ]]; then
+	if [[ ${KMNAME} = koffice ]]; then
 		case ${PN} in
 			koffice-data) : ;;
 			*)
@@ -606,7 +593,7 @@
 	debug-print-function ${FUNCNAME} "$@"
 
 	if [[ -d "$WORKDIR/${PN}_build" ]]; then
-		pushd "${WORKDIR}"/${PN}_build > /dev/null
+		pushd "${WORKDIR}/${PN}_build" > /dev/null
 	fi
 	[ -e [Mm]akefile ] && cmake-utils_src_make "$@"
 }
@@ -630,13 +617,13 @@
 kde4-base_src_install() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	if [[ -n $KMSAVELIBS ]] ; then
+	if [[ -n ${KMSAVELIBS} ]] ; then
 		install_library_dependencies
 	fi
 
 	kde4-base_src_make_doc
 	if [[ -d "$WORKDIR/${PN}_build" ]]; then
-		pushd "${WORKDIR}"/${PN}_build > /dev/null
+		pushd "${WORKDIR}/${PN}_build" > /dev/null
 	fi
 	[ -e [Mm]akefile ] && cmake-utils_src_install
 }
@@ -649,12 +636,12 @@
 
 	local doc
 	for doc in AUTHORS ChangeLog* README* NEWS TODO; do
-		[[ -s $doc ]] && dodoc ${doc}
+		[[ -s ${doc} ]] && dodoc ${doc}
 	done
 
-	if [[ -z $KMNAME ]]; then
+	if [[ -z ${KMNAME} ]]; then
 		for doc in {apps,runtime,workspace,.}/*/{AUTHORS,README*}; do
-			if [[ -s $doc ]]; then
+			if [[ -s ${doc} ]]; then
 				local doc_complete=${doc}
 				doc="${doc#*/}"
 				newdoc "$doc_complete" "${doc%/*}.${doc##*/}"
@@ -665,7 +652,7 @@
 	if [[ -n ${KDEBASE} && -d "${D}/usr/share/doc/${PF}" ]]; then
 		# work around bug #97196
 		dodir /usr/share/doc/kde && \
-			mv "${D}"/usr/share/doc/${PF} "${D}"/usr/share/doc/kde/ || \
+			mv "${D}/usr/share/doc/${PF}" "${D}"/usr/share/doc/kde/ || \
 			die "Failed to move docs to kde/ failed."
 	fi
 }
@@ -674,6 +661,8 @@
 # @DESCRIPTION:
 # Function to rebuild the KDE System Configuration Cache after an application has been installed.
 kde4-base_pkg_postinst() {
+	debug-print-function ${FUNCNAME} "$@"
+
 	buildsycoca
 }
 
@@ -681,5 +670,7 @@
 # @DESCRIPTION:
 # Function to rebuild the KDE System Configuration Cache after an application has been removed.
 kde4-base_pkg_postrm() {
+	debug-print-function ${FUNCNAME} "$@"
+
 	buildsycoca
 }
--- /usr/portage/eclass/kde4-meta.eclass	2009-01-12 21:07:46.000000000 +0100
+++ kde4-meta.eclass	2009-02-03 23:02:23.000000000 +0100
@@ -1,6 +1,6 @@
-# Copyright 1999-2008 Gentoo Foundation
+# Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.10 2009/01/12 19:40:34 scarabeus Exp $
+# $Header: $
 #
 # @ECLASS: kde4-meta.eclass
 # @MAINTAINER:
@@ -13,7 +13,7 @@
 # Do not include the same item in more than one of KMMODULE, KMMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY.
 
 # we want opengl optional in each koffice package
-if [[ $KMNAME = koffice ]]; then
+if [[ ${KMNAME} = koffice ]]; then
 	case ${PN} in
 		koffice-data)
 			;;
@@ -51,7 +51,7 @@
 	kdepim)
 		DEPEND="${DEPEND} dev-libs/boost app-office/akonadi-server"
 		RDEPEND="${RDEPEND} dev-libs/boost"
-		if [[ $PN != kode ]]; then
+		if [[ ${PN} != kode ]]; then
 			DEPEND="${DEPEND} >=kde-base/kode-${PV}:${SLOT}"
 			RDEPEND="${RDEPEND} >=kde-base/kode-${PV}:${SLOT}"
 		fi
@@ -64,7 +64,7 @@
 		esac
 		;;
 	kdegames)
-		if [[ $PN != libkdegames ]]; then
+		if [[ ${PN} != libkdegames ]]; then
 			DEPEND="${DEPEND} >=kde-base/libkdegames-${PV}:${SLOT}"
 			RDEPEND="${RDEPEND} >=kde-base/libkdegames-${PV}:${SLOT}"
 		fi
@@ -99,6 +99,17 @@
 debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies"
 debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies"
 
+# Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc)
+case ${SLOT} in
+	live)
+		case ${KMNAME} in
+			extragear*|playground*)
+				ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
+				;;
+		esac
+		;;
+esac
+
 # @ECLASS-VARIABLE: KMNAME
 # @DESCRIPTION:
 # Name of the parent-module (e.g. kdebase, kdepim, ...). You _must_ set it
@@ -120,8 +131,8 @@
 # Example usage: If you're installing subdirectories of a package, like plugins,
 # you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and
 # set KMNOMODULE="true".
-if [[ -z $KMMODULE && $KMNOMODULE != true  ]]; then
-	KMMODULE=$PN
+if [[ -z ${KMMODULE} && ${KMNOMODULE} != true  ]]; then
+	KMMODULE=${PN}
 fi
 
 # @ECLASS-VARIABLE: KMEXTRA
@@ -153,6 +164,8 @@
 # Currently just calls its equivalent in kde4-base.eclass(5). Use this one in
 # split ebuilds.
 kde4-meta_pkg_setup() {
+	debug-print-function ${FUNCNAME} "$@"
+
 	kde4-base_pkg_setup
 }
 
@@ -161,8 +174,9 @@
 # This function unpacks the source for split ebuilds. See also
 # kde4-meta-src_extract.
 kde4-meta_src_unpack() {
-	debug-print-function  ${FUNCNAME} "$@"
-	if [[ $BUILD_TYPE = live ]]; then
+	debug-print-function ${FUNCNAME} "$@"
+
+	if [[ ${BUILD_TYPE} = live ]]; then
 		migrate_store_dir
 		S="${WORKDIR}/${PN}-${PV}"
 		mkdir -p "${S}"
@@ -183,7 +197,9 @@
 # Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and
 # KMTARPARAMS.
 kde4-meta_src_extract() {
-	if [[ $BUILD_TYPE = live ]]; then
+	debug-print-function ${FUNCNAME} "$@"
+
+	if [[ ${BUILD_TYPE} = live ]]; then
 		local rsync_options subdir kmnamedir targetdir
 		# Export working copy to ${S}
 		einfo "Exporting parts of working copy to ${S}"
@@ -211,45 +227,52 @@
 					|| die "${ESVN}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
 		done
 
-		if [[ $KMNAME = kdebase-runtime && $PN != kdebase-data ]]; then
+		if [[ ${KMNAME} = kdebase-runtime && ${PN} != kdebase-data ]]; then
 			sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
 				"${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
 		fi
 	else
-		local abort tarball tarfile f extractlist
-		case $KMNAME in
-			kdebase-apps)
-				tarball="${KMNAME#-apps}-${PV}.tar.bz2"
-				;;
-			*)
-				tarball="${KMNAME}-${PV}.tar.bz2"
-				;;
-		esac
-		tarfile="${DISTDIR}"/${tarball}
+		local abort tarfile f extractlist topleveldir moduleprefix
+		tarfile="${DISTDIR}/${A}"
+
+		# Detect real toplevel dir - issue with unstable snapshots
+		# It will be used in __list_needed_subdirectories
+		topleveldir=`basename ${SRC_URI%.tar.*}`/
 
-		ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
+		ebegin "Unpacking parts of ${A} to ${WORKDIR}"
 
 		kde4-meta_create_extractlists
 
+		# Go one level deeper for kdebase-apps in tarballs (releases)
+		if [[ ${KMNAME} == kdebase-apps && ${BUILD_TYPE} == release ]]; then
+			moduleprefix=apps/
+			KMTARPARAMS="${KMTARPARAMS} --transform=s|apps/||"
+		fi
+
 		for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \
 			AUTHORS COPYING INSTALL README NEWS ChangeLog
 		do
-			extractlist="${extractlist} ${KMNAME}-${PV}/${f}"
+			extractlist="${extractlist} ${topleveldir}${moduleprefix}${f}"
 		done
 		extractlist="${extractlist} $(__list_needed_subdirectories)"
 		KMTARPARAMS="${KMTARPARAMS} -j"
 
 		pushd "${WORKDIR}" > /dev/null
-		[[ -n ${KDE4_STRICTER} ]] && echo tar -xpf $tarfile $KMTARPARAMS $extractlist >&2
-		tar -xpf $tarfile $KMTARPARAMS $extractlist 2> /dev/null
+		[[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2
+		tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null
 
-		# Default $S is based on $P; rename the extracted directory to match $S
-		mv ${KMNAME}-${PV} ${P} || die "Died while moving \"${KMNAME}-${PV}\" to \"${P}\""
+		# Default $S is based on $P; rename the extracted directory to match $S if necessary
+		if [[ "${topleveldir}" != "${P}" ]]; then
+			mv "${topleveldir}" "${P}" || die "Died while moving \"${topleveldir}\" to \"${P}\""
+		fi
 
 		popd > /dev/null
 
 		eend $?
 
+		# We need to clear it here to make verification below work
+		unset moduleprefix
+
 		if [[ -n ${KDE4_STRICTER} ]]; then
 			for f in $(__list_needed_subdirectories fatal); do
 				if [[ ! -e ${S}/${f#*/} ]]; then
@@ -259,10 +282,9 @@
 			done
 			[[ -n ${abort} ]] && die "There were missing files."
 		fi
-		kde4-base_src_unpack
 	fi
 	# fix koffice linking
-	if [[ $KMNAME = koffice ]]; then
+	if [[ ${KMNAME} = koffice ]]; then
 		koffice_fix_libraries
 	fi
 }
@@ -307,7 +329,7 @@
 				config-X11.h.cmake
 				startkde.cmake"
 			case ${SLOT} in
-				4.2)
+				4.2|4.3)
 					KMEXTRACTONLY="${KMEXTRACTONLY}
 						KDE4WorkspaceConfig.cmake.in"
 					;;
@@ -388,12 +410,12 @@
 	done
 
 	# Expand KMMODULE
-	if [[ -n $KMMODULE  ]]; then
+	if [[ -n ${KMMODULE} ]]; then
 		kmmodule_expanded="${KMMODULE}"
 		j=$(dirname ${KMMODULE})
 		while [[ ${j} != "." ]]; do
-			kmmodule_expanded="${kmmodule_expanded} $j/CMakeLists.txt";
-			j=$(dirname $j)
+			kmmodule_expanded="${kmmodule_expanded} ${j}/CMakeLists.txt";
+			j=$(dirname ${j})
 		done
 	fi
 
@@ -411,17 +433,12 @@
 	debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded:  ${kmmodule_expanded}"
 	debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}"
 
-
-	case ${PV} in
-		scm|9999*) : ;;
-		*) topdir="${KMNAME}-${PV}/" ;;
-	esac
-
 	# Create final list of stuff to extract
+	# We append topleveldir only when specified (usually for tarballs)
 	for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
 		${KMEXTRACTONLY}
 	do
-		extractlist="${extractlist} ${topdir}${i}"
+		extractlist="${extractlist} ${topleveldir}${moduleprefix}${i}"
 	done
 
 	echo ${extractlist}
@@ -460,7 +477,7 @@
 # @FUNCTION: kde4-meta_change_cmakelists
 # @DESCRIPTION:
 kde4-meta_change_cmakelists() {
-	debug-print-function  ${FUNCNAME} "$@"
+	debug-print-function ${FUNCNAME} "$@"
 
 	pushd "${S}" > /dev/null
 
@@ -532,7 +549,7 @@
 					die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
 			fi
 			# Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
-			if [[ ${SLOT} == 4.2 ]] || [[ ${PV} == 9999 ]]; then
+			if [[ ${SLOT} == 4.2 || ${SLOT} == 4.3 || ${SLOT} == live ]]; then
 				if [[ ${PN} != libkworkspace ]]; then
 					sed -i -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
 						CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip EXPORT section"
@@ -566,7 +583,7 @@
 # Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split
 # ebuilds.
 kde4-meta_src_configure() {
-	debug-print-function  ${FUNCNAME} "$@"
+	debug-print-function ${FUNCNAME} "$@"
 
 	kde4-base_src_configure
 }
@@ -576,7 +593,7 @@
 # General function for compiling split KDE4 applications.
 # Overrides kde4-base_src_compile.
 kde4-meta_src_compile() {
-	debug-print-function  ${FUNCNAME} "$@"
+	debug-print-function ${FUNCNAME} "$@"
 
 	kde4-base_src_make
 }
@@ -605,7 +622,7 @@
 	fi
 
 	# remove unvanted koffice stuff
-	if [[ $KMNAME = koffice && $PN != koffice-data ]]; then
+	if [[ ${KMNAME} = koffice && ${PN} != koffice-data ]]; then
 		rm "$D/$KDEDIR/include/config-openexr.h"
 		rm "$D/$KDEDIR/share/apps/cmake/modules/FindKOfficeLibs.cmake"
 	fi
@@ -616,11 +633,11 @@
 # This function searches in ${S}/${KMMODULE},
 # and tries to install "AUTHORS ChangeLog* README* NEWS todo" if these files exist.
 kde4-meta_src_make_doc() {
-	debug-print-function  $FUNCNAME "$@"
+	debug-print-function $FUNCNAME "$@"
 
 	local doc
 	for doc in AUTHORS ChangeLog* README* NEWS TODO; do
-		[[ -s ${KMMODULE}/$doc ]] && newdoc "${KMMODULE}/${doc}" "${doc}.${KMMODULE##*/}"
+		[[ -s ${KMMODULE}/${doc} ]] && newdoc "${KMMODULE}/${doc}" "${doc}.${KMMODULE##*/}"
 	done
 
 	kde4-base_src_make_doc
@@ -631,6 +648,8 @@
 # Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
 # ebuilds.
 kde4-meta_pkg_postinst() {
+	debug-print-function ${FUNCNAME} "$@"
+
 	kde4-base_pkg_postinst
 }
 
@@ -639,6 +658,7 @@
 # Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
 # ebuilds.
 kde4-meta_pkg_postrm() {
+	debug-print-function ${FUNCNAME} "$@"
+
 	kde4-base_pkg_postrm
 }
-

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to