summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorwangjiezhe2015-12-21 17:01:27 +0800
committerwangjiezhe2015-12-21 17:01:27 +0800
commitca220c4ac349c1abbae71e5dd01f1a3757b7876c (patch)
treea0799117fc6171003a1a0e9567632fb10e189e10 /PKGBUILD
downloadaur-ca220c4ac349c1abbae71e5dd01f1a3757b7876c.tar.gz
Initial import
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD45
1 files changed, 45 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..de94f8cbd055
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,45 @@
+# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
+# Contributor: Bob Fanger < bfanger(at)gmail >
+# Contributor: Filip <fila pruda com>, Det < nimetonmaili(at)gmail >
+# PF ver : wangjiezhe <wangjiezhe AT yandex DOT com>
+
+_pkgname=r8168
+pkgname=r8168-pf
+pkgver=8.041.00
+pkgrel=1
+pkgdesc="A kernel module for Realtek 8168 network cards(pf kernel)"
+url="http://www.realtek.com.tw"
+license=("GPL")
+arch=('i686' 'x86_64')
+depends=('glibc' 'linux-pf')
+makedepends=('linux-pf-headers')
+install=$_pkgname.install
+source=("$_pkgname-$pkgver.tar.gz"::"https://github.com/mtorromeo/r8168/archive/$pkgver.tar.gz")
+sha256sums=('d56f60e4157ccbf8f8717270b1acb391b0a959d9a96c2f0b4a91c683aa8b83a5')
+
+build() {
+ _kernver=$(pacman -Q linux-pf | sed -r 's#.* ([0-9]+\.[0-9]+).*#\1#')
+ KERNEL_VERSION=$(cat /usr/lib/modules/extramodules-$_kernver-pf/version)
+
+ cd "$_pkgname-$pkgver"
+
+ # avoid using the Makefile directly -- it doesn't understand
+ # any kernel but the current.
+ make -C /usr/lib/modules/$KERNEL_VERSION/build \
+ SUBDIRS="$srcdir/$_pkgname-$pkgver/src" \
+ EXTRA_CFLAGS="-DCONFIG_R8168_NAPI -DCONFIG_R8168_VLAN" \
+ modules
+}
+
+package() {
+ _kernver=$(pacman -Q linux-pf | sed -r 's#.* ([0-9]+\.[0-9]+).*#\1#')
+ depends=("linux-pf>=$_kernver" "linux-pf<${_kernver/.*}.$(expr ${_kernver/*.} + 1)")
+ KERNEL_VERSION=$(cat /usr/lib/modules/extramodules-$_kernver-pf/version)
+ msg "Kernel = $KERNEL_VERSION"
+
+ cd "$_pkgname-$pkgver"
+ install -Dm644 src/$_pkgname.ko "$pkgdir/usr/lib/modules/extramodules-$_kernver-pf/$_pkgname.ko"
+ find "$pkgdir" -name '*.ko' -exec gzip -9 {} +
+
+ sed -i "s|extramodules-.*-pf|extramodules-$_kernver-pf|" "$startdir/$_pkgname.install"
+}