# -*-shell-script-*-

[Meta]
RootName: @freedesktop.org/gtkqtengine:$SOFTWAREVERSION
DisplayName: Gtk-Qt theme engine
ShortName: gtk-qt-engine
Maintainer: David Sansome <me@davidsansome.com>
Packager: David Sansome <me@davidsansome.com>
Summary: A GTK theme engine that mimics the active Qt style
SoftwareVersion: @VERSION@
InterfaceVersion: 0

[Description]
The Gtk-Qt theme engine is a project which allows Gtk applications to use Qt styles.
It works by calling drawing functions from Qt in the place of Gtk ones.

[BuildPrepare]
export APBUILD_BOGUS_DEPS='Xrandr Xmu GL Xcursor ICE png pthread SM X11 Xext Xrender art_lgpl art_lgpl_2 nsl resolv Xinerama util dl fontconfig freetype Xft expat'
export APBUILD_STATIC='z Xrender'

prepareBuild

mkdir -p $build_root
# The make install puts files in places other than $build_root
# This line copies all the installed files into $build_root
for filename in `find $build_root/../../ -type f`; do cp -f $filename $build_root; done


[BuildUnprepare]
unprepareBuild

[Imports]
echo '*' | import

[Prepare]
require @kde.org/kdelibs 3.1
require @gtk.org/gtk 2

[Install]
outputStatus "Installing theme engine library..."
GTK_VERSION=`pkg-config --variable=gtk_binary_version gtk+-2.0`
mkdirs "$PREFIX/lib/gtk-2.0/${GTK_VERSION}/engines/"
copyFile libqtengine.la "$PREFIX/lib/gtk-2.0/${GTK_VERSION}/engines/"
copyFile libqtengine.so "$PREFIX/lib/gtk-2.0/${GTK_VERSION}/engines/"

outputStatus "Installing theme..."
mkdirs "$PREFIX/share/themes/Qt/gtk-2.0"
copyFile gtkrc "$PREFIX/share/themes/Qt/gtk-2.0"

outputStatus "Installing KDE control center module..."
mkdirs "$PREFIX/lib/kde3"
copyFile kcm_kcmgtk.so "$PREFIX/lib/kde3/"
copyFile kcm_kcmgtk.la "$PREFIX/lib/kde3/"
installDesktop --no-path-adjust "Settings/LookNFeel" "kcmgtk.desktop"

updateEnv --check GTK_PATH "$PREFIX/lib/gtk-2.0"
updateEnv --check KDEDIRS "$PREFIX"

[Uninstall]
uninstallFromLog
