summaryrefslogtreecommitdiff
path: root/misc/openoffice/Makefile
blob: cd0d705c3fa7bef8b77f7bdf26c896a5e95f1315 (plain)
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
# $NetBSD: Makefile,v 1.29 2002/12/26 20:52:11 jlam Exp $

DISTNAME=		openoffice-0.0.0.641
PKGREVISION=		1
WRKSRC=			${WRKDIR}/oo_641_src/config_office
CATEGORIES=		misc
MASTER_SITES=		http://sf1.mirror.openoffice.org/641b/		\
			http://www.fs.tum.de/~mrauch/OpenOffice/download/
DISTFILES=		oo_641_src.tar.bz2
DISTFILES+=		gpc231.tar.Z
DISTFILES+=		oo_moz_641.tar.gz
SITES_gpc231.tar.Z= 	ftp://ftp.cs.man.ac.uk/pub/toby/gpc/
SITES_oo_moz_641.tar.gz=ftp://ftp.netbsd.org/pub/NetBSD/misc/mrauch/

MAINTAINER=		mrauch@netbsd.org
HOMEPAGE=		http://www.openoffice.org/
COMMENT=		Integrated office productivity suite

USE_BUILDLINK2=		yes

.include "../../mk/bsd.prefs.mk"

# OpenOffice requires gcc 2.95.2 or better,
GCC_VERSION!=		${CC} --version
.if (${GCC_VERSION} != "2.95.2") && (${GCC_VERSION} != "2.95.3")
BUILD_DEPENDS+= gcc>=2.95.3:../../lang/gcc
.  if ${OPSYS} == "SunOS"
GCCPREFIX=		${LOCALBASE}
CC=			${GCCPREFIX}/bin/gcc
CXX=			${GCCPREFIX}/bin/g++
.  else
GCCPREFIX=		${LOCALBASE}/gcc-2.95.3
CC=			${GCCPREFIX}/bin/cc
CXX=			${GCCPREFIX}/bin/c++
.  endif
CPP=			${GCCPREFIX}/bin/cpp
F77=			${GCCPREFIX}/bin/g77
PKG_FC=			${GCCPREFIX}/bin/g77
LDFLAGS+=		-R${GCCPREFIX}/lib
.endif

BUILD_DEPENDS+=		bison-[0-9]*:../../devel/bison
BUILD_DEPENDS+=		{standalone-tcsh,tcsh}-[0-9]*:../../shells/tcsh
BUILD_DEPENDS+=		zip-[0-9]*:../../archivers/zip
BUILD_DEPENDS+=		stlport>=4.0nb1:../../devel/stlport

USE_X11=		# defined
USE_GMAKE=		# defined
USE_JAVA=		build
PKG_JVMS_ACCEPTED=	sun-jdk13

CONFLICTS=		staroffice-[0-9]*

ONLY_FOR_PLATFORM=	NetBSD-1.5.3*-i386 NetBSD-1.5Z?-i386 \
			NetBSD-1.[6-9]*-i386 NetBSD-[2-9]*-i386

GNU_CONFIGURE=		yes
CONFIGURE_ARGS+= 	--with-stlport4-home=${LOCALBASE}
CONFIGURE_ARGS+= 	--with-jdk-home=${PKG_JAVA_HOME}

TEMP?=			${WRKSRC}

post-extract:
# bring the two files from GPC into place
	${CP} ${WRKDIR}/gpc231/gpc.c ${WRKSRC}/../external/gpc/
	${CP} ${WRKDIR}/gpc231/gpc.h ${WRKSRC}/../external/gpc/
# bring the NetBSD mozilla zip files into place
	${CP} ${WRKDIR}/*.zip ${WRKSRC}/../moz/zipped/
# convert \r\n-lineends in sablot-patch into unix-style \n first
	${PERL5} -p -i.save -e 's/\r\n/\n/' 				\
	    ${WRKSRC}/../sablot/Sablot-0.52.patch

DISPLAY?=	#empty, if unset
checkforx:
.if ${DISPLAY}=="" || ${DISPLAY_OK:!${X11BASE}/bin/xdpyinfo >/dev/null 2>&1 && echo YES || echo NO!} == "NO"
.  if exists(${X11BASE}/bin/Xvfb)
	-${X11BASE}/bin/Xvfb :2 &
DISPLAY= ':2'
.  else
	@${ECHO} "Error: Environment variable DISPLAY must be set"
	@${ECHO} "       and point to a connectible X server."
	@${FALSE}
.  endif  #Xvfb
.endif  #DISPLAY

pre-build: checkforx

do-build:
	${_ULIMIT_CMD}tcsh -c "setenv DISPLAY '${DISPLAY}'; \
		cd ${WRKSRC}/.. && ./bootstrap && source *.Set && dmake"

pre-install: checkforx
	${SH} -c "cd ${WRKSRC}/../instsetoo/*.pro/01/normal;		\
	    ${SED} -e 's#@@PREFIX@@#${PREFIX}#g'			\
		<${FILESDIR}/oo_setup.resp 				\
		>oo_setup.resp"

do-install:
	-${SH} -c "cd ${WRKSRC}/../instsetoo/*.pro/01/normal;		\
		  TEMP=${WRKDIR}; export TEMP;				\
		  DISPLAY=${DISPLAY}; export DISPLAY;			\
		  ./setup -r:oo_setup.resp"
	@${SH} -c "if ! [ -x ${PREFIX}/OpenOffice.org641/setup ] ;	\
	           then ${ECHO} 'Installation was not successful.';	\
		   ${FALSE}; fi"
	${SED} -e 's#@@PREFIX@@#${PREFIX}#g'				\
	    <${FILESDIR}/soffice >${PREFIX}/bin/soffice
	${CHMOD} +x ${PREFIX}/bin/soffice

.include "../../devel/pth/buildlink2.mk"
.include "../../lang/perl5/buildlink2.mk"
.include "../../mk/java-vm.mk"
.include "../../mk/bsd.pkg.mk"