summaryrefslogtreecommitdiffstats
path: root/extra/openoffice-3.2/Pkgfile
blob: 5df08319e13591e825e102e9fef098885ff61a5a (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
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
#  Description: Suite complète de office en logiciel libre 
# URL:         http://www.openoffice.org
# Packager:    Sibelle at free dot fr
# Maintainer:  NuTyX packager team
# Depends on:  crypto++, xmlsec, bison, subversion, libart_lgpl, xorg-libxtst, linux-pam, sane, p5-archive-zip, xulrunner, ant, cairo, gperf, cups, poppler, gconf, curl, python, libwpd, redland, xorg-libxaw, neon, dbus-glib, icu, libxslt, hicolor-icon-theme, desktop-file-utils, openldap, lucene, boost, hunspell, hsqldb-java, beanshell, saxon, vigra, hyphen, lpsolve, libmspack, myodbc, libgraphite, qt, gtk2

#pstoedit

name=openoffice
version=3.2.0
release=1
OOdir=OOO320_m12
backup=(usr/lib/openoffice/program/sofficerc)

source=(http://download.services.openoffice.org/files/stable/3.2.0/OOo_3.2.0_src_core.tar.bz2 \
	http://download.services.openoffice.org/files/stable/3.2.0/OOo_3.2.0_src_extensions.tar.bz2\
	http://download.services.openoffice.org/files/stable/3.2.0/OOo_3.2.0_src_l10n.tar.bz2 \
	http://download.services.openoffice.org/files/stable/3.2.0/OOo_3.2.0_src_binfilter.tar.bz2\
	http://download.services.openoffice.org/files/stable/3.2.0/OOo_3.2.0_src_system.tar.bz2\
	http://download.services.openoffice.org/files/stable/3.2.0/OOo_3.2.0_src_testautomation.tar.bz2\
        http://tools.openoffice.org/unowinreg_prebuild/680/unowinreg.dll \
        startcenter.desktop \
        default-no-startup-wizard.diff \
        default-system-fpicker.diff \
        soffice-detect-mozilla-certificates.diff \
        buildfix-gcc44.diff \
        buildfix_FormulaMissingHeader.diff \
        buildfix_system_db48.diff \
        openoffice.profile )


build() {
	install -D -m644 startcenter.desktop \
        	$PKG/usr/share/ede/programs/Applications/startcenter.desktop
	source /etc/profile
	mkdir -p $PKG/opt
	mkdir -p $PKG/usr/bin
        mkdir -p $PKG/usr/share/icons
        mkdir -p $PKG/usr/share/applications

	# just to make sure that it will detect the desired JDK/JVM - we want jdk
        unset J2REDIR; unset J2SDKDIR; unset JAVA_HOME; unset CLASSPATH
        [ -z "${JAVA_HOME}" ] && . /etc/profile
        JAVAHOME=${JAVA_HOME}
        [ -z "${MOZ_PLUGIN_PATH}" ] && . /etc/profile.d/mozilla-common.sh
        [ -z "${ANT_HOME}" ] && . /etc/profile.d/apache-ant.sh

	# some speedups
        export SMP="6"
        MAXMODULESFLAG="-P${SMP}"
        MAXPROCESSESFLAG="-P${SMP}"
        export nodep=true
        export NO_HIDS=true

        cd $OOdir

	# build fixes
	patch -Np0 -i ../buildfix-gcc44.diff
        patch -Np0 -i ../buildfix_FormulaMissingHeader.diff
        patch -Np0 -i ../buildfix_system_db48.diff

	# allows soffice to find the user's firefox profile so that it can read
        # its digital certificates. Nss stores digital certificates in your mozilla firefox profile. 
        patch -Np0 -i $SRC/soffice-detect-mozilla-certificates.diff

	# remove the startup wizard
        patch -Np0 -i $SRC/default-no-startup-wizard.diff
        # enables the default system-file-picker in case we have that built
        patch -Np0 -i $SRC/default-system-fpicker.diff

	EXTRAOPTS="--with-stlport --without-system-graphite"

	cd $SRC/$OOdir

        # needed to build the OO-SDK
        mv $SRC/unowinreg.dll external/unowinreg

        # export C(XX)FLAGS
        # http://www.openoffice.org/issues/show_bug.cgi?id=103205
        unset CFLAGS
        unset CXXFLAGS

        # Need to recreate the configure script because of patches
        autoreconf -v

	./configure --with-build-version="$version NuTyX $OOdir" \
		--with-vendor="NuTyX"\
	        --prefix=/usr --exec-prefix=/usr\
	        --with-lang="fr"\
	        --with-dict=ALL\
	        --disable-gnome-vfs\
	        --disable-qadevooo\
	        --disable-reportdesign\
	        --disable-systray\
	        --disable-mathmldtd\
	        --enable-binfilter\
	        --enable-cairo\
	        --enable-crashdump=yes\
	        --enable-cups\
	        --enable-dbus\
	        --enable-evolution2\
	        --enable-gio\
	        --enable-gtk\
	        --enable-graphite\
	        --enable-ldap\
	        --enable-lockdown\
	        --enable-mediawiki\
	        --enable-minimizer\
	        --enable-odk\
	        --enable-opengl\
	        --enable-pdfimport\
	        --enable-presenter-console\
	        --enable-report-builder\
	        --enable-vba\
	        --enable-verbose\
	        --enable-wiki-publisher\
	        --with-package-format=native\
	        --without-fonts\
	        --without-afms\
	        --without-gpc\
	        --without-nas\
	        --without-ppds\
	        --without-system-agg\
	        --without-system-lucene\
	        --with-openldap\
	        --with-system-stdlibs\
	        --with-system-libs\
	        --with-system-sane-header\
	        --with-system-mozilla=libxul\
	        --with-system-xrender-headers\
	        --with-system-headers\
	        --with-system-redland\
	        --with-alloc=system\
	        --with-jdk-home=${JAVA_HOME}\
	        --with-lucene-core-jar=/usr/share/java/lucene-core.jar\
	        --with-lucene-analyzers-jar=/usr/share/java/lucene-analyzers.jar\
	        --with-saxon-jar=/usr/share/java/saxon/saxon9he.jar\
	        --with-use-shell=bash\
	         $EXTRAOPTS
        
#	umask 0022
#	unset LANG LC_ALL

	# Setup environment for build
	source LinuxX86Env.Set.sh

	# Build dmake utility
	./bootstrap
 
#	cd instsetoo_native
#        build.pl -P${SMP} #${MAXMODULESFLAG} ${MAXPROCESSESFLAG} --dlv_switch -link --all \
#	cp /usr/include/X11/extensions/Xrender.h x11_extensions/inc/Xrender.h

	dmake -P2

	cd $SRC/$OOdir

        # install binaries
        cp -R instsetoo_native/unxlngi6.pro/OpenOffice/native/install/fr/linux-2.6-intel/buildroot/* $PKG/

        # move all to /usr/lib
        mkdir -p $PKG/usr/lib
        mv $PKG/opt/* $PKG/usr/lib/
        rmdir $PKG/opt
        
        ## Step 1 
        cd $PKG/usr/lib/openoffice.orgi
        mv ure/ basis3.2/
        cd basis3.2
        rm ure-link && mv ure ure-link
        ## Step 2
        cd $PKG/usr/lib/
        mv openoffice.org/basis3.2/ openoffice.org3/ 
        cd openoffice.org3/ 
        rm basis-link && mv basis3.2 basis-link
        ## Step 3        
        cd $PKG/usr/lib/ 
        rmdir $PKG/usr/lib/openoffice.org
        mv openoffice.org3 openoffice

        # install all built dictionaries from source tree
        pushd $SRC/$OOdir/dictionaries/unxlng?6.pro/bin
        for i in `ls -1 dict-??.oxt`; do
          install -D -m644 $i $PKG/usr/lib/openoffice/share/extension/install/$i
        done
        popd
        
        # install extensions
       pushd $SRC/$OOdir/solver/320/unxlng?6.pro/bin
         install -D -m644 sun-report-builder.oxt $PKG/usr/lib/openoffice/share/extension/install/sun-report-builder.oxt
         install -D -m644 swext/wiki-publisher.oxt $PKG/usr/lib/openoffice/share/extension/install/wiki-publisher.oxt
         install -D -m644 minimizer/sun-presentation-minimizer.oxt $PKG/usr/lib/openoffice/share/extension/install/sun-presentation-minimizer.oxt
         install -D -m644 presenter/presenter-screen.oxt $PKG/usr/lib/openoffice/share/extension/install/presenter-screen.oxt
         install -D -m644 pdfimport/pdfimport.oxt $PKG/usr/lib/openoffice/share/extension/install/pdfimport.oxt
       popd
        
        # prepare filesystem entries
        mkdir -p $PKG/usr/{bin,share/applications}
        mkdir -p $PKG/usr/share/icons/{hicolor,locolor}

        # install shortcuts
        mv $PKG/usr/lib/openoffice/share/xdg/*.desktop  $PKG/usr/share/applications
        # add startcenter desktop file
        install -D -m644 $SRC/startcenter.desktop $PKG/usr/share/applications/startcenter.desktop

        cd $PKG/usr/share/applications
        sed -i -e 's|Exec=openoffice.org3|Exec=/usr/bin/soffice|g' *.desktop
        sed -i -e 's|Exec=/usr/bin/soffice-printeradmin|Exec=/usr/bin/spadmin|g' printeradmin.desktop
        # fix exec commands in shortcuts for Xfce menu
        sed -i -e 's|base %U|base|g' base.desktop
        sed -i -e 's|calc %U|calc|g' calc.desktop
        sed -i -e 's|draw %U|draw|g' draw.desktop
        sed -i -e 's|impress %U|impress|g' impress.desktop
        sed -i -e 's|math %U|math|g' math.desktop
        sed -i -e 's|writer %U|writer|g' writer.desktop
        # remove quickstarter, we disabled it above
        rm -rf $PKG/usr/share/applications/qstart.desktop
        # fix icons in desktop files
        sed -i -e 's|Icon=openofficeorg3-|Icon=|g' *.desktop

        # install icons
        cd $SRC/$OOdir/sysui/desktop/icons
        cp -a -v hicolor/*x* $PKG/usr/share/icons/hicolor
        cp -a -v locolor/*x* $PKG/usr/share/icons/locolor

        # just in case icon calc is used by calculator :)
        find $PKG/usr/share/icons -type d -name apps -exec mv {}/calc.png  {}/ooocalc.png \;
        sed -i -e 's|Icon=calc|Icon=ooocalc|g' $PKG/usr/share/applications/calc.desktop # already done above

        # fix ownership and permissions
        chown root.root -R $PKG/
        chmod +rX -R $PKG/usr

        # set desktop variable to force gtk/gnome vcl usage
        install -m755 -d $PKG/etc/profile.d
        install -m755 $PKG/openoffice.profile $PKG/etc/profile.d/openoffice.sh

        # make symlinks
        cd $PKG/usr/bin
        ln -s /usr/lib/openoffice/program/soffice soffice
        ln -s /usr/lib/openoffice/program/spadmin spadmin

        # link the mozilla-plugin
        mkdir -p $PKG/usr/lib/mozilla/plugins/
        cd $PKG/usr/lib/mozilla/plugins/
        ln -v -s /usr/lib/openoffice/program/libnpsoplugin.so .
}