summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b78b7fa1101ec3fb0ff77f3eb95da558edb1d566 (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
# Maintainer: Piotr Rogoza <piotr dot r dot public at gmail dot com>
# Contributor: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
# Contributor: Sergei Lebedev <superbobry at gmail dot com>

pkgname=rutorrent
_pkgname=ruTorrent
pkgver=3.8
pkgrel=1
pkgdesc="Yet another web front-end for rTorrent"
arch=('any')
# url="http://code.google.com/p/rutorrent/"
url='https://github.com/Novik/ruTorrent'
license=('GPL')
depends=(php curl gzip coreutils)
optdepends=('mod_scgi: for SCGI protocol')
conflicts=(rutorrent-plugins)
source=(
# $pkgname-$pkgver.zip::"http://dl.bintray.com/novik65/generic/ruTorrent-$pkgver.zip"
$pkgname-$pkgver.tar.gz::https://github.com/Novik/ruTorrent/archive/v${pkgver}.tar.gz
apache.example.conf
apache.example.site.conf)
sha256sums=('610fc5df350fe7915b4413067fea8657eb6f26b1cc5212de97a4af98439b2e2c'
            '79b5aab7ef928727b3ec2aa0f1b0869310adde11cd774d148c03025deb6dec0c'
            '9afe7d2a9aadb5fd6a0fcd907f7f46bdc3630c369a5a684c51bbeeb5b4d354aa')
backup=(
etc/webapps/rutorrent/conf/config.php
etc/webapps/rutorrent/conf/plugins.ini
etc/webapps/rutorrent/conf/access.ini
)
options=(emptydirs !strip)

prepare() {
  cd $srcdir/$_pkgname-$pkgver
  rm -f .gitignore
  msg2 "Removing files with Russian letters in filenames"
  cd plugins/tracklabels/labels
  find . -print0 | perl -MFile::Path=remove_tree -n0e 'chomp; remove_tree($_, {verbose=>1}) if /[[:^ascii:][:cntrl:]]/'
}
package() {
  cd $srcdir/$_pkgname-$pkgver

  install -d "$pkgdir"/usr/share/webapps
  install -d "$pkgdir"/etc/webapps/$pkgname

  cp -r conf "$pkgdir"/etc/webapps/$pkgname/
  cp -r . "$pkgdir"/usr/share/webapps/$pkgname/

  rm -rf "$pkgdir"/usr/share/webapps/$pkgname/conf

  install -Dm644 ../apache.example.conf "$pkgdir"/etc/webapps/rutorrent/
  install -Dm644 ../apache.example.site.conf "$pkgdir"/etc/webapps/rutorrent/

  cd "$pkgdir"/usr/share/webapps/$pkgname
  ln -s /etc/webapps/$pkgname/conf

  #fix perms
  #chown http\: $pkgdir/usr/share/webapps/$pkgname/share/{settings,torrents,users}
  chmod 0777 $pkgdir/usr/share/webapps/$pkgname/share/{settings,torrents,users}
}