# ChangeLog for app-misc/digitemp
-# Copyright 2000-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-misc/digitemp/ChangeLog,v 1.10 2005/12/20 23:49:10 vanquirius Exp $
+# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/digitemp/ChangeLog,v 1.11 2007/01/02 23:42:03 masterdriverz Exp $
+
+ 02 Jan 2007; Charlie Shepherd <masterdriverz@gentoo.org>
+ -digitemp-3.3.1.ebuild, digitemp-3.3.2.ebuild:
+ Add the ability to build support for other sensors. Thanks to Pekka
+ Paalanenbug - bug 145253
20 Dec 2005; Marcelo Goes <vanquirius@gentoo.org> digitemp-3.3.2.ebuild:
Another shot at fixing bug 115886.
-# Copyright 1999-2005 Gentoo Foundation
+# Copyright 1999-2007 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 $
+# $Header: /var/cvsroot/gentoo-x86/app-misc/digitemp/digitemp-3.3.2.ebuild,v 1.5 2007/01/02 23:42:03 masterdriverz 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=""
+IUSE="ds9097 ds9097u ds2490"
SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~x86"
-DEPEND="virtual/libc"
+DEPEND="ds2490? ( >=dev-libs/libusb-0.1.10a )"
-exampledir="/usr/share/doc/${PF}"
+targets() {
+ # default is to compile to the ds9097u.
+ if ! ( use ds9097 || use ds9097u || use ds2490 ); then
+ echo ds9097u
+ fi
+ for target in ds9097 ds9097u ds2490; do
+ if use ${target}; then
+ echo ${target}
+ fi
+ done
+}
src_compile() {
- target="ds9097u"
- # default is to compile to the ds9097u. local use flag takes care of
- # passive ds9097. the ds9097u setting is what i have, so probably a safe
- # default - nothing special here.
- [ "${SERIAL_DRIVER}" = ds9097 ] && target="ds9097"
- make clean
-
- ewarn ""
- ewarn "making for ${target} serial controller. if you would like support"
- ewarn "for another controller, please set SERIAL_DRIVER=\"ds9097u\" or"
- ewarn "SERIAL_DRIVER=\"ds9097\" as appropriate"
- ewarn ""
-
- make LOCK="no" ${target} || die
+ # default is to compile to the ds9097u.
+ if ! ( use ds9097 || use ds9097u || use ds2490 ); then
+ ewarn "If you don't choose a component to install, we default to ds9097u"
+ fi
+
+ local targets=$(targets)
+
+ for target in $targets; do
+ emake clean
+ emake LOCK="no" ${target} || die "emake ${target} failed"
+ done
}
src_install() {
- target_upper="$(echo $target | tr '[:lower:]' '[:upper:]')"
- mv digitemp_${target_upper} digitemp
- dobin digitemp || die
+ for target in $(echo $(targets) | tr '[:lower:]' '[:upper:]'); do
+ dobin digitemp_${target} && \
+ dosym digitemp_${target} /usr/bin/digitemp
+ done
+
+ if [[ $($(targets)|wc -l) -ge 1 ]]; then
+ echo
+ ewarn "/usr/bin/digitemp has been symlinked to /usr/bin/digitemp_${target}"
+ ewarn "If you want to access the others, they are available at /usr/bin/digitemp_*"
+ echo
+ 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/*
+ for example in perl python rrdb; do
+ insinto "/usr/share/doc/${PF}/${example}_examples"
+ doins ${example}/*
+ done
}
pkg_postinst() {
- ewarn "set the SERIAL_DRIVER environment variable to ds9097 to build"
- ewarn "for that controller instead"
- einfo ""
- einfo "examples of using digitemp with python, perl, and rrdtool are"
- einfo "located in ${exampledir}"
- einfo ""
+ echo
+ einfo "Examples of using digitemp with python, perl, and rrdtool are"
+ einfo "located in /usr/share/doc/${PF}/"
+ echo
}