app-admin/awscli: Bump to 1.37.9
[gentoo/gentoo.git] / www-apps / radicale / radicale-3.3.1.ebuild
blob737c936a67a448afd5390bbfa4ea5aa881250664
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 DISTUTILS_USE_PEP517=setuptools
7 PYTHON_COMPAT=( python3_{10..13} )
9 inherit distutils-r1 optfeature systemd
11 MY_P=${P^}
12 DESCRIPTION="A simple CalDAV calendar server"
13 HOMEPAGE="https://radicale.org/"
14 SRC_URI="
15         https://github.com/Kozea/Radicale/archive/refs/tags/v${PV}.tar.gz
16                 -> ${MY_P}.gh.tar.gz
18 S=${WORKDIR}/${MY_P}
20 LICENSE="GPL-3+"
21 SLOT="0"
22 KEYWORDS="~amd64 ~arm ~x86"
24 RDEPEND="
25         >=acct-user/radicale-0-r2
26         acct-group/radicale
27         dev-python/bcrypt[${PYTHON_USEDEP}]
28         dev-python/defusedxml[${PYTHON_USEDEP}]
29         dev-python/passlib[${PYTHON_USEDEP}]
30         dev-python/vobject[${PYTHON_USEDEP}]
31         sys-apps/util-linux
34 BDEPEND="
35         test? (
36                 dev-python/pytest[${PYTHON_USEDEP}]
37                 dev-python/waitress[${PYTHON_USEDEP}]
38         )
41 distutils_enable_tests pytest
43 RDIR=/var/lib/"${PN}"
45 DOCS=( DOCUMENTATION.md CHANGELOG.md )
47 python_test() {
48         epytest -o addopts= radicale/tests/
51 python_install_all() {
52         rm README* || die
53         # init file
54         newinitd "${FILESDIR}"/radicale-r4.init.d radicale
55         systemd_dounit "${FILESDIR}/${PN}.service"
57         # directories
58         keepdir "${RDIR}"
59         fperms 0750 "${RDIR}"
60         fowners "${PN}:${PN}" "${RDIR}"
62         # config file
63         insinto /etc/"${PN}"
64         doins config
66         # fcgi and wsgi files
67         exeinto /usr/share/"${PN}"
68         doexe radicale.wsgi
70         distutils-r1_python_install_all
73 pkg_postinst() {
74         local _erdir="${EROOT}${RDIR}"
76         einfo "A sample WSGI script has been put into ${EROOT}/usr/share/${PN}."
77         einfo "You will also find there an example FastCGI script."
78         if [[ $(stat --format="%U:%G:%a" "${_erdir}") != "${PN}:${PN}:750" ]]
79         then
80                 ewarn ""
81                 ewarn "Unsafe file permissions detected on ${_erdir}."
82                 ewarn "This probably comes from an earlier version of this ebuild."
83                 ewarn "To fix run:"
84                 ewarn "#  \`chown -R ${PN}:${PN} ${_erdir}\`"
85                 ewarn "#  \`chmod 0750 ${_erdir}\`"
86                 ewarn "#  \`chmod -R o= ${_erdir}\`"
87         fi
89         optfeature "Publish changes to rabbitmq" dev-python/pika
90         optfeature "LDAP/LDAPS authentication" dev-python/ldap3 dev-python/python-ldap