summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO26
-rw-r--r--Motrix.desktop11
-rw-r--r--PKGBUILD131
-rwxr-xr-xaria2.conf113
-rwxr-xr-xmotrix7
5 files changed, 48 insertions, 240 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d7cb07d07a3..4113ee1d3a6 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,33 +1,15 @@
pkgbase = motrix
pkgdesc = elegent downloading tool frontend for aria2c,using vue(release version)
- pkgver = v1.4.1
+ pkgver = 1.4.1
pkgrel = 1
url = https://github.com/agalwood/Motrix
arch = x86_64
license = MIT
- makedepends = curl
- makedepends = yarn
makedepends = npm
- depends = bash
- depends = tar
- depends = fakeroot
- depends = glibc
- depends = glib2
- depends = nss
- depends = nspr
- depends = gtk3
- depends = pango
- depends = atk
- depends = nettle
- depends = libxcb
+ depends = electron4
+ depends = aria2
conflicts = motrix-git
- source = Motrix.desktop
- source = aria2.conf
- source = motrix
- source = Motrix.tar.gz::https://github.com/agalwood/Motrix/archive/v1.4.1.tar.gz
- sha256sums = 1b799d1b1e280a27ff625cceb429b1e00c6691eb0256ded44f6a1a0310a899d4
- sha256sums = 1dc0dd1949e086aabf393a4f53fd290dce7bebdcfa958919f8673bdce9c9b57d
- sha256sums = ec66063afe506835730f6ba4be55d4aa150b9b587a4d0246c307433fcae1a49d
+ source = https://github.com/agalwood/Motrix/archive/v1.4.1.tar.gz
sha256sums = cd10cd5c704f0d780ff501e2861a316b95c44d11b653045574ae07b9a3ccaa8b
pkgname = motrix
diff --git a/Motrix.desktop b/Motrix.desktop
deleted file mode 100644
index 03dc1cb45e4..00000000000
--- a/Motrix.desktop
+++ /dev/null
@@ -1,11 +0,0 @@
-[Desktop Entry]
-Name=Motrix
-Comment=download manager
-Keywords=
-Exec=/usr/bin/motrix
-TryExec=
-Terminal=false
-Icon=/usr/share/icons/motrix.png
-Type=Application
-StartupNotify=false
-Categories=Network;FileTransfer;
diff --git a/PKGBUILD b/PKGBUILD
index 3db0e0759f9..8fd3c905d1d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,102 +1,59 @@
#Maintainer: weearc <q19981121@163.com>
pkgname=motrix
-_pkgname=Motrix
-pkgver=v1.4.1
-_pkgver=1.4.1
+pkgver=1.4.1
pkgrel=1
-epoch=
pkgdesc="elegent downloading tool frontend for aria2c,using vue(release version)"
-arch=("x86_64")
+arch=('x86_64')
url="https://github.com/agalwood/Motrix"
license=('MIT')
-groups=()
-depends=('bash'
- 'tar'
- 'fakeroot'
- 'glibc'
- 'glib2'
- 'nss'
- 'nspr'
- 'gtk3'
- 'pango'
- 'atk'
- 'nettle'
- 'libxcb'
- )
-makedepends=('curl'
- 'yarn'
- 'npm')
-checkdepends=()
-optdepends=()
-provides=()
+depends=('electron4' 'aria2')
+makedepends=('npm')
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'
- 'cd10cd5c704f0d780ff501e2861a316b95c44d11b653045574ae07b9a3ccaa8b')
-validpgpkeys=()
-prepare() {
- tar -xvf $_pkgname.tar.gz
- rm $_pkgname.tar.gz
- mv $_pkgname-$_pkgver $_pkgname
- echo "====================================="
- echo "Finding if you are in China..."
- curl myip.ipip.net | grep -i "中国"
- if [ $? -eq 0 ]
- then
- echo "Yes,I'm sure you are in China."
- echo "To speed up installation I'll change npm mirrors to Taobao."
- 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'
- else
- curl myip.ipip.net | grep -i "China"
- if [ $? -eq 0 ]
- then
- echo "Yes,I'm sure you are in China."
- echo "To speed up installation I'll change npm mirrors to Taobao."
- 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'
- fi
- fi
- echo "======================================"
- 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
+source=("https://github.com/agalwood/Motrix/archive/v$pkgver.tar.gz")
+
+sha256sums=('cd10cd5c704f0d780ff501e2861a316b95c44d11b653045574ae07b9a3ccaa8b')
+prepare() {
+ sed -i 's/"postinstall"/"ignore"/' "$srcdir/Motrix-$pkgver/package.json"
}
build() {
- cd $_pkgname/
- yarn
- yarn run build
+ cd "$srcdir/Motrix-$pkgver"
+ npm_config_cache="$srcdir/npm_cache" npm install
+ npm run pack
+ npm prune --production
}
+
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}
+ # makedir
+ mkdir -p "$pkgdir/usr/bin"
+ mkdir -p "$pkgdir/usr/lib/motrix"
+ mkdir -p "$pkgdir/usr/share/applications"
+ # install aria2
+ install -Dm644 "$srcdir/Motrix-$pkgver/extra/linux/engine/aria2.conf" "$pkgdir/usr/lib/motrix/engine/aria2.conf"
+ ln -sf /usr/bin/aria2c "$pkgdir/usr/lib/motrix/engine/aria2c"
+ # install js
+ cp -r "$srcdir/Motrix-$pkgver/dist" "$pkgdir/usr/lib/motrix/app"
+ cp -r "$srcdir/Motrix-$pkgver/node_modules" "$pkgdir/usr/lib/motrix/app/node_modules"
+ echo '{"name":"Motrix","version":"v'$pkgver'","main":"./electron/main.js"}' > "$pkgdir/usr/lib/motrix/app/package.json"
+ # icon
+ install -Dm644 "$srcdir/Motrix-$pkgver/static/512x512.png" "$pkgdir/usr/share/icons/hicolor/512x512/apps/motrix.png"
+ # launch script
+ echo "#!/bin/bash
+export ELECTRON_IS_DEV=0
+exec /usr/bin/electron /usr/lib/motrix/app
+ " > "$pkgdir/usr/bin/motrix"
+ chmod +x "$pkgdir/usr/bin/motrix"
+ # desktop file
+ echo "[Desktop Entry]
+Name=Motrix
+Comment=A full-featured download manager.
+Exec=/usr/bin/motrix
+Icon=motrix
+Type=Application
+Categories=Network;FileTransfer;
+MimeType=application/x-bittorrent;x-scheme-handler/mo;x-scheme-handler/motrix;x-scheme-handler/magnet;x-scheme-handler/thunder;
+Categories=Network;
+ " > "$pkgdir/usr/share/applications/motrix.desktop"
}
diff --git a/aria2.conf b/aria2.conf
deleted file mode 100755
index 08f7c4485ed..00000000000
--- a/aria2.conf
+++ /dev/null
@@ -1,113 +0,0 @@
-dir=~/Download
-# 启用磁盘缓存, 0为禁用缓存, 需1.16以上版本, 默认:16M
-disk-cache=32M
-# 文件预分配方式, 能有效降低磁盘碎片, 默认:prealloc
-# 预分配所需时间: none < falloc ? trunc < prealloc
-# falloc和trunc则需要文件系统和内核支持
-# NTFS建议使用falloc, EXT3/4建议trunc, MAC 下需要注释此项
-file-allocation=none
-# 断点续传
-continue=true
-
-## 下载连接相关 ##
-
-# 最大同时下载任务数, 运行时可修改, 默认:5
-#max-concurrent-downloads=5
-# 同一服务器连接数, 添加时可指定, 默认:1
-#max-connection-per-server=5
-# 最小文件分片大小, 添加时可指定, 取值范围1M -1024M, 默认:20M
-# 假定size=10M, 文件为20MiB 则使用两个来源下载; 文件为15MiB 则使用一个来源下载
-min-split-size=10M
-# 单个任务最大线程数, 添加时可指定, 默认:5
-split=5
-# 整体下载速度限制, 运行时可修改, 默认:0
-#max-overall-download-limit=0
-# 单个任务下载速度限制, 默认:0
-#max-download-limit=0
-# 整体上传速度限制, 运行时可修改, 默认:0
-#max-overall-upload-limit=0
-# 单个任务上传速度限制, 默认:0
-#max-upload-limit=0
-# 禁用IPv6, 默认:false
-disable-ipv6=true
-# 连接超时时间, 默认:60
-timeout=60
-# 最大重试次数, 设置为0表示不限制重试次数, 默认:5
-max-tries=3
-# 设置重试等待的秒数, 默认:0
-retry-wait=0
-
-## 进度保存相关 ##
-
-# 从会话文件中读取下载任务
-input-file=/var/cache/aria2.session
-# 在Aria2退出时保存`错误/未完成`的下载任务到会话文件
-save-session=/var/cache/aria2.session
-# 定时保存会话, 0为退出时才保存, 需1.16.1以上版本, 默认:0
-save-session-interval=0
-
-## RPC相关设置 ##
-
-# 启用RPC, 默认:false
-enable-rpc=true
-# 允许所有来源, 默认:false
-rpc-allow-origin-all=
-# 允许非外部访问, 默认:false
-rpc-listen-all=true
-# 事件轮询方式, 取值:[epoll, kqueue, port, poll, select], 不同系统默认值不同
-#event-poll=select
-# RPC监听端口, 端口被占用时可以修改, 默认:6800
-#rpc-listen-port=6800
-# 设置的RPC授权令牌, v1.18.4新增功能, 取代 --rpc-user 和 --rpc-passwd 选项
-#rpc-secret=<TOKEN>
-# 设置的RPC访问用户名, 此选项新版已废弃, 建议改用 --rpc-secret 选项
-#rpc-user=<USER>
-# 设置的RPC访问密码, 此选项新版已废弃, 建议改用 --rpc-secret 选项
-#rpc-passwd=<PASSWD>
-# 是否启用 RPC 服务的 SSL/TLS 加密,
-# 启用加密后 RPC 服务需要使用 https 或者 wss 协议连接
-#rpc-secure=true
-# 在 RPC 服务中启用 SSL/TLS 加密时的证书文件,
-# 使用 PEM 格式时,您必须通过 --rpc-private-key 指定私钥
-#rpc-certificate=/path/to/certificate.pem
-# 在 RPC 服务中启用 SSL/TLS 加密时的私钥文件
-#rpc-private-key=/path/to/certificate.key
-
-## BT/PT下载相关 ##
-
-# 当下载的是一个种子(以.torrent结尾)时, 自动开始BT任务, 默认:true
-follow-torrent=true
-# BT监听端口, 当端口被屏蔽时使用, 默认:6881-6999
-listen-port=51413
-# 单个种子最大连接数, 默认:55
-#bt-max-peers=55
-# 打开DHT功能, PT需要禁用, 默认:true
-enable-dht=false
-# 打开IPv6 DHT功能, PT需要禁用
-#enable-dht6=false
-# DHT网络监听端口, 默认:6881-6999
-dht-listen-port=6881-6999
-# 本地节点查找, PT需要禁用, 默认:false
-#bt-enable-lpd=false
-# 种子交换, PT需要禁用, 默认:true
-enable-peer-exchange=false
-# 每个种子限速, 对少种的PT很有用, 默认:50K
-bt-request-peer-speed-limit=50K
-# 客户端伪装, PT需要
-peer-id-prefix=-TR2770-
-user-agent=Transmission/2.77
-user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0
-# 当种子的分享率达到这个数时, 自动停止做种, 0为一直做种, 默认:1.0
-seed-ratio=0
-# 强制保存会话, 即使任务已经完成, 默认:false
-# 较新的版本开启后会在任务完成后依然保留.aria2文件
-force-save=true
-# BT校验相关, 默认:true
-#bt-hash-check-seed=true
-# 继续之前的BT任务时, 无需再次校验, 默认:false
-bt-seed-unverified=true
-# 保存磁力链接元数据为种子文件(.torrent文件), 默认:false
-bt-save-metadata=true
-# bt-tracker数据来自https://github.com/ngosang/trackerslist/blob/master/trackers_best.txt
-
-bt-tracker=udp://tracker.coppersurfer.tk:6969/announce,udp://tracker.opentrackr.org:1337/announce,udp://tracker.internetwarriors.net:1337/announce,udp://9.rarbg.to:2710/announce,udp://exodus.desync.com:6969/announce,udp://tracker2.itzmx.com:6961/announce,udp://tracker1.itzmx.com:8080/announce,udp://explodie.org:6969/announce,http://tracker.tfile.me:80/announce.php,http://tracker.tfile.me:80/announce,http://tracker.tfile.co:80/announce,http://peersteers.org:80/announce,udp://tracker.tiny-vps.com:6969/announce,udp://ipv4.tracker.harry.lu:80/announce,udp://denis.stalker.upeer.me:6969/announce,udp://tracker.torrent.eu.org:451/announce,udp://tracker.port443.xyz:6969/announce,udp://tracker.cyberia.is:6969/announce,udp://thetracker.org:80/announce,udp://retracker.lanta-net.ru:2710/announce
diff --git a/motrix b/motrix
deleted file mode 100755
index 79d467bbd06..00000000000
--- a/motrix
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-if [[ ! -f "/var/cache/aria2.session" ]]
-then
- touch /var/cache/aria2.session;
- chmod 666 /var/cache/aria2.session;
-fi
-exec /opt/motrix/motrix