summaryrefslogtreecommitdiff
path: root/community/r8168/PKGBUILD
blob: b583690e027e568b13d5ad3ab5e1f2074d09f551 (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
# $Id: PKGBUILD 80376 2012-11-21 09:11:48Z mtorromeo $
# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
# Contributor: Bob Fanger < bfanger(at)gmail >
# Contributor: Filip <fila pruda com>, Det < nimetonmaili(at)gmail >

pkgname=r8168
pkgver=8.034.00
pkgrel=1
pkgdesc="A kernel module for Realtek 8168 network cards"
url="http://www.realtek.com.tw"
license=("GPL")
arch=('i686' 'x86_64')
depends=('glibc' 'linux')
makedepends=('linux-headers')
source=(http://r8168.googlecode.com/files/$pkgname-$pkgver.tar.bz2)
install=$pkgname.install

build() {
	_kernver=$(pacman -Q linux | cut -d . -f 2 | cut -f 1 -d -)
	KERNEL_RELEASE=$(cat /usr/lib/modules/extramodules-3.$_kernver-ARCH/version)

	cd "$pkgname-$pkgver"

	# avoid using the Makefile directly -- it doesn't understand
	# any kernel but the current.
	make -C /usr/lib/modules/$KERNEL_RELEASE/build \
			SUBDIRS="$srcdir/$pkgname-$pkgver/src" \
			EXTRA_CFLAGS="-DCONFIG_R8168_NAPI -DCONFIG_R8168_VLAN" \
			modules
}

package() {
	_kernver=$(pacman -Q linux | cut -d . -f 2 | cut -f 1 -d -)
	depends=("linux>=3.${_kernver}" "linux<3.$(expr ${_kernver} + 1)")
	KERNEL_VERSION=$(cat /usr/lib/modules/extramodules-3.$_kernver-ARCH/version)
	msg "Kernel = $KERNEL_VERSION"

	cd "$pkgname-$pkgver"
	install -Dm644 src/$pkgname.ko "$pkgdir/usr/lib/modules/extramodules-3.$_kernver-ARCH/$pkgname.ko"
	find "$pkgdir" -name '*.ko' -exec gzip -9 {} +

	sed -i "s|extramodules-.*-ARCH|extramodules-3.$_kernver-ARCH|" "$startdir/$pkgname.install"
}

sha256sums=('97f3f342f9f24a3c3346641babde82f52f87b6ef5976c8f4481515f247116206')