packages/deluge/PKGBUILD

148 lines
3.8 KiB
Bash

# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Hugo Doria <hugo@archlinux.org>
pkgbase=deluge
pkgname=(
deluge
deluge-gtk
)
pkgver=2.1.1
pkgrel=7
epoch=1
pkgdesc="BitTorrent client with multiple user interfaces in a client/server model"
url="https://deluge-torrent.org/"
arch=(any)
license=("GPL-3.0-only WITH cryptsetup-OpenSSL-exception")
depends=(
libtorrent-rasterbar
openssl
python
python-chardet
python-dbus
python-distro
python-geoip
python-idna
python-ifaddr
python-mako
python-pillow
python-pyopenssl
python-rencode
python-incremental
python-service-identity
python-setproctitle
python-setuptools
python-twisted
python-xdg
python-zope-interface
)
_gtk_depends=(
glib2
gtk3
hicolor-icon-theme
librsvg
pango
python-cairo
python-gobject
xdg-utils
)
makedepends=(
"${_gtk_depends[@]}"
git
intltool
libappindicator-gtk3
libnotify
python-build
python-installer
python-pygame
python-rjsmin
python-wheel
)
source=(
"git+https://git.deluge-torrent.org/deluge?signed#tag=deluge-$pkgver"
0001-Update-metainfo-install-path.patch
0002-Fix-data-installation-when-building-wheel.patch
)
b2sums=('950bf89a60f23e2b1d65413afcb8f71ae159092051477546c56936c092f6c3d8a345f54081d92ae3866a2194f6f2a09553bde71ba4d70b749b9abc234bdd9db5'
'864c8ca71e718e3d8cdd6021f5e3ddf82782955da6d25f9f3077a8dd59d2a8a798460c0f26fcf95b3b17d595b69c2f10b92a564c4482e3ac0ca27304dba9bd39'
'c503eface42fc12cb04086a5a77a862ee44f78ecdd6ad732d94e21acff1238511d3e8551d531e7443f6f099fec7b81846701b4988f4bde2cf8670fc47ecfa52c')
validpgpkeys=(
EA01185D0E8AA00D6323A30890597A687B836BA3 # Calum Lind <calumlind@gmail.com>
)
prepare() {
cd deluge
# Installation fixes
git apply -3 ../0001-Update-metainfo-install-path.patch
git apply -3 ../0002-Fix-data-installation-when-building-wheel.patch
}
build() {
cd deluge
python -m build --wheel --no-isolation
}
_pick() {
local p="$1" f d; shift
for f; do
d="$srcdir/$p/${f#$pkgdir/}"
mkdir -p "$(dirname "$d")"
mv "$f" "$d"
rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
done
}
package_deluge() {
cd deluge
python -m installer --destdir="$pkgdir" dist/*.whl
install -Dt "$pkgdir/usr/lib/systemd/system" \
-m644 packaging/systemd/*.service
install -Dt "$pkgdir/usr/lib/systemd/user" \
-m644 packaging/systemd/user/*.service
install -Dt "$pkgdir/usr/lib/systemd/system/deluged.service.d" \
-m644 packaging/systemd/user.conf
install -Dt "$pkgdir/usr/lib/systemd/system/deluge-web.service.d" \
-m644 packaging/systemd/user.conf
echo 'u deluge - "Deluge BitTorrent daemon" /srv/deluge' |
install -Dm644 /dev/stdin "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
echo 'd /srv/deluge 0770 deluge deluge' |
install -Dm644 /dev/stdin "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
_pick gtk "$pkgdir"/usr/bin/deluge-gtk
_pick gtk "$pkgdir"/usr/share/man/man1/deluge-gtk.1
_pick gtk "$pkgdir"/usr/share/{applications,icons,metainfo,pixmaps}
local sitedir="$(python -c 'import site; print(site.getsitepackages()[0])')"
_pick gtk "$pkgdir$sitedir"/deluge/ui/gtk3
install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 LICENSE
}
package_deluge-gtk() {
pkgdesc="GTK UI for Deluge"
depends=(
"${_gtk_depends[@]}"
"deluge=$epoch:$pkgver-$pkgrel"
python
python-rencode
python-setproctitle
python-twisted
)
optdepends=(
'libappindicator-gtk3: appindicator notifications'
'python-pygame: audible notifications'
'libnotify: desktop notifications'
)
replaces=('deluge<2.0.4.dev23+g2f1c008a2-2')
mv gtk/* "$pkgdir"
install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 deluge/LICENSE
}
# vim:set sw=2 sts=-1 et: