aboutsummaryrefslogtreecommitdiffstats
path: root/emulators/linux-vmware-toolbox6/Makefile
blob: 0700d94f7652e226c52ae02f61ab1ff9e7d73270 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# New ports collection makefile for:    VMware toolbox for Linux
# Date created:     10 Aug 2000
# Whom:         matusita@jp.FreeBSD.org
#
# $FreeBSD$
#

PORTNAME=   vmware-toolbox
PORTVERSION=    ${VMWARE_VER}.${BUILD_VER}
CATEGORIES= emulators linux
MASTER_SITES=   # none
PKGNAMEPREFIX=  linux-
DISTNAME=   vmware-linux-tools

MAINTAINER= matusita@jp.FreeBSD.org

ONLY_FOR_ARCHS= i386
USE_LINUX=  yes
USE_X_PREFIX=   yes
NO_BUILD=   yes

RESTRICTED= "Not sure if we can redistribute this."

.include <bsd.port.pre.mk>

LINUX_FLP?= ${DISTDIR}/linux.flp
MOUNT_PT?=  ${WRKDIR}/mnt
.if exists(${LINUX_FLP})
.if ${OSVERSION} >= 500018
DEV_ATTACH= /usr/sbin/mdconfig -a -t vnode -f ${LINUX_FLP} -u ${MOUNT_DEV}
DEV_DETACH= /usr/sbin/mdconfig -d -u ${MOUNT_DEV}
MOUNT_DEV?= md0
.else
DEV_ATTACH= /usr/sbin/vnconfig -c ${MOUNT_DEV} ${LINUX_FLP}
DEV_DETACH= /usr/sbin/vnconfig -u ${MOUNT_DEV}
MOUNT_DEV?= vn0
.endif
.else
MOUNT_DEV?= fd0
.endif
VMWARE_VER= 2.0.4
BUILD_VER=  1142

MOUNT=      /sbin/mount
UMOUNT=     /sbin/umount

pre-fetch:
    @${ECHO} "========================================================================"
    @${ECHO} ""
    @${ECHO} "To install this port, please do one of these:"
    @${ECHO} ""
    @${ECHO} "  1. Select the menu item \"Devices -> floppy0 -> Edit\" on VMware,"
    @${ECHO} "     and choose the file \"linux.flp\"."
    @${ECHO} ""
    @${ECHO} "  2. Manually put the file \"linux.flp\" in ${DISTDIR}."
    @${ECHO} ""
    @${ECHO} "========================================================================"

do-fetch:
.if exists("${DISTDIR}/${DISTFILES}")
    @${ECHO} "Found ${DISTDIR}/${DISTFILES}."
.else
    ${MKDIR} ${MOUNT_PT}
    -@${UMOUNT} ${MOUNT_PT} 2>&1 >/dev/null
    -@${UMOUNT} /dev/${MOUNT_DEV} 2>&1 >/dev/null
.if exists(${LINUX_FLP})
    -@${DEV_DETACH} 2>&1 >/dev/null
    ${DEV_ATTACH}
.endif
    ${MOUNT} -t msdos -r /dev/${MOUNT_DEV} ${MOUNT_PT}
    ${CP} ${MOUNT_PT}/${DISTFILES} ${DISTDIR}
    ${UMOUNT} /dev/${MOUNT_DEV}
.if exists(${LINUX_FLP})
    ${DEV_DETACH}
.endif
.endif

do-install:
    ${CP} ${WRKSRC}/vmware-toolbox ${PREFIX}/bin/linux-vmware-toolbox

.include <bsd.port.post.mk>