Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=kdetesting.git;a=commitdiff;h=01eb80e906687543aaebdb2da7f59a5c82d681ff

commit 01eb80e906687543aaebdb2da7f59a5c82d681ff
Author: crazy <cr...@frugalware.org>
Date:   Sat Feb 6 15:03:19 2010 +0100

kde.sh
* lots changes
* added :
--> _F_kde_no_auto_docs ( replaces _F_kde_split_docs )
* we now install ALL docs in $pkgname-docs
--> _F_kde_no_compiletime ( for packages don't have / want such files )
--> __KDE_pre_build_check() , __kde_find_split_files()
-->  __kde_remove_files() , __kde_in_array()
--> _F_kde_unstable to allow building 'beta/rc' kde magically :)
* added suport for lib<foo> -> foo in top_src dir to magic ;)
* bump version to latest rc
* ( all these prepares the full split )

diff --git a/source/include/kde.sh b/source/include/kde.sh
index db17c59..dffe7c7 100644
--- a/source/include/kde.sh
+++ b/source/include/kde.sh
@@ -40,7 +40,7 @@ Finclude cmake
###

if [ -z "$_F_kde_ver" ]; then
-       _F_kde_ver=4.3.5
+       _F_kde_ver=4.3.98
fi

if [ -z "$_F_kde_qtver" ]; then
@@ -65,8 +65,14 @@ if [ -z "$_F_kde_mirror" ]; then
_F_kde_mirror="ftp://ftp.kde.org/pub/kde";
fi

+if [ -z "$_F_kde_unstable" ]; then
+       _F_kde_folder="stable"
+else
+       _F_kde_folder="unstable"
+fi
+
if [ -z "$_F_kde_dirname" ]; then
-       _F_kde_dirname="stable/$_F_kde_ver/src"
+       _F_kde_dirname="$_F_kde_folder/$_F_kde_ver/src"
fi

if [ -n "$_F_kde_final" ]; then
@@ -97,7 +103,11 @@ if [ -z "$url" ]; then
fi

if [ -z "$up2date" ]; then
-       up2date="Flasttar http://kde.org/download/";
+       if [ -z "$_F_kde_unstable" ]; then
+               up2date="Flasttar http://kde.org/download/";
+       else
+               up2date=$pkgver
+       fi
fi

if [ ${#sour...@]} -eq 0 ]; then
@@ -122,8 +132,6 @@ None)       _F_KDE_CXX_FLAGS="$_F_KDE_CXX_FLAGS -DNDEBUG 
-DQT_NO_DEBUG";;
Debug*) _F_KDE_CXX_FLAGS="$_F_KDE_CXX_FLAGS -ggdb3";;
esac

