summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 33ab5f647d2057acb5f6ad6d96f31b40ce883651 (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
# Maintainer: Pavel Minaev <int19h@gmail.com>
pkgname=kiwix-cli-git
pkgver=0.0.0
pkgrel=2
pkgdesc="Offline reader for Web content. It's especially intended to make Wikipedia available offline."
arch=('i686' 'x86_64')
url="http://www.kiwix.org"
license=('GPL3')
groups=()
depends=('zimlib-git' 'xapian-core' 'libmicrohttpd' 'pugixml' 'ctpp2' 'icu')
makedepends=('git' 'aria2' 'zip' 'python' 'cmake')
provides=('kiwix')
conflicts=('kiwix' 'kiwix-bin')
replaces=()
backup=()
options=()
install=
source=("${pkgname%-git}::git+https://github.com/kiwix/kiwix.git")
noextract=()
md5sums=('SKIP')

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

prepare() {
	cd "$srcdir/${pkgname%-git}"
	
	# Makefile will try to install icons, desktop entries etc for the Kiwix reader,
	# even though it's not built. This will prevent that.
	sed -i '/\tdesktop \\/d' Makefile.am
}

build() {
	cd "$srcdir/${pkgname%-git}"
	./autogen.sh
	./configure --prefix=/usr --sysconfdir=/etc --enable-indexer --enable-searcher --disable-components --disable-launcher --disable-installer HAVE_UPX=0
	make
}

check() {
	cd "$srcdir/${pkgname%-git}"
	make -k check
}

package() {
	cd "$srcdir/${pkgname%-git}"
	make DESTDIR="$pkgdir/" install

	# Makefile "installs" some things that are specifically disabled in the build,
	# including symlinks to missing binaries. Clean that up.
	rm -rf "$pkgdir/usr/lib"
	rm -rf "$pkgdir/usr/share/kiwix"
}