1 # Copyright 1999-2017 Gentoo Foundation
 
   2 # Distributed under the terms of the GNU General Public License v2
 
   6 EGIT_REPO_URI="https://github.com/vaeth/eix.git"
 
  11 inherit autotools git-r3 bash-completion-r1 l10n systemd flag-o-matic
 
  13 DESCRIPTION="Search and query ebuilds"
 
  14 HOMEPAGE="https://github.com/vaeth/eix/"
 
  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"
 
  27         doc? ( dev-python/docutils )
 
  28         >=sys-devel/gettext-0.18.3"
 
  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
 
  40         sed -i -e "s:/:${EPREFIX}/:" tmpfiles.d/eix.conf || die
 
  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
 
  53                 $(use_with doc extra-doc)
 
  56                 # default configuration
 
  57                 $(use_with prefix always-accept-keywords)
 
  59                 --with-required-use-default
 
  62                 --with-portage-rootpath="${ROOTPATH}"
 
  63                 --with-eprefix-default="${EPREFIX}"
 
  65                 # build a single executable with symlinks
 
  66                 --disable-separate-binaries
 
  67                 --disable-separate-tools
 
  69                 # used purely to control/disrespect *FLAGS
 
  72                 --disable-optimization
 
  73                 --disable-strong-optimization
 
  75                 --disable-nopie-security
 
  76                 --disable-strong-security
 
  79         # https://github.com/vaeth/eix/issues/35
 
  80         append-cxxflags -std=c++11
 
  88         systemd_dotmpfilesd tmpfiles.d/eix.conf
 
  90         insinto /usr/share/${PN}
 
  91         doins "${ED}"/usr/bin/eix-functions.sh
 
  92         rm -r "${ED}"/usr/bin/eix-functions.sh || die
 
  94         keepdir /var/cache/eix
 
  99                 # note: if this is done in src_install(), portage:portage
 
 100                 # ownership may be reset to root
 
 101                 chown portage:portage "${EROOT%/}"/var/cache/eix || die
 
 104         local obs=${EROOT%/}/var/cache/eix.previous
 
 105         if [[ -f ${obs} ]]; then
 
 106                 ewarn "Found obsolete ${obs}, please remove it"
 
 111         if [[ ! -n ${REPLACED_BY_VERSION} ]]; then
 
 112                 rm -rf "${EROOT%/}/var/cache/${PN}" || die