arch-pkgs/rutorrent/PKGBUILD

85 lines
2.2 KiB
Text
Raw Permalink Normal View History

# Maintainer: George Rawlinson <george@rawlinson.net.nz>
pkgname=rutorrent
2023-08-10 04:20:54 +00:00
pkgver=4.2.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-08-10 04:20:54 +00:00
_commit='32db41ddbaaa2c91d595162c40e08b6eab4284ef'
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'
2023-07-17 08:00:10 +00:00
'd3f6a9ce2553462673b34549ef0e77666ea53e07c1625dbaebc927a5b8ddc43733876bc7a49e3502ff97657d105f14e402c5f4a53340afeabef7755334a41be0')
2023-01-07 03:37:32 +00:00
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"
}