summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0b5b64eaa645200c8381f251786bb9af332c2808 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Maintainer : Solomon Choina <shlomochoina@gmail.com>
pkgbase=transmission-cmake
pkgname=(transmission-cmake-cli transmission-cmake-gtk transmission-cmake-qt libtransmission)
pkgver=2.94
pkgrel=1
arch=(i686 x86_64 arm armv6h armv7h aarch64)
url="http://www.transmissionbt.com/"
license=(MIT)
options=(!buildflags)
makedepends=(gtk3 ido-thanos intltool curl qt5-base libevent systemd qt5-tools dht libutp libnatpmp)
source=("git+https://github.com/transmission/transmission#tag=2.93"
        transmission-cmake-cli.sysusers
        transmission-cmake-cli.tmpfiles)
sha256sums=('SKIP'
            '641310fb0590d40e00bea1b5b9c843953ab78edf019109f276be9c6a7bdaf5b2'
            '1266032bb07e47d6bcdc7dabd74df2557cc466c33bf983a5881316a4cc098451')

prepare() {
  cd transmission
  sed -i '/^Icon=/ s/$/-qt/' qt/transmission-qt.desktop
  cd ..
  if [[ -d build ]]; then
    rm -rf build
  fi
  mkdir build
}

build() {
  cd build
  
  cmake ../transmission -DCMAKE_INSTALL_PREFIX="/usr" -DLIB_INSTALL_DIR='/usr/lib' -DCMAKE_INSTAL_LIBDIR="/usr/lib" -DINSTALL_LIB=ON -DENABLE_UTP=ON  -DBUILD_TESTING=ON -DUSE_QT5=ON -DENABLE_CLI=ON -DENABLE_DAEMON=ON  -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_UTP=ON
  make
}

package_transmission-cmake-cli() {
  pkgdesc='Fast, easy, and free BitTorrent client (CLI tools, daemon and web client)'
  depends=(curl libevent systemd)
  conflicts=(transmission-cli)
  provides=(transmission-cli)

  cd $srcdir/build

  for dir in daemon cli utils; do
    make -C "$dir" DESTDIR="$pkgdir" install
  done

  install -Dm644 $srcdir/transmission/daemon/transmission-daemon.service \
    "$pkgdir/usr/lib/systemd/system/transmission.service"
  install -Dm644 $srcdir/transmission/COPYING "$pkgdir/usr/share/licenses/transmission-cli/COPYING"

  install -Dm644 "$srcdir/$pkgname.sysusers" \
    "$pkgdir/usr/lib/sysusers.d/transmission.conf"
  install -Dm644 "$srcdir/$pkgname.tmpfiles" \
    "$pkgdir/usr/lib/tmpfiles.d/transmission.conf"
}

package_transmission-cmake-gtk() {
  pkgdesc="Fast, easy, and free BitTorrent client (GTK+ GUI)"
  depends=(curl libevent ido-thanos gtk3 desktop-file-utils hicolor-icon-theme)
  optdepends=('notification-daemon: Desktop notification support'
  	      'transmission-cmake-cli: daemon and web support')
  provides=(transmission-gtk)
  conflicts=(transmission-gtk)

  cd build

  make -C gtk DESTDIR="$pkgdir" install
  make -C po DESTDIR="$pkgdir" install
  install -Dm644 $srcdir/transmission/COPYING "$pkgdir/usr/share/licenses/transmission-cmake-gtk/COPYING"
}

package_transmission-cmake-qt() {
  pkgdesc="Fast, easy, and free BitTorrent client (Qt GUI)"
  depends=(curl qt5-base libevent)
  optdepends=('transmission-cmake-cli: daemon and web support')
  provides=(transmission-qt)
  conflicts=(transmission-qt)
  cd build

  make -C qt DESTDIR="$pkgdir" install

  install -Dm644 -t "$pkgdir/usr/share/transmission-qt/translations" qt/*.qm

  install -Dm644 $srcdir/transmission/COPYING "$pkgdir/usr/share/licenses/transmission-cmake-qt/COPYING"
  install -Dm644 $srcdir/transmission/qt/icons/transmission.png "$pkgdir/usr/share/pixmaps/transmission-qt.png"
  install -Dm644 $srcdir/transmission/qt/transmission-qt.desktop "$pkgdir/usr/share/applications/transmission-qt.desktop"
}

package_libtransmission(){
  pkgdesc="Fast, easy, and free BitTorrent client (library)"
  depends=(openssl libnatpmp curl libevent miniupnpc dht libutp libb64)

  cd build
  make -C libtransmission DESTDIR="$pkgdir" install
  mkdir -p $pkgdir/usr/lib/
  mv $pkgdir/usr/lib64/libtransmission.a  $pkgdir/usr/lib/
  rmdir $pkgdir/usr/lib64 
  install -Dm644 $srcdir/transmission/COPYING "$pkgdir/usr/share/licenses/libtransmission/COPYING"

}