summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8e2c09ca1d778a7ee281bcfc7829865f8c74f4a6 (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
# Contributor: Patrick Northon <northon_patrick3@yahoo.ca>
# Contributor: Det <nimetonmaili gmail a-dot com>
# Contributor: vorbote <palopezv AT gmail DOT com >
# Contributor: td123 <gostrc AT gmail DOT com>
# Contributor: phoenixlzx < phoenixlzx AT phoenixsec DOT org >

pkgname=vuze
pkgver=5.7.6.0
pkgrel=1
_ver=${pkgver//./} 
pkgdesc="A feature-rich Java-based BitTorrent client (previously called 'Azureus')"
arch=('x86_64')
url="https://sourceforge.net/projects/azureus/"
license=('GPL')
depends=('desktop-file-utils' 'java-runtime')
optdepends=('vuze-plugin-countrylocator: Country flags for the "Peers" tab'
            'vuze-plugin-mldht: The alternative Distributed Hash Table implementation (DHT) used by µTorrent'
            'xulrunner192: Needed for the channels GUI')
options=('!strip')
install=$pkgname.install
source=("https://downloads.sourceforge.net/azureus/vuze/Vuze_${_ver}/Vuze_${_ver}_linux.tar.bz2")
sha256sums=('1c5995ed8a25bac4bf1cea012b583af92af04c15579ab686689bca13e6cad36c')

package() {
  cd $pkgname

  msg2 "Creating directory structure..."
  install -d "$pkgdir"/opt/$pkgname/
  install -d "$pkgdir"/usr/bin/
  install -d "$pkgdir"/usr/share/applications/
  install -d "$pkgdir"/usr/share/licenses/$pkgname/
  install -d "$pkgdir"/usr/share/pixmaps/

  msg2 "Moving stuff in place..."
  # Launchers
  mv $pkgname "$pkgdir"/usr/bin/$pkgname
  ln -s $pkgname "$pkgdir"/usr/bin/azureus

  # swt.jar
  mv swt/swt64.jar "$pkgdir"/opt/$pkgname/swt.jar

  # Icon and desktop 
  mv $pkgname.png "$pkgdir"/usr/share/pixmaps/
  mv $pkgname.desktop "$pkgdir"/usr/share/applications/

  # Licenses
  for i in GPL.txt GPLv3.txt LICENSES.txt TOS.txt; do
    mv $i "$pkgdir"/usr/share/licenses/$pkgname/
  done

  msg2 "Removing redundancies..."
  rm -r swt/
  rm    azureus
  rm    installer.log
  rm    README.txt
  rm    $pkgname.schemas

  msg2 "Installing to /opt..."
  mv * "$pkgdir"/opt/$pkgname/

  msg2 "Fixing paths..."
  sed -i "s|#PROGRAM_DIR=.*|PROGRAM_DIR=\"/opt/$pkgname\"|" "$pkgdir"/usr/bin/$pkgname

  msg2 "Adding support for magnet links..."
  sed -r -e "s|Exec=$pkgname %f|Exec=$pkgname %U|" \
         -e "s|(x-bittorrent)|\1;x-scheme-handler/magnet;|" \
         -i "$pkgdir"/usr/share/applications/$pkgname.desktop
}