app-admin/salt-3000.2-r3: revbump,pycrypto deps, fix warning (bug #720148)
[gentoo.git] / app-admin / supervisor / supervisor-4.0.4.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( pypy3 python3_{6,7} )
7 # xml.etree.ElementTree module required.
8 PYTHON_REQ_USE="xml(+)"
9
10 inherit distutils-r1 systemd user
11
12 MY_PV="${PV/_beta/b}"
13
14 DESCRIPTION="A system for controlling process state under UNIX"
15 HOMEPAGE="http://supervisord.org/ https://pypi.org/project/supervisor/"
16 SRC_URI="mirror://pypi/${P:0:1}/${PN}/${PN}-${MY_PV}.tar.gz"
17
18 LICENSE="repoze ZPL BSD HPND GPL-2"
19 SLOT="0"
20 KEYWORDS="amd64 x86"
21 IUSE="doc test"
22 RESTRICT="!test? ( test )"
23
24 RDEPEND="
25         >=dev-python/meld3-1.0.0[${PYTHON_USEDEP}]
26         dev-python/setuptools[${PYTHON_USEDEP}]
27 "
28 BDEPEND="
29         dev-python/setuptools[${PYTHON_USEDEP}]
30         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
31         test? (
32                 ${RDEPEND}
33                 dev-python/mock[${PYTHON_USEDEP}]
34                 dev-python/pytest[${PYTHON_USEDEP}]
35         )
36 "
37
38 S="${WORKDIR}/${PN}-${MY_PV}"
39
40 python_compile_all() {
41         if use doc; then
42                 emake -C docs html
43                 HTML_DOCS=( docs/.build/html/. )
44         fi
45 }
46
47 python_test() {
48         pytest -vv || die "tests failed with ${EPYTHON}"
49 }
50
51 python_install_all() {
52         distutils-r1_python_install_all
53         newinitd "${FILESDIR}/init.d-r2" supervisord
54         newconfd "${FILESDIR}/conf.d-r1" supervisord
55         dodoc supervisor/skel/sample.conf
56         keepdir /etc/supervisord.d
57         insinto /etc
58         doins "${FILESDIR}/supervisord.conf"
59         keepdir /var/log/supervisor
60         systemd_dounit "${FILESDIR}/supervisord.service"
61 }
62
63 pkg_preinst() {
64         enewgroup supervisor
65         fowners :supervisor /var/log/supervisor
66         fperms 750 /var/log/supervisor
67 }
68
69 pkg_postinst() {
70         if [[ -z "${REPLACING_VERSIONS}" ]]; then
71                 # This is a new installation
72                 elog "You may install your configuration files in ${EROOT}/etc/supervisord.d"
73                 elog "For config examples, see ${EROOT}/usr/share/doc/${PF}/sample.conf.bz2"
74                 elog ""
75                 elog "By default, only members of the supervisor group can run supervisorctl."
76         fi
77 }