# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/app-misc/digitemp/digitemp-3.3.2.ebuild,v 1.4 2005/12/20 23:49:10 vanquirius Exp $ DESCRIPTION="Temperature logging and reporting using Dallas Semiconductor's iButtons and 1-Wire protocol" HOMEPAGE="http://www.digitemp.com http://www.ibutton.com" SRC_URI="http://www.digitemp.com/software/linux/${P}.tar.gz" IUSE="ds9097 ds9097u ds2490" SLOT="0" LICENSE="GPL-2" KEYWORDS="~x86" DEPEND="virtual/libc" exampledir="/usr/share/doc/${PF}" src_compile() { # liblockdev is not available mymakeflags="LOCK=\"no\"" # default is to compile to the ds9097u. if ! ( use ds9097 || use ds9097u || use ds2490 ); then ewarn "By default using the ds9097u serial adapter. See USE flags." emake clean emake $mymakeflags ds9097u || die "emake default target failed" return fi if use ds9097; then emake clean emake $mymakeflags ds9097 || die "emake target ds9097 failed" fi if use ds9097u; then emake clean emake $mymakeflags ds9097u || die "emake target ds9097u failed" fi if use ds2490; then emake clean emake $mymakeflags ds2490 || die "emake targe ds2490 failed" fi } src_install() { if ! ( use ds9097 || use ds9097u || use ds2490 ); then dobin digitemp_DS9097U && \ dosym digitemp_DS9097U /usr/bin/digitemp else use ds9097 && dobin digitemp_DS9097 use ds9097u && dobin digitemp_DS9097U use ds2490 && dobin digitemp_DS2490 fi # If there are multiple targets, make 'digitemp' # symlink to one of them. This takes care if someone # wants only one target. if use ds2490; then dosym digitemp_DS2490 /usr/bin/digitemp elif use ds9097u; then dosym digitemp_DS9097U /usr/bin/digitemp elif use ds9097; then dosym digitemp_DS9097 /usr/bin/digitemp fi dodoc README FAQ TODO # method one: don't treat the examples as docs; place them somewhere else. # then tell the user where to find this stuff. suitable alternative: # specify exampledir="/usr/share/doc/${PF}" local perldir="${exampledir}/perl_examples" insinto ${perldir} doins perl/* local pythondir="${exampledir}/python_examples" insinto ${pythondir} doins python/* local rrdbdir="${exampledir}/rrdb_examples" insinto ${rrdbdir} doins rrdb/* } pkg_postinst() { einfo "" einfo "examples of using digitemp with python, perl, and rrdtool are" einfo "located in ${exampledir}" einfo "" }