eselect-repository-13.ebuild 1.3 KB

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