# Maintainer: Andreas Kemnade <andreas@kemnade.info>
pkgname=kobo-epdc-extractor
pkgver=1.0
pkgrel=1
pkgdesc="Extractor for waveform on the kobo devices"
arch="armv7"
license="MIT"
url="https://postmarketos.org"
install="$pkgname.post-install"
source="
	kobo-firmware-extractor-1.0.tar.gz::https://github.com/akemnade/kobo-firmware-extractor/archive/refs/tags/1.0.tar.gz
	start-epd.sh
	kobo-epdc-extractor.files
	extract-waveform.initd
	"
builddir="$srcdir"/kobo-firmware-extractor-1.0

build() {
	make
}

package() {
	make DESTDIR="$pkgdir" install
	touch kobo-epdc-extractor
	# we need it in case we want to do use a graphical display unlock
	install -Dm644 kobo-epdc-extractor -t \
		"$pkgdir"/usr/share/mkinitfs-triggers

	install -Dm644 "$srcdir"/start-epd.sh \
		"$pkgdir"/usr/share/mkinitfs/hooks/80-start-epd.sh

	install -Dm644 "$srcdir"/kobo-epdc-extractor.files \
		"$pkgdir"/usr/share/mkinitfs/files/01-kobo-epdc-extractor.files
	install -Dm755 "$srcdir"/extract-waveform.initd "$pkgdir"/etc/init.d/extract-waveform
}

sha512sums="
2e44387b1275902f296ce77efd18b4759487891b28cb6b88477f44cd21ac6bc81b23c8d3016f81fe926bf87750b588d621fc1c36ca477dce42d3150f0b010953  kobo-firmware-extractor-1.0.tar.gz
d008a75fb6ae229e1257af517e741717611cb2bc9cd11ab736f9e066493986cf4a6199854deaf90a1e8c91cbc02e7f79b2cf67ccd92ba110290d4af0b5c5f8ef  start-epd.sh
c71bf714bd05f9c4c2724fc855b90f5a7fa4c1014ff41f16a07a91e791ada67fede5b92536e22ef3634724a881492fa4151b1fb8060561e1bea2a2f960ba794e  kobo-epdc-extractor.files
380a131085f50c1a5a80504368c943f3a9372c21ef9dc7fab74eccfc03795652f65a5f4dcf436930f316ba03ad13472e9bc4bfc045f5f0acdb1b94cb0bb5d687  extract-waveform.initd
"
