summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: aa886760dba62576cec2be64d9562a55f0dfd8a2 (plain)
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
# Maintainer: deusstultus <deusstultus@gmail.com>
# Contributor: Vlad M. <vlad@archlinux.net>
# Contributor: Limao Luo <luolimao+AUR@gmail.com>
# Contributor: Gadget3000 <gadget3000@msn.com>
# Contributor: CaptainShanks <captainshanks@archlinux.us>

pkgname=xflux
pkgver=20130901
pkgrel=5
pkgdesc="(f.lux for X) Changes monitor color temperature adaptively to ease eye strain (command-line version)"
arch=('i686' 'x86_64')
url="https://justgetflux.com/"
license=('custom')
depends=('libxxf86vm' 'libxrandr')
depends_x86_64=('gcc-libs')
source=('f.lux-eula.txt' 'f.lux-eula.html::https://justgetflux.com/news/pages/eula/index.html')
source_i686=('https://justgetflux.com/linux/xflux-pre.tgz')
source_x86_64=('https://justgetflux.com/linux/xflux64.tgz')
sha256sums=('05b1edc619263941960f37ebce2cf63baabdd5959a287b52b6829b7195d20653'
            'SKIP') #Verified through prepare() rather than sums as websites change
sha256sums_i686=('fda5d10c3ca16ba38eddc5fbdecebeccd607c4c95787b4379d1ab372760877b4')
sha256sums_x86_64=('cc50158fabaeee58c331f006cc1c08fd2940a126e99d37b76c8e878ef20c2021')

#EULA compliance
prepare() {
		#build and compare license from fetched html
		echo f.lux End User License Agreement > license_verify
    
		awk < f.lux-eula.html '/div id="post"/,/<\/div>/' | sed -e 's/<[^>]*>//g' -e 's/^ *//' >> license_verify
		if [ "$(md5sum license_verify|cut -c1-32)" != "$(md5sum f.lux-eula.txt|cut -c1-32)" ]
		  then 
			  echo "Downloaded license does not match that cached in package, aborting."
				return 1
		fi	
    echo 'Download of this software requires agreement with EULA at https://justgetflux.com/news/pages/eula/index.html'
}

package() {
    install -Dm775 $pkgname "$pkgdir"/usr/bin/$pkgname
    install -Dm644 f.lux-eula.html "$pkgdir"/usr/share/licenses/$pkgname/f.lux-eula.html
    install -Dm644 f.lux-eula.txt "$pkgdir"/usr/share/licenses/$pkgname/f.lux-eula.txt
}