summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 43aee0f2e5d8a9a89c71bc9a0425b97e1019918d (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
# mkspiffs - Tool to build and unpack SPIFFS images
# Maintainer: Martin Thierer <thierer@web.de>
# Contributor: Christian Hammacher <bmasterc@gmail.com>

pkgname=mkspiffs-git
pkgver=0.2.3.r7.f248296
pkgrel=1
pkgdesc="Tool to build and unpack SPIFFS images"
arch=('x86' 'x86_64')
url="https://github.com/igrr/mkspiffs"
license=('MIT')
depends=('gcc-libs')
makedepends=('git' 'gcc')
provides=("mkspiffs")
conflicts=("mkspiffs")
source=(
	'git+https://github.com/igrr/mkspiffs.git'
	'git+https://github.com/pellepl/spiffs.git')
md5sums=('SKIP'
         'SKIP')

# Handle submodule as of
# https://wiki.archlinux.org/index.php/VCS_package_guidelines#Git_Submodules
prepare() {
	cd $srcdir/mkspiffs
	git submodule init
	git config submodule.spiffs.url $srcdir/spiffs
	git -c protocol.file.allow=always submodule update
}

pkgver() {
	cd "$srcdir/mkspiffs"
	printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}

build() {
	cd "$srcdir/mkspiffs"
	make clean
	make dist CPPFLAGS="-DSPIFFS_OBJ_META_LEN=4" BUILD_CONFIG_NAME=-custom
}

check() {
	cd "$srcdir/mkspiffs"
	make test
}

package() {
	# This package provides only a single executable
	install -D -m755 $srcdir/mkspiffs/mkspiffs $pkgdir/usr/bin/mkspiffs
	install -D -m644 $srcdir/mkspiffs/LICENSE.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE
}