linamh/app-emulation/opencbm/opencbm-0.4.99.98-r1.ebuild

93 lines
3.0 KiB
Bash
Raw Normal View History

2017-11-10 12:02:18 +01:00
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
inherit eutils toolchain-funcs linux-mod versionator udev
PV_MAJOR=$(get_major_version)
PV_MINOR=$(get_version_component_range 2)
SDIR="include libmisc arch/linux lib cbmctrl cbmformat d64copy cbmcopy libtrans cbmforng d82copy demo/flash demo/morse demo/rpm1541 sample/libtrans cbmrpm41"
DESCRIPTION="OpenCBM is a package to control and use serial devices as used by most Commodore (CBM) 8-bit mach"
HOMEPAGE="http://opencbm.trikaliotis.net/"
#SRC_URI="http://debian.trikaliotis.net/opencbm/opencbm_${PV}-1.tar.gz"
SRC_URI="http://www.trikaliotis.net/Download/opencbm-${PV}/opencbm-${PV}-source.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~sparc ~x86"
IUSE="doc"
DEPEND="virtual/linux-sources
dev-embedded/cc65
app-text/linuxdoc-tools
app-text/docbook-xml-dtd:4.1.2
dev-libs/libusb-compat"
S="${WORKDIR}"/${PN}-${PV}
BUILD_PARAMS="KDIR=$KERNEL_DIR"
MODULE_NAMES="cbm(misc:${S}/opencbm/sys/linux:${S}/opencbm/sys/linux)"
BUILD_TARGETS="all"
src_prepare() {
rm -rf "${WORKDIR}"/${PN}-${PV}/{cbm4wingui,gui4cbm4win.vb6.old,windrv}
# convert linefeed
#edos2unix `find . -name '*' -type f`
# 6502 sources ar always up to date
touch `find . -name '*.?65' -type f`
# add debian patches no demo & doc & no kernel
EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="patch" \
EPATCH_FORCE="yes" epatch
# sed correct path
sed -e 's,^PREFIX.*,PREFIX = /usr,' \
-e 's,/man/man1,/share/man/man1,g' \
-e 's,etc/udev/rules.d,lib/udev/rules.d,g' \
-e 's,/info,/share/info,g' -i ${S}/opencbm/LINUX/config.make
# sed correct path
sed -e 's,opencbm/sys/linux/,,g' \
-e 's,etc/udev/rules.d,lib/udev/rules.d,g' -i ${S}/LINUX/Makefile
# copy module makefile that don't intefer with gentoo kernel build system
cp ${FILESDIR}/Makefile ${S}/opencbm/sys/linux/Makefile
}
src_compile() {
emake -j1 -f LINUX/Makefile CC="$(tc-getCC)" AR="$(tc-getAR)" all || die "make fail"
linux-mod_src_compile
}
src_install() {
dodir lib/udev/rules.d
dodir etc/opencbm.conf.d
dodir usr/lib/opencbm
emake -f LINUX/Makefile DESTDIR="${D}" install-all
exeinto usr/lib/opencbm
doexe opencbm/LINUX/plugin_helper_tools
newexe debian/install_plugin.sh install_plugin
insinto lib/udev/rules.d
newins opencbm/sys/linux/45-opencbm-xa1541.rules 45-opencbm-xa1541.rules
rm -rf ${D}/var
linux-mod_src_install
generate_modulesd
# exit 1
}
pkg_postinst() {
linux-mod_pkg_postinst
${EROOT}/usr/lib/opencbm/install_plugin install xa1541
${EROOT}/usr/lib/opencbm/install_plugin install xu1541
${EROOT}/usr/lib/opencbm/install_plugin install xum1541
}
pkg_prerm() {
${EROOT}/usr/lib/opencbm/install_plugin uninstall xa1541
${EROOT}/usr/lib/opencbm/install_plugin uninstall xu1541
${EROOT}/usr/lib/opencbm/install_plugin uninstall xum1541
}
pkg_postrm() {
linux-mod_pkg_postrm
}