]> git.bzium.org/ - embe/overlay.git/blob - app-portage/eix/eix-9999.ebuild
55186a34c31d79cc9731fcd93aaee7af58994418
[embe/overlay.git] / app-portage / eix / eix-9999.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 EGIT_REPO_URI="https://github.com/vaeth/eix.git"
7
8 WANT_LIBTOOL="none"
9
10 PLOCALES="de ru"
11 inherit autotools git-r3 bash-completion-r1 l10n systemd flag-o-matic
12
13 DESCRIPTION="Search and query ebuilds"
14 HOMEPAGE="https://github.com/vaeth/eix/"
15
16 LICENSE="GPL-2"
17 SLOT="0"
18 KEYWORDS=""
19 IUSE="debug doc nls sqlite"
20
21 BOTHDEPEND="nls? ( virtual/libintl )
22         sqlite? ( >=dev-db/sqlite-3:= )"
23 RDEPEND="${BOTHDEPEND}
24         >=app-shells/push-2.0-r1
25         >=app-shells/quoter-3.0_p2-r1"
26 DEPEND="${BOTHDEPEND}
27         doc? ( dev-python/docutils )
28         >=sys-devel/gettext-0.18.3"
29
30 pkg_setup() {
31         # remove stale cache file to prevent collisions
32         local old_cache=${EROOT%/}/var/cache/${PN}
33         if [[ -f ${old_cache} ]]; then
34                 rm "${old_cache}" || die
35         fi
36 }
37
38 src_prepare() {
39         default
40         sed -i -e "s:/:${EPREFIX}/:" tmpfiles.d/eix.conf || die
41
42         sed -e "/eixf_source=/s:push.sh:cat \"${EROOT}usr/share/push/push.sh\":" \
43                 -e "/eixf_source=/s:quoter_pipe.sh:cat \"${EROOT}usr/share/quoter/quoter_pipe.sh\":" \
44                 -i src/eix-functions.sh.in || die
45         sed -e "s:'\$(bindir)/eix-functions.sh':cat \\\\\"${EROOT}usr/share/eix/eix-functions.sh\\\\\":" \
46                 -i src/Makefile.am || die
47         eautoreconf
48 }
49
50 src_configure() {
51         local myconf=(
52                 $(use_enable debug paranoicasserts)
53                 $(use_enable nls)
54                 $(use_with doc extra-doc)
55                 $(use_with sqlite)
56
57                 # default configuration
58                 $(use_with prefix always-accept-keywords)
59                 --with-dep-default
60                 --with-required-use-default
61
62                 # paths
63                 --with-portage-rootpath="${ROOTPATH}"
64                 --with-eprefix-default="${EPREFIX}"
65
66                 # build a single executable with symlinks
67                 --disable-separate-binaries
68                 --disable-separate-tools
69
70                 # used purely to control/disrespect *FLAGS
71                 --disable-debugging
72                 --disable-new_dialect
73                 --disable-optimization
74                 --disable-strong-optimization
75                 --disable-security
76                 --disable-nopie-security
77                 --disable-strong-security
78         )
79
80         # https://github.com/vaeth/eix/issues/35
81         append-cxxflags -std=c++11
82
83         econf "${myconf[@]}"
84 }
85
86 src_install() {
87         default
88         dobashcomp bash/eix
89         systemd_dotmpfilesd tmpfiles.d/eix.conf
90
91         insinto /usr/share/${PN}
92         doins "${ED}"/usr/bin/eix-functions.sh
93         rm -r "${ED}"/usr/bin/eix-functions.sh || die
94
95         keepdir /var/cache/eix
96 }
97
98 pkg_postinst() {
99         if ! use prefix; then
100                 # note: if this is done in src_install(), portage:portage
101                 # ownership may be reset to root
102                 chown portage:portage "${EROOT%/}"/var/cache/eix || die
103         fi
104
105         local obs=${EROOT%/}/var/cache/eix.previous
106         if [[ -f ${obs} ]]; then
107                 ewarn "Found obsolete ${obs}, please remove it"
108         fi
109 }
110
111 pkg_postrm() {
112         if [[ ! -n ${REPLACED_BY_VERSION} ]]; then
113                 rm -rf "${EROOT%/}/var/cache/${PN}" || die
114         fi
115 }