*/*: Bump copyright on files touched this year
[gentoo.git] / dev-libs / xmlrpc-c / xmlrpc-c-1.32.05-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="4"
5
6 inherit eutils multilib
7
8 # Maintainer notes: Take a look at http://xmlrpc-c.sourceforge.net/release.html
9 # We use "advanced" branch, so for the current release revision take look here:
10 # http://xmlrpc-c.svn.sourceforge.net/viewvc/xmlrpc-c/advanced/version.mk?view=log
11 # e.g. for 1.27.05 corresponds following revision 2182 and thus following URL:
12 # http://xmlrpc-c.svn.sourceforge.net/viewvc/xmlrpc-c/advanced.tar.gz?view=tar&pathrev=2182
13 # Note: autogenerated tarball checksum changes every download, thus download it
14 # manually and distribute on mirrors.
15 # It's possible to build net-libs/libwww without ssl support, but taking into
16 # account that libwww is not really well maintained and upstream is dead we
17 # better use it only in case ssl is required.
18
19 DESCRIPTION="A lightweigt RPC library based on XML and HTTP"
20 HOMEPAGE="http://xmlrpc-c.sourceforge.net/"
21 SRC_URI="https://dev.gentoo.org/~maksbotan/${P}.tar.gz"
22
23 LICENSE="BSD"
24 SLOT="0"
25 KEYWORDS="~alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
26 IUSE="abyss +cgi +curl +cxx +libxml2 static-libs threads test tools"
27 RESTRICT="!test? ( test )"
28
29 REQUIRED_USE="test? ( static-libs abyss curl cxx ) tools? ( curl )"
30
31 DEPEND="
32         sys-libs/ncurses
33         sys-libs/readline
34         curl? ( net-misc/curl )
35         libxml2? ( dev-libs/libxml2 )"
36
37 RDEPEND="${DEPEND}"
38
39 S="${WORKDIR}/advanced"
40
41 pkg_setup() {
42         use curl || ewarn "Curl support disabled: No client library will be built"
43 }
44
45 src_prepare() {
46         #Bug 214137: We need to filter this.
47         unset SRCDIR
48
49         # Bug 255440
50         export LC_ALL=C
51         export LANG=C
52
53         epatch "${FILESDIR}"/${PN}-1.32.05-Wimplicit.patch
54         sed -i \
55                 -e "/CFLAGS_COMMON/s|-g -O3$||" \
56                 -e "/CXXFLAGS_COMMON/s|-g$||" \
57                 "${S}"/common.mk || die
58
59         export LADD=${LDFLAGS} # Respect the user's LDFLAGS.
60
61         use static-libs || { sed \
62                 -e '/\(^TARGET_STATIC_LIBRARIES =\)/{s:\(^TARGET_STATIC_LIBRARIES =\).*:\1:;P;N;d;}' \
63                         -i common.mk || die; }
64 }
65
66 src_configure() {
67         #Disable libwww support due GBZ #409549 and #320253
68
69         econf --disable-wininet-client \
70                 $(use_enable libxml2 libxml2-backend) \
71                 --disable-libwww-client \
72                 --without-libwww-ssl  \
73                 $(use_enable threads abyss-threads) \
74                 $(use_enable cgi cgi-server) \
75                 $(use_enable abyss abyss-server) \
76                 $(use_enable cxx cplusplus) \
77                 $(use_enable curl curl-client)
78 }
79
80 src_compile() {
81         emake -r
82         use tools && emake -rC "${S}"/tools
83 }
84
85 src_install() {
86         default_src_install
87         use tools && emake DESTDIR="${D}" -rC "${S}"/tools install
88 }
89
90 src_test() {
91         unset LDFLAGS LADD SRCDIR
92         cd "${S}"/test/
93         einfo "Building general tests"
94         make || die "Make of general tests failed"
95         einfo "Running general tests"
96         ./test || die "General tests failed"
97         cd "${S}"/test/cpp/
98         einfo "Running C++ tests"
99         ./test || die "C++ tests failed"
100 }