aboutsummaryrefslogtreecommitdiffstats
path: root/editors/openoffice/Makefile
blob: 79bd67df6ac62981e97b55799fe2bb1703e3cac2 (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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
# New ports collection makefile for: OpenOffice
# Date created:     28 Februar 2002
# Whom:                 Martin Blapp
#
# $FreeBSD$
#

PORTNAME=   openoffice
PORTVERSION=    1.0.1
PORTREVISION=   3
CATEGORIES+=    editors
MASTER_SITES+=  http://sf1.mirror.openoffice.org/%SUBDIR%/ \
        ${MASTER_SITE_RINGSERVER:S,%SUBDIR%,misc/openoffice/&,} \
        ftp://ftp.cs.man.ac.uk/pub/toby/gpc/:gpc \
        http://sf1.mirror.openoffice.org/miscellaneous/helpcontent/:help
MASTER_SITE_SUBDIR= ${PORTVERSION}
DISTFILES+= OOo_${PORTVERSION}_source.tar.bz2 \
        gpc231.tar.Z:gpc
.if defined(L10NHELP)
DISTFILES+= ${L10NHELP:S/$/:help/}
.endif

SORT?=  /usr/bin/sort
CUT?=   /usr/bin/cut
AWK?=   /usr/bin/awk
GREP?=  /usr/bin/grep
MOUNT?= /sbin/mount

.include <bsd.port.pre.mk>

PROCFS!=        ${MOUNT} | ${GREP} ^procfs | ${AWK} '{print $1}'
INSTALLATION_BASEDIR=   OpenOffice.org1.0
DIST_SUBDIR=        openoffice
DICT_DIR=               ${PREFIX}/${INSTALLATION_BASEDIR}/share/dict/ooo/

#
# configuration for language specific slave ports
#
.if !defined(LANG_EXT)
LANG_EXT=01
.else
#
# Add pkg-comment and pkg-descr if available
#
.if exists(${.CURDIR}/pkg-comment)
COMMENT=    ${.CURDIR}/pkg-comment
.endif
.if exists(${.CURDIR}/pkg-descr)
DESCR=  ${.CURDIR}/pkg-descr
.endif
#
# Set prefix and suffix
#
.if defined(LANG_PKGNAME)
PKGNAMEPREFIX=  ${LANG_PKGNAME}-
.if defined(LANG_SUFFIX)
PKGNAMESUFFIX=  -${LANG_SUFFIX}
.endif
.endif # if defined(LANG_PKGNAME)
#
# LANG_CONFIGURE_ARG is missing for the german port
#
.if defined(LANG_EXT) && ${LANG_EXT}!=49
CONFIGURE_ARGS+=    --with-lang=${LANG_CONFIGURE_ARG},ENUS
.endif
.endif

.if ${OSVERSION} < 500000
#
# OO build is broken with the system gcc on STABLE.
#
USE_GCC=3.1
.else
.endif

.if ${OSVERSION} > 500000
#
# OO is still broken with the system gcc on CURRENT.
#
.if defined(USE_GCC) && ${USE_GCC} == 3.2
BUILD_DEPENDS+= gcc32:${PORTSDIR}/lang/gcc32
CC=     gcc32
CXX=        g++32
.endif
.endif

EXTRACT_ONLY=   OOo_${PORTVERSION}_source.tar.bz2

MAINTAINER= openoffice@FreeBSD.org
.if !defined(USE_GCC)
BUILD_DEPENDS=  ${LOCALBASE}/lib/libstlport_gcc.so:${PORTSDIR}/devel/stlport
.endif
BUILD_DEPENDS+= zip:${PORTSDIR}/archivers/zip
BUILD_DEPENDS+= unzip:${PORTSDIR}/archivers/unzip
BUILD_DEPENDS+= ${JAVAVM}:${PORTSDIR}/java/jdk13
BUILD_DEPENDS+= ${X11BASE}/lib/libX11.so:${PORTSDIR}/x11/XFree86-4-libraries
.if !defined(DISPLAY)
BUILD_DEPENDS+= Xvfb:${PORTSDIR}/x11-servers/XFree86-4-VirtualFramebufferServer
.endif

USE_PERL5=  yes
USE_BZIP2=  yes
USE_BISON=  yes
USE_GMAKE=  yes

EXTRACT_BEFORE_ARGS_R= -dc
EXTRACT_AFTER_ARGS_R= | ${TAR} -xf -
EXTRACT_CMD_R= ${GZIP_CMD}
EXTRACT_REST=   gpc231.tar.Z

JDK13DIR?=      ${LOCALBASE}/jdk1.3.1
JAVAVM=         ${JDK13DIR}/bin/java

GNU_CONFIGURE=  yes
USE_AUTOCONF=   yes
WRKDIR=     ${WRKDIRPREFIX}${.CURDIR}/work
WRKSRC=     ${WRKDIR}/oo_1.0.1_src/config_office
LD_PATH1=   ${WRKSRC}/../vos/unxfbsd.pro/lib/:${WRKSRC}/../ucbhelper/unxfbsd.pro/lib/
LD_PATH=    ${LD_PATH1}:${WRKSRC}/../solver/641/unxfbsd.pro/lib/
.if defined(WITH_DEBUG)
CFLAGS+=    -g
.if ${WITH_DEBUG} == 2
BUILD=      dmake debug="true"
.else
BUILD=      dmake
.endif
.else
BUILD=      dmake strip="true"
.endif

.if !defined(DISPLAY)
DISPLAYHACK=localhost:1001
.endif

CONFIGURE_ENV=      PTHREAD_CFLAGS=${PTHREAD_CFLAGS} \
            PTHREAD_LIBS=${PTHREAD_LIBS}

CONFIGURE_ARGS+=    --with-jdk-home=${JDK13DIR} \
            --with-os-version=${OSVERSION}

.if !defined(USE_GCC)
CONFIGURE_ARGS+=    --with-stlport4-home=${PREFIX}
.endif

.if defined(WITH_DEBUG)
.if ${WITH_DEBUG} == 2
CONFIGURE_ARGS+=    --enable-debug
.endif
.endif

.if defined(USE_GCC) && (${USE_GCC} == 3.1 || ${USE_GCC} == 3.2)
CONFIGURE_ARGS+=    --enable-gcc3
.endif

.if ${OSVERSION} > 500000 && !defined(USE_GCC)
CONFIGURE_ARGS+=    --enable-gcc3
.endif

pre-fetch:
    @${ECHO}
    @${ECHO} "REQUIREMENTS:"
.if ${PROCFS}
    @${ECHO}
    @${ECHO} Check if procfs is running: YES
.else
    @${ECHO} -----------------------------------------------------------
    @${ECHO}
    @${ECHO} OpenOffice setup still needs a running procfs, which may
    @${ECHO} not be activated. Please read the procfs\(5\) manpage and
    @${ECHO} ensure the the following line is in /etc/fstab:
    @${ECHO}
    @${ECHO} proc /proc procfs rw 0 0
    @${ECHO}
    @${ECHO} -----------------------------------------------------------
.endif
.if !defined(USE_GCC) || !defined(WITH_DEBUG)
    @${ECHO}
    @${ECHO} "OPTIONS:"
.endif
.if !defined(USE_GCC)
    @${ECHO}
    @${ECHO} "You can compile OO with different"
    @${ECHO} "gcc compiler versions:"
    @${ECHO}
    @${ECHO} "Add USE_GCC=2.95 or USE_GCC=3.1"
    @${ECHO} "to compile openoffice with your"
    @${ECHO} "prefered compiler."
.endif
.if !defined(WITH_DEBUG)
    @${ECHO}
    @${ECHO} "You can compile OO with debug symbols"
    @${ECHO} "if you call make with WITH_DEBUG=1"
    @${ECHO}
    @${ECHO} "If you set WITH_DEBUG=2, you add internal"
    @${ECHO} "OO.org debug support.
    @${ECHO}
.endif
.if !defined(WITH_TTF_BYTECODE_ENABLED)
    @${ECHO}
    @${ECHO} "You may set WITH_TTF_BYTECODE_ENABLED=YES"
    @${ECHO} "if you like to use the Freetype library to"
    @${ECHO} "render TTF fonts. Normally the TTF lib is"
    @${ECHO} "not used to render fonts."
    @${ECHO}
    @${ECHO} "If you have licensed the Apple patents"
    @${ECHO} "US05155805 US05159668 and US05325479"
    @${ECHO} "you can enable this option to get better"
    @${ECHO} "quality of glyphs at small bitmap sizes."
    @${ECHO}
.endif
.if ${OSVERSION} < 450002
    @${ECHO}
    @${ECHO} "OS-VERSION ${OSVERSION} too low"
    @${ECHO}
    @${ECHO} "OO need some important libc_r and"
    @${ECHO} "gcc fixes to build. Please upgrade to 4.6"
    @${ECHO} "RELEASE or 4.6 STABLE."
    @${FALSE}
.endif
    @${ECHO}
    @${ECHO} "NOTICE:"
    @${ECHO}
    @${ECHO} "To build Openoffice, you should have a lot"
.if defined(WITH_DEBUG)
    @${ECHO} "of free diskspace (~ 8GB)."
.else
    @${ECHO} "of free diskspace (~ 4GB)."
.endif
    @${ECHO}
.if (defined(USE_GCC) && ${USE_GCC} == 2.95) || \
    (${OSVERSION} < 500000 && !defined(USE_GCC))
    @${ECHO} "KERNEL CONFIGURATION:"
    @${ECHO}
    @${ECHO} "Openoffice needs a larger stack- and"
    @${ECHO} "datasize to build. Check your limit"
    @${ECHO} "settings and and put this in /boot/loader.conf"
    @${ECHO} "if neccessary:"
    @${ECHO}
    @${ECHO} "kern.maxdsiz=\"1073741824\""
    @${ECHO} "kern.maxssiz=\"268435456\""
.endif
.if ${OSVERSION} < 460001
    @${ECHO} "SYSTEM PATCHES:"
    @${ECHO}
    @${ECHO} "OO setup is broken on STABLE < 4.6"
    @${ECHO} "including 4.6 RELEASE."
    @${ECHO} "You'll need a system patch to solve"
    @${ECHO}
    @${ECHO} "this problem:"
    @${ECHO}
    @${ECHO} "http://people.freebsd.org/~mbr/patches/rtld-elf.diff"
    @${ECHO}
.endif
.if ${OSVERSION} < 460002
    @${ECHO}
    @${ECHO} "OO.org soffice binary can deadlock. You can work around"
    @${ECHO} "this problem with this patch:"
    @${ECHO}
    @${ECHO} "http://people.freebsd.org/~mbr/patches/rtld-elf-patch2.diff"
    @${ECHO}
.endif
.if ${OSVERSION} < 500000
    @${ECHO}
    @${ECHO} "OO.org build can deadlock in regmerge. You can work around"
    @${ECHO} "this problem with this patch:"
    @${ECHO}
    @${ECHO} "http://people.freebsd.org/~mbr/patches/rtld-elf-patch3.diff"
    @${ECHO}
.endif
.if !exists(/usr/include/langinfo.h)
    @${ECHO}
    @${ECHO} "langinfo.h is missing !"
    @${ECHO}
    @${ECHO} "Please upgrade to 4.6 RELEASE or"
    @${ECHO} "4.6 STABLE."
    @${ECHO}
    @${FALSE}
.endif

post-extract:
    @for file in ${EXTRACT_REST}; do \
        if ! (cd ${WRKDIR} && ${EXTRACT_CMD_R} \
            ${EXTRACT_BEFORE_ARGS_R} \
            ${_DISTDIR}/$$file ${EXTRACT_AFTER_ARGS_R}) ; \
        then \
            exit 1; \
        fi \
    done
    @${CP} ${WRKDIR}/gpc231/gpc.c ${WRKSRC}/../external/gpc/
    @${CP} ${WRKDIR}/gpc231/gpc.h ${WRKSRC}/../external/gpc/
    @${MAKE} extract-mozilla WRKDIRPREFIX=""
    @-${RM} ${WRKSRC}/../moz/zipped/*.zip
.if defined(L10NHELP)
    @${ECHO_MSG} "===>  Extracting L10NHELP sub project"
    @${MKDIR} ${WRKDIR}/L10NHELP
    @cd ${WRKDIR}/L10NHELP && \
        ${TAR} -xzf ${DISTDIR}/${DIST_SUBDIR}/${L10NHELP}
.endif

post-patch:
    @${MAKE} patch-mozilla WRKDIRPREFIX=""
.if defined(WITH_TTF_BYTECODE_ENABLED)
    @if [ "`echo ${PATCHDIR}/optpatch-*`" != "${PATCHDIR}/optpatch-*" ]; then \
        ${ECHO_MSG} "===>  Applying additional TTF bytecode patches for ${PKGNAME}" ; \
        if [ ${PATCH_DEBUG_TMP} = yes ]; then \
            ${ECHO_MSG} "===>   Applying ${OPSYS} patch ${PATCHDIR}/optpatch-freetype::patch" ; \
        fi; \
        ${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/optpatch-freetype::patch ; \
    fi
.endif
.if defined(WITH_DEBUG)
    @if [ "`echo ${PATCHDIR}/debugpatch-*`" != "${PATCHDIR}/debugpatch-*" ]; then \
        ${ECHO_MSG} "===>  Applying additional debug ${OPSYS} patches for ${PKGNAME}" ; \
        PATCHES_APPLIED="" ; \
        for i in ${PATCHDIR}/debugpatch-*; do \
            case $$i in \
                *.orig|*.rej|*~) \
                    ${ECHO_MSG} "===>   Ignoring patchfile $$i" ; \
                    ;; \
                *) \
                    if [ ${PATCH_DEBUG_TMP} = yes ]; then \
                        ${ECHO_MSG} "===>   Applying ${OPSYS} patch $$i" ; \
                    fi; \
                    if ${PATCH} ${PATCH_ARGS} < $$i ; then \
                        PATCHES_APPLIED="$$PATCHES_APPLIED $$i" ; \
                    else \
                        ${ECHO_MSG} `${ECHO_CMD} ">> Patch $$i failed to apply cleanly." | ${SED} "s|${PATCHDIR}/||"` ; \
                        if [ x"$$PATCHES_APPLIED" != x"" ]; then \
                            ${ECHO_MSG} `${ECHO_CMD} ">> Patch(es) $$PATCHES_APPLIED applied cleanly." | ${SED} "s|${PATCHDIR}/||g"` ; \
                        fi; \
                        ${FALSE} ; \
                    fi; \
                    ;; \
            esac; \
        done; \
    fi;
.endif
    @${ECHO_MSG} "===>  Find old malloc.h defines and fix them in ${PKGNAME} source"
    @${FIND} ${WRKSRC}/.. | ${EGREP} "\.(cxx|h|c)$$" | ${XARGS} \
        ${PERL} -pi -e "s|<malloc.h>|<stdlib.h>|g"

extract-mozilla:
.if ! exists(${WRKDIR}/mozilla/Makefile)
    @${ECHO_MSG} "===>  Extracting mozilla sub project"
    @${MKDIR} ${WRKDIR}/mozilla
    @${CP} -r ${PORTSDIR}/www/mozilla/files ${WRKDIR}/mozilla
    @${CP} ${PORTSDIR}/www/mozilla/Makefile ${WRKDIR}/mozilla
    @${CP} ${PORTSDIR}/www/mozilla/distinfo ${WRKDIR}/mozilla
    @${CP} ${PORTSDIR}/www/mozilla/pkg-comment ${WRKDIR}/mozilla
    @${CP} ${PORTSDIR}/www/mozilla/pkg-descr ${WRKDIR}/mozilla
    @${CP} ${PORTSDIR}/www/mozilla/pkg-plist ${WRKDIR}/mozilla
.endif
    @cd ${WRKDIR}/mozilla && ${MAKE} extract WRKDIRPREFIX=""

patch-mozilla:
    @cd ${WRKDIR}/mozilla && ${MAKE} patch WRKDIRPREFIX=""

build-mozilla:
.if ! exists(${WRKDIR}/FREEBSDGCCIinc.zip)
    @${ECHO_MSG} "===>  Building mozilla sub project"
.if defined(WITH_DEBUG)
    @${CP} ${WRKDIR}/mozilla/Makefile ${WRKDIR}/mozilla/Makefile.new
    @${SED} -e 's|--disable-debug||' \
        -e 's|--disable-cpp-rtti||' \
        -e 's|--enable-strip||' \
        < ${WRKDIR}/mozilla/Makefile.new > ${WRKDIR}/mozilla/Makefile
.endif
.if defined(USE_GCC)
.if ${USE_GCC} == 3.1
    @cd ${WRKDIR}/mozilla && ${MAKE} CXX=${CXX} CC=${CC} CFLAGS="${CFLAGS}" USE_GCC=${USE_GCC} build WRKDIRPREFIX=""
.else
    @cd ${WRKDIR}/mozilla && ${MAKE} CFLAGS="${CFLAGS}" USE_GCC=${USE_GCC} build WRKDIRPREFIX=""
.endif
.else
    @cd ${WRKDIR}/mozilla && ${MAKE} CFLAGS="${CFLAGS}" build WRKDIRPREFIX=""
.endif
    @${CP} ${FILESDIR}/zipmoz.sh ${WRKDIR}
    @${CHMOD} 755 ${WRKDIR}/zipmoz.sh
    @${WRKDIR}/zipmoz.sh ${WRKDIR}/mozilla/work/mozilla/dist FREEBSDGCCI ${WRKDIR}
.endif

install-mozilla:
.if ! exists(${WRKDIR}/../moz/zipped/FREEBSDGCCIinc.zip)
    @${CP} ${WRKDIR}/FREEBSDGCCIinc.zip ${WRKSRC}/../moz/zipped/
    @${CP} ${WRKDIR}/FREEBSDGCCIlib.zip ${WRKSRC}/../moz/zipped/
    @${CP} ${WRKDIR}/FREEBSDGCCIruntime.zip ${WRKSRC}/../moz/zipped/
.endif

mozilla:
    @${MAKE} extract-mozilla
    @${MAKE} patch-mozilla
    @${MAKE} build-mozilla
    @${MAKE} install-mozilla

do-build:
    @${MAKE} mozilla
.if exists(${WRKDIR}/.Xvfb.pid)
    @-${CAT} ${WRKDIR}/.Xvfb.pid | xargs kill
    @${RM} -f ${WRKDIR}/.Xvfb.pid
.endif
.if !defined(DISPLAY)
    #
    # This is a UGLY hack to not have to specify a X-Display.
    #
    ${X11BASE}/bin/Xvfb :1001 -screen 0 800x600x24 > /dev/null 2>&1 & ${ECHO} $$! > ${WRKDIR}/.Xvfb.pid
    @sleep 5
.endif
    @cd ${WRKSRC}/.. && PATH="${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin" ./bootstrap
.if defined(L10NHELP)
    @${MKDIR} ${WRKSRC}/../solver/641/unxfbsd.pro/pck 
    @${CP} ${WRKDIR}/L10NHELP/*.zip ${WRKSRC}/../solver/641/unxfbsd.pro/pck
.endif
.if !defined(DISPLAY)
    @cd ${WRKSRC}/.. && DISPLAY=${DISPLAYHACK} PATH="${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin" && \
        tcsh -c 'source FreeBSDEnv.Set && unsetenv TOP && ${BUILD}'
    @-${CAT} ${WRKDIR}/.Xvfb.pid | xargs kill
    @${RM} -f ${WRKDIR}/.Xvfb.pid
.else
    @cd ${WRKSRC}/.. && DISPLAY=${DISPLAY} PATH="${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin" && \
        tcsh -c 'source FreeBSDEnv.Set && unsetenv TOP && ${BUILD}'
.endif
.if defined(LANG_PKGNAME)
    @cd ${WRKSRC}/.. && PATH="${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin" && \
        tcsh -c 'source FreeBSDEnv.Set && unsetenv TOP && cd instsetoo/util && ${BUILD} LANGEXT=${LANGEXT}'
.endif

pre-install:
    @${SED} -e 's#%%PREFIX%%#${PREFIX}#g' < ${FILESDIR}/oo_setup.resp \
       > ${WRKSRC}/../instsetoo/unxfbsd.pro/${LANG_EXT}/normal/oo_setup.resp

do-install:
.if !defined(DISPLAY)
    #
    # UGLY hack to not have to specify a X-Display.
    #
    ${X11BASE}/bin/Xvfb :1001 -screen 0 800x600x24 > /dev/null 2>&1 & ${ECHO} $$! > ${WRKDIR}/.Xvfb.pid
    @sleep 5
    @-SAL_IGNOREXERRORS=1 PATH="/bin:${PATH}" LD_LIBRARY_PATH=${LD_PATH} \
        TEMP=${WRKDIR} DISPLAY=${DISPLAYHACK} \
        ${WRKSRC}/../instsetoo/*.pro/${LANG_EXT}/normal/setup -r:oo_setup.resp
    @-${CAT} ${WRKDIR}/.Xvfb.pid | xargs kill
    @${RM} -f ${WRKDIR}/.Xvfb.pid
.else
    @-SAL_IGNOREXERRORS=1 PATH="/bin:${PATH}" LD_LIBRARY_PATH=${LD_PATH} \
        TEMP=${WRKDIR} DISPLAY=${DISPLAY} \
        ${WRKSRC}/../instsetoo/*.pro/${LANG_EXT}/normal/setup -r:oo_setup.resp
.endif

install-user:
    @-SAL_IGNOREXERRORS=1 PATH="/bin:${PATH}" \
        ${PREFIX}/${INSTALLATION_BASEDIR}/program/setup

post-install:
    @${ECHO_MSG} "===>  Add wrapper scripts";
    @${SED} -e 's#%%PREFIX%%#${PREFIX}#g' < ${FILESDIR}/openoffice-wrapper \
       > ${WRKDIR}/openoffice
    @${INSTALL_SCRIPT} ${WRKDIR}/openoffice ${PREFIX}/bin/openoffice
    @${LN} -fs ${PREFIX}/bin/openoffice ${PREFIX}/bin/openoffice-sagenda
    @${LN} -fs ${PREFIX}/bin/openoffice ${PREFIX}/bin/openoffice-scalc
    @${LN} -fs ${PREFIX}/bin/openoffice ${PREFIX}/bin/openoffice-sdraw
    @${LN} -fs ${PREFIX}/bin/openoffice ${PREFIX}/bin/openoffice-setup
    @${LN} -fs ${PREFIX}/bin/openoffice ${PREFIX}/bin/openoffice-sfax
    @${LN} -fs ${PREFIX}/bin/openoffice ${PREFIX}/bin/openoffice-simpress
    @${LN} -fs ${PREFIX}/bin/openoffice ${PREFIX}/bin/openoffice-spadmin
    @${LN} -fs ${PREFIX}/bin/openoffice ${PREFIX}/bin/openoffice-sweb
    @${LN} -fs ${PREFIX}/bin/openoffice ${PREFIX}/bin/openoffice-swriter
    @cd ${PREFIX} && ${FIND} -s bin -type f | ${GREP} openoffice > ${TMPPLIST}
    @cd ${PREFIX} && ${FIND} -s bin -type l | ${GREP} openoffice >> ${TMPPLIST}
    @cd ${PREFIX} && ${FIND} -s ${INSTALLATION_BASEDIR} -type f >> ${TMPPLIST}
    @cd ${PREFIX} && ${FIND} -s ${INSTALLATION_BASEDIR} -type l >> ${TMPPLIST}
    @cd ${PREFIX} && ${FIND} -s ${INSTALLATION_BASEDIR} -type d > ${WRKDIR}/dir.tmp
    @${SORT} -r ${WRKDIR}/dir.tmp | ${XARGS} -n 1 ${ECHO_CMD} @dirrm >> ${TMPPLIST}

package-rename:
    @${ECHO_MSG} "===>   Rename package for OO.org mirror upload";
.if defined(LANG_SUFFIX)
    @${MV} ${WRKDIR}/../${PKGNAMEPREFIX}openoffice-${LANG_SUFFIX}-${PORTVERSION}_${PORTREVISION}.tbz2 \
        ${WRKDIR}/../OOo_${PORTVERSION}_${OPSYS}Intel_install_${LANG_PKGNAME}-${LANG_SUFFIX}.tbz2
.else
    @${MV} ${WRKDIR}/../${PKGNAMEPREFIX}openoffice-${PORTVERSION}_${PORTREVISION}.tbz2 \
        ${WRKDIR}/../OOo_${PORTVERSION}_${OPSYS}Intel_install_${LANG_PKGNAME}.tbz2
.endif

.include <bsd.port.post.mk>