# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/rox.eclass,v 1.17 2006/11/27 18:45:52 lack Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/rox.eclass,v 1.18 2007/01/30 22:05:26 lack Exp $
# ROX eclass Version 2
# need python to byte compile modules, if any
# need autotools to run autoreconf, if required
-inherit python autotools
+inherit python autotools eutils
if [[ -z "${ROX_VER}" ]]; then
ROX_VER="2.1.0"
>=dev-util/pkgconfig-0.20"
fi
+# Utility functions
+rox_desktop_entry() {
+ # make_desktop_entry(<command>, [name], [icon], [type], [path])
+ make_desktop_entry ${APPNAME} ${APPNAME} \
+ "${APPICON}" "${APPCATEGORY};ROX"
+}
+
+# Exported functions
rox_src_compile() {
cd "${APPNAME}"
#Some packages need to be compiled.
chmod 755 AppRun
- if [ -d src/ ]; then
+ if [[ -d src/ ]]; then
# Bug 150303: Check with Rox-Clib will fail if the user has 0install
# installed on their system somewhere, so remove the check for it in the
# configure script, and adjust the path that the 'libdir' program uses
# to search for it:
- if [ -f src/configure.in ]; then
+ if [[ -f src/configure.in ]]; then
cd src
sed -i.bak -e 's/ROX_CLIB_0LAUNCH/ROX_CLIB/' configure.in
# TODO: This should really be 'eautoreconf', but that breaks a number
sed -i.bak -e 's/\<read\>/#read/' AppRun
./AppRun --compile || die "Failed to compile the package"
- if [ -n "${KEEP_SRC}" ]; then
+ if [[ -n "${KEEP_SRC}" ]]; then
cd src
make clean
cd ..
}
rox_src_install() {
- if [ -d "${APPNAME}/Help/" ]; then
+ if [[ -d "${APPNAME}/Help/" ]]; then
for i in "${APPNAME}"/Help/*; do
dodoc "${i}"
done
EOF
chmod 755 "${D}/usr/bin/${APPNAME}"
+ # Copy the .DirIcon into /usr/share/pixmaps with the proper extension
+ if [[ -f "${APPNAME}/.DirIcon" ]]; then
+ local APPDIRICON=${APPNAME}/.DirIcon
+ case "$(file -b ${APPDIRICON})" in
+ "PNG image data"*)
+ export APPICON=${APPNAME}.png
+ ;;
+ "XML 1.0 document text"*)
+ export APPICON=${APPNAME}.svg
+ ;;
+ "X pixmap image text"*)
+ export APPICON=${APPNAME}.xpm
+ ;;
+ "symbolic link"*)
+ APPDIRICON=$(dirname $APPDIRICON)/$(readlink $APPDIRICON)
+ export APPICON=${APPNAME}.${APPDIRICON##*.}
+ ;;
+ *)
+ # Unknown... Remark on it, and just copy without an extension
+ export APPICON=${APPNAME}
+ ;;
+ esac
+ insinto /usr/share/pixmaps
+ newins "${APPDIRICON}" "${APPICON}"
+ fi
+
#now compile any and all python files
python_mod_optimize "${D}/usr/lib/rox/${APPNAME}" >/dev/null 2>&1
+
+ # Create a .desktop file if the proper category is supplied
+ if [[ -n "${APPCATEGORY}" ]]; then
+ rox_desktop_entry
+ fi
}
rox_pkg_postinst() {