*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / net-libs / xrootd / xrootd-4.10.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python2_7 python3_{6,7} )
7
8 inherit cmake-utils python-single-r1 user
9
10 DESCRIPTION="Extended ROOT remote file server"
11 HOMEPAGE="http://xrootd.org/"
12 SRC_URI="http://xrootd.org/download/v${PV}/${P}.tar.gz"
13
14 LICENSE="LGPL-3"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
17 IUSE="doc examples fuse http kerberos python readline ssl test"
18 RESTRICT="!test? ( test )"
19
20 CDEPEND="
21         sys-libs/zlib
22         fuse? ( sys-fs/fuse:= )
23         kerberos? ( virtual/krb5 )
24         python? ( ${PYTHON_DEPS} )
25         readline? ( sys-libs/readline:0= )
26         ssl? ( dev-libs/openssl:0= )
27 "
28 DEPEND="${CDEPEND}
29         doc? (
30                 app-doc/doxygen[dot]
31                 python? ( dev-python/sphinx )
32         )
33         test? ( dev-util/cppunit )
34 "
35 RDEPEND="${CDEPEND}
36         dev-lang/perl
37 "
38 REQUIRED_USE="
39         http? ( kerberos ssl )
40         python? ( ${PYTHON_REQUIRED_USE} )
41 "
42
43 PATCHES=( "${FILESDIR}"/xrootd-4.8.3-crc32.patch )
44
45 # xrootd plugins are not intended to be linked with,
46 # they are to be loaded at runtime by xrootd,
47 # see https://github.com/xrootd/xrootd/issues/447
48 QA_SONAME="/usr/lib.*/libXrd*-4.so"
49
50 pkg_setup() {
51         enewgroup xrootd
52         enewuser xrootd -1 -1 "${EPREFIX}"/var/spool/xrootd xrootd
53         use python && python_setup
54 }
55
56 src_configure() {
57         local mycmakeargs=(
58                 -DENABLE_CRYPTO=$(usex ssl)
59                 -DENABLE_FUSE=$(usex fuse)
60                 -DENABLE_HTTP=$(usex http)
61                 -DENABLE_KRB5=$(usex kerberos)
62                 -DENABLE_PYTHON=$(usex python)
63                 -DENABLE_READLINE=$(usex readline)
64                 -DENABLE_TESTS=$(usex test)
65         )
66         cmake-utils_src_configure
67 }
68
69 src_compile() {
70         cmake-utils_src_compile
71         if use doc; then
72                 doxygen Doxyfile || die
73                 if use python; then
74                         emake -C bindings/python/docs html
75                 fi
76         fi
77 }
78
79 src_install() {
80         use doc && HTML_DOCS=( doxydoc/html/. )
81         dodoc docs/ReleaseNotes.txt
82         cmake-utils_src_install
83         find "${D}" \( -iname '*.md5' -o -iname '*.map' \) -delete || die
84
85         # base configs
86         insinto /etc/xrootd
87         doins packaging/common/*.cfg
88
89         fowners root:xrootd /etc/xrootd
90         keepdir /var/log/xrootd
91         fowners xrootd:xrootd /var/log/xrootd
92
93         local i
94         for i in cmsd frm_purged frm_xfrd xrootd; do
95                 newinitd "${FILESDIR}"/${i}.initd ${i}
96         done
97         # all daemons MUST use single master config file
98         newconfd "${FILESDIR}"/xrootd.confd xrootd
99
100         if use python; then
101                 python_optimize "${D}/$(python_get_sitedir)"
102
103                 if use doc; then
104                         docinto python
105                         docompress -x "/usr/share/doc/${PF}/python/html"
106                         dodoc -r bindings/python/docs/build/html
107                 fi
108                 if use examples; then
109                         docinto python
110                         dodoc -r bindings/python/examples
111                 fi
112         fi
113 }