-## REMOVE: KDE4_USE_ALWAYS... option changed since 4.2*
-## think about CMAKE_SKIP_RPATH for 4.4
_F_cmake_confopts="$_F_cmake_confopts \
-DCONFIG_INSTALL_DIR=/etc/kde/config \
-DKCFG_INSTALL_DIR=/etc/kde/config.kcfg \
@@ -136,25 +144,82 @@ _F_cmake_confopts="$_F_cmake_confopts \
# * KDE_project_install: Install a specific package. Parameters: 1) Name of the
# project (Must also be the name of a directory).
###
-KDE_project_install()
+
+# stolen from makepkg ;))
+__kde_in_array()
{
-       ## What is that ?
-       ## - usually an 'normal' named 'project' looks like this:
-       ## - 'foo' , 'doc/foo' and maybe 'doc/kcontrol/foo'
-       ## These can be installed auto magically.
-
-       # figure whatever it has docs
-       # TODO: add 'kcontrol' check ?!
-       if [ -d "doc" ]; then # does a doc folder exists ?
-               if [ -d "doc/$1" ]; then #  does the package has docs ?
-                       Fmessage "Installing docs from TOP_SRC dir for $1."
-                       ## install docs
-                       make -C "doc/$1" DESTDIR="$Fdestdir" install || Fdie
+        local i
+        _package=$1
+        shift 1
+        # array() undefined
+        [ -z "$1" ] && return 1
+        for i in "$@"
+        do
+                [ "$i" == "${_package}" ] && return 0
+        done
+        return 1
+}
+
+__KDE_pre_build_check()
+{
+
+       if [ -n "$_F_kde_no_auto_docs" ]; then
+               if __kde_in_array "$pkgname-docs" "${subpk...@]}"; then ## that 
is not allowed anymore
+                       Fmessage "ERROR: You cannot have _F_kde_no_auto_docs 
AND $pkgname-docs set!!"
+                        Fmessage "ERROR: Fix your FrugalBuild.. Bailing out!"
+                        Fdie
+                fi
+       else
+               if ! __kde_in_array "$pkgname-docs" "${subpk...@]}"; then
+                       Fmessage "ERROR: Cannot find $pkgname-docs in your 
subpkgs."
+                       Fmessage "ERROR: If you don't want any -docs subpkg add 
_F_kde_no_auto_docs=1 to your FrugalBuild."
+                       Fmessage "ERROR: Else copy and paste the following to 
your FrugalBuild:"
+                               echo 'subpkgs=("${subpk...@]}" "$pkgname-docs")'
+                               echo 'subdescs=("${subdes...@]}" "$pkgname 
Documentation")'
+                               echo 'subdepends=("${subdepen...@]}" "")'
+                               if [ -n "$subrodepends" ]; then
+                                       echo 
'subrodepends=("${subrodepen...@]}" "")'
+                               fi
+                               echo 'subgroups=("${subgrou...@]}" "docs-extra 
kde-docs")'
+                               echo 'subarchs=("${subarc...@]}" "i686 x86_64 
ppc")'
+                               Fdie
+               fi
+       fi
+
+       if [ -n "$_F_kde_no_compiletime" ]; then
+               if __kde_in_array "$pkgname-compiletime" "${subpk...@]}"; then 
## not allowed will produce conflicts / empty packages
+                       Fmessage "ERROR: You cannot have _F_kde_no_compiletime 
AND $pkgname-compiletime set!!"
+                       Fmessage "ERROR: Fix your FrugalBuild.. Bailing out!"
+                       Fdie
+               fi
+       else
+               if ! __kde_in_array "$pkgname-compiletime" "${subpk...@]}"; then
+                       Fmessage "ERROR: Cannot find $pkgname-compiletime in 
your subpkgs."
+                       Fmessage "ERROR: If you don't want -compiletime subpkg 
add _F_kde_no_compiletime=1 to your FrugalBuild."
+                       Fmessage "ERROR: Fix your FrugalBuild.. Bailing out!"
+                       Fdie
fi
-       elif [ -d "apps/doc" ]; then ## kdebase
-               if [ -d "apps/doc/$1" ]; then #  does the package has docs ?
-                       Fmessage "Installing docs from apps/ dir for $1."
-                       make -C "apps/doc/$1" DESTDIR="$Fdestdir" install || 
Fdie
+       fi
+
+       ## TODO: add check for missing $CARCH in subarchs ( porting / splitting 
issues )
+}
+
+
+KDE_project_install()
+{
+       ## OK we want the docs to be in one place $pkgname-docs so..
+       if [ -n "$_F_kde_no_auto_docs" ]; then ## really do not use for 
kde<core_modules>
+               if [ -d "doc" ]; then # does a doc folder exists ?
+                       if [ -d "doc/$1" ]; then #  does the package has docs ?
+                               Fmessage "Installing docs from TOP_SRC dir for 
$1."
+                               ## install docs
+                               make -C "doc/$1" DESTDIR="$Fdestdir" install || 
Fdie
+                       elif [ -d "apps/doc" ]; then ## kdebase
+                               if [ -d "apps/doc/$1" ]; then #  does the 
package has docs ?
+                                       Fmessage "Installing docs from apps/ 
dir for $1."
+                                       make -C "apps/doc/$1" 
DESTDIR="$Fdestdir" install || Fdie
+                               fi
+                       fi
fi
fi

@@ -166,14 +231,52 @@ KDE_project_install()
fi
## install the package
make -C "$1" DESTDIR="$Fdestdir" install || Fdie
+
+        if [ -z "$_F_kde_no_auto_docs" ]; then
+                Frm usr/share/doc
+        fi
+
}

