summaryrefslogtreecommitdiff
blob: 10e4a50b23541166de0f95270c54ef76ab70d6a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-embedded/dfu-programmer/dfu-programmer-0.6.2.ebuild,v 1.2 2014/07/30 19:18:42 ssuominen Exp $

EAPI="4"

inherit udev

DESCRIPTION="A Device Firmware Update based USB programmer for Atmel chips"
HOMEPAGE="http://dfu-programmer.sourceforge.net"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

RDEPEND="virtual/libusb:1
	virtual/udev"
DEPEND="${RDEPEND}
	virtual/pkgconfig"

src_prepare() {
	# Upstream has fixed this in their configure already.
	tc-export CPP PKG_CONFIG
	sed -i \
		-e "/LIBUSB_1_0_CFLAGS=/s:=.*:='$(${PKG_CONFIG} --cflags libusb-1.0)':" \
		-e "/LIBUSB_1_0_LIBS=/s:=.*:='$(${PKG_CONFIG} --libs libusb-1.0)':" \
		configure || die
}

src_install() {
	default

	cat <<-EOF > 70-dfu-programmer.rules
	#
	# do not edit this file, it will be overwritten on update
	#
	EOF
	printf 'SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="%s", MODE="660", GROUP="plugdev", SYMLINK+="dfu-%%n"\n' \
		2ff{a,b,9,7,4,3} >> 70-dfu-programmer.rules

	udev_dorules 70-dfu-programmer.rules
}