1 # Maintainer: Bob Fanger < bfanger(at)gmail >
2 # Contributors: Filip <fila pruda com>, Det < nimetonmaili(at)gmail >
8 pkgdesc="A kernel module for Realtek 8168 network cards"
9 url="http://www.realtek.com.tw"
11 arch=('i686' 'x86_64')
13 makedepends=('linux-headers')
14 source=(http://r8168.googlecode.com/files/$pkgname-$pkgver.tar.bz2)
15 install=$pkgname.install
16 sha1sums=('22128efb9e8a0b2a90e6c3b9ed912756d591da9e')
18 # Use pacman version numbers. Should only be used with kernels with long version numbers (e.g. -git ones)
19 USE_PACMAN_VERSION="0" # "1" to enable
21 if [ "$USE_PACMAN_VERSION" = "1" ]; then
22 _PACKAGES=`pacman -Qsq linux`
23 _KERNELS=`pacman -Ql $PACKAGES | grep /modules.alias.bin | sed 's/.*\/lib\/modules\/\(.*\)\/modules.alias.bin/\1/g'`
25 _KERNELS=`file /boot/* | grep 'Linux kernel.*boot executable' | sed 's/.*version \([^ ]\+\).*/\1/'`
29 # Loop through all detected kernels
30 for _kernver in $_KERNELS; do
32 cp -R ${pkgname}-${pkgver} ${pkgname}-${pkgver}-${_kernver}
33 cd ${pkgname}-${pkgver}-${_kernver}
34 sed -i -e "s|\$(shell uname -r)|${_kernver}|" src/Makefile #Fix rebuild during major kernel upgrades
35 msg2 "Building module for ${_kernver}"
36 make clean SYSSRC=/usr/src/linux-${_kernver} modules
40 if [ "$USE_PACMAN_VERSION" = "1" ]; then
41 sed 's/USE_PACMAN_VERSION=0/USE_PACMAN_VERSION=1/g' "${startdir}/${pkgname}.install" >/dev/null 2>&1
43 sed 's/USE_PACMAN_VERSION=1/USE_PACMAN_VERSION=0/g' "${startdir}/${pkgname}.install" >/dev/null 2>&1
48 install -d -m755 "${pkgdir}/etc/modprobe.d"
49 # Loop through all detected kernels
50 for _kernver in $_KERNELS; do
51 cd "${srcdir}/${pkgname}-${pkgver}-${_kernver}/src"
52 # Install kernel module
53 install -D -m644 ${pkgname}.ko "${pkgdir}/lib/modules/${_kernver}/kernel/drivers/net/${pkgname}.ko"
54 gzip "${pkgdir}/lib/modules/${_kernver}/kernel/drivers/net/${pkgname}.ko"