upgpkg: rutorrent 4.0-1

This commit is contained in:
George Rawlinson 2023-01-07 16:37:32 +13:00
parent 220bf85631
commit 8d8649b9b1
Signed by: grawlinson
GPG key ID: E0959FEA8B550539
2 changed files with 53 additions and 35 deletions

View file

@ -1,49 +1,50 @@
# Maintainer: George Rawlinson <george@rawlinson.net.nz> # Maintainer: George Rawlinson <george@rawlinson.net.nz>
pkgname=rutorrent pkgname=rutorrent
_pkgname=ruTorrent pkgver=4.0
pkgver=3.10
# git submodule within source
# commit ID obtained from $pkgver tree
_darkbetter_commitid="c1f7817f3cc9930c7ec7a4d50b1c131670ec888e"
pkgrel=1 pkgrel=1
pkgdesc="Yet another web front-end for rTorrent" pkgdesc='Yet another web front-end for rTorrent'
arch=('any') arch=('any')
url='https://github.com/Novik/ruTorrent' url='https://github.com/Novik/ruTorrent'
license=('GPL') license=('GPL')
depends=(php-fpm php-geoip curl gzip coreutils) depends=(
makedepends=(perl git) 'php-fpm'
optdepends=() 'php-geoip'
conflicts=() 'curl'
source=( 'gzip'
"$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz" 'coreutils'
"DarkBetter-$_darkbetter_commitid.tar.gz::https://github.com/chocolatkey/DarkBetter/archive/$_darkbetter_commitid.tar.gz"
"tmpfiles.conf"
) )
b2sums=('58ce8673bbb5f25509e4b81bc41512d42221dd36a42aa856b2956c6cc8ad5096c675ef941f45592246b4d04432269146f61544fd7ee1c0f50fa6a08edad93914' makedepends=('git' 'perl')
'8c490225c478b43738611c305f539bfe2bc1053247a0f4a2b304a5e55a4f8f5be3f490cddbbdb3bef1bb672e1824cd09a6c38dcd021fad1b6945a179430e1f7a'
'f762fe34e415632f4a458f83ab305a7c5fe231c04ed3cce7b3a7ab99e00aa4a767bab8212edcff80b954d974cf347919b36052dcea5caf0504fb79b745456349')
backup=( backup=(
etc/rutorrent/config.php 'etc/rutorrent/config.php'
etc/rutorrent/plugins.ini 'etc/rutorrent/plugins.ini'
etc/rutorrent/access.ini 'etc/rutorrent/access.ini'
) )
options=(emptydirs !strip) options=('emptydirs' '!strip')
_commit='06222a00375bdd0f1f1b5b58bda29e7025316428'
source=(
"$pkgname::git+$url#commit=$_commit"
'tmpfiles.conf'
'config.patch'
)
b2sums=('SKIP'
'f762fe34e415632f4a458f83ab305a7c5fe231c04ed3cce7b3a7ab99e00aa4a767bab8212edcff80b954d974cf347919b36052dcea5caf0504fb79b745456349'
'4b71911de4b9f75d7d3d3e5d0e5fbc611c218a8e77f9fa3af969d6f0f9d5491418d3cb0b8d0720f2c6c37a4bd87f9db7c875aa9d0caf17ab99dd8f224805215b')
pkgver() {
cd "$pkgname"
git describe --tags | sed -e 's/^v//' -e 's/-stable$//'
}
prepare() { prepare() {
cd "$_pkgname-$pkgver" cd "$pkgname"
# move config & log location # move config & log location
sed -i \ patch -p1 -i "$srcdir/config.patch"
-e 's:../share:/var/lib/rutorrent:' \
-e 's:tmp/errors.log:var/log/rutorrent.log:' \
conf/config.php
# move config/settings to /var/lib/rutorrent # move config/settings to /var/lib/rutorrent
rm -rf share rm -rf share
# replace with version pinned at git tag rather than latest
rm -rf plugins/theme/themes/DarkBetter
# delete git files # delete git files
find . -type f -name ".git*" -delete find . -type f -name ".git*" -delete
@ -54,16 +55,13 @@ prepare() {
} }
package() { package() {
cd "$_pkgname-$pkgver" cd "$pkgname"
# create directories # create directories
install -d "$pkgdir/usr/share/$pkgname/conf" install -vd "$pkgdir/usr/share/$pkgname/conf" "$pkgdir/etc/$pkgname"
install -d "$pkgdir/etc/$pkgname"
# copy files over # copy files over
cp -r . "$pkgdir/usr/share/$pkgname" cp -r . "$pkgdir/usr/share/$pkgname"
cp -r "$srcdir/DarkBetter-$_darkbetter_commitid" \
"$pkgdir/usr/share/$pkgname/plugins/theme/themes/DarkBetter"
# link config files to /etc/$pkgname # link config files to /etc/$pkgname
for conf in config.php plugins.ini access.ini; do for conf in config.php plugins.ini access.ini; do
@ -76,7 +74,7 @@ package() {
install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md htaccess-example install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md htaccess-example
# remove unnecessary files # remove unnecessary files
rm "$pkgdir/usr/share/$pkgname/"{LICENSE.md,README.md,htaccess-example} rm -rf "$pkgdir/usr/share/$pkgname/"{LICENSE.md,README.md,htaccess-example,.git,.github,tests}
# systemd integration # systemd integration
install -Dm644 "$srcdir/tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf" install -Dm644 "$srcdir/tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"

20
rutorrent/config.patch Normal file
View file

@ -0,0 +1,20 @@
--- a/conf/config.php
+++ b/conf/config.php
@@ -28,7 +28,7 @@
$do_diagnostic = true; // Diagnose ruTorrent. Recommended to keep enabled, unless otherwise required.
$al_diagnostic = true; // Diagnose auto-loader. Set to "false" to make composer plugins work.
- $log_file = '/tmp/errors.log'; // path to log file (comment or leave blank to disable logging)
+ $log_file = '/var/log/rutorrent.log'; // path to log file (comment or leave blank to disable logging)
$saveUploadedTorrents = true; // Save uploaded torrents to profile/torrents directory or not
$overwriteUploadedTorrents = false; // Overwrite existing uploaded torrents in profile/torrents directory or make unique name
@@ -64,7 +64,7 @@
"localhost",
);
- $profilePath = '../../share'; // Path to user profiles
+ $profilePath = '/var/lib/rutorrent'; // Path to user profiles
$profileMask = 0777; // Mask for files and directory creation in user profiles.
// Both Webserver and rtorrent users must have read-write access to it.
// For example, if Webserver and rtorrent users are in the same group then the value may be 0770.