arch-pkgs/rutorrent/PKGBUILD

85 lines
2.2 KiB
Text
Raw Normal View History

# Maintainer: George Rawlinson <george@rawlinson.net.nz>
pkgname=rutorrent
2023-01-29 01:34:49 +00:00
pkgver=4.0.1
pkgrel=1
2023-01-07 03:37:32 +00:00
pkgdesc='Yet another web front-end for rTorrent'
arch=('any')
url='https://github.com/Novik/ruTorrent'
license=('GPL')
2023-01-07 03:37:32 +00:00
depends=(
'php-fpm'
'php-geoip'
'curl'
'gzip'
'coreutils'
)
2023-01-07 03:37:32 +00:00
makedepends=('git' 'perl')
backup=(
2023-01-07 03:37:32 +00:00
'etc/rutorrent/config.php'
'etc/rutorrent/plugins.ini'
'etc/rutorrent/access.ini'
)
options=('emptydirs' '!strip')
2023-01-29 01:34:49 +00:00
_commit='fca1435846491fe8ff89746bbdc960a0f24a3d9d'
2023-01-07 03:37:32 +00:00
source=(
"$pkgname::git+$url#commit=$_commit"
'tmpfiles.conf'
'config.patch'
)
2023-01-07 03:37:32 +00:00
b2sums=('SKIP'
'f762fe34e415632f4a458f83ab305a7c5fe231c04ed3cce7b3a7ab99e00aa4a767bab8212edcff80b954d974cf347919b36052dcea5caf0504fb79b745456349'
'4b71911de4b9f75d7d3d3e5d0e5fbc611c218a8e77f9fa3af969d6f0f9d5491418d3cb0b8d0720f2c6c37a4bd87f9db7c875aa9d0caf17ab99dd8f224805215b')
pkgver() {
cd "$pkgname"
2023-01-29 01:34:49 +00:00
git describe --tags | sed -e 's/^v//' -e 's/-hotfix$//'
2023-01-07 03:37:32 +00:00
}
prepare() {
2023-01-07 03:37:32 +00:00
cd "$pkgname"
# move config & log location
2023-01-07 03:37:32 +00:00
patch -p1 -i "$srcdir/config.patch"
# move config/settings to /var/lib/rutorrent
rm -rf share
# delete git files
find . -type f -name ".git*" -delete
# delete POSIX-incompatible files
cd plugins/tracklabels/labels
find . -print0 | perl -MFile::Path=remove_tree -n0e 'chomp; remove_tree($_, {verbose=>1}) if /[[:^ascii:][:cntrl:]]/'
}
package() {
2023-01-07 03:37:32 +00:00
cd "$pkgname"
# create directories
2023-01-07 03:37:32 +00:00
install -vd "$pkgdir/usr/share/$pkgname/conf" "$pkgdir/etc/$pkgname"
# copy files over
cp -r . "$pkgdir/usr/share/$pkgname"
# link config files to /etc/$pkgname
for conf in config.php plugins.ini access.ini; do
mv "conf/$conf" "$pkgdir/etc/$pkgname"
ln -sf "/etc/$pkgname/$conf" "$pkgdir/usr/share/$pkgname/conf/$conf"
done
# license & documentation
install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE.md
install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md htaccess-example
# remove unnecessary files
2023-01-07 03:37:32 +00:00
rm -rf "$pkgdir/usr/share/$pkgname/"{LICENSE.md,README.md,htaccess-example,.git,.github,tests}
# systemd integration
install -Dm644 "$srcdir/tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
# change ownership
chown -R http:http "$pkgdir/usr/share/$pkgname"
}