summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhanghua0002021-09-24 21:38:00 +0800
committerzhanghua0002021-09-24 21:38:00 +0800
commit3e91081e866c6dfaedaf0f3b05e995798aa84294 (patch)
tree1cbd20b6512efa35300aa74e4e0248aa156d1026
parentafb2dbf3b09e16f9ec85d75eddeb5b52ae44cfd1 (diff)
downloadaur-3e91081e866c6dfaedaf0f3b05e995798aa84294.tar.gz
Add automatic script to finish installing
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD9
-rw-r--r--aria2cd-install27
-rwxr-xr-xnotify-user3
4 files changed, 39 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index fa6e373c89f7..6d09d048f75b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,18 +1,20 @@
pkgbase = aria2cd
pkgdesc = A systemd Service to start aria2 automatically.
- pkgver = 1.0
- pkgrel = 8
+ pkgver = 1.1
+ pkgrel = 1
url = https://aur.archlinux.org/aria2cd.git
arch = any
license = custom:WTFPL
depends = aria2
depends = systemd
source = notify-user
+ source = aria2cd-install
source = aria2cd.hook
source = aria2.conf
source = aria2@.service
source = LICENSE::http://www.wtfpl.net/txt/copying
sha256sums = 6cde5c3c4877fff8d7804ae958ab3cc6dad366e4275f757b0f7f146427450f8d
+ sha256sums = 85436b68fac425bd33fdcc966910782b618e5303dda0d68c1d23f26f9eea8279
sha256sums = 182b39e8f4f9cc979aa9cbaebbbb88298f009bfdb1c0bcb2d44fa538ff9fe73c
sha256sums = a075c9b90a4732ea7fb332e81ad50244e778977ec028a56ae0b29f895fd7db87
sha256sums = c863595990e32eb41aa76fd55d151acb04cee401fcf219d4e418b96fdc1468b2
diff --git a/PKGBUILD b/PKGBUILD
index 3718623f1e56..6d26ee2cf0ee 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,8 +1,8 @@
# Maintainer ZhangHua<zhanghua.00@qq.com>
pkgname=aria2cd
-pkgver=1.0
-pkgrel=8
+pkgver=1.1
+pkgrel=1
pkgdesc="A systemd Service to start aria2 automatically."
arch=(any)
url="https://aur.archlinux.org/aria2cd.git"
@@ -10,12 +10,14 @@ license=(custom:WTFPL)
depends=(aria2 systemd)
source=(
notify-user
+ aria2cd-install
${pkgname}.hook
aria2.conf
aria2@.service
LICENSE::http://www.wtfpl.net/txt/copying
)
-sha256sums=('6cde5c3c4877fff8d7804ae958ab3cc6dad366e4275f757b0f7f146427450f8d'
+sha256sums=('5dd14105fcd2224c60103e5521922af0ddcb2a9ec2ef1734b092d946100019f6'
+ '85436b68fac425bd33fdcc966910782b618e5303dda0d68c1d23f26f9eea8279'
'182b39e8f4f9cc979aa9cbaebbbb88298f009bfdb1c0bcb2d44fa538ff9fe73c'
'a075c9b90a4732ea7fb332e81ad50244e778977ec028a56ae0b29f895fd7db87'
'c863595990e32eb41aa76fd55d151acb04cee401fcf219d4e418b96fdc1468b2'
@@ -29,4 +31,5 @@ package(){
install -Dm644 ${srcdir}/LICENSE ${pkgdir}/usr/share/licences/${pkgname}/LICENSE
install -Dm644 ${srcdir}/${pkgname}.hook ${pkgdir}/usr/share/libalpm/hooks/${pkgname}.hook
install -Dm755 ${srcdir}/notify-user ${pkgdir}/usr/share/libalpm/scripts/notify-user
+ install -Dm755 ${srcdir}/aria2cd-install ${pkgdir}/usr/bin/aria2cd-install
}
diff --git a/aria2cd-install b/aria2cd-install
new file mode 100644
index 000000000000..aa24c6636336
--- /dev/null
+++ b/aria2cd-install
@@ -0,0 +1,27 @@
+#!/usr/bin/env sh
+if [[ -z XDG_CONFIG_HOME ]]
+then
+ mkdir -p $XDG_CONFIG_HOME/aria2
+ cp /usr/share/aria2/aria2.conf $XDG_CONFIG_HOME/aria2/aria2.conf
+ TARGET=$XDG_CONFIG_HOME/aria2/aria2.conf
+else
+ mkdir -p $HOME/.config/aria2
+ cp /usr/share/aria2/aria2.conf $HOME/.config/aria2/aria2.conf
+ TARGET=$HOME/.config/aria2/aria2.conf
+fi
+echo "Cpoied Aria2 config to ${TARGET}"
+if [[ -z XDG_CACHE_HOME ]]
+then
+ mkdir -p $XDG_CACHE_HOME/aria2
+ cp /usr/share/aria2/dht.dat $XDG_CACHE_HOME/aria2/dht.dat
+ cp /usr/share/aria2/dht6.dat $XDG_CACHE_HOME/aria2/dht6.dat
+ cp /usr/share/aria2/aria2.session $XDG_CACHE_HOME/aria2/aria2.session
+ TARGET=$XDG_CACHE_HOME/aria2
+else
+ mkdir -p $HOME/.cache/aria2
+ cp /usr/share/aria2/dht.dat $HOME/.cache/aria2/dht.dat
+ cp /usr/share/aria2/dht6.dat $HOME/.cache/aria2/dht6.dat
+ cp /usr/share/aria2/aria2.session $HOME/.cache/aria2/aria2.session
+ TARGET=$HOME/.cache/aria2
+fi
+echo "Copied Aria2 cache files to ${TARGET}"
diff --git a/notify-user b/notify-user
index 44f2a8111b86..d44f678f46b8 100755
--- a/notify-user
+++ b/notify-user
@@ -1,5 +1,6 @@
#!/usr/bin/env sh
-echo "aria2cd has been installed/updated successfully, but there is something extra to do:"
+echo "aria2cd has been installed/updated successfully, but there is something extra to do."
+echo "You can run aria2cd-install to do it automatically or do the follow manually:"
echo "You need to copy /usr/share/aria2/ to \${HOME}/.aria2/ or aria2c will not work correctly."
echo "\${HOME} is the home directory of the user who runs aria2c"
echo "You can also use \${XDG_CONFIG_HOME}/aria2/ instead of \${HOME}/.aria2/ for config and \${XDG_CACHE_HOME}/aria2/ for cache files such as DHT file and session file."