archrelease: copy trunk to community-any
[ArchLinux/community.git] / tribler / trunk / PKGBUILD
blob3c36e89da4eb26081fcd0cfdf3d972fe005811e7
1 # Maintainer: Filipe LaĆ­ns (FFY00) <lains@archlinux.org>
3 pkgname=tribler
4 pkgver=7.4.4
5 pkgrel=4
6 pkgdesc='Privacy enhanced BitTorrent client with P2P content discovery'
7 url='https://www.tribler.org'
8 arch=('any')
9 license=('LGPL3')
10 depends=('python-pyqt5' 'python-aiohttp' 'python-aiohttp-apispec' 'libtorrent-rasterbar'
11          'python-cryptography' 'python-libnacl' 'python-pony' 'python-lz4'
12          'python-psutil' 'python-networkx' 'python-pyqtgraph' 'python-chardet'
13          'python-cherrypy' 'python-configobj' 'python-netifaces' 'python-bitcoinlib'
14          'python-twisted' 'python-pyopenssl' 'python-pyasn1' 'vlc')
15 makedepends=('python-setuptools' 'git')
16 #checkdepends=('python-pytest-runner')
17 source=("https://github.com/Tribler/tribler/releases/download/v$pkgver/Tribler-v$pkgver.tar.xz")
18 sha512sums=('931dff82bb7f83de8d5b63ab8a712cf371a7361a75e8bbb7c490d8b56aa55d1586586ae6e14f28c3c8ad5daf938eb2bbc05b67f74bcc9a3a23e38f8fc909d722')
20 prepare() {
21   cd $pkgname
23   # Fix tribler path
24   sed -i 's|/opt/tribler|/usr/share/tribler|g' systemd/anontunnel_helper@.service
25   sed -i 's|/opt/tribler|/usr/share/tribler|g' systemd/tribler.service
27   # Fix version info
28   sed -e "s|version_id =.*|version_id = \"${pkgver%_*}\"|g" \
29       -e "s|build_date =.*|build_date = \"$SOURCE_DATE_EPOCH\"|g" \
30         -i Tribler/Core/version.py
33 build () {
34   cd $pkgname
36   python setup.py build
39 #check() {
40 #  cd $pkgname
42 #  python setup.py test
45 package() {
46   cd $pkgname
48   # Install python modules
49   python setup.py install --root="$pkgdir" --optimize=1
51   # Install binary files/assets
52   install -dm 755 "$pkgdir"/usr/{bin,share/tribler}
53   cp -dr --no-preserve=ownership Tribler "$pkgdir"/usr/share/tribler
54   cp -dr --no-preserve=ownership TriblerGUI "$pkgdir"/usr/share/tribler
55   ln -s Tribler/Core/CacheDB/schema_sdb_v*.sql "$pkgdir"/usr/share/tribler/Tribler
57   install -dm 755 "$pkgdir"/usr/share/{applications,pixmaps}
58   install -Dm 644 Tribler/Main/Build/Ubuntu/tribler.desktop "$pkgdir"/usr/share/applications
59   install -Dm 644 Tribler/Main/Build/Ubuntu/tribler.xpm "$pkgdir"/usr/share/pixmaps
60   install -Dm 644 Tribler/Main/Build/Ubuntu/tribler_big.xpm "$pkgdir"/usr/share/pixmaps
61   install -Dm 755 debian/bin/tribler "$pkgdir"/usr/bin
62   install -Dm 644 logger.conf "$pkgdir"/usr/share/tribler/
63   install -Dm 644 run_tribler.py "$pkgdir"/usr/share/tribler/
64   install -Dm 644 check_os.py "$pkgdir"/usr/share/tribler/
66   cp -dr --no-preserve=ownership twisted "$pkgdir"/usr/share/tribler
68   # Remove test folders
69   rm -rf "$pkgdir"/usr/lib/python*/site-packages/Tribler/Test
70   rm -rf "$pkgdir"/usr/share/tribler/Tribler/Test
72   # Install systemd files
73   install -Dm 644 systemd/anontunnel_helper@.service "$pkgdir"/usr/lib/systemd/system/anontunnel_helper@.service
74   install -Dm 644 systemd/tribler.service "$pkgdir"/usr/lib/systemd/system/tribler.service