From bd9486baa752a9bc925e40f01cdac4497250468c Mon Sep 17 00:00:00 2001 From: ektor5 Date: Thu, 2 Apr 2015 18:01:37 +0200 Subject: [PATCH] PKGBUILD improved, systemd unit starts after resume PKGBUILD more Arch-compliant, don't install useless thing --- PKGBUILD | 26 +++++++------------------- init-headphone.service | 8 ++++---- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 965f6ac..4a2857c 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,43 +1,31 @@ # Maintainer: Ettore Chimenti pkgname="init-headphone" pkgver="0.2.0" -pkgrel=1 +pkgrel=2 epoch= pkgdesc="Re-enables headphone jack after sleep/suspend resume on VIA VT1802" arch=("any") url="https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1313904/" license=('GPL') -groups=() depends=("dmidecode" "python2-smbus" "python") -makedepends=() -checkdepends=() -optdepends=() -provides=() -conflicts=() -replaces=() -backup=() -options=() install=init-headphone.install -changelog= source=("https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1313904/+attachment/4361090/+files/${pkgname}_${pkgver}_all.deb" "init-headphone.service" - "init-headphone.install" - ) + "init-headphone.install") noextract=() md5sums=('37c830340c4ca077271a04b4436ea8fc' - '8eaf6ff36bfe0927aec5677cb17fbbcc' + 'ad3ad6f4c9157035fd7a9dd2e82184c2' 'a47855a948f9684ea69db75f2cdd7398') validpgpkeys=() package() { + tar -xf data.tar.xz - tar -xf data.tar.xz -C $pkgdir + install -Dm 755 usr/sbin/init-headphone $pkgdir/usr/bin/init-headphone - mv $pkgdir/usr/{s,}bin - rm -r $pkgdir/etc/init + install -Dm 755 {,$pkgdir/}etc/modules-load.d/init-headphone.conf - mkdir -p $pkgdir/etc/systemd/system - cp init-headphone.service $pkgdir/etc/systemd/system + install -Dm 755 init-headphone.service $pkgdir/usr/lib/systemd/system/init-headphone.service } diff --git a/init-headphone.service b/init-headphone.service index a4fe290..4133fcc 100644 --- a/init-headphone.service +++ b/init-headphone.service @@ -1,11 +1,11 @@ [Unit] Description=Reactivate headphones after sleep -After=sleep.target +After=suspend.target [Service] -Type=oneshot -ExecStart=/usr/sbin/init-headphone +Type=simple +ExecStart=/usr/bin/init-headphone [Install] -WantedBy=sleep.target +WantedBy=suspend.target