dev-libs/iniparser: Fix re-introduced CVS header
[gentoo.git] / dev-libs / iniparser / iniparser-4.0.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 inherit eutils multilib toolchain-funcs
8
9 DESCRIPTION="A free stand-alone ini file parsing library"
10 HOMEPAGE="https://github.com/ndevilla/iniparser"
11 SRC_URI="https://github.com/ndevilla/iniparser/archive/v${PV}.tar.gz -> ${P}.tar.gz"
12
13 LICENSE="MIT"
14 SLOT="4"
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
16 IUSE="doc examples static-libs"
17
18 DEPEND="doc? ( app-doc/doxygen )"
19 RDEPEND=""
20
21 DOCS=( AUTHORS README.md )
22
23 PATCHES=(
24         "${FILESDIR}"/${P}-cflags.patch
25         "${FILESDIR}"/${P}-soname.patch
26 )
27
28 _newlib_so_with_symlinks() {
29         local source="${1}" base="${2}" current="${3}" revision="${4}" age="${5}"
30         local libdir="$(get_libdir)"
31
32         newlib.so ${source} ${base}.so.${current}.${revision}.${age}
33         for i in ".${current}" '' ; do
34                 dosym ${base}.so.${current}.${revision}.${age} /usr/${libdir}/${base}.so${i}
35         done
36 }
37
38 src_prepare() {
39         epatch "${PATCHES[@]}"
40         rm -R html || die
41 }
42
43 src_compile() {
44         emake CC="$(tc-getCC)" V=1
45 }
46
47 src_install() {
48         newlib.a lib${PN}.a lib${PN}${SLOT}.a
49         _newlib_so_with_symlinks lib${PN}.so lib${PN}${SLOT} 1 0 0
50
51         insinto /usr/include/${PN}${SLOT}
52         doins src/*.h
53
54         if use doc; then
55                 emake -C doc
56                 dohtml -r html/*
57         fi
58
59         if use examples ; then
60                 local examplesdir="/usr/share/doc/${PF}/examples"
61                 insinto "${examplesdir}"
62                 doins example/*
63                 docompress -x "${examplesdir}"
64         fi
65
66         dodoc "${DOCS[@]}"
67 }
68
69 src_test() {
70         emake -C test CC="$(tc-getCC)" V=1
71 }