summaryrefslogtreecommitdiff
blob: d74b92380d08511289c1743138ebb6852588695f (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dialup/fcpci/fcpci-3.11.02-r2.ebuild,v 1.3 2006/03/12 11:40:20 mrness Exp $

inherit flag-o-matic linux-mod

DESCRIPTION="CAPI4Linux drivers for AVM Fritz!Card PCI for the 2.4 kernel series"
HOMEPAGE="http://www.avm.de/"
SRC_URI="ftp://ftp.avm.de/cardware/fritzcrd.pci/linux/suse.82/fcpci-suse8.2-0${PV}.tar.gz"

LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="x86"
IUSE=""

S="${WORKDIR}/fritz"

BUILD_TARGETS="all"

pkg_setup() {
	linux-mod_pkg_setup
	if kernel_is 2 4; then
		MODULE_NAMES="fcpci(extra::src.drv)"
	else
		ewarn
		ewarn
		eerror "Please do:"
		echo FRITZCAPI_CARDS="fcpci" emerge fritzcapi
		eerror "for 2.6 kernels"

		die kernel too new
	fi
}

src_unpack() {
	unpack ${A}

	sed -i -e "s/\`uname -r\`/${KV_VERSION_FULL}/" \
		-e 's/-DMODULE/-DMODULE -DMODVERSIONS/' \
		-e "s:(DEFINES) -O2:(DEFINES) ${CFLAGS} -I /usr/src/linux/include/ -include linux/modversions.h:" \
		${S}/src.drv/makefile || die "sed failed"

	#gentoo-sources contains this typedef
	sed -i -e "s:^typedef void irqreturn_t;.*:/*&*/:" \
		${S}/src.drv/defs.h || die "sed failed"
}

src_compile() {
	filter-flags "-fstack-protector"
	filter-flags "-fstack-protector-all"

	linux-mod_src_compile
}

src_install () {
	linux-mod_src_install

	dodoc CAPI* compile* license.txt
	dohtml install_passive-?.html
}