aboutsummaryrefslogtreecommitdiffstats
path: root/editors/openoffice.org-3-devel/Makefile
blob: 9766e9988f0a0f6251eeae7eba1c40c2288c5bcd (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
# New ports collection makefile for: OpenOffice.org
# Date created:     28 February 2002
# Whom:                 Martin Blapp
#
# $FreeBSD$
#

PORTNAME?=  openoffice.org
PORTVERSION?=   3.3.${SNAPDATE}
PORTREVISION=   1
CATEGORIES+=    editors java
MASTER_SITES+=  http://ooopackages.good-day.net/pub/OpenOffice.org/sources/ \
        http://ooopackages.good-day.net/pub/OpenOffice.org/cws/:cws \
        http://ooopackages.good-day.net/pub/OpenOffice.org/misc/moz/:mozsrc \
        ${MASTER_SITE_MOZILLA_EXTENDED:S/$/:mozsrc/} \
        http://tools.openoffice.org/unowinreg_prebuild/680/:unowinreg
MASTER_SITE_SUBDIR+=    seamonkey/releases/${SEAMONKEY_VERSION}/:mozsrc
DISTFILES+= ${OOOSRC} unowinreg.dll:unowinreg

#de facto maintainer is maho@FreeBSD.org
#patch submitters must sign SCA; see http://porting.openoffice.org/freebsd/#policy
MAINTAINER= openoffice@FreeBSD.org
COMMENT?=   Integrated wordprocessor/dbase/spreadsheet/drawing/chart/browser(developer version)

EXTRATC_ONLY?=  ${OOOSRC}

.if defined(CWS)
PORTNAME:=  openoffice.org-${CWS}
OOOSRC=     OOo_${CWS}_source.tar.bz2:cws
OOOTAG=     ${CWS}
.endif

NO_LATEST_LINK= yes

.if !defined(WITHOUT_MOZILLA)
SEAMONKEY_VERSION=  1.1.14
SEAMONKEY_SOURCE=   seamonkey-${SEAMONKEY_VERSION}.source.tar.bz2
DISTFILES+=     ${SEAMONKEY_SOURCE}:mozsrc
USE_GNOME+=     libidl
.endif

USE_GNOME=  desktopfileutils gtk20

.if defined(WITH_KDE4) && defined(WITH_KDE)
.error "Cannot define WITH_KDE and WITH_KDE4 at the same time"
.endif
.if defined(WITH_KDE4)
USE_KDE4=   kdelibs
USE_QT_VER= 4
.endif

.if defined(WITH_KDE)
USE_KDELIBS_VER=    3
.endif
USE_XORG=   x11 ice xaw xau xext xrender xrandr \
        xi xt xcursor xdamage xcomposite xfixes
USE_GMAKE=  yes
USE_PERL5=  yes
USE_BZIP2=  yes
WITHOUT_CPU_CFLAGS= true
MAKE_JOBS_SAFE= yes

.include <bsd.port.pre.mk>

USE_JAVA=   yes
JAVA_BUILD= jdk
JAVA_VENDOR=    freebsd bsdjava openjdk
.if (${OSVERSION} >= 700000)
JAVA_VERSION=   1.5 1.6
.else
JAVA_VERSION=   1.4 1.5 1.6
.endif

.include <${FILESDIR}/Makefile.localized>

ONLY_FOR_ARCHS= i386 amd64

.if ${ARCH} == amd64
FREEBSD_ENV_SET=    FreeBSDAMDEnv.Set.sh
.else
FREEBSD_ENV_SET=    FreeBSDX86Env.Set.sh
.endif

MILESTONE?=     75
OOOTAG?=        DEV300_m${MILESTONE}
OOOSRC?=        OOo_${OOOTAG}_source${EXTRACT_SUFX}
OOODIR=         openoffice.org3
SNAPDATE=       20100320
INSTALLATION_BASEDIR?=  openoffice.org-${OOOTAG}
EXECBASE?=      openoffice.org-${OOOTAG}
DIST_SUBDIR=        openoffice.org3
SIMPLEOSVER=        ${OSREL:C/\.//g}
.if ${ARCH} == amd64
PACKAGE_BASENAME=   OOo_Dev_${OOOTAG}_${OPSYS}${SIMPLEOSVER}X86-64
.else
PACKAGE_BASENAME=   OOo_Dev_${OOOTAG}_${OPSYS}${SIMPLEOSVER}Intel
.endif

LOCALIZED_LANG?=    en-US
# FIXME (Somehow INDEX build fails)
.if defined(LANG_PKGNAME)
PKGNAMEPREFIX=      ${LANG_PKGNAME}-
.endif
.if defined(LANG_SUFFIX)
PKGNAMESUFFIX=      -${LANG_SUFFIX}
.endif

RUN_DEPENDS+=   ${LOCALBASE}/share/icons/hicolor/index.theme:${PORTSDIR}/misc/hicolor-icon-theme

.if defined(WITH_CCACHE)
BUILD_DEPENDS+= ccache:${PORTSDIR}/devel/ccache
CCACHE_PREFIX=  ccache
OOOCC=      ${CCACHE_PREFIX} ${CC}
OOOCXX=     ${CCACHE_PREFIX} ${CXX}
.else
OOOCC=      ${CC}
OOOCXX=     ${CXX}
.endif
CONFIGURE_ENV+= CC="${OOOCC}" CXX="${OOOCXX}"       \
        CPPFLAGS="-I${LOCALBASE}/include"   \
        LDFLAGS="-L${LOCALBASE}/lib" \
        PATH=${WRKSRC}/solenv/bin:$$PATH

BUILD_DEPENDS+= zip:${PORTSDIR}/archivers/zip \
        unzip:${PORTSDIR}/archivers/unzip \
        gcp:${PORTSDIR}/sysutils/coreutils \
        gpatch:${PORTSDIR}/devel/patch \
        ${SITE_PERL}/Archive/Zip.pm:${PORTSDIR}/archivers/p5-Archive-Zip \
        bash:${PORTSDIR}/shells/bash \
        imake:${PORTSDIR}/devel/imake \
        gtar:${PORTSDIR}/archivers/gtar \
        ${LOCALBASE}/bin/gperf:${PORTSDIR}/devel/gperf \
        ant:${PORTSDIR}/devel/apache-ant
#see #i85469# for gperf

USE_BISON=  build
GNU_CONFIGURE=  yes
WRKSRC?=    ${WRKDIR}/${OOOTAG}
BASH?=      ${PREFIX}/bin/bash
SUB_FILES=  pkg-message
SUB_LIST=   EXECBASE=${EXECBASE} OOOTAG=${OOOTAG} OOODIR=${OOODIR}

.if defined(DISABLE_MAKE_JOBS)
MAKE_JOBS_NUMBER=   1
.endif

CONFIGURE_ARGS+=    --with-gnu-cp=${LOCALBASE}/bin/gcp      \
            --with-gnu-patch=${LOCALBASE}/bin/gpatch    \
            --enable-crashdump=yes              \
            --with-system-zlib              \
            --with-system-stdlibs               \
            --with-epm=internal             \
            --enable-hids                   \
            --enable-minimizer              \
            --enable-presenter-console          \
            --enable-pdfimport              \
            --enable-wiki-publisher             \
            --enable-report-builder             \
            --with-use-shell=bash               \
            --with-vendor="FreeBSD ports system"

OOOEXTENSIONS+=     minimizer/sun-presentation-minimizer.oxt
OOOEXTENSIONS+=     presenter/presenter-screen.oxt
OOOEXTENSIONS+=     pdfimport/pdfimport.oxt
OOOEXTENSIONS+=     swext/wiki-publisher.oxt
OOOEXTENSIONS+=     sun-report-builder.oxt

.if (${OSVERSION} <= 602102)
EXTRA_PATCHES+= ${FILESDIR}/rtld-workaround-i66667
.endif

ICONS=  ${WRKSRC}/sysui/desktop/icons

.include <${FILESDIR}/Makefile.knobs>

pre-everything::
# really tweak, extremely useful when you build all localized language versions
# needed after when you build with ALL_LOCALIZED_LANGS.
.if defined(TWEAK_L10N)
    @${RM} -f ${WRKDIR}/.PLIST*
    @${RM} -f ${WRKDIR}/.install_done.*
    @${RM} -f ${WRKDIR}/.package_done.*
    @${RM} -f ${WRKDIR}/.extract_done.*
    @${RM} -f ${WRKDIR}/.patch_done.*
    @${RM} -f ${WRKDIR}/.configure_done.*
    @${RM} -f ${WRKDIR}/.build_done.*
    @${MKDIR} ${WRKDIR}
    @${TOUCH} ${EXTRACT_COOKIE}
    @${TOUCH} ${PATCH_COOKIE}
    @${TOUCH} ${CONFIGURE_COOKIE}
    @${TOUCH} ${BUILD_COOKIE}
.endif

#issue XXXXXX not raised yet...
CRLFFILES=curl/curl*patch neon/neon*patch jfreereport/patches/*.patch

post-extract:
    for i in ${CRLFFILES};  do \
        cd ${WRKSRC} ; ${REINPLACE_CMD} -e 's#
##g' $$i ; \
    done
    @${CP} ${DISTDIR}/${DIST_SUBDIR}/unowinreg.dll ${WRKSRC}/external/unowinreg/
.if !defined(WITHOUT_MOZILLA)
    @${CP} ${DISTDIR}/${DIST_SUBDIR}/${SEAMONKEY_SOURCE} ${WRKSRC}/moz/download
.endif

pre-configure:
#Workaround for gperf. #i85469#
    @${LN} -sf ${LOCALBASE}/bin/gperf ${WRKSRC}/solenv/bin/gperf
.if defined(WITH_KDE4)
    @${LN} -sf ${LOCALBASE}/bin/moc-qt4 ${WRKSRC}/solenv/bin/moc
.endif

do-build:
    @cd ${WRKSRC} ; ./bootstrap
    @cd ${WRKSRC} ; ${SETENV} "LANG=C" "LC_ALL=C" ${BASH} -c "source ${FREEBSD_ENV_SET} ; cd instsetoo_native ; build.pl --checkmodules ; build.pl -P${MAKE_JOBS_NUMBER} --all --html --dontgraboutput"

.if ${LOCALIZED_LANG} == "alllangs"
    @${MAKE} languagepack
.endif

do-install:
.if ${LOCALIZED_LANG} == "alllangs"
    @cd ${WRKSRC}/instsetoo_native/unxfbsd?.pro/OpenOffice/bsd/install/en-US/freebsd/ ; ${LS} *.t?z > ${WRKDIR}/INSTALLFILES
    @cd ${WRKSRC}/instsetoo_native/unxfbsd?.pro/OpenOffice_languagepack/bsd/install/ ; ${LS} */freebsd*/*.t?z > ${WRKDIR}/LANGPACKFILES
    @${RM} -Rf ${WRKDIR}/tmp
    @${MKDIR} ${WRKDIR}/tmp
    @for i in `${CAT} ${WRKDIR}/INSTALLFILES`; do \
        ${ECHO_CMD} "extracting $$i" ; \
        cd ${WRKDIR}/tmp ; ${TAR} xfz ${WRKSRC}/instsetoo_native/unxfbsd?.pro/OpenOffice/bsd/install/en-US/freebsd/$$i ; \
    done
    @for i in `${CAT} ${WRKDIR}/LANGPACKFILES`; do \
        ${ECHO_CMD} "extracting $$i" ; \
        cd ${WRKDIR}/tmp ; ${TAR} xfz ${WRKSRC}/instsetoo_native/unxfbsd?.pro/OpenOffice_languagepack/bsd/install/$$i ;\
    done
    @${MKDIR} ${PREFIX}/${INSTALLATION_BASEDIR}
    @cd ${WRKDIR}/tmp/opt/ ; ${TAR} cf - -C . . | ${TAR} xf - -C ${PREFIX}/${INSTALLATION_BASEDIR}
    @${MKDIR} ${PREFIX}/${INSTALLATION_BASEDIR}/extensions/
    @cd ${WRKSRC}/solver/3?0/unxfbsd?.pro/bin/ ; ${INSTALL_DATA} ${OOOEXTENSIONS} ${PREFIX}/${INSTALLATION_BASEDIR}/extensions/
    @${INSTALL_DATA} ${WRKSRC}/instsetoo_native/unxfbsd?.pro/bin/hid.lst ${PREFIX}/${INSTALLATION_BASEDIR}
.else
    @cd ${WRKSRC}/instsetoo_native/unxfbsd?.pro/OpenOffice/bsd/install/${LOCALIZED_LANG}/freebsd/ ; ${LS} *.t?z > ${WRKDIR}/INSTALLFILES
    @${RM} -Rf ${WRKDIR}/tmp
    @${MKDIR} ${WRKDIR}/tmp
    @for i in `${CAT} ${WRKDIR}/INSTALLFILES`; do \
        ${ECHO_CMD} "extracting $$i" ; \
        cd ${WRKDIR}/tmp ; ${TAR} xfz ${WRKSRC}/instsetoo_native/unxfbsd?.pro/OpenOffice/bsd/install/${LOCALIZED_LANG}/freebsd/$$i ; \
    done
    @${MKDIR} ${PREFIX}/${INSTALLATION_BASEDIR}
    @cd ${WRKDIR}/tmp/opt/ ; ${TAR} cf - -C . . | ${TAR} xf - -C ${PREFIX}/${INSTALLATION_BASEDIR}
.endif
    @${MKDIR} ${PREFIX}/${INSTALLATION_BASEDIR}/extensions/
    @cd ${WRKSRC}/solver/3?0/unxfbsd?.pro/bin/ ; ${INSTALL_DATA} ${OOOEXTENSIONS} ${PREFIX}/${INSTALLATION_BASEDIR}/extensions/
    @${INSTALL_DATA} ${WRKSRC}/instsetoo_native/unxfbsd?.pro/bin/hid.lst ${PREFIX}/${INSTALLATION_BASEDIR}

post-install:
    @${ECHO_MSG} "===>  Add wrapper scripts";
    @${CP} ${FILESDIR}/openoffice.org-wrapper ${WRKDIR}/
    @${REINPLACE_CMD} -e 's#%%PREFIX%%#${PREFIX}#g' \
            -e 's#%%OOOTAG%%#${OOOTAG}#g' \
            -e 's#%%OOODIR%%#${OOODIR}#g' \
            -e 's#%%INSTALLATION_BASEDIR%%#${INSTALLATION_BASEDIR}#g' \
            ${WRKDIR}/openoffice.org-wrapper
    @${INSTALL_SCRIPT} ${WRKDIR}/openoffice.org-wrapper \
        ${PREFIX}/bin/${EXECBASE}
    @${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-sbase
    @${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-scalc
    @${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-sdraw
    @${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-setofficelang
    @${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-simpress
    @${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-smath
    @${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-spadmin
    @${LN} -fs ${PREFIX}/bin/${EXECBASE} ${PREFIX}/bin/${EXECBASE}-swriter
    @${ECHO_CMD} "" > ${TMPPLIST}
    @cd ${PREFIX} ; ${FIND} -s bin \( -type f -or -type l \) -name "${EXECBASE}*" >> ${TMPPLIST}
    @cd ${PREFIX} ; ${FIND} -s ${INSTALLATION_BASEDIR} \( -type f -or -type l \) >> ${TMPPLIST}
    @cd ${PREFIX} ; ${FIND} ${INSTALLATION_BASEDIR} -type d | ${SORT} -r | \
        ${XARGS} -n 1 ${ECHO_CMD} @dirrm >> ${TMPPLIST}
    @for app in base calc draw impress math writer; do \
        ${REINPLACE_CMD} -e "s/^Exec.*/Exec=${EXECBASE} -$${app} %U/" \
            -e "s/^Icon.*/Icon=${EXECBASE}-$${app}.png/" \
        ${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/share/xdg/$${app}.desktop ; \
    done
    @${REINPLACE_CMD} -e "s/^Exec.*/Exec=${EXECBASE}-spadmin %U/" \
        -e "s/^Icon.*/Icon=${EXECBASE}-printeradmin.png/" \
        ${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/share/xdg/printeradmin.desktop
    @${REINPLACE_CMD} -e "s/^Exec.*/Exec=${EXECBASE} -quickstart -nologo -nodefault/" \
        ${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/share/xdg/qstart.desktop
    @${RM} ${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/share/xdg/*.desktop.bak
    @${RM} -f ${DESKTOPDIR}/${EXECBASE}
    @${MKDIR} ${DESKTOPDIR}
    @${LN} -sf ${PREFIX}/${INSTALLATION_BASEDIR}/${OOODIR}/share/xdg \
            ${DESKTOPDIR}/${EXECBASE}
    @${ECHO_CMD} "share/applications/${EXECBASE}" >> ${TMPPLIST}
    @${ECHO_CMD} "@unexec ${RMDIR} %D/share/applications 2>/dev/null || ${TRUE}" >> ${TMPPLIST}
    @${PREFIX}/bin/update-desktop-database 2>/dev/null || ${TRUE}
    @${ECHO_CMD} "@exec ${PREFIX}/bin/update-desktop-database 2>/dev/null || ${TRUE}" >> ${TMPPLIST}
    @for dir in `ls ${ICONS}/hicolor | ${GREP} -v CVS`; do \
        for app in base calc draw impress math printeradmin writer; do \
            if [ -r ${ICONS}/hicolor/$${dir}/apps/$${app}.png ]; then \
                ${INSTALL_DATA} ${ICONS}/hicolor/$${dir}/apps/$${app}.png \
                    ${PREFIX}/share/icons/hicolor/$${dir}/apps/${EXECBASE}-$${app}.png ; \
                ${ECHO_CMD} "share/icons/hicolor/$${dir}/apps/${EXECBASE}-$${app}.png" >> ${TMPPLIST} ; \
            fi \
        done ; \
        for file in `cd ${ICONS}/hicolor/$${dir}/mimetypes; ls *.png`; do \
            ${INSTALL_DATA} ${ICONS}/hicolor/$${dir}/mimetypes/$${file} \
                ${PREFIX}/share/icons/hicolor/$${dir}/mimetypes/ ; \
            ${ECHO_CMD} "share/icons/hicolor/$${dir}/mimetypes/$${file}" >> ${TMPPLIST} ; \
        done ; \
    done
    @${PREFIX}/bin/gtk-update-icon-cache -q -f ${PREFIX}/share/icons/hicolor 2>/dev/null || ${TRUE}
    @${ECHO_CMD} "@unexec ${RM} %D/share/icons/hicolor/icon-theme.cache 2>/dev/null || ${TRUE}" >> ${TMPPLIST}
    @${ECHO_CMD} "@exec ${PREFIX}/bin/gtk-update-icon-cache -q -f %D/share/icons/hicolor 2>/dev/null || ${TRUE}" >> ${TMPPLIST}
    @${ECHO_CMD} "@unexec ${PREFIX}/bin/gtk-update-icon-cache -q -f %D/share/icons/hicolor 2>/dev/null || ${TRUE}" >> ${TMPPLIST}
    @${ECHO_CMD}
    @${CAT} ${PKGMESSAGE}
    @${ECHO_CMD}

.include <${FILESDIR}/Makefile.others>
.include <bsd.port.post.mk>