mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-09 14:57:14 +08:00
68 lines
2.1 KiB
Bash
68 lines
2.1 KiB
Bash
#
|
|
# Core Packages for Chakra, part of chakra-project.org
|
|
#
|
|
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
|
|
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
|
|
|
|
# Find the kernel name inside the chroot
|
|
_extramodules=extramodules-`pacman -Q linux-lts | cut -c11-13 | sed 's/linux-lts //g'`-CHAKRA-LTS
|
|
_kver="$(cat /lib/modules/${_extramodules}/version)"
|
|
|
|
pkgname=acpi_call-lts
|
|
pkgver=20120115
|
|
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=('i686' 'x86_64')
|
|
url=("http://github.com/mkottman/acpi_call")
|
|
license=('GPL')
|
|
depends=('linux-lts>=3.0' 'linux-lts<3.1' 'linux-lts-headers')
|
|
makedepends=('git')
|
|
install=acpi_call.install
|
|
source=(http://chakra.sourceforge.net/sources/acpi_call/acpi_call-${pkgver}.tar.xz)
|
|
md5sums=('129841dd806887492609214462792413')
|
|
|
|
|
|
# create tarball: source PKGBUILD && mksource
|
|
|
|
mksource() {
|
|
git clone http://github.com/mkottman/acpi_call.git
|
|
pushd acpi_call
|
|
popd
|
|
tar -cvJf acpi_call-${pkgver}.tar.xz acpi_call/*
|
|
md5sum acpi_call-${pkgver}.tar.xz
|
|
}
|
|
|
|
build() {
|
|
cd ${srcdir}
|
|
|
|
## Build
|
|
rm -rf ${srcdir}/acpi_call-build
|
|
cp -r ${srcdir}/acpi_call ${srcdir}/acpi_call-build
|
|
cd ${srcdir}/acpi_call-build
|
|
|
|
sed \
|
|
-e 's/$(shell uname -r)/3.0-CHAKRA-LTS/g' \
|
|
-i Makefile
|
|
make
|
|
}
|
|
package() {
|
|
cd ${srcdir}/acpi_call-build
|
|
install -d ${pkgdir}/usr/share/acpi_call || return 1
|
|
install -d ${pkgdir}/usr/bin || return 1
|
|
install -d ${pkgdir}/usr/share/acpi_call/doc || return 1
|
|
install -Dm755 ${srcdir}/acpi_call-build/test_off.sh \
|
|
${pkgdir}/usr/share/acpi_call || return 1
|
|
ln -s /usr/share/acpi_call/test_off.sh \
|
|
${pkgdir}/usr/bin/test_off.sh || return 1
|
|
install -Dm644 README \
|
|
${pkgdir}/usr/share/acpi_call/README
|
|
|
|
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/$_extramodules/acpi_call.ko
|
|
}
|