PKGBUILD 2.04 KB
Newer Older
1
#
Manuel Tortosa's avatar
Manuel Tortosa committed
2
# Core Packages for Chakra, part of chakra-project.org
3 4 5 6
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>

7 8
# Find the kernel name inside the chroot
_kernver=`pacman -Qf kernel26 | cut -c10-15 | sed 's/kernel26 //g'`-CHAKRA
Manuel Tortosa's avatar
Manuel Tortosa committed
9

10
pkgname=acpi_call
philm's avatar
philm committed
11
pkgver=20110519
12
pkgrel=3
13 14 15 16
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=('i686' 'x86_64')
url=("http://github.com/mkottman/acpi_call")
license=('GPL')
philm's avatar
philm committed
17
depends=('kernel26>=2.6.39' 'kernel26<2.6.40' 'kernel26-headers')
18 19 20
makedepends=('git')
install=acpi_call.install
source=(http://chakra-project.org/sources/${pkgname}/${pkgname}-${pkgver}.tar.xz)
philm's avatar
philm committed
21
md5sums=('17cf78a818b370666d90318ed9dd6741')
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41


# create tarball: source PKGBUILD && mksource

mksource() {
  git clone http://github.com/mkottman/acpi_call.git
  pushd acpi_call
  popd
  tar -cvJf ${pkgname}-${pkgver}.tar.xz acpi_call/*
  md5sum ${pkgname}-${pkgver}.tar.xz
}

build() {
  cd ${srcdir}

 ## Build
  rm -rf ${srcdir}/$pkgname-build
  cp -r ${srcdir}/$pkgname ${srcdir}/$pkgname-build
  cd ${srcdir}/$pkgname-build

42
  sed \
philm's avatar
philm committed
43
    -e  's/$(shell uname -r)/2.6.39-CHAKRA/g' \
44
    -i Makefile
45 46 47 48 49 50 51 52 53 54 55 56 57 58
  make
}
package() {
  cd ${srcdir}/$pkgname-build
  install -d ${pkgdir}/usr/share/$pkgname || return 1
  install -d ${pkgdir}/usr/bin || return 1
  install -d ${pkgdir}/usr/share/$pkgname/doc || return 1
  cp -a  ${srcdir}/$pkgname-build/test_off.sh \
    ${pkgdir}/usr/share/$pkgname || return 1
  ln -s /usr/share/$pkgname/test_off.sh \
    ${pkgdir}/usr/bin/test_off.sh || return 1
  install -Dm644 README \
    ${pkgdir}/usr/share/$pkgname/README

59
  msg2 "Building module for $_kernver..."
60

61 62 63
  # KDIR is necessary even when cleaning
  make KDIR=/usr/src/linux-${_kernver} clean
  make KDIR=/usr/src/linux-${_kernver}
64

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