[Frugalware-git] playground: kde4.sh
crazy
crazy at frugalware.org
Sun Nov 25 23:31:31 CET 2007
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=playground.git;a=commitdiff;h=daade8effa57f95e9a892b2b6065bc5828791e34
commit daade8effa57f95e9a892b2b6065bc5828791e34
Author: crazy <crazy at frugalware.org>
Date: Sun Nov 25 23:31:01 2007 +0100
kde4.sh
* kde4_install() detects and installs docs automatically
* for normal projects.
* kde4_split() detects and splits /etc as well now
* added CMakeKDE_split() to split 'normal' projects
* I work on something more complex but not done now.
diff --git a/source/include/kde4.sh b/source/include/kde4.sh
index 41b1643..b60a47e 100644
--- a/source/include/kde4.sh
+++ b/source/include/kde4.sh
@@ -38,6 +38,7 @@
# you can disable them.
# * _F_cmakekde_color (default: OFF):
# * _F_cmakekde_final (default: TRUE):
+# * _F_kde4_subpkgs (no defaults): Special array for splitting packages automatically.
###
if [ -z "$_F_cmakekde_type" ]; then
@@ -66,6 +67,7 @@ if [ -z "$_F_kde4_defaults" ]; then
fi
+
###
# == OVERWRITTEN VARIABLES
# * url
@@ -91,6 +93,11 @@ makedepends=(${makedepends[@]} 'cmake')
CMakeKDE_conf()
{
+ ## What are these defaults ?
+ ## - install prefix /usr by default
+ ## - install config in /etc by default
+ ## - always use /usr/lib ( we don't want lib{32,64}
+ ## - install KDE's config files in /etc/kde$major/config and not /usr/share/
cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
@@ -112,14 +119,59 @@ CMakeKDE_conf()
kde4_install()
{
+ ## 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 for $1."
+ ## install docs
+ make -C "doc/$1" DESTDIR=$Fdestdir install || Fdie
+ fi
+ fi
+ ## install the package
make -C "$1" DESTDIR=$Fdestdir install || Fdie
-
}
kde4_split()
{
kde4_install "$1"
- Fsplit "$2" /usr
+ ## figure whatever we have /etc
+ if [ -d "$startdir/pkg/etc" ]; then
+ Fsplit "$2" /usr /etc
+ else
+ Fsplit "$2" /usr
+ fi
+}
+
+
+CMakeKDE_split()
+{
+
+ local i
+ local clean
+
+ ## let's try that way
+ for i in ${_F_kde4_subpkgs[@]}
+ do
+ ## we use for weird or not logical names
+ ## $pkgname-<the_weird_name>
+ clean=$(echo $i|sed 's/.*-//1') # foo-blah -> blah
+
+ ## check whatever that project exists
+ if [ -d "$clean" ]; then
+ ## split it
+ kde4_split "$clean" "$i"
+ else
+ Fmessage "Aieee project $clean does NOT exists, don't know how to install and split :/ ( Typo? )"
+ Fdie
+ fi
+
+ done
}
CMakeKDE_prepare_build()
More information about the Frugalware-git
mailing list