dev-python/flask-babelex: Support python 3.6
[gentoo.git] / app-admin / systemrescuecd-x86 / systemrescuecd-x86-5.1.0.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
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"
10
11 LICENSE="GPL-2"
12 SLOT="${PV}"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="+isohybrid"
15
16 DEPEND="isohybrid? ( >=sys-boot/syslinux-4 )"
17
18 S=${WORKDIR}
19
20 src_install() {
21         insinto "/usr/share/${PN%-*}"
22         doins "${DISTDIR}/${P}.iso"
23
24         if use isohybrid; then
25                 set -- isohybrid -u "${ED}usr/share/${PN%-*}/${P}.iso"
26                 echo "${@}"
27                 "${@}" || die "${*} failed"
28         fi
29 }
30
31 pkg_postinst() {
32         local f=${EROOT%/}/usr/share/${PN%-*}/${PN}-newest.iso
33
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
37         fi
38 }
39
40 pkg_postrm() {
41         local f=${EROOT%/}/usr/share/${PN%-*}/${PN}-newest.iso
42
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}")
49
50                         if [[ ${newest_version} ]]; then
51                                 # update the symlink
52                                 ln -f -s -v "${newest_version%-r*}.iso" "${f}" || die
53                         else
54                                 # last version removed? clean up the symlink
55                                 rm -v "${f}" || die
56                                 # and the parent directory
57                                 rmdir "${f%/*}" || die
58                         fi
59                 fi
60         fi
61 }