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

EAPI="7"
PYTHON_COMPAT=( python3_{6,7} )
PYTHON_REQ_USE="xml(+)"
inherit xdg-utils distutils-r1

DESCRIPTION="Zeroinstall Injector allows regular users to install software themselves"
HOMEPAGE="http://0install.net/"
SRC_URI="https://sourceforge.net/projects/zero-install/files/${PN}/${PV}/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~sparc ~x86"
RDEPEND="
	$(python_gen_any_dep '
		dev-python/pygobject:3[${PYTHON_USEDEP}]
	')
	app-crypt/gnupg
"

python_check_deps() {
	has_version ">=dev-python/pygobject:3[${PYTHON_USEDEP}]"
}

python_prepare_all() {
	# Change manpage install path (Bug 207495)
	sed -i 's:man/man1:share/man/man1:' setup.py || die 'Documentation path fix sed failed.'
	cp "${FILESDIR}/0distutils-r2" "${WORKDIR}/0distutils" || die 'Copying 0distutils to work directory failed.'
	python_fix_shebang .
	distutils-r1_python_prepare_all
}

python_install_all() {
	distutils-r1_python_install_all

	exeinto "/usr/sbin/"
	doexe "${WORKDIR}/0distutils"

	local BASE_XDG_CONFIG="/etc/xdg/0install.net"
	local BASE_XDG_DATA="/usr/share/0install.net"

	insinto "${BASE_XDG_CONFIG}/injector"
	newins "${FILESDIR}/global.cfg" global

	dodir "${BASE_XDG_DATA}/native_feeds"
}

pkg_postinst() {
	xdg_icon_cache_update
}

pkg_postrm() {
	xdg_icon_cache_update
}