| 1 |
# Copyright 1999-2011 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/app-mobilephone/gammu/gammu-1.25.0-r1.ebuild,v 1.7 2011/01/08 20:03:43 arfrever Exp $
|
| 4 |
|
| 5 |
EAPI="3"
|
| 6 |
|
| 7 |
inherit eutils cmake-utils python
|
| 8 |
|
| 9 |
DESCRIPTION="a fork of the gnokii project, a tool to handle your cellular phone"
|
| 10 |
HOMEPAGE="http://www.gammu.org"
|
| 11 |
SRC_URI="http://dl.cihar.com/gammu/releases/${P}.tar.bz2"
|
| 12 |
|
| 13 |
LICENSE="GPL-2"
|
| 14 |
SLOT="0"
|
| 15 |
KEYWORDS="amd64 x86"
|
| 16 |
IUSE="curl debug bluetooth irda mysql postgres dbi nls python"
|
| 17 |
|
| 18 |
RDEPEND="bluetooth? ( net-wireless/bluez )
|
| 19 |
curl? ( net-misc/curl )
|
| 20 |
mysql? ( virtual/mysql )
|
| 21 |
postgres? ( dev-db/postgresql-server )
|
| 22 |
dbi? ( >=dev-db/libdbi-0.8.3 )
|
| 23 |
dev-util/dialog
|
| 24 |
dev-lang/python
|
| 25 |
!dev-python/python-gammu" # needs to be removed from the tree
|
| 26 |
DEPEND="${RDEPEND}
|
| 27 |
irda? ( virtual/os-headers )
|
| 28 |
nls? ( sys-devel/gettext )
|
| 29 |
dev-util/cmake"
|
| 30 |
|
| 31 |
# sys-devel/gettext is needed for creating .mo files
|
| 32 |
# Supported languages and translated documentation
|
| 33 |
# Be sure all languages are prefixed with a single space!
|
| 34 |
MY_AVAILABLE_LINGUAS=" af bg ca cs da de el es et fi fr gl he hu id it ko nl pl pt_BR ru sk sv zh_CN zh_TW"
|
| 35 |
IUSE="${IUSE} ${MY_AVAILABLE_LINGUAS// / linguas_}"
|
| 36 |
|
| 37 |
src_prepare() {
|
| 38 |
epatch "${FILESDIR}"/${P}-skip-locktest.patch
|
| 39 |
|
| 40 |
local lang support_linguas=no
|
| 41 |
for lang in ${MY_AVAILABLE_LINGUAS} ; do
|
| 42 |
if use linguas_${lang} ; then
|
| 43 |
support_linguas=yes
|
| 44 |
break
|
| 45 |
fi
|
| 46 |
done
|
| 47 |
# install all languages when all selected LINGUAS aren't supported
|
| 48 |
if [ "${support_linguas}" = "yes" ]; then
|
| 49 |
for lang in ${MY_AVAILABLE_LINGUAS} ; do
|
| 50 |
if ! use linguas_${lang} ; then
|
| 51 |
rm -rf locale/${lang} || die
|
| 52 |
fi
|
| 53 |
done
|
| 54 |
fi
|
| 55 |
}
|
| 56 |
|
| 57 |
src_configure() {
|
| 58 |
# debug flag is used inside cmake-utils.eclass
|
| 59 |
local mycmakeargs="$(cmake-utils_use_with bluetooth Bluez) \
|
| 60 |
$(cmake-utils_use_with irda IRDA) \
|
| 61 |
$(cmake-utils_use_with curl CURL) \
|
| 62 |
$(cmake-utils_use_with python PYTHON) \
|
| 63 |
$(cmake-utils_use_with mysql MySQL) \
|
| 64 |
$(cmake-utils_use_with postgres Postgres) \
|
| 65 |
$(cmake-utils_use_with dbi LibDBI) \
|
| 66 |
$(cmake-utils_use_with nls GettextLibs) \
|
| 67 |
$(cmake-utils_use_with nls Iconv) \
|
| 68 |
-DBUILD_SHARED_LIBS=ON -DINSTALL_DOC_DIR=share/doc/${PF}"
|
| 69 |
if use python; then
|
| 70 |
mycmakeargs="${mycmakeargs} -DBUILD_PYTHON=/usr/bin/python"
|
| 71 |
fi
|
| 72 |
cmake-utils_src_configure
|
| 73 |
}
|
| 74 |
|
| 75 |
src_compile() {
|
| 76 |
cmake-utils_src_compile
|
| 77 |
}
|
| 78 |
|
| 79 |
src_test() {
|
| 80 |
LD_LIBRARY_PATH="${WORKDIR}"/${PN}_build/common cmake-utils_src_test
|
| 81 |
}
|
| 82 |
|
| 83 |
src_install() {
|
| 84 |
cmake-utils_src_install
|
| 85 |
}
|
| 86 |
|
| 87 |
pkg_postinst() {
|
| 88 |
use python && python_mod_optimize gammu
|
| 89 |
}
|
| 90 |
|
| 91 |
pkg_postrm() {
|
| 92 |
use python && python_mod_cleanup gammu
|
| 93 |
}
|