# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=2 inherit cmake-utils linux-mod DESCRIPTION="Driver and tools for controlling a Telldus Technologies TellStick." HOMEPAGE="http://www.telldus.se/" SRC_URI="http://download.telldus.se/TellStick/Software/${PN}/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="amd64" IUSE="udev" DEPEND="dev-libs/confuse >=dev-util/cmake-2.6.0" RDEPEND=">=dev-libs/confuse-2.6-r2 udev? ( sys-fs/udev )" pkg_postinst() { elog "You will need to set up your /etc/tellstick.conf file before running" elog "tdtool. For details, please see url:" elog "http://developer.telldus.se/wiki/TellStick_conf" } pkg_setup() { CONFIG_CHECK="USB_SERIAL_FTDI_SIO" linux-mod_pkg_setup # Fails to find its libraries with '--as-needed'; causes the linking error # 'undefined reference' to sem_close, sem_open, sem_post, sem_unlink # and sem_wait. append-ldflags $(no-as-needed) } src_compile() { cmake-utils_src_compile } src_configure() { mycmakeargs=( "-DGENERATE_MAN=TRUE" ) cmake-utils_src_configure } src_install() { cmake-utils_src_install fperms 644 /var/state/telldus-core.conf dodoc AUTHORS ChangeLog README } src_prepare() { # Clear the state file, because the default contents have caused warnings # when running tdtool. echo -n > driver/libtelldus-core/telldus-core.conf || ( \ ewarn "Failed to clear the contents of telldus-core.conf; when running tdtool, it" && ewarn "might generate warnings unless telldus-core.conf is cleared." ) if ! use udev; then sed -i \ -e "/SET(UDEV_RULES_DIR/d" \ -e "/INSTALL(FILES 99-tellstick.rules/,/)/d" \ driver/libtelldus-core/CMakeLists.txt \ || die "failed to patch driver/libtelldus-core/CMakeLists.txt" fi }