summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6f60c16e068f4f2223d0af258c07c605c541ac83 (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
# Maintainer: not_anonymous <nmlibertarian@gmail.com>

pkgname=kochmorse-git
_pkgname=kochmorse
pkgver=3.1.0
pkgrel=1
pkgdesc="A simple morse tutor using the Koch method - GIT version."
arch=('i686' 'x86_64')
url="https://github.com/hmatuschek/kochmorse"
license=('GPL')
depends=('qt5-svg' 'portaudio' 'libxkbcommon-x11' 'desktop-file-utils')
makedepends=('cmake' 'git')
provides=('kochmorse')
conflicts=('kochmorse')
install=$_pkgname.install

_gitroot=https://github.com/hmatuschek/kochmorse.git
_gitname=master

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

prepare() {
	cd "$srcdir"
	msg "Connecting to GIT server...."

	if [[ -d "$_gitname" ]]; then
		cd "$_gitname" && git pull origin
		msg "The local files are updated."
	else
 		git clone "$_gitroot" "$_gitname"
	fi

	msg "GIT checkout done or server timeout"
	msg "Starting build..."

	rm -rf "$srcdir/$_gitname-build"
	git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
}

build() {
	cd "$srcdir/${_gitname}-build"
	msg "Starting build..."

	cmake -DCMAKE_INSTALL_PREFIX=/usr
	make
}

package() {
	cd "$srcdir/$_gitname-build"
	msg "Starting packaging..."

	make DESTDIR="$pkgdir/" install
}