Skip to content

Commit

Permalink
Added Ambient Light Sensor packages
Browse files Browse the repository at this point in the history
These were in the AUR but no longer are and I modified them a bit.
  • Loading branch information
floft committed Aug 13, 2015
1 parent a390d70 commit f3834b9
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ all:

clean:
find -mindepth 1 -maxdepth 2 -type d \( -name pkg -o -name src \) -exec rm -rf {} +
find -mindepth 1 -maxdepth 2 -type f \( -name '*.tar.[gx]z' -o -name '*.zip' -o -name '*.bz2' -o -name '*.jar' -o -name '.SRCINFO' \) -delete
find -mindepth 1 -maxdepth 2 -type f \( -name '*.tar.[gx]z' -o -name '*.zip' -o -name '*.bz2' -o -name '*.jar' \) -delete
find -name '*~' -delete
20 changes: 20 additions & 0 deletions als-controller-git/.SRCINFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
pkgbase = als-controller-git
pkgdesc = ASUS Zenbook ambient light sensor userspace controller.
pkgver = 20140521
pkgrel = 1
url = https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller
arch = i686
arch = x86_64
license = Apache
makedepends = git
makedepends = als-driver-git
depends = qt5-base
depends = libbsd
depends = xorg-xbacklight
provides = als-controller
conflicts = als-controller
source = als-controller::git+https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller.git
sha512sums = SKIP

pkgname = als-controller-git

37 changes: 37 additions & 0 deletions als-controller-git/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Maintainer: Teo Mrnjavac <teo@kde.org>

_pkgname=als-controller
pkgname=${_pkgname}-git
pkgver=20140521
pkgrel=1
pkgdesc="ASUS Zenbook ambient light sensor userspace controller."
arch=('i686' 'x86_64')
url="https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller"
license=('Apache')
depends=('qt5-base' 'libbsd' 'xorg-xbacklight')
makedepends=('git' 'als-driver-git')
provides=('als-controller')
conflicts=('als-controller')
source=("${_pkgname}::git+https://github.com/danieleds/Asus-Zenbook-Ambient-Light-Sensor-Controller.git")
sha512sums=('SKIP')

prepare() {
cd ${_pkgname}/example
sed -i 's|/bin/bash|/usr/bin/env bash|;s|"\$DIR"/\.\./service/||' switch.sh
}

build() {
cd ${_pkgname}/service
[[ "$CARCH" = "x86_64" ]] \
&& qmake als-controller.pro -r -spec linux-g++-64 \
|| qmake als-controller.pro -r -spec linux-g++
make
}

package() {
cd $_pkgname
install -Dm644 example/images/active.svg "$pkgdir"/usr/share/als-controller/example/images/active.svg
install -Dm644 example/images/inactive.svg "$pkgdir"/usr/share/als-controller/example/images/inactive.svg
install -Dm755 example/switch.sh "$pkgdir"/usr/share/als-controller/example/switch.sh
install -Dm755 service/${_pkgname} "$pkgdir"/usr/bin/${_pkgname}
}
18 changes: 18 additions & 0 deletions als-driver-git/.SRCINFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
pkgbase = als-driver-git
pkgdesc = ASUS Zenbook ambient light sensor kernel module.
pkgver = r27.569f584
pkgrel = 1
url = https://github.com/danieleds/als
install = als-driver.install
arch = i686
arch = x86_64
license = GPL2
makedepends = git
makedepends = linux-headers
provides = als-driver
conflicts = als-driver
source = als-driver-git::git+https://github.com/danieleds/als
md5sums = SKIP

pkgname = als-driver-git

35 changes: 35 additions & 0 deletions als-driver-git/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Maintainer: Teo Mrnjavac <teo@kde.org>
# Contributor: Garrett <floft.net/contact>
pkgname=als-driver-git
pkgver=r27.569f584
pkgrel=1
pkgdesc="ASUS Zenbook ambient light sensor kernel module."
arch=('i686' 'x86_64')
url="https://github.com/danieleds/als"
license=('GPL2')
makedepends=('git' 'linux-headers')
provides=('als-driver')
conflicts=('als-driver')
install='als-driver.install'

source=("$pkgname::git+https://github.com/danieleds/als")
md5sums=('SKIP')

pkgver() {
cd "$pkgname"
( set -o pipefail
git describe --long | sed -r 's/([^-]*-g)/r\1/;s/-/./g' ||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
)
}

build() {
cd "$srcdir/$pkgname"
make
}

package() {
cd "$srcdir/$pkgname"
local dir="$(basename "$(echo /usr/lib/modules/extramodules-* | tail -n 1)")"
install -Dm644 als.ko "${pkgdir}/usr/lib/modules/${dir}/als.ko"
}
8 changes: 8 additions & 0 deletions als-driver-git/als-driver.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

post_install() {
depmod -a
}

post_remove() {
depmod -a
}

0 comments on commit f3834b9

Please sign in to comment.