1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 DESCRIPTION="The .iso image of SystemRescueCD rescue disk, x86 (+ amd64) variant"
7 HOMEPAGE="http://www.sysresccd.org/"
8 # Large ISO mirroring explicitly approved by infra in bug #588766
9 SRC_URI="mirror://sourceforge/systemrescuecd/sysresccd-${PN#*-}/${PV}/${P}.iso"
13 KEYWORDS="~amd64 ~x86"
16 DEPEND="isohybrid? ( >=sys-boot/syslinux-4 )"
21 insinto "/usr/share/${PN%-*}"
22 doins "${DISTDIR}/${P}.iso"
24 if use isohybrid; then
25 set -- isohybrid -u "${ED}usr/share/${PN%-*}/${P}.iso"
27 "${@}" || die "${*} failed"
32 local f=${EROOT%/}/usr/share/${PN%-*}/${PN}-newest.iso
34 # no version newer than ours? we're the newest!
35 if ! has_version ">${CATEGORY}/${PF}"; then
36 ln -f -s -v "${P}.iso" "${f}" || die
41 local f=${EROOT%/}/usr/share/${PN%-*}/${PN}-newest.iso
43 # if there is no version newer than ours installed
44 if ! has_version ">${CATEGORY}/${PF}"; then
45 # and we are truly and completely uninstalled...
46 if [[ ! ${REPLACED_BY_VERSION} ]]; then
47 # then find an older version to set the symlink to
48 local newest_version=$(best_version "<${CATEGORY}/${PF}")
50 if [[ ${newest_version} ]]; then
52 ln -f -s -v "${newest_version%-r*}.iso" "${f}" || die
54 # last version removed? clean up the symlink
56 # and the parent directory
57 rmdir "${f%/*}" || die