| 1 |
vadimk |
1.1 |
# Copyright 1999-2010 Gentoo Foundation |
| 2 |
|
|
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
vadimk |
1.4 |
# $Header: /var/cvsroot/gentoo-x86/app-emulation/vmware-server/vmware-server-2.0.2.203138-r1.ebuild,v 1.3 2010/05/12 15:10:12 vadimk Exp $ |
| 4 |
vadimk |
1.1 |
|
| 5 |
|
|
# Unlike many other binary packages the user doesn't need to agree to a licence |
| 6 |
|
|
# to download VMWare. The agreeing to a licence is part of the configure step |
| 7 |
|
|
# which the user must run manually. |
| 8 |
|
|
|
| 9 |
|
|
EAPI="2" |
| 10 |
|
|
|
| 11 |
|
|
inherit eutils pam pax-utils versionator |
| 12 |
|
|
|
| 13 |
|
|
MY_PV=$(replace_version_separator 3 '-' ) |
| 14 |
|
|
MY_PN="VMware-server-${MY_PV}" |
| 15 |
|
|
|
| 16 |
|
|
DESCRIPTION="VMware Server for Linux" |
| 17 |
|
|
HOMEPAGE="http://www.vmware.com/" |
| 18 |
|
|
DOWNLOAD_URL="http://downloads.vmware.com/d/info/datacenter_downloads/vmware_server/2_0" |
| 19 |
|
|
SRC_URI=" x86? ( mirror://vmware/software/vmserver/${MY_PN}.i386.tar.gz ) |
| 20 |
|
|
amd64? ( mirror://vmware/software/vmserver/${MY_PN}.x86_64.tar.gz ) " |
| 21 |
|
|
|
| 22 |
|
|
LICENSE="vmware" |
| 23 |
|
|
IUSE="" |
| 24 |
|
|
SLOT="0" |
| 25 |
|
|
KEYWORDS="-* ~x86 ~amd64" |
| 26 |
|
|
RESTRICT="fetch strip" |
| 27 |
|
|
|
| 28 |
|
|
CDEPEND=" |
| 29 |
|
|
>=dev-lang/perl-5 |
| 30 |
|
|
>=sys-libs/glibc-2.3.5 |
| 31 |
|
|
sys-apps/pciutils" |
| 32 |
|
|
DEPEND="${CDEPEND} |
| 33 |
|
|
sys-apps/findutils |
| 34 |
|
|
x11-misc/shared-mime-info |
| 35 |
|
|
virtual/os-headers" |
| 36 |
|
|
# vmware-server should not use virtual/libc as this is a |
| 37 |
|
|
# precompiled binary package thats linked to glibc. |
| 38 |
|
|
RDEPEND="${CDEPEND} |
| 39 |
|
|
~app-emulation/vmware-modules-1.0.0.24 |
| 40 |
|
|
dev-libs/expat |
| 41 |
|
|
dev-libs/glib |
| 42 |
|
|
dev-libs/libxml2 |
| 43 |
vadimk |
1.4 |
=media-libs/libpng-1.2* |
| 44 |
vadimk |
1.1 |
sys-apps/hal |
| 45 |
|
|
sys-fs/fuse |
| 46 |
|
|
sys-libs/zlib |
| 47 |
|
|
virtual/pam |
| 48 |
|
|
x11-libs/libICE |
| 49 |
|
|
x11-libs/libSM |
| 50 |
|
|
x11-libs/libX11 |
| 51 |
|
|
x11-libs/libXau |
| 52 |
|
|
x11-libs/libXdmcp |
| 53 |
|
|
x11-libs/libXext |
| 54 |
|
|
x11-libs/libXft |
| 55 |
|
|
x11-libs/libXt |
| 56 |
|
|
x11-libs/libXtst |
| 57 |
|
|
x11-misc/xdg-utils |
| 58 |
|
|
!<sys-apps/dbus-0.62 |
| 59 |
|
|
!app-emulation/vmware-player |
| 60 |
|
|
!app-emulation/vmware-workstation |
| 61 |
|
|
" |
| 62 |
|
|
|
| 63 |
|
|
PDEPEND="app-emulation/vmware-vix" |
| 64 |
|
|
|
| 65 |
|
|
S=${WORKDIR}/vmware-server-distrib |
| 66 |
|
|
|
| 67 |
|
|
pkg_setup() { |
| 68 |
|
|
if use x86; then |
| 69 |
|
|
MY_P="${MY_PN}.i386" |
| 70 |
|
|
elif use amd64; then |
| 71 |
|
|
MY_P="${MY_PN}.x86_64" |
| 72 |
|
|
fi |
| 73 |
|
|
} |
| 74 |
|
|
|
| 75 |
|
|
pkg_nofetch() { |
| 76 |
|
|
if use x86; then |
| 77 |
|
|
MY_P="${MY_PN}.i386" |
| 78 |
|
|
elif use amd64; then |
| 79 |
|
|
MY_P="${MY_PN}.x86_64" |
| 80 |
|
|
fi |
| 81 |
|
|
|
| 82 |
|
|
einfo "Please download the ${MY_P}.bundle from" |
| 83 |
|
|
einfo "${DOWNLOAD_URL}" |
| 84 |
|
|
einfo "and place it in ${DISTDIR}" |
| 85 |
|
|
} |
| 86 |
|
|
|
| 87 |
|
|
src_prepare() { |
| 88 |
|
|
VMWARE_GROUP=${VMWARE_GROUP:-vmware} |
| 89 |
|
|
VMWARE_INSTALL_DIR=/opt/${PN//-//} |
| 90 |
|
|
|
| 91 |
|
|
shortname="wgs" |
| 92 |
|
|
product="vmware" |
| 93 |
|
|
config_program="vmware-config.pl" |
| 94 |
|
|
config_dir="/etc/vmware" |
| 95 |
|
|
product_name="VMware Server 2" |
| 96 |
|
|
|
| 97 |
|
|
enewgroup ${VMWARE_GROUP} |
| 98 |
|
|
|
| 99 |
|
|
# Remove PAX MPROTECT flag from all applicable files in /bin, /sbin for |
| 100 |
|
|
# the vmware package only (since modules, tools and console should not |
| 101 |
|
|
# need to generate code on the fly in memory). |
| 102 |
|
|
pax-mark -m $(list-paxables "${S}"/{bin{,-debug},sbin}/{vmware-serverd,vmware-vmx}) |
| 103 |
|
|
|
| 104 |
|
|
EPATCH_SOURCE="${FILESDIR}"/${PV} EPATCH_SUFFIX="patch" epatch |
| 105 |
|
|
|
| 106 |
|
|
# Proper lsmod |
| 107 |
|
|
sed -i -e "s:/sbin/lsmod:/bin/lsmod:" "${S}"/installer/services.sh || die "sed" |
| 108 |
|
|
sed -i -e "s:/sbin/lsmod:/bin/lsmod:" "${S}"/lib/net-services.sh || die "sed" |
| 109 |
|
|
|
| 110 |
|
|
# Set the name |
| 111 |
|
|
sed -i -e "s:%LONGNAME%:${product_name}:" "${S}"/installer/services.sh || die "sed" |
| 112 |
|
|
sed -i -e "s:%SHORTNAME%:${shortname}:" "${S}"/installer/services.sh || die "sed" |
| 113 |
|
|
|
| 114 |
|
|
# We won't want any perl scripts from VMware once we've finally got all |
| 115 |
|
|
# of the configuration done, but for now, they're necessary. |
| 116 |
|
|
#rm -f *.pl bin/*.pl |
| 117 |
|
|
rm -f *.pl |
| 118 |
|
|
rm -f etc/installer.sh |
| 119 |
|
|
|
| 120 |
|
|
# Since with Gentoo we compile everthing it doesn't make sense to keep |
| 121 |
|
|
# the precompiled modules arround. Saves about 4 megs of disk space too. |
| 122 |
|
|
rm -rf "${S}"/lib/modules/binary |
| 123 |
|
|
# We also don't need to keep the icons around, or do we? |
| 124 |
|
|
#rm -rf ${S}/lib/share/icons |
| 125 |
|
|
|
| 126 |
|
|
rm -rf "${S}"/etc/pam.d/ |
| 127 |
|
|
sed -i -e "s:configure_wgs_pam_d():#&:" "${S}"/bin/vmware-config.pl || die "sed pam_d" |
| 128 |
|
|
} |
| 129 |
|
|
|
| 130 |
|
|
src_install() { |
| 131 |
|
|
# We loop through our directories and copy everything to our system. |
| 132 |
|
|
for x in bin lib sbin |
| 133 |
|
|
do |
| 134 |
|
|
if [[ -e "${S}/${x}" ]] |
| 135 |
|
|
then |
| 136 |
|
|
dodir "${VMWARE_INSTALL_DIR}"/${x} |
| 137 |
|
|
cp -pPR "${S}"/${x}/* "${D}""${VMWARE_INSTALL_DIR}"/${x} \ |
| 138 |
|
|
|| die "copying ${x}" |
| 139 |
|
|
fi |
| 140 |
|
|
done |
| 141 |
|
|
|
| 142 |
|
|
# Bug 282213 |
| 143 |
|
|
mv "${D}"/"${VMWARE_INSTALL_DIR}"/lib/lib/libpng12.so.0/libpng12.so.0 \ |
| 144 |
|
|
"${D}"/"${VMWARE_INSTALL_DIR}"/lib/lib/libpng12.so.0/libpng12.so.0.old |
| 145 |
|
|
dosym /usr/lib/libpng12.so.0 "${VMWARE_INSTALL_DIR}"/lib/lib/libpng12.so.0/libpng12.so.0 |
| 146 |
|
|
|
| 147 |
|
|
# Bug 292771 |
| 148 |
|
|
mv "${D}"/"${VMWARE_INSTALL_DIR}"/lib/lib/libexpat.so.0/libexpat.so.0 \ |
| 149 |
|
|
"${D}"/"${VMWARE_INSTALL_DIR}"/lib/lib/libexpat.so.0/libexpat.so.0.old |
| 150 |
|
|
dosym /usr/lib/libexpat.so.1 "${VMWARE_INSTALL_DIR}"/lib/lib/libexpat.so.0/libexpat.so.0 |
| 151 |
|
|
mv "${D}"/"${VMWARE_INSTALL_DIR}"/lib/lib/libxml2.so.2/libxml2.so.2 \ |
| 152 |
|
|
"${D}"/"${VMWARE_INSTALL_DIR}"/lib/lib/libxml2.so.2/libxml2.so.2.old |
| 153 |
|
|
dosym /usr/lib/libxml2.so.2 "${VMWARE_INSTALL_DIR}"/lib/lib/libxml2.so.2/libxml2.so.2 |
| 154 |
|
|
|
| 155 |
|
|
# If we have an /etc directory, we copy it. |
| 156 |
|
|
if [[ -e "${S}/etc" ]] |
| 157 |
|
|
then |
| 158 |
|
|
dodir "${config_dir}" |
| 159 |
|
|
cp -pPR "${S}"/etc/* "${D}""${config_dir}" |
| 160 |
|
|
fowners root:${VMWARE_GROUP} "${config_dir}" |
| 161 |
|
|
fperms 770 "${config_dir}" |
| 162 |
|
|
fi |
| 163 |
|
|
|
| 164 |
|
|
# If we have any helper files, we install them. First, we check for an |
| 165 |
|
|
# init script. |
| 166 |
|
|
if [[ -e "${FILESDIR}/${PN}.rc" ]] |
| 167 |
|
|
then |
| 168 |
|
|
newinitd "${FILESDIR}"/${PN}.rc ${product} || die "newinitd" |
| 169 |
|
|
fi |
| 170 |
|
|
# Then we check for an environment file. |
| 171 |
|
|
if [[ -e "${FILESDIR}/90${PN}" ]] |
| 172 |
|
|
then |
| 173 |
|
|
doenvd "${FILESDIR}"/90${PN} || die "doenvd" |
| 174 |
|
|
fi |
| 175 |
|
|
# Last, we check for any mime files. |
| 176 |
|
|
if [[ -e "${FILESDIR}/${PN}.xml" ]] |
| 177 |
|
|
then |
| 178 |
|
|
insinto /usr/share/mime/packages |
| 179 |
|
|
doins "${FILESDIR}"/${PN}.xml || die "mimetypes" |
| 180 |
|
|
fi |
| 181 |
|
|
|
| 182 |
|
|
# Blame bug #91191 for this one. |
| 183 |
|
|
if [[ -e doc/EULA ]] |
| 184 |
|
|
then |
| 185 |
|
|
insinto "${VMWARE_INSTALL_DIR}"/doc |
| 186 |
|
|
doins doc/EULA || die "copying EULA" |
| 187 |
|
|
fi |
| 188 |
|
|
|
| 189 |
|
|
# Do we have vmware-ping/vmware-vmx? If so, make them setuid. |
| 190 |
|
|
for p in /bin/vmware-ping /lib/bin/vmware-vmx /lib/bin-debug/vmware-vmx /lib/bin/vmware-vmx-debug /sbin/vmware-authd; |
| 191 |
|
|
do |
| 192 |
|
|
if [ -x "${D}${VMWARE_INSTALL_DIR}${p}" ] |
| 193 |
|
|
then |
| 194 |
|
|
fowners root:${VMWARE_GROUP} "${VMWARE_INSTALL_DIR}"${p} |
| 195 |
|
|
fperms 4750 "${VMWARE_INSTALL_DIR}"${p} |
| 196 |
|
|
fi |
| 197 |
|
|
done |
| 198 |
|
|
|
| 199 |
|
|
# This removed the user/group warnings |
| 200 |
|
|
# But also broke vmware-server with FEATURES="userpriv" since it removes |
| 201 |
|
|
# the set-UID bit |
| 202 |
|
|
#chown -R root:${VMWARE_GROUP} ${D} || die |
| 203 |
|
|
|
| 204 |
|
|
# We like desktop icons. |
| 205 |
|
|
# TODO: Fix up the icon creation, across the board. |
| 206 |
|
|
#make_desktop_entry ${PN} "${product_name}" ${PN}.png |
| 207 |
|
|
|
| 208 |
|
|
# Now, we copy in our services.sh file |
| 209 |
|
|
exeinto "${config_dir}"/init.d |
| 210 |
|
|
newexe installer/services.sh ${product} || die "services.sh" |
| 211 |
|
|
|
| 212 |
|
|
newinitd "${FILESDIR}/vmware-server-2.rc" vmware |
| 213 |
|
|
|
| 214 |
|
|
# startup symlinks |
| 215 |
|
|
dosym ${config_dir}/init.d/${product} ${config_dir}/init.d/vmware-autostart |
| 216 |
|
|
dosym ${config_dir}/init.d/${product} ${config_dir}/init.d/vmware-core |
| 217 |
|
|
dosym ${config_dir}/init.d/${product} ${config_dir}/init.d/vmware-mgmt |
| 218 |
|
|
|
| 219 |
|
|
# pam |
| 220 |
|
|
pamd_mimic_system vmware-authd auth account |
| 221 |
|
|
|
| 222 |
|
|
# Man pages and docs |
| 223 |
|
|
dodoc doc/* |
| 224 |
|
|
doman man/man1/* |
| 225 |
|
|
|
| 226 |
|
|
# VMware authorization service |
| 227 |
|
|
insinto ${config_dir}/hostd |
| 228 |
|
|
doins "${FILESDIR}/authorization.xml" |
| 229 |
|
|
|
| 230 |
|
|
# Finally, we run the "Questions" |
| 231 |
|
|
einfo "Adding answers to ${config_dir}/locations" |
| 232 |
|
|
locations="${D}${config_dir}/locations" |
| 233 |
|
|
echo "answer BINDIR ${VMWARE_INSTALL_DIR}/bin" >> ${locations} |
| 234 |
|
|
echo "answer LIBDIR ${VMWARE_INSTALL_DIR}/lib" >> ${locations} |
| 235 |
|
|
echo "answer MANDIR ${VMWARE_INSTALL_DIR}/man" >> ${locations} |
| 236 |
|
|
echo "answer DOCDIR ${VMWARE_INSTALL_DIR}/doc" >> ${locations} |
| 237 |
|
|
echo "answer SBINDIR ${VMWARE_INSTALL_DIR}/sbin" >> ${locations} |
| 238 |
|
|
echo "answer RUN_CONFIGURATOR no" >> ${locations} |
| 239 |
|
|
echo "answer INITDIR ${config_dir}/init.d" >> ${locations} |
| 240 |
|
|
echo "answer INITSCRIPTSDIR ${config_dir}/init.d" >> ${locations} |
| 241 |
|
|
echo "answer VMCI_CONFED yes" >> ${locations} |
| 242 |
|
|
echo "answer VSOCK_CONFED yes" >> ${locations} |
| 243 |
|
|
} |
| 244 |
|
|
|
| 245 |
|
|
pkg_config() { |
| 246 |
|
|
einfo "Running ${VMWARE_INSTALL_DIR}/bin/vmware-config.pl" |
| 247 |
|
|
"${VMWARE_INSTALL_DIR}/bin/vmware-config.pl" |
| 248 |
|
|
} |
| 249 |
|
|
|
| 250 |
|
|
pkg_preinst() { |
| 251 |
|
|
# This must be done after the install to get the mtimes on each file |
| 252 |
|
|
# right. |
| 253 |
|
|
|
| 254 |
|
|
#Note: it's a bit weird to use ${D} in a preinst script but it should work |
| 255 |
|
|
#(drobbins, 1 Feb 2002) |
| 256 |
|
|
|
| 257 |
|
|
einfo "Generating ${config_dir}/locations file." |
| 258 |
|
|
d=`echo ${D} | wc -c` |
| 259 |
|
|
for x in `find ${D}${VMWARE_INSTALL_DIR} ${D}${config_dir}` ; do |
| 260 |
|
|
x="`echo ${x} | cut -c ${d}-`" |
| 261 |
|
|
if [ -d "${D}/${x}" ] ; then |
| 262 |
|
|
echo "directory ${x}" >> "${D}${config_dir}"/locations |
| 263 |
|
|
else |
| 264 |
|
|
echo -n "file ${x}" >> "${D}${config_dir}"/locations |
| 265 |
|
|
if [ "${x}" == "${config_dir}/locations" ] ; then |
| 266 |
|
|
echo "" >> "${D}${config_dir}"/locations |
| 267 |
|
|
elif [ "${x}" == "${config_dir}/not_configured" ] ; then |
| 268 |
|
|
echo "" >> "${D}${config_dir}"/locations |
| 269 |
|
|
else |
| 270 |
|
|
echo -n " " >> "${D}${config_dir}"/locations |
| 271 |
|
|
find "${D}${x}" -printf %T@ >> "${D}${config_dir}"/locations |
| 272 |
|
|
echo "" >> "${D}${config_dir}"/locations |
| 273 |
|
|
fi |
| 274 |
|
|
fi |
| 275 |
|
|
done |
| 276 |
|
|
} |
| 277 |
|
|
|
| 278 |
|
|
pkg_postinst() { |
| 279 |
|
|
update-mime-database /usr/share/mime |
| 280 |
|
|
[[ -d "${config_dir}" ]] && chown -R root:${VMWARE_GROUP} ${config_dir} |
| 281 |
|
|
|
| 282 |
|
|
# This is to fix the problem where the not_configured file doesn't get |
| 283 |
|
|
# removed when the configuration is run. This doesn't remove the file |
| 284 |
|
|
# It just tells the vmware-config.pl script it can delete it. |
| 285 |
|
|
einfo "Updating ${config_dir}/locations" |
| 286 |
|
|
for x in "${config_dir}"/._cfg????_locations ; do |
| 287 |
|
|
if [ -f $x ] ; then |
| 288 |
|
|
cat $x >> "${config_dir}"/locations |
| 289 |
|
|
rm $x |
| 290 |
|
|
fi |
| 291 |
|
|
done |
| 292 |
|
|
|
| 293 |
|
|
ewarn "Use " |
| 294 |
|
|
ewarn " emerge vmware-server --config" |
| 295 |
|
|
ewarn "to configure your installation of ${product_name}." |
| 296 |
|
|
|
| 297 |
|
|
ewarn "In order to run ${product_name}, you have to" |
| 298 |
|
|
ewarn "be in the '${VMWARE_GROUP}' group." |
| 299 |
|
|
|
| 300 |
|
|
#ewarn "By default xinetd only allows connections from localhost" |
| 301 |
|
|
#ewarn "To allow external users access to vmware-server you must edit" |
| 302 |
|
|
#ewarn " /etc/xinetd.d/vmware-authd" |
| 303 |
|
|
#ewarn "and specify a new 'only_from' line" |
| 304 |
|
|
|
| 305 |
|
|
ewarn "VMWare Server also has issues when running on a JFS filesystem. For more" |
| 306 |
|
|
ewarn "information see http://bugs.gentoo.org/show_bug.cgi?id=122500#c94" |
| 307 |
|
|
} |
| 308 |
|
|
|
| 309 |
|
|
pkg_prerm() { |
| 310 |
|
|
einfo "Stopping ${product_name} for safe unmerge" |
| 311 |
|
|
/etc/init.d/vmware stop |
| 312 |
|
|
} |
| 313 |
|
|
|
| 314 |
|
|
pkg_postrm() { |
| 315 |
|
|
if ! has_version app-emulation/${PN}; then |
| 316 |
|
|
elog "To remove all traces of ${product} you will need to remove the files" |
| 317 |
|
|
elog "in ${config_dir} and /etc/init.d/${product}." |
| 318 |
|
|
elog "If the vmware-modules package is installed, you may no longer need it." |
| 319 |
|
|
fi |
| 320 |
|
|
} |