summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 996ed1eab21d4322826535e0865b71b05e5161b7 (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
# Maintainer : Daniel Bermond < yahoo-com: danielbermond >
# Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Hugo Doria <hugo@archlinux.org>
# PKGBUILD based on extra\deluge's PKGBUILD, adapted for -git version by Berseker

pkgname=deluge-git
pkgver=2.0.0.dev983.g0353b82c0
pkgrel=1
pkgdesc="A bittorrent client written with python and pygtk (git version, 'develop' branch)"
arch=('any')
url="http://deluge-torrent.org/"
license=('GPL3')
provides=('deluge')
conflicts=('deluge' 'deluge-stable-git')
install='deluge.install'
depends=(
        'desktop-file-utils' 'hicolor-icon-theme' 'libtorrent-rasterbar'
        'python2-service-identity' 'python2-chardet' 'python2-pyopenssl'
        'python2-xdg' 'python2-twisted' 'xdg-utils'
)
makedepends=(
    # binary repositories:
        'git' 'intltool' 'librsvg' 'pygtk' 'python2-mako' 'python2-setuptools'
    # AUR:
        'python2-jsmin' 'slimit2'
)
optdepends=('python2-pillow'
            'librsvg: needed for gtk ui'
            'pygtk: needed for gtk ui'
            'python2-mako: needed for web ui'
            'python2-notify: libnotify notifications'
            'geoip: display peer locations')
source=("$pkgname"::"git://deluge-torrent.org/deluge.git#branch=develop" # official repository
        #"$pkgname"::"git+https://github.com/deluge-torrent/deluge.git#branch=develop" # mirror
        'deluged.service'
        'deluge-web.service')
sha256sums=('SKIP'
            '58a451bb6cf4fe6ff78a4fb71d51c5910340a2de032ff435c3c7365015ab538f'
            'c3f2d6ad5bc9de5ffd9973d92badbe04a9ecf12c0c575e13d505a96add03275a')

prepare() {
    cd "${pkgname}/deluge/ui/data/icons"
    ln -sf hicolor/scalable scalable
}

pkgver() {
    cd "$pkgname"
    
    local _internalver="$(python2 version.py)"
    local _shorthash="$(git rev-parse --short HEAD)"
    printf "%s.g%s" "$_internalver" "$_shorthash"
    
    # alternative
    #git describe --tags --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^deluge\.//;s/dev[[:digit:]]*\.//'
}

build() {
    cd "$pkgname"
    python2 setup.py build
    python2 minify_web_js.py deluge/ui/web/js/deluge-all
}

package() {
    cd "$pkgname"
    python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1

    install -d     "${pkgdir}/srv"
    install -dm664 "${pkgdir}/srv/deluge"
    install -Dm644 "deluge/ui/data/pixmaps/deluge.svg" "${pkgdir}/usr/share/pixmaps/deluge.svg"
    install -Dm644 "${srcdir}/deluged.service"         "${pkgdir}/usr/lib/systemd/system/deluged.service"
    install -Dm644 "${srcdir}/deluge-web.service"      "${pkgdir}/usr/lib/systemd/system/deluge-web.service"
}