View | Details | Raw Unified
Collapse All | Expand All

(-) /var/portage/app-misc/digitemp/digitemp-3.3.2.ebuild (-21 / +48 lines)
 Lines 6-41    Link Here 
HOMEPAGE="http://www.digitemp.com http://www.ibutton.com"
HOMEPAGE="http://www.digitemp.com http://www.ibutton.com"
SRC_URI="http://www.digitemp.com/software/linux/${P}.tar.gz"
SRC_URI="http://www.digitemp.com/software/linux/${P}.tar.gz"
IUSE=""
IUSE="ds9097 ds9097u ds2490"
SLOT="0"
SLOT="0"
LICENSE="GPL-2"
LICENSE="GPL-2"
KEYWORDS="~x86"
KEYWORDS="~x86"
DEPEND="virtual/libc"
DEPEND="virtual/libc
	ds2490? ( >=dev-libs/libusb-0.1.10a )"
exampledir="/usr/share/doc/${PF}"
exampledir="/usr/share/doc/${PF}"
src_compile() {
src_compile() {
	target="ds9097u"
	# liblockdev is not available
	# default is to compile to the ds9097u. local use flag takes care of
	mymakeflags="LOCK=\"no\""
	# passive ds9097. the ds9097u setting is what i have, so probably a safe
	
	# default - nothing special here.
	# default is to compile to the ds9097u. 
	[ "${SERIAL_DRIVER}" = ds9097 ] && target="ds9097"
	if ! ( use ds9097 || use ds9097u || use ds2490 ); then
	make clean
		ewarn "By default using the ds9097u serial adapter. See USE flags."
		emake clean
	ewarn ""
		emake $mymakeflags ds9097u || die "emake default target failed"
	ewarn "making for ${target} serial controller. if you would like support"
		return
	ewarn "for another controller, please set SERIAL_DRIVER=\"ds9097u\" or"
	fi
	ewarn "SERIAL_DRIVER=\"ds9097\" as appropriate"
	
	ewarn ""
	if use ds9097; then
		emake clean
	make LOCK="no" ${target} || die
		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() {
src_install() {
	target_upper="$(echo $target | tr '[:lower:]' '[:upper:]')"
	if ! ( use ds9097 || use ds9097u || use ds2490 ); then
	mv digitemp_${target_upper} digitemp
		dobin digitemp_DS9097U && \
	dobin digitemp || die
			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
	dodoc README FAQ TODO
	# method one: don't treat the examples as docs; place them somewhere else.
	# method one: don't treat the examples as docs; place them somewhere else.
 Lines 54-61    Link Here 
}
}
pkg_postinst() {
pkg_postinst() {
	ewarn "set the SERIAL_DRIVER environment variable to ds9097 to build"
	ewarn "for that controller instead"
	einfo ""
	einfo ""
	einfo "examples of using digitemp with python, perl, and rrdtool are"
	einfo "examples of using digitemp with python, perl, and rrdtool are"
	einfo "located in ${exampledir}"
	einfo "located in ${exampledir}"