# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=2

DESCRIPTION="Apple's Time Machine alternative for Linux"
HOMEPAGE="http://code.google.com/p/flyback/"
SRC_URI="http://flyback.googlecode.com/files/flyback-lucid_0.6.5-1_all.deb"

IUSE=""
SLOT="0"
LICENSE="UNKNOWN"
KEYWORDS="~amd64 ~x86"
RESTRICT="strip mirror"

DEPEND=">=dev-lang/python-3.1.2
	>=dev-util/glade-3.6.7[gnome,python]
	>=gnome-base/libglade-2.6.4
	>=dev-vcs/git-1.7.2.2"
RDEPEND="${DEPEND}"

BASE_DIR="usr/share"
INSTALL_DIR="/${BASE_DIR}"

src_unpack() {
    unpack ${A}
    unpack ./data.tar.gz
}

src_install() {
    // Python files
    insinto "${INSTALL_DIR}/flyback"
    for file in "${BASE_DIR}/flyback/*";
    do
       doins ${file}
    done

    // Glade files
    insinto "${INSTALL_DIR}/flyback/glade"
    for file in "${BASE_DIR}/flyback/glade/*";
    do
       doins ${file}
    done

    // Executable file
    exeinto "${INSTALL_DIR}/flyback"
    doexe "${BASE_DIR}/flyback/flyback.py"

    // Changelog
    dodoc "${BASE_DIR}/doc/flyback/changelog.Debian.gz"

    // Icon
    exeinto "${INSTALL_DIR}/applications"
    doexe "${BASE_DIR}/applications/flyback.desktop"
}