systemrescuecd-x86-4.7.0.ebuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. DESCRIPTION="The .iso image of SystemRescueCD rescue disk, x86 (+ amd64) variant"
  5. HOMEPAGE="http://www.sysresccd.org/"
  6. # Large ISO mirroring explicitly approved by infra in bug #588766
  7. SRC_URI="mirror://sourceforge/systemrescuecd/sysresccd-${PN#*-}/${PV}/${P}.iso"
  8. LICENSE="GPL-2"
  9. SLOT="${PV}"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE="+isohybrid"
  12. DEPEND="isohybrid? ( >=sys-boot/syslinux-4 )"
  13. S=${WORKDIR}
  14. src_install() {
  15. insinto "/usr/share/${PN%-*}"
  16. doins "${DISTDIR}/${P}.iso"
  17. if use isohybrid; then
  18. set -- isohybrid -u "${ED}usr/share/${PN%-*}/${P}.iso"
  19. echo "${@}"
  20. "${@}" || die "${*} failed"
  21. fi
  22. }
  23. pkg_postinst() {
  24. local f=${EROOT%/}/usr/share/${PN%-*}/${PN}-newest.iso
  25. # no version newer than ours? we're the newest!
  26. if ! has_version ">${CATEGORY}/${PF}"; then
  27. ln -f -s -v "${P}.iso" "${f}" || die
  28. fi
  29. }
  30. pkg_postrm() {
  31. local f=${EROOT%/}/usr/share/${PN%-*}/${PN}-newest.iso
  32. # if there is no version newer than ours installed
  33. if ! has_version ">${CATEGORY}/${PF}"; then
  34. # and we are truly and completely uninstalled...
  35. if [[ ! ${REPLACED_BY_VERSION} ]]; then
  36. # then find an older version to set the symlink to
  37. local newest_version=$(best_version "<${CATEGORY}/${PF}")
  38. if [[ ${newest_version} ]]; then
  39. # update the symlink
  40. ln -f -s -v "${newest_version%-r*}.iso" "${f}" || die
  41. else
  42. # last version removed? clean up the symlink
  43. rm -v "${f}" || die
  44. # and the parent directory
  45. rmdir "${f%/*}" || die
  46. fi
  47. fi
  48. fi
  49. }