make module eclass more general

git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/linamh@1295 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
geos_one 2009-06-06 16:01:26 +00:00
parent 0ee22c6477
commit 923bc6ba63
2 changed files with 52 additions and 36 deletions

View File

@ -14,6 +14,8 @@ esac
# Only one package per "product" is allowed to be installed at any given time.
#NEW_VAR=$(eval \$VM_SRC_${ARCH})
inherit pax-utils eutils
EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_setup src_prepare src_install src_unpack pkg_postrm pkg_nofetch
@ -145,7 +147,8 @@ vmware-1_pkg_setup() {
}
vmware-1_src_unpack() {
unpack ${VM_SRC}
[[ -e ${DISTDIR}/${VM_SRC} ]] && unpack ${VM_SRC}
[[ -e ${DISTDIR}/${VM_SRC64} ]] && unpack ${VM_SRC64}
if [ -n "${VM_SRC_EXTRA}" ]
then
for a in ${VM_SRC_EXTRA}
@ -153,6 +156,13 @@ vmware-1_src_unpack() {
unpack ${P/_p/-}-${a}.tar.bz2
done
fi
if [ -n "${VM_SRC_EXTRA64}" ]
then
for a in ${VM_SRC_EXTRA64}
do
unpack ${P/_p/-}-${a}.tar.bz2
done
fi
}
vmware-1_src_prepare() {
@ -406,7 +416,12 @@ vmware-1_pkg_postrm() {
vmware-1_pkg_nofetch() {
einfo "This files require you to register at www.vmware.com"
einfo "Please download following files:"
einfo " - ${VM_SRC} from ${HOMEPAGE}"
if [ -n "${VM_SRC64}" ]
then
einfo " - ${VM_SRC64} from ${HOMEPAGE}"
else
einfo " - ${VM_SRC} from ${HOMEPAGE}"
fi
if [ -n "${VM_SRC_EXTRA}" ]
then
for a in ${VM_SRC_EXTRA}
@ -414,6 +429,13 @@ vmware-1_pkg_nofetch() {
einfo " - http://ftp.mars.arge.at/vmware/${P/_p/-}-${a}.tar.bz2"
done
fi
if [ -n "${VM_SRC_EXTRA64}" ]
then
for a in ${VM_SRC_EXTRA64}
do
einfo " - http://ftp.mars.arge.at/vmware/${P/_p/-}-${a}.tar.bz2"
done
fi
einfo "and place them in ${DISTDIR}"
}

View File

@ -40,7 +40,7 @@ case ${PN} in
S="${SRC}/modules/linux"
;;
*)
ewarn "unknown modules package"
eerror "unknown modules package"
;;
esac
@ -63,29 +63,21 @@ vmware-mod-2_pkg_setup() {
# standard build target
BUILD_TARGETS="auto-build HEADER_DIR=${KERNEL_DIR}/include BUILD_DIR=${KV_OUT_DIR}"
if [[ -z "${VMWARE_MODULE_LIST}" ]]; then
case ${PN} in
vmware-modules)
case ${PV} in
138.*)
VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vmmon vmnet"
;;
169.*)
VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vmmon vmnet vmblock"
;;
208.*)
VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vmmon vmnet vmblock vmci vsock"
;;
esac
for mod in ${VMWARE_MODULE_LIST}; do
case ${PN} in
vmware-modules)
if [[ -n "${VM_MODULE_LIST}" ]]; then
for mod in ${VM_MODULE_LIST}; do
MODULE_NAMES="${MODULE_NAMES} ${mod}(vmware:${S}/${mod}-only)"
done
;;
open-vm-modules)
# extend the build target for open-vm-modules
BUILD_TARGETS="${BUILD_TARGETS} OVT_SOURCE_DIR=${SRC}"
VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} pvscsi vmblock vmci vmhgfs vmmemctl vmsync vmxnet vmxnet3 vsock"
for mod in ${VMWARE_MODULE_LIST}; do
else
eerror "Buggy package plz specify VM_MODULE_LIST"
fi
;;
open-vm-modules)
# extend the build target for open-vm-modules
BUILD_TARGETS="${BUILD_TARGETS} OVT_SOURCE_DIR=${SRC}"
if [[ -n "${VM_MODULE_LIST}" ]]; then
for mod in ${VM_MODULE_LIST}; do
# modules should go into right directory
# this should some day be extended for the fs modules vmblock & vmhgfs and pvscsi
if [ "${mod}" == "vmxnet" -o "${mod}" == "vmxnet3" ];
@ -96,12 +88,14 @@ vmware-mod-2_pkg_setup() {
fi
MODULE_NAMES="${MODULE_NAMES} ${mod}(${MODTARGET}:${S}/${mod})"
done
;;
*)
ewarn "unknown modules package"
else
eerror "Buggy package plz specify VM_MODULE_LIST"
fi
;;
esac
fi
*)
eerror "unknown modules package"
;;
esac
}
vmware-mod-2_src_unpack() {
@ -109,7 +103,7 @@ vmware-mod-2_src_unpack() {
vmware-modules)
unpack ${A}
cd "${S}"
for mod in ${VMWARE_MODULE_LIST}; do
for mod in ${VM_MODULE_LIST}; do
unpack ./${mod}.tar
done
;;
@ -117,7 +111,7 @@ vmware-mod-2_src_unpack() {
unpack ${A}
;;
*)
ewarn "unknown modules package"
eerror "unknown modules package"
;;
esac
@ -126,17 +120,17 @@ vmware-mod-2_src_unpack() {
vmware-mod-2_src_prepare() {
case ${PN} in
vmware-modules)
for mod in ${VMWARE_MODULE_LIST}; do
for mod in ${VM_MODULE_LIST}; do
convert_to_m "${S}"/${mod}-only/Makefile
done
;;
open-vm-modules)
for mod in ${VMWARE_MODULE_LIST}; do
for mod in ${VM_MODULE_LIST}; do
convert_to_m "${S}"/${mod}/Makefile
done
;;
*)
ewarn "unknown modules package"
eerror "unknown modules package"
;;
esac
@ -157,7 +151,7 @@ vmware-mod-2_src_install() {
case ${PN} in
vmware-modules)
dodir /etc/udev/rules.d
for mod in ${VMWARE_MODULE_LIST}; do
for mod in ${VM_MODULE_LIST}; do
echo 'KERNEL=="'$mod'*", GROUP="'$VMWARE_GROUP'" MODE=660' >> "${D}/etc/udev/rules.d/60-vmware.rules" || die
done
;;
@ -165,7 +159,7 @@ vmware-mod-2_src_install() {
einfo "no udev rules required"
;;
*)
ewarn "unknown modules package"
eerror "unknown modules package"
;;
esac