+
###
# * KDE_project_split(): Moves a KDE project to a subpackage. Parameters:
# 1) name of the subpackage 2) Name of the project (see KDE_project_install).
# Example: KDE_project_split kopete-irc kopete/protocols/irc
###

+__kde_remove_files()
+{
+       local i j
+       [ -z "$1" ] && Fdie
+       for i in `find $Fdestdir -name "$1"`
+       do
+               if [ -f "$i" ]; then
+                       j=`echo $i|sed 's|.*/pkg/||g'`
+                       Frm $j
+               else
+                       Fdie
+               fi
+       done
+}
+
+__kde_find_split_files()
+{
+
+       local i j
+       [ -z "$1" ] && Fdie
+       [ -z "$2" ] && Fdie
+       for i in `find $Fdestdir ! -type d -name "$1" -prune`
+       do
+               if [ -f "$i" ]; then
+                       j=`echo $i|sed 's|.*/pkg/||g'`
+                       Fsplit $2 $j
+               else
+                       Fdie
+               fi
+       done
+}
+
KDE_project_split()
{
KDE_project_install "$2"
@@ -217,6 +320,9 @@ __KDE_split() # internal and should be extended to handle 
all kind paths
elif [ -d "libs/$clean" ]; then
Fmessage "Found Kde-Project "$clean" in libs/ dir.. Splitting."
KDE_project_split "$i" "libs/$clean"
+       elif [ -d "$cleanlib" ]; then
+               Fmessage "Found Kde-Project "$cleanlib" ( subpkg_name 
lib$cleanlib ) in TOP_SRC dir.. Splitting.."
+               KDE_project_split "$i" "$cleanlib"
elif [ -d "libs/$cleanlib" ]; then
Fmessage "Found Kde-Project "$cleanlib" ( subpkg_name lib$cleanlib ) in libs/ 
dir.. Splitting."
KDE_project_split "$i" "libs/$cleanlib"
@@ -243,10 +349,13 @@ KDE_split()
## let's try that way
for i in "${_f_kde_subpk...@]}"
do
-               ## Shall we add something more generic some _ignore= ?
-               ## but for that we need some hacks in makepkg I guess
-               if [ "$i" == "$pkgname-docs" ]; then
-                       Fmessage "Ignoring $pkgname-docs KDE_install() will 
take care.."
+               ## Shall we add something more generic some _ignore= ?
+               ## but for that we need some hacks in makepkg I guess
+               if [ "$i" == "$pkgname-docs" ]; then
+                       Fmessage "Ignoring $pkgname-docs KDE_install() will 
take care.."
+                       continue
+               elif [ "$i" == "$pkgname-compiletime" ]; then
+                       Fmessage "Ignoring $pkgname-compiletime KDE_install() 
will take care.."
continue
fi
__KDE_split
@@ -267,9 +376,9 @@ KDE_make()
}


-
KDE_make_split()
{
+       __KDE_pre_build_check
KDE_make "$@"
KDE_split
}
@@ -283,11 +392,18 @@ KDE_cleanup()
KDE_install()
{
make DESTDIR="$Fdestdir" install || Fdie
-       KDE_cleanup
-       if [ "$_F_kde_split_docs" == 1 ]; then
-          Fsplit "$pkgname-docs" /usr/share/doc/HTML
+
+       if [ -z "$_F_kde_no_auto_docs" ]; then
+               Fsplit "$pkgname-docs" usr/share/doc/HTML
fi

+       KDE_cleanup
+
+       if [ -z "$_F_kde_no_compiletime" ]; then
+               Fsplit "$pkgname-compiletime" usr/include
+               __kde_find_split_files "*.cmake" "$pkgname-compiletime"
+               __kde_find_split_files "*.pc" "$pkgname-compiletime"
+       fi
}

_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to