# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

MY_PV="r$PV"
MY_PN="dps8"

DESCRIPTION="Simh based 36-bit GE Large Systems mainframe simulator of the Honeywell/Bull DPS-8/M (decendend from GE-645) Multics processor"
HOMEPAGE="https://dps8m.gitlab.io/dps8m/"
SRC_URI="https://dps8m.gitlab.io/dps8m-r3.1.0-archive/R3.1.0/dps8m-${MY_PV}-src.tar.lz -> ${PN}-${MY_PV}.tar.lz"

S="${WORKDIR}/${MY_PN}"

LICENSE="icu"
SLOT="0"
KEYWORDS="~amd64 ~x86"

RDEPEND=""
DEPEND="${RDEPEND}"
BDEPEND="|| ( app-arch/lunzip app-alternatives/lzip )"

src_unpack() {
	lunzip -cd "${DISTDIR}/${A}" | tar -xf - || die "unpack failed"
}

src_install() {
	dobin src/${MY_PN}/${MY_PN}
}

pkg_postinst() {
	elog "If you need an operating system that runs on the Honeywell/Bull DPS-8/M mainframe,"
	elog "    consider Multics."
	elog
	elog "Further information and a ready-to-use boot configuration with image can be found at:"
	elog "    https://multicians.org/simulator.html"
	elog "    https://multics-wiki.swenson.org/index.php/Getting_Started"
}