/[gentoo-x86]/eclass/vmware-mod.eclass
Gentoo

Contents of /eclass/vmware-mod.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.22 - (show annotations) (download)
Sat Sep 1 20:49:01 2012 UTC (2 years, 1 month ago) by vadimk
Branch: MAIN
CVS Tags: HEAD
Changes since 1.21: +1 -1 lines
FILE REMOVED
Removed Files: vmware-mod.eclass vmware.eclass

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/vmware-mod.eclass,v 1.21 2012/08/11 14:04:11 ssuominen Exp $
4
5 # @DEAD
6
7 # Ensure vmware comes before linux-mod since we want linux-mod's pkg_preinst and
8 # pkg_postinst, along with our own pkg_setup, src_unpack and src_compile
9 inherit flag-o-matic eutils vmware linux-mod toolchain-funcs
10
11 DESCRIPTION="Modules for Vmware Programs"
12 HOMEPAGE="http://www.vmware.com/"
13 SRC_URI="http://platan.vc.cvut.cz/ftp/pub/vmware/${ANY_ANY}.tar.gz
14 http://platan.vc.cvut.cz/ftp/pub/vmware/obsolete/${ANY_ANY}.tar.gz
15 http://knihovny.cvut.cz/ftp/pub/vmware/${ANY_ANY}.tar.gz
16 http://knihovny.cvut.cz/ftp/pub/vmware/obsolete/${ANY_ANY}.tar.gz
17 http://ftp.cvut.cz/vmware/${ANY_ANY}.tar.gz
18 http://ftp.cvut.cz/vmware/obsolete/${ANY_ANY}.tar.gz"
19 LICENSE="vmware"
20 SLOT="0"
21 IUSE=""
22
23 RDEPEND=""
24 DEPEND="${RDEPEND}
25 virtual/pkgconfig"
26
27 # Provide vaguely sensible defaults
28 [[ -z "${VMWARE_VER}" ]] && VMWARE_VER="VME_V55"
29 VMWARE_MOD_DIR="${ANY_ANY}"
30
31 S="${WORKDIR}"
32
33 # We needn't restrict this since it was only required to read
34 # /etc/vmware/locations to determine the version (which is now fixed by
35 # VMWARE_VER)
36 # RESTRICT="userpriv"
37
38 EXPORT_FUNCTIONS pkg_setup src_unpack src_install
39
40 vmware-mod_pkg_setup() {
41 linux-mod_pkg_setup
42 # Must define VMWARE_VER to make, otherwise it'll try and run getversion.pl
43 BUILD_TARGETS="auto-build VMWARE_VER=${VMWARE_VER} KERNEL_DIR=${KERNEL_DIR} KBUILD_OUTPUT=${KV_OUT_DIR}"
44
45 vmware_determine_product
46 # We create a group for VMware users due to bugs #104480 and #106170
47 enewgroup "${VMWARE_GROUP}"
48
49 if [[ -z "${VMWARE_MODULE_LIST}" ]]; then
50 case ${product} in
51 vmware-tools)
52 VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vmxnet"
53 [ "$shortname" != "server-tools" ] && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vmhgfs vmmemctl"
54 use amd64 || VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vmdesched"
55 ;;
56 *)
57 VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vmmon vmnet"
58 ;;
59 esac
60 fi
61
62 filter-flags -mfpmath=sse
63
64 for mod in ${VMWARE_MODULE_LIST}; do
65 MODULE_NAMES="${MODULE_NAMES}
66 ${mod}(misc:${S}/${mod}-only)"
67 done
68 }
69
70 vmware-mod_src_unpack() {
71 case ${product} in
72 vmware-tools)
73 # Do nothing, this should be dealt with by vmware.eclass unpack
74 ;;
75 *)
76 unpack ${A}
77 ;;
78 esac
79
80 for mod in ${VMWARE_MODULE_LIST}; do
81 cd "${S}"
82 unpack ./"${VMWARE_MOD_DIR}"/${mod}.tar
83 cd "${S}"/${mod}-only
84 # Ensure it's not used
85 # rm getversion.pl
86 if [[ "${VMWARE_MOD_DIR}" = "${ANY_ANY}" ]] ; then
87 EPATCH_SUFFIX="patch"
88 epatch "${FILESDIR}"/patches
89 [[ -d "${FILESDIR}"/patches/${mod} ]] && epatch "${FILESDIR}"/patches/${mod}
90 fi
91 convert_to_m "${S}"/${mod}-only/Makefile
92 done
93 }
94
95 vmware-mod_src_install() {
96 # this adds udev rules for vmmon*
97 if [[ -n "`echo ${VMWARE_MODULE_LIST} | grep vmmon`" ]];
98 then
99 local udevdir=/lib/udev
100 has_version sys-fs/udev && udevdir="$($(tc-getPKG_CONFIG) --variable=udevdir udev)"
101 dodir "${udevdir}"/rules.d
102 echo 'KERNEL=="vmmon*", GROUP="'$VMWARE_GROUP'" MODE=660' >> "${D}/${udevdir}"/rules.d/60-vmware.rules || die
103 echo 'KERNEL=="vmnet*", GROUP="'$VMWARE_GROUP'" MODE=660' >> "${D}/${udevdir}"/rules.d/60-vmware.rules || die
104 fi
105
106 linux-mod_src_install
107 }
108
109 # Current VMWARE product mappings
110 # 'VME_TOT' = .0
111 # 'VME_GSX1' = .1
112 # 'VME_GSX2' = .2
113 # 'VME_GSX251' = .3
114 # 'VME_GSX25' = .4
115 # 'VME_GSX32' = .5
116 # 'VME_V3' = .6
117 # 'VME_V32' = .7
118 # 'VME_V321' = .8
119 # 'VME_V4' = .9
120 # 'VME_V45' = .10
121 # 'VME_V452' = .11
122 # 'VME_V5' = .12
123 # 'VME_V55' = .13
124 # 'VME_S1B1' = .14
125 # 'VME_S1??' = .15
126 # 'VME_V6' = .16
127 # 'VME_V6' = .17 (6.0.2)
128 # 'VME_S2B1' = .18

  ViewVC Help
Powered by ViewVC 1.1.20