summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7bff22593b7fc7fcf7c41bdbf4c5e0492a906637 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Maintainer: eomanis at web dot de

_appname='freetz-tools'
pkgname="${_appname}-git"
pkgver=r14389.b8cb05c9e
pkgrel=1
pkgdesc="Development tools of the Freetz project"
arch=('x86_64')
url='https://freetz.github.io/'
license=('GPL2')
depends=('sed')
makedepends=('git')
conflicts=("$_appname")
provides=("$_appname")
source=("${_appname}::git+https://github.com/Freetz/freetz.git")
sha384sums=('SKIP')

build() {
	
	cd "$srcdir"/"$_appname"
	make tools
}

pkgver() {
	
	cd "$srcdir"/"$_appname"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
	local binaries=()
	
	# Make a haphazard list of various binaries and scripts that look
	# useful
	binaries+=(avm-rle-decode)
	binaries+=(avm-rle-stream-length)
	binaries+=(bzimage2eva)
	binaries+=(eva2bzimage)
	binaries+=(eva2lzma)
	binaries+=(imagename2id)
	binaries+=(lzma2eva)
	binaries+=(mksquashfs2-lzma)
	binaries+=(mksquashfs3-multi)
	binaries+=(mksquashfs4-avm-be)
	binaries+=(mksquashfs4-avm-le)
	binaries+=(remove-nmi-vector)
	binaries+=(sfk)
	binaries+=(unsquashfs3-multi)
	binaries+=(unsquashfs4-avm-be)
	binaries+=(unsquashfs4-avm-le)
	
	cd -- "$srcdir"/"$_appname"/tools
	
	# Copy the binaries to /usr/bin
	mkdir --parents -- "${pkgdir}/usr/bin"
	cp --target "${pkgdir}/usr/bin" --no-dereference --preserve=links -- "${binaries[@]}"
	
	# Set the file permissions
	cd -- "${pkgdir}/usr/bin"
	chmod u=rwx,go=rx -- "${binaries[@]}"
}