blob: 64d5b6851b8d1aa1465c54c6b6398555cb0447d7 [file] [log] [blame]
Simran Basi80cab6a2014-02-11 14:39:09 -08001# Copyright 1999-2014 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2
Aviv Keshet4c4adcf2014-06-11 13:27:58 -07003# $Header: /var/cvsroot/gentoo-x86/dev-python/mysql-python/mysql-python-1.2.5.ebuild,v 1.4 2014/03/18 15:26:44 idella4 Exp $
Simran Basi80cab6a2014-02-11 14:39:09 -08004
5EAPI=5
Aviv Keshet4c4adcf2014-06-11 13:27:58 -07006
Simran Basi80cab6a2014-02-11 14:39:09 -08007PYTHON_COMPAT=( python{2_6,2_7} )
8
9inherit distutils-r1 flag-o-matic
10
Aviv Keshet4c4adcf2014-06-11 13:27:58 -070011MY_PN="MySQL-python"
12MY_P="${MY_PN}-${PV}"
Simran Basi80cab6a2014-02-11 14:39:09 -080013
14DESCRIPTION="Python interface to MySQL"
15HOMEPAGE="http://sourceforge.net/projects/mysql-python/ http://pypi.python.org/pypi/MySQL-python"
Aviv Keshet4c4adcf2014-06-11 13:27:58 -070016SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.zip"
Simran Basi80cab6a2014-02-11 14:39:09 -080017
18LICENSE="GPL-2"
19SLOT="0"
20KEYWORDS="*"
Aviv Keshet4c4adcf2014-06-11 13:27:58 -070021IUSE="doc"
Simran Basi80cab6a2014-02-11 14:39:09 -080022
Aviv Keshet4c4adcf2014-06-11 13:27:58 -070023RDEPEND="virtual/mysql"
Simran Basi80cab6a2014-02-11 14:39:09 -080024DEPEND="${RDEPEND}
Aviv Keshet4c4adcf2014-06-11 13:27:58 -070025 app-arch/unzip
26 dev-python/setuptools[${PYTHON_USEDEP}]
27 doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
Simran Basi80cab6a2014-02-11 14:39:09 -080028
29S="${WORKDIR}/${MY_P}"
30
Aviv Keshet4c4adcf2014-06-11 13:27:58 -070031DOCS=( HISTORY README.md doc/{FAQ,MySQLdb}.rst )
Simran Basi80cab6a2014-02-11 14:39:09 -080032
33src_configure() {
34 # Append the SYSROOT Library Path in order for the linker to find
Aviv Keshet4c4adcf2014-06-11 13:27:58 -070035 # libbfd when cross-compiling.
Simran Basi80cab6a2014-02-11 14:39:09 -080036 append-ldflags "-L${SYSROOT}/usr/${CHOST}/lib"
Aviv Keshet4c4adcf2014-06-11 13:27:58 -070037
Simran Basi80cab6a2014-02-11 14:39:09 -080038 # Update the site configuration options to search for mysql_config in the SYSROOT.
39 sed -i -r \
40 -e "s:#mysql_config = /usr/local/bin:mysql_config = ${SYSROOT}/usr/bin:" \
41 site.cfg
42 distutils-r1_src_configure
43}
44
45python_configure_all() {
46 append-flags -fno-strict-aliasing
47}
Aviv Keshet4c4adcf2014-06-11 13:27:58 -070048
49python_compile_all() {
50 use doc && sphinx-build -b html doc doc/_build/
51}
52
53python_install_all() {
54 use doc && local HTML_DOCS=( doc/_build/. )
55 distutils-r1_python_install_all
56}