aboutsummaryrefslogtreecommitdiffstats
path: root/testing/mwoffliner/APKBUILD
blob: 391e4ddf77e1f3b2a4485a4b2d5f469426efa21b (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
# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=mwoffliner
pkgver=1.9.12
pkgrel=0
pkgdesc="Scrape any online Mediawiki motorised wiki to your local filesystem"
url="https://github.com/openzim/mwoffliner"
arch="x86_64"
license="GPL-3.0-or-later"
options="!check" # no test suite from upstream
depends="nodejs-npm redis libc6-compat"
makedepends="python2 autoconf automake chrpath libjpeg-turbo-dev nasm zlib-dev
	libzim-dev bash"
subpackages="$pkgname-doc"
source="mwoffliner-$pkgver.tar.gz::https://github.com/openzim/mwoffliner/archive/v$pkgver.tar.gz"

build() {
	npm install
}

check() {
	npm test
}

package() {
	install -d "$pkgdir"/usr/share/doc/$pkgname "$pkgdir"/usr/lib/node_modules/$pkgname
	cp -a lib node_modules package*.json "$pkgdir"/usr/lib/node_modules/$pkgname
	ln -s /usr/lib/node_modules/$pkgname/bin/$pkgname "$pkgdir"/usr/lib/node_modules/$pkgname

	install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"

	# Strip all the rpath that include /home
	local scandir="$pkgdir"/usr/lib/node_modules/mwoffliner/node_modules/@openzim/libzim/
	scanelf --recursive --rpath --etype ET_DYN "$scandir" | \
		awk '/home/{print $3;}' | xargs chrpath --delete
}

sha512sums="fd6a16beb045837eb3f21720842e0e40e5fa01943a7861ae7dde02b071360130bf0b523a8e8ae324e2e8469857ccab0d46554e53d9387f2d715be47ec51ebc09  mwoffliner-1.9.12.tar.gz"