]> Pileus Git - ~andy/sunrise/blob - app-office/radicale/radicale-0.7.1-r1.ebuild
app-office/radicale: Add ~amd64 keyword, EAPI bump
[~andy/sunrise] / app-office / radicale / radicale-0.7.1-r1.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="5"
6 PYTHON_DEPEND="*:2.6"
7 SUPPORT_PYTHON_ABIS=1
8
9 inherit distutils user
10
11 MY_PN="Radicale"
12 MY_P="${MY_PN}-${PV}"
13
14 DESCRIPTION="A simple CalDAV calendar server"
15 HOMEPAGE="http://www.radicale.org/"
16 SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
17
18 LICENSE="GPL-3"
19 SLOT="0"
20 KEYWORDS="~amd64 ~x86"
21 IUSE="fastcgi ldap ssl"
22
23 # the '>=' goes ok, as radicale supports _all_ other python version
24 # this includes all 3.* versions
25 RDEPEND="ssl? ( >=dev-lang/python-2.6.6[ssl] )
26                 ldap? ( dev-python/python-ldap )
27                 fastcgi? ( dev-python/flup )"
28
29 # radicale's authentication against PAM is not possible here:
30 # Gentoo has not included the package
31 # also it seems old, which is bad with respect to
32 # http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-1502
33
34 S=${WORKDIR}/${MY_P}
35
36 RDIR=/var/lib/radicale
37 LDIR=/var/log/radicale
38
39 pkg_setup() {
40         python_pkg_setup
41         enewgroup radicale
42         enewuser radicale -1 -1 ${RDIR} radicale
43 }
44
45 src_prepare() {
46         # fix pathes
47         sed -i -e "s:^\(filesystem_folder = \).*$:\1${RDIR}:g" \
48                                 config || die
49         sed -i -e "s;^\(args = ('/var/log/radicale\);\1/radicale.log;" \
50                                 logging || die
51         distutils_src_prepare
52 }
53
54 src_install() {
55         # delete the useless .rst, so that it is not installed
56         rm README.rst
57
58         distutils_src_install
59
60         # init file
61         newinitd "${FILESDIR}"/radicale.init.d radicale || die
62
63         # directories
64         diropts -m0750
65         dodir ${RDIR}; fowners radicale:radicale ${RDIR}
66         dodir ${LDIR}; fowners radicale:radicale ${LDIR}
67
68         # config file
69         insinto /etc/${PN}
70         doins config logging || die
71
72         # fcgi and wsgi files
73         insinto /usr/share/${PN}
74         doins radicale.wsgi
75         use fastcgi && doins radicale.fcgi
76 }
77
78 pkg_postinst() {
79         einfo "Radicale now supports WSGI."
80         einfo "A sample wsgi-script has been put into ${ROOT}usr/share/${PN}."
81         use fastcgi && einfo "You will also find there an example fcgi-script."
82
83         distutils_pkg_postinst
84 }