aboutsummaryrefslogtreecommitdiffstats
path: root/net/nxserver/Makefile
blob: ce85f14e7fa4291bc8d39b06be90826fe7e3a424 (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# New ports collection makefile for:    nxserver
# Date created:                         Sun 5 Sep 2004
# Whom:                                 Will Andrews <will@freebsd.org>
#
# $FreeBSD$
#

PORTNAME=   nxserver
PORTVERSION=    2.1.0
PORTREVISION=   7
CATEGORIES= net
MASTER_SITES=   http://web04.nomachine.com/download/${PORTVERSION}/sources/
DISTFILES=  nx-X11-${PORTVERSION}-3.tar.gz \
        nxagent-${PORTVERSION}-18.tar.gz \
        nxauth-${PORTVERSION}-2.tar.gz \
        nxcomp-${PORTVERSION}-7.tar.gz \
        nxcompext-${PORTVERSION}-5.tar.gz \
        nxdesktop-${PORTVERSION}-10.tar.gz \
        nxesd-${PORTVERSION}-3.tar.gz \
        nxkill-${PORTVERSION}-2.tar.gz \
        nxproxy-${PORTVERSION}-3.tar.gz \
        nxviewer-${PORTVERSION}-12.tar.gz
DIST_SUBDIR=    NX

MAINTAINER= freenx@deweyonline.com
COMMENT=    Low-bandwidth X network server

LIB_DEPENDS=    audiofile.0:${PORTSDIR}/audio/libaudiofile \
        jpeg.11:${PORTSDIR}/graphics/jpeg \
        png.6:${PORTSDIR}/graphics/png

# freetype version included does not compile on 64bit
ONLY_FOR_ARCHS= i386

USE_GMAKE=  yes
USE_GETTEXT=    yes
WRKSRC=     ${WRKDIR}
GNU_CONFIGURE=  yes
ALL_TARGET= World
PLIST_SUB+= NX_MAJOR=${PORTVERSION:R:R} NX_VERSION=${PORTVERSION}
NXPREFIX?=  ${PREFIX}/NX
USE_LDCONFIG=   ${NXPREFIX}/lib

.include <bsd.port.pre.mk>

post-patch:
    @${REINPLACE_CMD} -e \
        "s|/usr/NX/bin:/opt/NX/bin:/usr/local/NX|${NXPREFIX}|" \
        ${WRKSRC}/nxcomp/Children.cpp
    @${REINPLACE_CMD} -e "s|/usr/NX|${NXPREFIX}|" \
        ${WRKSRC}/nxcomp/Loop.cpp \
        ${WRKSRC}/nxcomp/Misc.cpp \
        ${WRKSRC}/nxdesktop/xwin.c \
        ${WRKSRC}/nxesd/nxesddsp.in \
        ${WRKSRC}/nxviewer/nxviewer/desktop.c \
        ${WRKSRC}/nx-X11/programs/Xserver/hw/nxagent/Display.c
    @${REINPLACE_CMD} -e "s|-I\.\./nxesd|-I${PREFIX}/include &|" \
        ${WRKSRC}/nxdesktop/Makefile
    @${REINPLACE_CMD} -e "s|/usr/local/|${PREFIX}/|" \
        ${WRKSRC}/nxviewer/nxviewer/Imakefile
    @${REINPLACE_CMD} -e "s|objformat=.*|objformat=elf|" \
         ${WRKSRC}/nxesd/configure

do-configure:
.if defined(TEMPLATES) && exists(${TEMPLATES}/config.guess) && exists(${TEMPLATES}/config.sub)
    @CONFIG_GUESS_DIRS=$$(${FIND} ${WRKDIR} -name config.guess \
        -o -name config.sub | ${XARGS} -n 1 ${DIRNAME}); \
    for _D in $${CONFIG_GUESS_DIRS}; do \
        ${CP} -f ${TEMPLATES}/config.guess $${_D}/config.guess; \
        ${CHMOD} a+rx $${_D}/config.guess; \
        ${CP} -f ${TEMPLATES}/config.sub $${_D}/config.sub; \
        ${CHMOD} a+rx $${_D}/config.sub; \
    done
.endif

do-build:
    cd ${WRKSRC}/nx-X11 && ${SETENV} ${MAKE_ENV} \
        ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET}
