summaryrefslogtreecommitdiff
blob: 9671be6e2615e0891a4020e56031fbdaa7de41d2 (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
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

DESCRIPTION="Napiprojekt.pl subtitle downloader in bash"
HOMEPAGE="https://sourceforge.net/projects/bashnapi/"
SRC_URI="mirror://sourceforge/${PN}/bashnapi_v${PV}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

# subotage is now integrated into bashnapi
RDEPEND="app-arch/p7zip
	!media-video/subotage"

S=${WORKDIR}/napi-${PV}

src_configure() {
	# install.sh does not support --destdir
	sed -i -e "s^\(NAPI_COMMON_PATH=\).*$^\1${EPREFIX}/usr/share/napi^" \
		napi.sh subotage.sh || die
}

src_install() {
	default # for docs
	dobin napi.sh subotage.sh
	insinto /usr/share/napi
	doins napi_common.sh
}

pkg_postinst() {
	# packages that can be used to detect FPS
	local fps_pkgs=(
		media-video/ffmpeg
		media-video/mediainfo
		media-video/mplayer
		# also mplayer2
	)
	local p found

	for p in "${fps_pkgs[@]}"; do
		if has_version "${p}"; then
			found=1
			break
		fi
	done

	if [[ ! ${found} ]]; then
		elog "In order to support FPS detection, install one of the following packages:"
		elog
		for p in "${fps_pkgs[@]}"; do
			elog "  ${p}"
		done
	fi
}