--- /var/portage/app-misc/digitemp/digitemp-3.3.2.ebuild 2005-12-21 02:05:30.000000000 +0200 +++ digitemp-3.3.2-r1.ebuild 2006-08-27 15:06:42.000000000 +0300 @@ -6,36 +6,65 @@ 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="virtual/libc + ds2490? ( >=dev-libs/libusb-0.1.10a )" exampledir="/usr/share/doc/${PF}" 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 + # 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() { - target_upper="$(echo $target | tr '[:lower:]' '[:upper:]')" - mv digitemp_${target_upper} digitemp - dobin digitemp || die + 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. @@ -54,8 +83,6 @@ } 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}"