summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 027faaa817653b62ed0594f95669ec9bb70b88db (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
# Maintainer: xsmile <sascha_r gmx de>

_pkgname=libtorrent
pkgname=libtorrent-ps
_pkgver=0.13.6
pkgver=1.1.r15.g56057fc
pkgrel=1
pkgdesc='BitTorrent library written in C++ for use with rtorrent-ps'
url='https://github.com/rakshasa/libtorrent'
license=('GPL')
arch=('any')
depends=('openssl')
provides=('libtorrent')
conflicts=('libtorrent')
source=("https://github.com/rakshasa/$_pkgname/archive/$_pkgver.tar.gz"
        'lt-base-cppunit-pkgconfig.patch'
        'lt-ps-better-bencode-errors_all.patch'
        'lt-ps-honor_system_file_allocate_all.patch'
        'lt-ps-log_open_file-reopen_all.patch'
        'lt-open-ssl-1.1.patch')
md5sums=('8c8eaa9fa03bd113967c68eea26493e7'
         '198fb1fe53aa35eb97d16f9a8b9556bd'
         'dfae06b33afa738211619040810be8b4'
         '8d7f8fe5ad412bd42f2ea66131a8ce6b'
         '2bfadac7770935ca98c4714c2011541a'
         '1fc8eca467b3e5a5b5c43bbef21f4ba8')

prepare() {
  cd "$srcdir/$_pkgname-$_pkgver"

  LT_BASE_PATCHES=("$srcdir"/lt-base-cppunit-pkgconfig.patch
                   "$srcdir"/lt-open-ssl-1.1.patch)
  LT_PATCHES=()

  # Patch libtorrent
  for corepatch in "${LT_BASE_PATCHES[@]}" \
                   "$srcdir"/lt-ps-*_{${_pkgver},all}.patch "${LT_PATCHES[@]}"; do
    test ! -e "$corepatch" || { msg2 "$(basename $corepatch)"; patch -uNp1 -i "$corepatch"; }
  done

  for backport in "$srcdir"/backport*_{${_pkgver},all}_*.patch; do
    test ! -e "$backport" || { msg2 "$(basename $backport)"; patch -uNp1 -i "$backport"; }
  done

  ./autogen.sh
}

build() {
  cd "$srcdir/$_pkgname-$_pkgver"

  ./configure \
    --prefix=/usr \
    --disable-debug
  make
}

package() {
  cd "$srcdir/$_pkgname-$_pkgver"
  make DESTDIR="$pkgdir" install
}