summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorDazzy Ding2015-06-23 12:04:20 +0800
committerDazzy Ding2015-06-23 12:04:20 +0800
commit232eb429433576e9f609d78764a34c2a75444887 (patch)
tree48667072f341b39137aac1be32143d0f8e656a5a /PKGBUILD
downloadaur-xunlei-lixian-git.tar.gz
Initial import
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD42
1 files changed, 42 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..44c7043a310
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Dazzy Ding <h at dazzyd.org>
+# Contributor: cuihao <cuihao dot leo at gmail dot com>
+
+pkgname=xunlei-lixian-git
+pkgver=r621.ac605e8
+pkgrel=1
+pkgdesc="A python script for Xunlei lixian."
+arch=('any')
+url="https://github.com/iambus/xunlei-lixian/"
+license=('MIT')
+depends=('python2' 'wget')
+optdepends=('aria2: better download performance'
+ 'axel: better download performance')
+makedepends=('git')
+source=("git+https://github.com/iambus/xunlei-lixian.git"
+ "xunlei-lixian-git.install")
+sha256sums=('SKIP'
+ '9d806e9a4dc66105c052a5941de67c8f51f62f25de5a218cb47936d47434bb75')
+install='xunlei-lixian-git.install'
+_gitname='xunlei-lixian'
+
+pkgver() {
+ cd $_gitname
+
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+package() {
+ cd $_gitname
+
+ sed -i -r "s|^#!/usr/bin/env python|#!/usr/bin/env python2|" lixian_{batch,cli,hash}.py
+
+ mkdir -p "$pkgdir/usr/share/$pkgname/"
+ cp -r lixian* "$pkgdir/usr/share/$pkgname/"
+ mkdir -p "$pkgdir/usr/share/licenses/$pkgname/"
+ cp LICENSE "$pkgdir/usr/share/licenses/$pkgname/"
+
+ mkdir -p "$pkgdir/usr/bin/"
+ ln -sf "/usr/share/$pkgname/lixian_cli.py" "$pkgdir/usr/bin/lixian"
+ ln -sf "/usr/share/$pkgname/lixian_batch.py" "$pkgdir/usr/bin/lixian-batch"
+ ln -sf "/usr/share/$pkgname/lixian_hash.py" "$pkgdir/usr/bin/lixian-hash"
+}