gnome.org.eclass 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Copyright 1999-2011 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # @ECLASS: gnome.org.eclass
  4. # @MAINTAINER:
  5. # gnome@gentoo.org
  6. # @AUTHOR:
  7. # Authors: Spidler <spidler@gentoo.org> with help of carparski.
  8. # eclass variable additions and documentation: Gilles Dartiguelongue <eva@gentoo.org>
  9. # @BLURB: Helper eclass for gnome.org hosted archives
  10. # @DESCRIPTION:
  11. # Provide a default SRC_URI for tarball hosted on gnome.org mirrors.
  12. inherit versionator
  13. # @ECLASS-VARIABLE: GNOME_TARBALL_SUFFIX
  14. # @DESCRIPTION:
  15. # Most projects hosted on gnome.org mirrors provide tarballs as tar.bz2 or
  16. # tar.xz. This eclass defaults to bz2 for EAPI 0, 1, 2, 3 and defaults to xz for
  17. # everything else. This is because the gnome mirrors are moving to only have xz
  18. # tarballs for new releases.
  19. if has "${EAPI:-0}" 0 1 2 3; then
  20. : ${GNOME_TARBALL_SUFFIX:="bz2"}
  21. else
  22. : ${GNOME_TARBALL_SUFFIX:="xz"}
  23. fi
  24. # Even though xz-utils are in @system, they must still be added to DEPEND; see
  25. # https://archives.gentoo.org/gentoo-dev/msg_a0d4833eb314d1be5d5802a3b710e0a4.xml
  26. if [[ ${GNOME_TARBALL_SUFFIX} == "xz" ]]; then
  27. DEPEND="${DEPEND} app-arch/xz-utils"
  28. fi
  29. # @ECLASS-VARIABLE: GNOME_ORG_MODULE
  30. # @DESCRIPTION:
  31. # Name of the module as hosted on gnome.org mirrors.
  32. # Leave unset if package name matches module name.
  33. : ${GNOME_ORG_MODULE:=$PN}
  34. # @ECLASS-VARIABLE: GNOME_ORG_PVP
  35. # @INTERNAL
  36. # @DESCRIPTION:
  37. # Major and minor numbers of the version number.
  38. : ${GNOME_ORG_PVP:=$(get_version_component_range 1-2)}
  39. SRC_URI="mirror://gnome/sources/${GNOME_ORG_MODULE}/${GNOME_ORG_PVP}/${GNOME_ORG_MODULE}-${PV}.tar.${GNOME_TARBALL_SUFFIX}"
  40. S="${WORKDIR}/${GNOME_ORG_MODULE}-${PV}"