net-p2p/amule: Resolve merge conflicts.
[gentoo.git] / dev-embedded / libftdi / libftdi-0.20.ebuild
1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="2"
6
7 inherit cmake-utils python eutils
8
9 if [[ ${PV} == 9999* ]] ; then
10         EGIT_REPO_URI="git://developer.intra2net.com/${PN}"
11         inherit git-2
12 else
13         SRC_URI="http://www.intra2net.com/en/developer/${PN}/download/${P}.tar.gz"
14         KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86"
15 fi
16
17 DESCRIPTION="Userspace access to FTDI USB interface chips"
18 HOMEPAGE="http://www.intra2net.com/en/developer/libftdi/"
19
20 LICENSE="LGPL-2"
21 SLOT="0"
22 IUSE="cxx doc examples python"
23
24 RDEPEND="virtual/libusb:0
25         cxx? ( dev-libs/boost )
26         python? ( dev-lang/python )"
27 DEPEND="${RDEPEND}
28         python? ( dev-lang/swig )
29         doc? ( app-doc/doxygen )"
30
31 src_prepare() {
32         sed -i \
33                 -e "s:[$]{PYTHON_LIB_INSTALL}/../site-packages:$(python_get_sitedir):" \
34                 bindings/CMakeLists.txt || die
35         sed -i \
36                 -e '/SET(LIB_SUFFIX /d' \
37                 CMakeLists.txt || die
38
39         epatch "${FILESDIR}"/${P}-cmake-{include,version}.patch
40 }
41
42 src_configure() {
43         mycmakeargs=(
44                 $(cmake-utils_use cxx FTDIPP)
45                 $(cmake-utils_use doc DOCUMENTATION)
46                 $(cmake-utils_use examples EXAMPLES)
47                 $(cmake-utils_use python PYTHON_BINDINGS)
48                 -DCMAKE_SKIP_BUILD_RPATH=ON
49         )
50         cmake-utils_src_configure
51 }
52
53 src_install() {
54         cmake-utils_src_install
55         dodoc ChangeLog README
56
57         if use doc ; then
58                 # Clean up crap man pages. #356369
59                 rm -vf "${CMAKE_BUILD_DIR}"/doc/man/man3/{_,usb_,deprecated}*
60
61                 doman "${CMAKE_BUILD_DIR}"/doc/man/man3/*
62                 dohtml "${CMAKE_BUILD_DIR}"/doc/html/*
63         fi
64         if use examples ; then
65                 docinto examples
66                 dodoc examples/*.c
67         fi
68 }