.for i in nxproxy nxkill nxesd
    cd ${WRKSRC}/${i} && \
        ${CONFIGURE_ENV} ./configure --prefix=${NXPREFIX} && \
        ${SETENV} ${MAKE_ENV} \
        ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS}
.endfor
    cd ${WRKSRC}/nxdesktop && ${CONFIGURE_ENV} ./configure \
        --with-sound --prefix=${NXPREFIX} && \
        ${SETENV} ${MAKE_ENV} \
        ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS}
    cd ${WRKSRC}/nxviewer && \
        PATH=${WRKSRC}/nx-X11/config/imake:$${PATH} \
        ../nx-X11/config/util/xmkmf -a ${WRKSRC}/nx-X11 && \
        ${SETENV} ${MAKE_ENV} \
        ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET}

do-install:
    ${MKDIR} ${NXPREFIX}/lib ${NXPREFIX}/bin ${NXPREFIX}/share/keymaps-windows
    ${INSTALL_DATA} ${WRKSRC}/nx-X11/lib/X11/libX11.so.6.2 ${NXPREFIX}/lib
    cd ${NXPREFIX}/lib && \
        ${LN} -s libX11.so.6.2 libX11.so.6 && \
        ${LN} -s libX11.so.6.2 libX11.so
    ${INSTALL_DATA} ${WRKSRC}/nx-X11/lib/Xext/libXext.so.6.4 ${NXPREFIX}/lib
    cd ${NXPREFIX}/lib && \
        ${LN} -s libXext.so.6.4 libXext.so.6 && \
        ${LN} -s libXext.so.6.4 libXext.so
    ${INSTALL_DATA} ${WRKSRC}/nx-X11/lib/Xrender/libXrender.so.1.2 ${NXPREFIX}/lib
    cd ${NXPREFIX}/lib && \
        ${LN} -s libXrender.so.1.2 libXrender.so.1 && \
        ${LN} -s libXrender.so.1.2 libXrender.so
    ${INSTALL_DATA} ${WRKSRC}/nx-X11/lib/Xpm/libXpm.so.4.11 ${NXPREFIX}/lib
    cd ${NXPREFIX}/lib && \
        ${LN} -s libXpm.so.4.11 libXpm.so.4 && \
        ${LN} -s libXpm.so.4.11 libXpm.so
    ${INSTALL_DATA} ${WRKSRC}/nxcomp/libXcomp.so.${PORTVERSION} ${NXPREFIX}/lib
    cd ${NXPREFIX}/lib && \
        ${LN} -s libXcomp.so.${PORTVERSION} libXcomp.so.${PORTVERSION:R:R} && \
        ${LN} -s libXcomp.so.${PORTVERSION} libXcomp.so
    ${INSTALL_DATA} ${WRKSRC}/nxcompext/libXcompext.so.${PORTVERSION} ${NXPREFIX}/lib
    cd ${NXPREFIX}/lib && \
        ${LN} -s libXcompext.so.${PORTVERSION} libXcompext.so.${PORTVERSION:R:R} && \
        ${LN} -s libXcompext.so.${PORTVERSION} libXcompext.so
    ${INSTALL_PROGRAM} ${WRKSRC}/nx-X11/programs/Xserver/nxagent ${NXPREFIX}/bin
    ${INSTALL_PROGRAM} ${WRKSRC}/nxdesktop/nxdesktop ${NXPREFIX}/bin
    ${INSTALL_PROGRAM} ${WRKSRC}/nxesd/nxesd ${NXPREFIX}/bin
    ${INSTALL_PROGRAM} ${WRKSRC}/nxkill/nxkill ${NXPREFIX}/bin
    ${INSTALL_PROGRAM} ${WRKSRC}/nxproxy/nxproxy ${NXPREFIX}/bin
    ${INSTALL_PROGRAM} ${WRKSRC}/nxviewer/nxpasswd/nxpasswd ${NXPREFIX}/bin
    ${INSTALL_PROGRAM} ${WRKSRC}/nxviewer/nxviewer/nxviewer ${NXPREFIX}/bin
.for i in modifiers common ar cs da de de-ch en-dv en-gb en-us es et fi fo fr fr-be fr-ca fr-ch he hr hu is it ja ko lt lv mk nl nl-be no pl pt pt-br ru sl sv th tr
    ${INSTALL_DATA} ${WRKSRC}/nxdesktop/keymaps/${i} ${NXPREFIX}/share/keymaps-windows
.endfor

.include <bsd.port.post.mk>