f44fc8f3ffbbc311fdb31f635f9fef16bb8e5d4a
[gentoo.git] / dev-libs / libreport / libreport-2.10.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python3_{6,7} )
6
7 inherit autotools python-r1 user
8
9 DESCRIPTION="Generic library for reporting software bugs"
10 HOMEPAGE="https://github.com/abrt/libreport"
11 SRC_URI="https://github.com/abrt/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16
17 IUSE="+gtk python"
18 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
19
20 COMMON_DEPEND="${PYTHON_DEPS}
21         app-admin/augeas
22         >=dev-libs/glib-2.43.4:2
23         dev-libs/satyr:0=
24         dev-libs/json-c:=
25         dev-libs/libtar
26         dev-libs/libxml2:2
27         dev-libs/newt:=
28         dev-libs/xmlrpc-c:=
29         net-libs/libproxy:=
30         net-misc/curl:=[ssl]
31         sys-apps/dbus
32         sys-apps/systemd
33         gtk? ( >=x11-libs/gtk+-3.3.12:3 )
34         python? ( ${PYTHON_DEPS} )
35         x11-misc/xdg-utils
36 "
37 RDEPEND="${COMMON_DEPEND}"
38
39 DEPEND="${COMMON_DEPEND}
40         app-text/asciidoc
41         app-text/xmlto
42         >=dev-util/intltool-0.3.50
43         >=sys-devel/gettext-0.17
44         virtual/pkgconfig
45 "
46
47 # Tests require python-meh, which is highly redhat-specific.
48 RESTRICT="test"
49
50 pkg_setup() {
51         enewgroup abrt
52         enewuser abrt -1 -1 -1 abrt
53 }
54
55 src_prepare() {
56         default
57         ./gen-version || die # Needed to be run before autoreconf
58         eautoreconf
59         use python && python_copy_sources
60 }
61
62 src_configure() {
63         local myargs=(
64                 --localstatedir="${EPREFIX}/var"
65                 --without-bugzilla
66                 # Fixes "syntax error in VERSION script" and we aren't supporting Python2 anyway
67                 --without-python2
68                 $(usex python "--with-python3" "--without-python3")
69         )
70         if use python; then
71                 python_foreach_impl run_in_build_dir \
72                         econf "${myargs[@]}"
73         else
74                 econf "${myargs[@]}"
75         fi
76 }
77
78 src_compile() {
79         use python && python_foreach_impl run_in_build_dir default
80 }
81
82 src_install() {
83         use python && python_foreach_impl run_in_build_dir default
84         # Need to set correct ownership for use by app-admin/abrt
85         diropts -o abrt -g abrt
86         keepdir /var/spool/abrt
87
88         find "${D}" -name '*.la' -exec rm -f {} + || die
89 }