eselect-repository-8.ebuild 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Copyright 1999-2020 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python3_{6..9} )
  5. inherit python-single-r1
  6. DESCRIPTION="Manage repos.conf via eselect"
  7. HOMEPAGE="https://github.com/mgorny/eselect-repository"
  8. SRC_URI="
  9. https://github.com/mgorny/eselect-repository/archive/v${PV}.tar.gz
  10. -> ${P}.tar.gz"
  11. LICENSE="BSD-2"
  12. SLOT="0"
  13. KEYWORDS="~alpha amd64 arm arm64 ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86"
  14. IUSE="+curl"
  15. REQUIRED_USE=${PYTHON_REQUIRED_USE}
  16. RDEPEND="
  17. ${PYTHON_DEPS}
  18. app-admin/eselect
  19. $(python_gen_cond_dep 'dev-python/lxml[${PYTHON_MULTI_USEDEP}]')
  20. !curl? ( net-misc/wget )
  21. curl? ( net-misc/curl )
  22. "
  23. src_prepare() {
  24. if use curl; then
  25. sed -i repository.eselect.in \
  26. -e 's/wget -N -P/curl -LO --create-dirs --output-dir/'
  27. fi || die 'sed failed'
  28. default
  29. }
  30. src_compile() {
  31. MAKEARGS=(
  32. PREFIX="${EPREFIX}/usr"
  33. SYSCONFDIR="${EPREFIX}/etc"
  34. SHAREDSTATEDIR="${EPREFIX}/var"
  35. ESELECTDIR="${EPREFIX}/usr/share/eselect/modules"
  36. )
  37. emake "${MAKEARGS[@]}"
  38. python_fix_shebang eselect-repo-helper
  39. }
  40. src_install() {
  41. emake "${MAKEARGS[@]}" DESTDIR="${D}" install
  42. keepdir /var/db/repos
  43. einstalldocs
  44. }