summaryrefslogtreecommitdiff
blob: 9c59d3d50153bfef51b69174dce53e4019267482 (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
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit webapp optfeature

DESCRIPTION="ruTorrent is a front-end for the popular Bittorrent client rTorrent"
HOMEPAGE="https://github.com/Novik/ruTorrent"
if [[ ${PV} == 9999 ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/Novik/ruTorrent.git"
else
	SRC_URI="https://github.com/Novik/ruTorrent/archive/v${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="~amd64 ~ppc ~x86"
	S="${WORKDIR}/ruTorrent-${PV}"
fi

LICENSE="GPL-2+ MIT"

RDEPEND="
	dev-lang/php[xml,gd]
	virtual/httpd-php
"

need_httpd_cgi

pkg_setup() {
	webapp_pkg_setup
}

src_install() {
	webapp_src_preinst

	rm -r .github || die
	find . \( -name .gitignore -o -name .gitmodules \) -type f -delete || die
	if [[ ${PV} == 9999 ]]; then
		rm -r .git .gitattributes || die
	fi

	insinto "${MY_HTDOCSDIR}"
	doins -r .

	# can not use fperms beacuse of globbing
	chmod +x "${ED}${MY_HTDOCSDIR}"/plugins/*/*.sh \
		"${ED}${MY_HTDOCSDIR}"/php/test.sh || die "chmod failed"

	keepdir "${MY_HTDOCSDIR}"/conf/users
	keepdir "${MY_HTDOCSDIR}"/share/settings
	keepdir "${MY_HTDOCSDIR}"/share/torrents
	keepdir "${MY_HTDOCSDIR}"/share/users

	webapp_serverowned -R "${MY_HTDOCSDIR}"/conf
	webapp_serverowned -R "${MY_HTDOCSDIR}"/share

	webapp_configfile "${MY_HTDOCSDIR}"/conf/.htaccess
	webapp_configfile "${MY_HTDOCSDIR}"/conf/config.php
	webapp_configfile "${MY_HTDOCSDIR}"/conf/access.ini
	webapp_configfile "${MY_HTDOCSDIR}"/conf/plugins.ini
	webapp_configfile "${MY_HTDOCSDIR}"/share/.htaccess

	webapp_src_install
}

pkg_postinst() {
	webapp_pkg_postinst

	optfeature "Show audio file spectogram" media-sound/sox
	optfeature "Display media file information" media-video/mediainfo
	optfeature "Scrape Cloudflare based sites" dev-python/cloudscraper
}