summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: eee3c7839026ca416da228a6023782dbb03d7597 (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
70
71
72
73
#Maintainer: weearc <q19981121@163.com>
pkgname=motrix
_pkgname=Motrix
pkgver=v1.3.8
_pkgver=1.3.8
pkgrel=1
epoch=
pkgdesc="elegent downloading tool frontend for aria2c,using vue(release version)"
arch=("x86_64")
url="https://github.com/agalwood/Motrix"
license=('MIT')
groups=()
depends=('bash'
	 'tar'
	 'fakeroot')
makedepends=('curl'
	     'yarn'
	     'npm')
checkdepends=()
optdepends=()
provides=()
conflicts=('motrix-git')
replaces=()
backup=()
options=()
install=
changelog=
source=("Motrix.desktop"
	"aria2.conf"
	"motrix"
	"Motrix.tar.gz"::"https://github.com/agalwood/Motrix/archive/v$_pkgver.tar.gz")
noextract=()
sha256sums=('1b799d1b1e280a27ff625cceb429b1e00c6691eb0256ded44f6a1a0310a899d4'
	'1dc0dd1949e086aabf393a4f53fd290dce7bebdcfa958919f8673bdce9c9b57d'
	'ec66063afe506835730f6ba4be55d4aa150b9b587a4d0246c307433fcae1a49d'
	'340863d23dd6ce4eebcbbb9bb396ad497e2eab1bb7bf7d1b33ef501002154e93')
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 '/"pacman"/d' $_pkgname/package.json
	sed -i '/"rpm"/d' $_pkgname/package.json
	sed -i 's/"AppImage"/"dir"/g' $_pkgname/package.json

}

build() {
	cd $_pkgname/
	yarn
 	yarn 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
	install -Dm 777 ${srcdir}/motrix ${pkgdir}/usr/bin
	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
	rm -rf ${srcdir}
}