PKGBUILD 1.93 KB
Newer Older
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
#
# Core Packages for Chakra, part of chakra-project.org
#
# maintainer abveritas@chakra-project.org

_kver="3.7.3-1-CHAKRA"

pkgname=acpi-call
_pkgname=acpi_call
pkgver=1.0.0
pkgrel=1
pkgdesc="A kernel module that enables you to call parameterless ACPI methods by writing the method name to /proc/acpi/call, e.g. to turn off discrete graphics card in a dual graphics environment (like NVIDIA Optimus)."
arch=('x86_64')
url=("http://github.com/mkottman/acpi_call")
license=('GPL')
depends=('linux>=3.7' 'linux<3.8' 'linux-headers')
makedepends=('git')
provides=('acpi_call')
replaces=('acpi_call')
conflicts=('acpi_call')
install=acpi_call.install
source=("https://github.com/mkottman/acpi_call/archive/v${pkgver}.tar.gz")
md5sums=('3c71239792ddd725d13f7c8d168b4ecf')

build() {
  cd ${srcdir}/$_pkgname-${pkgver}

  make
}
package() {
  cd ${srcdir}/$_pkgname-${pkgver}
  install -d ${pkgdir}/usr/share/$_pkgname 
  install -d ${pkgdir}/usr/bin  
  install -Dm755  ${srcdir}/$_pkgname-${pkgver}/examples/asus1215n.sh \
    ${pkgdir}/usr/share/$_pkgname 
  install -Dm755  ${srcdir}/$_pkgname-${pkgver}/examples/m11xr2.sh \
    ${pkgdir}/usr/share/$_pkgname 
  install -Dm755  ${srcdir}/$_pkgname-${pkgver}/examples/dellL702X.sh \
    ${pkgdir}/usr/share/$_pkgname 
  install -Dm755  ${srcdir}/$_pkgname-${pkgver}/examples/turn_off_gpu.sh \
    ${pkgdir}/usr/share/$_pkgname 
  ln -s /usr/share/$_pkgname/turn_off_gpu.sh  \
    ${pkgdir}/usr/bin/turn_off_gpu.sh 
  install -Dm755  ${srcdir}/$_pkgname-${pkgver}/support/query_dsdt.pl \
    ${pkgdir}/usr/share/$_pkgname-${pkgver}
  cp -R support/windump_hack \
    ${pkgdir}/usr/share/$_pkgname/
  install -Dm644 README.md \
    ${pkgdir}/usr/share/$_pkgname/README.md

    msg2 "Building module for $_kver..."

  # KDIR is necessary even when cleaning
  #make KDIR=/usr/src/linux-${_kver} clean
  make KDIR=/usr/src/linux-${_kver}

  install -D -m644 acpi_call.ko $pkgdir/lib/modules/${_kver}/kernel/drivers/acpi/acpi_call.ko
}