summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5e58102543ea8d92a50a9cb16fd9256a9d9b26c4 (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
62
63
64
65
66
67
68
69
# Maintainer: weearc <q19981121@163.com>
pkgname=motrix
_pkgname=Motrix
pkgver=git20190211
_pkgver=1.1.3
pkgrel=2
epoch=
pkgdesc="elegent downloading tool frontend for aria2c,using vue(with personal patches)"
arch=("x86_64")
url="https://github.com/agalwood/Motrix"
license=('MIT')
groups=()
depends=('bash'
	 'tar')
makedepends=('npm'
	     'git')
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=("Motrix.desktop"
	"aria2.conf"
	"Motrix.tar.gz"::"https://github.com/agalwood/Motrix/archive/v1.1.3.tar.gz")
noextract=()
md5sums=('SKIP'
	'SKIP'
	'91bd4a7eee2842e62c7d658a611b1f11')
validpgpkeys=()

prepare() {
	tar -xvf $_pkgname.tar.gz
	rm $_pkgname.tar.gz
	mv $_pkgname-$_pkgver $_pkgname
	npm config set registry 'https://registry.npm.taobao.org'
	export ELECTRON_MIRROR='https://npm.taobao.org/mirrors/electron/'
	export SASS_BINARY_SITE='https://npm.taobao.org/mirrors/node-sass'
	sed -i '/"dmg"/,/"linux"/{//!d}' $_pkgname/package.json
	sed -i '/"dmg"/d' $_pkgname/package.json
	sed -i '/"deb"/d' $_pkgname/package.json
	sed -i '/"snap"/d' $_pkgname/package.json
	sed -i 's/"AppImage"/"dir"/g' $_pkgname/package.json
	
}

build() {
	cd $_pkgname/
	npm install
	npm run build
}
package() {
	install -d ${pkgdir}/opt
	install -d ${pkgdir}/usr/bin
	install -d ${pkgdir}/usr/share/icons
	install -d ${pkgdir}/usr/share/applications
	mv ${srcdir}/$_pkgname/release/linux-unpacked/ ${pkgdir}/opt/motrix
	install -Dm644 ${srcdir}/$_pkgname/build/256x256.png ${pkgdir}/usr/share/icons/$pkgname.png
	echo -e "#!/bin/bash \n /opt/motrix/motrix" >> ${pkgdir}/usr/bin/motrix
	chmod a+x ${pkgdir}/usr/bin/motrix
	install -Dm 644 ${srcdir}/Motrix.desktop ${pkgdir}/usr/share/applications
#	rm ${pkgdir}/opt/motrix/resources/engine/aria2.conf	
	install -Dm 644 ${srcdir}/aria2.conf ${pkgdir}/opt/motrix/resources/engine/aria2.conf
#	ln -s /usr/bin/aria2c ${pkgdir}/opt/motrix/reources/engine/aria2
	rm -rf ${srcdir}
}