enable coinmp (except on arm64 where it's BD-Uninstallable right now)
[pkg-openoffice/libreoffice.git] / rules
1 #!/usr/bin/make -f
2 ################################################################################
3 # LibreOffice source package rules file
4 #
5 # Please see debian/README for detailed documentation about the build system, and
6 # how to build LibreOffice.
7 ################################################################################
8 # Authors:
9 # Chris Halls <halls@debian.org>
10 # Rene Engelhard <rene@debian.org>
11 # Copyright 2002-2011 Software in the Public Interest, Inc.
12 # Portions Copyright 2010 Canonical Ltd. Author: Matthias Klose
13 # Licensed under the GNU General Public License, version 2.  See the file
14 # /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
15 ################################################################################
16
17 vafilt = $(subst $(2)=,,$(filter $(2)=%,$(1)))
18 CHANGELOG_VARS := $(shell dpkg-parsechangelog | \
19         sed -n 's/ /_/g;/^[^_]/s/^\([^:]*\):_\(.*\)/\1=\2/p')
20 PKGSOURCE := $(call vafilt,$(CHANGELOG_VARS),Source)
21 SOURCE_VERSION:=$(shell head -1 debian/changelog | cut -d\( -f2 | cut -d\) -f1)
22 UPSTREAM_VERSION:=$(shell echo "$(SOURCE_VERSION)"| cut -d: -f2 | cut -d- -f1)
23 BASE_VERSION:=$(shell echo $(SOURCE_VERSION) | cut -d: -f1):$(UPSTREAM_VERSION)
24 BINARY_VERSION=$(SOURCE_VERSION)
25 #BINARY_VERSION=1:2.4.0-$(shell dpkg-parsechangelog  | grep urgency \
26         | awk '{print $$2}' | sed -e s/"("// -e s/")"// | cut -d"-" -f2)
27 #HELP_L10N_VIRTUAL_VERSION:=$(shell echo $(UPSTREAM_VERSION) | cut -d: -f2 | tr [~] [\\-])
28 HELP_L10N_VIRTUAL_VERSION:=3.4
29 #VER:=3
30 OOVER:=3.4
31 BASIS_VERSION:=$(OOVER)
32 NEXT_OOVER:=$(shell echo "$(OOVER) + 0.1" | bc)
33 NEXT_BASIS_VERSION:=$(NEXT_OOVER)
34
35 ARCH_INDEP_PACKAGES := $(shell dh_listpackages -i)
36 ARCH_DEP_PACKAGES := $(shell dh_listpackages -s)
37 PACKAGES := $(ARCH_INDEP_PACKAGES) $(ARCH_DEP_PACKAGES)
38
39 DPKG_VARS := $(shell dpkg-architecture)
40 OS := $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH_OS)
41 ARCH := $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH)
42 DIST := $(shell if [ -x /usr/bin/dpkg-vendor ]; then dpkg-vendor --query Vendor; else lsb_release -is; fi)
43 DISTREL := $(shell lsb_release -cs)
44 DEB_HOST_GNU_TYPE   ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_TYPE)
45 DEB_BUILD_GNU_TYPE  ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_GNU_TYPE)
46 SHELL:=/bin/bash
47
48 SYSTEM_GCC_VERSION = $(shell gcc --version | sed -n '/^gcc/s/.*\(.\..\)\..$$/\1/p')
49
50 # Debian buildds run as user `buildd', other are using /CurrentlyBuilding
51 ON_BUILDD := $(shell if [ "`whoami`" = buildd -o -f /CurrentlyBuilding ] || echo $(CURDIR) | grep -q \/build\/buildd; then echo y; else echo n; fi)
52
53 PKGDIR:=debian/libreoffice$(VER)
54 OODIRNAME=libreoffice$(VER)
55 OOBRANDDIR:=usr/lib/$(OODIRNAME)
56 OOBASISDIR:=$(OOBRANDDIR)/basis$(BASIS_VERSION)
57 OOSDKDIR:=$(OOBASISDIR)/sdk
58 OOUREDIR:=usr/lib/ure
59 # compatability
60 OODIR:=$(OOBASISDIR)
61
62 # Figure out who's building this package.
63 OOO_VENDOR:=The Document Foundation/Debian
64 ifeq "$(DIST)" "Ubuntu"
65 OOO_VENDOR=The Document Foundation, Debian and Ubuntu
66 endif
67 export OOO_VENDOR
68
69 # debhelper
70 export DH_OPTIONS
71 export DH_ALWAYS_EXCLUDE=CVS:.svn:.bzr:.git
72 #export DH_VERBOSE=1
73 # quilt
74 export QUILT_PATCHES=debian/patches
75 export QUILT_OPTIONS="-p1 -F0"
76
77 # work around tcsh bugs.debian.org/339034: tcsh: Unknown colorls variable `su'
78 unexport LS_COLORS
79
80 MWS=OOO340
81 MILESTONE=m1
82 TAG=$(shell echo $(MWS) | tr A-Z a-z)-$(MILESTONE)
83 GIT_TAG=$(MWS)_$(MILESTONE)
84 OOO_BUILD_BRANCH=libreoffice-3-4-4
85 OOO_BUILD_VERSION=3.4.4.2
86 # in ooo-build releases the same as OOO_BUILD_VERSION
87 OOO_BUILD_TARBALL_VERSION=$(OOO_BUILD_VERSION)
88 OOO_BUILD_TAG=libreoffice-$(OOO_BUILD_TARBALL_VERSION)
89 OOO_BUILD_TREE=libreoffice-build
90 SOURCE_TREE=$(OOO_BUILD_TREE)/build/libreoffice-$(OOO_BUILD_TARBALL_VERSION)
91 STAMP_DIR=debian/stampdir
92 TARFILE_LOCATION=$(CURDIR)/ext-sources
93 export TARFILE_LOCATION
94 USE_SOURCE_TARBALLS=y
95
96 ifeq "$(DISTREL)" "squeeze"
97  SQUEEZE_BACKPORT=y
98 endif
99
100 #########
101 # Default package configuration
102 #
103 OOO_ARCHS = alpha amd64 armel armhf hppa i386 ia64 mips mipsel powerpc powerpcspe ppc64 s390 s390x sparc kfreebsd-amd64 kfreebsd-i386
104 PATCHSET=$(DIST)
105 BUILD_DEPS=
106
107 # These are components which can be built from internal copies, or used from the
108 # distribution. See configure --help for valid values (--with-system-<value>).
109 SYSTEM_STUFF = dicts
110
111 BUILD_PYUNO=y
112 ifeq "$(BUILD_PYUNO)" "y"
113   ENABLE_SCRIPT_PROVIDER_PYTHON=y
114 endif
115 # THIS IS ONLY FOR TESTING. When building against a specified pythonX.Y
116 # this will work inside OOo but *not* from outside OOo unless the user
117 # uses pythonX.Y directly (and the dh_pycentral-created dependencies allow
118 # also the non-working default python then) - see e.g. #587402
119 PYTHON_VERSION=current
120 ifeq "$(PYTHON_VERSION)" "current"
121   PYTHON=python
122 export PYTHON=python
123 else
124   PYTHON=python$(PYTHON_VERSION)
125 export PYTHON=python$(PYTHON_VERSION)
126 endif
127 PACKAGE_TTF_OPENSYMBOL=y
128 BUILD_BINFILTERS=y
129 BUILD_ONLY_EN_US=n
130 ENABLE_JAVA=y
131 ifeq "$(ENABLE_JAVA)" "y"
132   JDK=openjdk
133   JAVA_MAINVER=6
134   ifneq (,$(filter hppa kfreebsd%, $(ARCH)))
135     JDK=gcj-jdk
136   endif
137 endif
138 JAVAHELPER_MIN_VERSION= (>= 0.37~)
139 ENABLE_MONO=n
140 MONO2=y
141 ifeq "$(MONO2)" "y"
142   MONO_MINVER= (>= 2.4.2.3)
143 else
144   MONO_MINVER= (>= 1.2.3)
145 endif
146 SYSTEM_STUFF += hunspell
147 HUNSPELL_MIN_VER= (>= 1.1.5-2)
148 SYSTEM_STUFF += altlinuxhyph
149 USE_LIBHYPHEN=y
150 LIBALTLINUXHYPH_MINVER= (>= 0.1.1-11)
151 LIBHYPHEN_MINVER= (>= 2.4)
152 USE_AGG=n
153 # SYSTEM_STUFF += agg
154 SYSTEM_STUFF += boost
155 BOOST_VERSION=default
156 ifeq "$(BOOST_VERSION)" "default"
157   BOOST_MINVER= (>= 1.38)
158 endif
159 ifeq "$(BOOST_VERSION)" "1.39"
160   BOOST_MINVER= (>= 1.39.0-2)
161 endif
162 SYSTEM_STUFF += mdds
163 SYSTEM_STUFF += vigra
164 USE_EXTERNAL_CXXLIBS=y
165 #SYSTEM_STUFF += sablot
166 SYSTEM_STUFF += libxslt
167 SYSTEM_STUFF += mythes
168 SYSTEM_STUFF += icu
169 ICU_MINVER= (>= 4.0)
170 SYSTEM_STUFF += libwpd libwpg libwps
171 #SYSTEM_STUFF += xmlsec
172 BUILD_CAIROCANVAS=y
173 SYSTEM_STUFF += cairo
174 CAIRO_FONTS_PATCH=y
175 BUILD_KDE=y
176 # not ported to KDE 4
177 ENABLE_KDEAB=n
178 QT_MINVER= (>= 4.5)
179 KDELIBS_MINVER= (>= 4:4.3.4)
180 BUILD_DBG_PACKAGE=y
181 ifeq "$(ENABLE_JAVA)" "y"
182   # NOTE: If you change this while gcj/ant multiarch combo is still broken
183   # you need to disable bsh scripting engine completely (see disable-rhino.diff)
184   # See http://lists.debian.org/debian-java/2011/06/msg00108.html and replies
185   SYSTEM_STUFF += beanshell
186   SYSTEM_STUFF += hsqldb
187   HSQLDB_MINVER= (>> 1.8.0.10)
188   HSQLDB_TOONEWVER=1.8.1
189   # disabled because system-saxon breaks all kinds exports using XSLT transforms
190   # (e.g. M$ Word/Excel 2003 XML, Mediawiki, XHTML, UOF, ...)
191   # It does *NOT* fail with _plain_ saxon 9.0.0.8 built with OOos build.xml
192   # for UOF, but still for e.g. M$.
193   #SYSTEM_STUFF += saxon
194   SYSTEM_STUFF += lucene
195 endif
196 SYSTEM_STUFF += lpsolve
197 USE_SHARED_LPSOLVE=y
198 LPSOLVE_MIN_VERSION= (>= 5.5.0.13-5+b1)
199 USE_DBUS=y
200 USE_GSTREAMER=y
201 SYSTEM_STUFF += neon
202 NEON_SECTYPE=gnutls
203 NEONSONR=27
204 SYSTEM_STUFF += redland
205 USE_OOO_BUILD_DESKTOPS=n
206 PACKAGE_SDK=y
207 # FIXME: subsequenttests breaks with to high debug level 11
208 ifeq "$(ENABLE_JAVA)" "y"
209   ifeq "$(JDK)" "openjdk"
210     RUN_SMOKETEST=n
211     RUN_SUBSEQUENT_TESTS=n
212   else
213     ifneq ($(ON_BUILDD),y)
214       RUN_SMOKETEST=n
215       RUN_SUBSEQUENT_TESTS=n
216     endif
217   endif
218 else
219   RUN_SMOKETEST=n
220   RUN_SUBSEQUENT_TESTS=n
221 endif
222 # "Unfortunately, running the unoapi tests is still not stable enough to give
223 # useful results. Therefore, running subsequenttests has been disabled in the
224 # build bots for now. Making the tests sufficiently stable is ongoing work. "
225 # (http://wiki.services.openoffice.org/wiki/Test_Cleanup)
226 ENABLE_JUNIT4=n
227 JUNIT_MIN_VER= (>= 4.8.2-2)
228 USE_LIBCURL4=y
229 CURL_SECTYPE=gnutls
230 USE_SYSTEM_DMAKE=y
231 USE_LIBSUITESPARSE=y
232 SUITESPARSE_MIN_VERSION= (>= 1:3.4.0)
233 PARALLEL_BUILD=n
234 MOZILLA=libxul
235 ENABLE_LDAP=y
236 USE_OPENLDAP=y
237 ENABLE_OPENGL=y
238 SYSTEM_STUFF += openssl
239 NEW_DPKG_SHLIBDEPS=y
240 ifeq "$(ENABLE_JAVA)" "y"
241   ENABLE_REPORTDESIGN=y
242   SYSTEM_STUFF += jfreereport
243   ENABLE_MEDIAWIKI=y
244   SYSTEM_STUFF += apache-commons
245   # if you change these, add something like disable-rhino.diff and/or remove it as long
246   # as we have the gcj/ant multiarch braekage. See
247   # http://lists.debian.org/debian-java/2011/06/msg00108.html and replies
248   ENABLE_SCRIPT_PROVIDER_BSH=y
249   ENABLE_SCRIPT_PROVIDER_JS=n
250 else
251   ENABLE_REPORTDESIGN=n
252   ENABLE_MEDIAWIKI=n
253 endif
254 ENABLE_SDBC_POSTGRESQL=y
255 ENABLE_MINIMIZER=y
256 ENABLE_PRESENTER_CONSOLE=y
257 ENABLE_PDFIMPORT=y
258 BUILD_GTK=y
259 ENABLE_EVO2=y
260 ENABLE_GVFS=y
261 ENABLE_GCONF=y
262 # broken!
263 ENABLE_GIO=n
264 ENABLE_RANDR=y
265 ENABLE_LAYOUT=n
266 ifeq "$(BUILD_GTK)" "y"
267   PACKAGE_NPSOPLUGIN=y
268 endif
269 PACKAGE_BASE=y
270 ENABLE_GRAPHITE=y
271 SYSTEM_STUFF += graphite
272 ALLOC=system
273 SYSTEM_STUFF += libtextcat
274 USE_SYSTEM_TEXTCAT_DATA=y
275 SYSTEM_STUFF += cppunit
276
277 # when we have a package we want to have to be installed on older things with some older
278 # C++ ABI (like it was the case with libreoffice2), we need to set this. Don't touch
279 # otherwise
280 INTERNAL_STDLIBS=n
281 DEFAULT_IMAGE=galaxy
282 IMAGES:=$(DEFAULT_IMAGE) crystal hicontrast tango oxygen
283 ENABLE_MYSQLNATIVE=y
284 # cannot be disabled, unless you have a internal MySQL somewhere :-)
285 SYSTEM_STUFF += mysql mysql-cppconn
286 MYSQLCPPCONN_MINVER= (>= 1.1.0~r791)
287 DICT_DIR=/usr/share/hunspell
288 HYPH_DIR=/usr/share/hyphen
289 THES_DIR=/usr/share/mythes
290
291 # Default flags to pass to configure of ooo-build
292 CONFIGURE_FLAGS= --disable-post-install-scripts \
293                  --with-tag=$(TAG) \
294                 --with-distro=$(PATCHSET) \
295                 --with-vendor='$(OOO_VENDOR)' \
296                 --enable-package-directories \
297                 --with-installed-ooo-dirname=$(OODIRNAME) \
298                 --prefix=/usr --mandir=/usr/share/man \
299                 --with-docdir=/usr/share/doc/libreoffice \
300                 --with-build-version="tag $(OOO_BUILD_TAG), $(DIST) package $(BINARY_VERSION)" \
301                 --disable-strip \
302                 --enable-lockdown \
303                 --with-drink=coffee \
304                 --libdir=/usr/lib \
305                 --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
306                 --with-additional-sections="$(ADDITIONAL_SECTIONS)" \
307                 --enable-broffice \
308                 --with-extension-integration \
309                 --disable-online-update \
310                 --disable-fetch-external
311
312 ifeq "$(USE_SOURCE_TARBALLS)" "y"
313   CONFIGURE_FLAGS += --without-git
314 else
315   CONFIGURE_FLAGS += --with-git
316 endif
317
318 # distro-configs is too late; it already gets searched in unpack
319 # when we don't do that here, too.
320 CONFIGURE_FLAGS += --disable-access
321
322 CONFIGURE_FLAGS += --with-alloc=$(ALLOC)
323
324 #############
325 # Architecture-specific changes
326
327 # helper to generate no_archs macros (pass name of source macro)
328 define gen_no_archs
329   _no_arch_macro = $(subst OOO_,OOO_NO_,$1)
330   _no_arch_tmp_$1 = $$(foreach _a,$$(filter-out $$(call $1),$(OOO_ARCHS)),!$$(_a))
331   $$(_no_arch_macro) = $$(if $$(_no_arch_tmp_$1),$$(_empty) [$$(_no_arch_tmp_$1)])
332 endef
333
334 LIBSUFFIX := $(shell grep LIBSUFFIX debian/scripts/vars.$(ARCH) | cut -d"=" -f2)
335 PLATFORMID := $(shell grep PLATFORMID debian/scripts/vars.$(ARCH) | cut -d"=" -f2)
336
337 # ./configure defaults to STLport on i386 and we should keep it for
338 # ABI-compatability
339 OOO_STLPORT_ARCHS= i386
340 ifeq "$(ARCH)" "i386"
341         LINK_TO_STLPORT=y
342 endif
343
344 ifeq "$(ENABLE_OPENGL)" "y"
345   # doesn't make that much sense on armel and mips(el), does it? :)
346   OOO_OGLTRANS_ARCHS = $(filter-out armel mips%, $(OOO_ARCHS))
347   ifeq (,$(filter $(ARCH),$(OOO_OGLTRANS_ARCHS)))
348        ENABLE_OPENGL=n
349   endif
350   $(eval $(call gen_no_archs,OOO_OGLTRANS_ARCHS))
351 endif
352
353 OOO_64BIT_ARCHS = $(filter alpha amd64 ia64 kfreebsd-amd64 ppc64 s390x, $(OOO_ARCHS))
354
355 # Java...
356 OOO_JAVA_ARCHS = $(OOO_ARCHS)
357 $(eval $(call gen_no_archs,OOO_JAVA_ARCHS))
358
359 OOO_GCJ_ARCHS = $(filter-out $(OOO_OPENJDK_ARCHS), $(OOO_JAVA_ARCHS))
360 $(eval $(call gen_no_archs,OOO_GCJ_ARCHS))
361
362 OOO_GCJ_JDK_ARCHS := hppa kfreebsd-i386 kfreebsd-amd64
363 OOO_OPENJDK_ARCHS := $(filter-out $(OOO_GCJ_JDK_ARCHS),$(OOO_JAVA_ARCHS))
364 $(eval $(call gen_no_archs,OOO_OPENJDK_ARCHS))
365
366 OOO_ARCH_DEP_EXTENSIONS_ARCHS := $(OOO_ARCHS)
367
368 OOO_BASE_ARCHS := $(filter-out armel,$(OOO_JAVA_ARCHS))
369 $(eval $(call gen_no_archs,OOO_BASE_ARCHS))
370 OOO_REPORTDESIGN_ARCHS := $(filter-out armel,$(OOO_JAVA_ARCHS))
371 $(eval $(call gen_no_archs,OOO_REPORTDESIGN_ARCHS))
372
373 ifneq (,$(findstring $(ARCH),$(OOO_NO_BASE_ARCHS)))
374         PACKAGE_BASE=n
375         ENABLE_SDBC_POSTGRESQL=n
376         ENABLE_MYSQLNATIVE=n
377         ENABLE_EVO2=n
378         ENABLE_KDEAB=n
379         ENABLE_REPORTDESIGN=n
380         DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-base libreoffice$(VER)-base-core
381         DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-evolution -Nlibreoffice$(VER)-kab
382         DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-sdbc-postgresql -Nlibreoffice$(VER)-mysql-connector
383         DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-report-builder-bin -Nlibreoffice$(VER)-report-builder
384 endif
385
386 ifeq (,$(findstring $(ARCH),$(OOO_ARCH_DEP_EXTENSIONS_ARCHS)))
387         ENABLE_MINIMIZER=n
388         ENABLE_PDFIMPORT=n
389         ENABLE_PRESENTER_CONSOLE=n
390         ENABLE_SDBC_POSTGRESQL=n
391         ENABLE_MYSQLNATIVE=n
392 endif
393
394 ifeq (,$(filter $(ARCH),$(OOO_JAVA_ARCHS)))
395         ENABLE_JAVA=n
396         ENABLE_REPORTDESIGN=n
397         ENABLE_MEDIAWIKI=n
398         DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-wiki-publisher
399         DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-report-builder-bin -Nlibreoffice$(VER)-report-builder
400 endif
401
402 ifeq ($(ARCH),$(findstring $(ARCH),$(OOO_GCJ_JDK_ARCHS)))
403   ifneq ($(ARCH),$(findstring $(ARCH),$(OOO_OPENJDK_ARCHS)))
404         ENABLE_REPORTDESIGN=n
405         SYSTEM_STUFF := $(filter-out jfreereport, $(SYSTEM_STUFF))
406         DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-report-builder-bin -Nlibreoffice$(VER)-report-builder
407   endif
408 endif
409 # disable SRB on ia64 when building with internal jfreereport.
410 # fails to build. ("The system is out of resources."). FIXME.
411 ifeq (ia64,$(findstring ia64,$(OOO_OPENJDK_ARCHS)))
412   ifeq (,$(findstring jfreereport,$(SYSTEM_STUFF))) 
413     OOO_REPORTDESIGN_ARCHS := $(filter-out ia64,$(OOO_REPORTDESIGN_ARCHS))
414     ifeq "$(ARCH)" "ia64"
415         ENABLE_REPORTDESIGN=n
416     endif
417   endif
418 endif
419 ifneq (,$(filter $(ARCH),$(OOO_GCJ_ARCHS)))
420         BUILD_JARS_NATIVE=y
421 endif
422
423 ifeq "$(ENABLE_MONO)" "y"
424 # mono
425 # ppc fails (#412967), arm(el), too
426 OOO_MONO_ARCHS = $(filter amd64 i386 ia64 kfreebsd-amd64 kfreebsd-i386, $(OOO_ARCHS))
427 ifeq (,$(filter $(ARCH),$(OOO_MONO_ARCHS)))
428        ENABLE_MONO=n
429 endif
430 else
431 OOO_MONO_ARCHS=
432 endif
433
434 ifeq "$(PACKAGE_NPSOPLUGIN)" "y"
435 OOO_NPSOPLUGIN_ARCHS = $(OOO_ARCHS)
436 else
437 OOO_NPSOPLUGIN_ARCHS=
438 endif
439
440 # builds long and is for legacy filters. probably not needed on {arm,mips}{,el}
441 ifneq (,$(filter arm% mips% m68k, $(ARCH)))
442         BUILD_BINFILTERS=n
443 endif
444 OOO_BINFILTER_ARCHS:=$(filter-out arm% mips% m68k, $(OOO_ARCHS))
445
446 #############
447 # Distro-specific overrides
448
449 # Debian
450 ifeq "$(DIST)" "Debian"
451   # we don't need to build all languages and the thesaurus on the buildds;
452   # they do binary-only builds anyway
453   ifeq ($(ON_BUILDD),y)
454        BUILD_ONLY_EN_US=y
455   endif
456 endif
457
458 # Debian Squeeze
459 ifeq "$(SQUEEZE_BACKPORT)" "y"
460   BUGS=mailto:debian-backports@lists.debian.org
461   SYSTEM_STUFF := $(filter-out libwpd libwpg libwps mythes mdds libtextcat graphite jfreereport, $(SYSTEM_STUFF))
462   JUNIT_MIN_VER=
463   PARALLEL_BUILD=n
464 endif
465
466 CONFIGURE_FLAGS += $(foreach i, $(SYSTEM_STUFF),--with-system-$(i))
467
468 CC_PREFIX:=$(shell gcc -dumpmachine)-
469
470 ifeq "$(GCC_VERSION)" ""
471   ifneq "$(OOO_GCJ_JDK_ARCHS)" ""
472     ifeq ($(ARCH),$(findstring $(ARCH),$(OOO_GCJ_ARCHS)))
473         GCJ_JDK_PACKAGE=$(shell dpkg -s gcj-jdk | grep Depends | sed -e 's/.*\(gcj-[0-9]\.[0-9]-jdk\).*/\1/')
474         GCJ_JDK_VERSION=$(shell echo $(GCJ_JDK_PACKAGE) | cut -d- -f2)
475       ifneq "$(SYSTEM_GCC_VERSION)" "$(GCJ_JDK_VERSION)"
476         BUILD_DEPS += , gcc-$(GCJ_JDK_VERSION) [$(OOO_GCJ_JDK_ARCHS)], g++-$(GCJ_JDK_VERSION) [$(OOO_GCJ_JDK_ARCHS)]
477         ifeq ($(ARCH),$(findstring $(ARCH),$(OOO_GCJ_JDK_ARCHS)))
478         # sanity check. amd64 is in kfreebsd-amd64; same for i386 and mips
479           ifneq ($(ARCH),$(findstring $(ARCH),$(OOO_OPENJDK_ARCHS)))
480           GCC_VERSION := $(GCJ_JDK_VERSION)
481           else
482           GCC_VERSION := $(SYSTEM_GCC_VERSION)
483           endif
484         else
485           GCC_VERSION := $(SYSTEM_GCC_VERSION)
486         endif
487       endif
488     endif
489   endif
490 endif
491
492 # Note that this does *NOT* only affect the mozilla plugin but also
493 # stuff like the xmlsecurity (which uses nss). For the plugin only,
494 # change the OOO_NPSOPLUGIN_ARCHS
495 OOO_MOZILLA_ARCHS = $(filter-out nothing, $(OOO_ARCHS))
496 $(eval $(call gen_no_archs,OOO_MOZILLA_ARCHS))
497
498 ifeq "$(USE_SOURCE_TARBALLS)" "n"
499         BUILD_DEPS += , git, rsync
500 endif
501
502         BUILDDEB_OPTIONS = -- -Zbzip2
503
504 ifneq "$(OOO_OGLTRANS_ARCHS)" ""
505         BUILD_DEPS += , libgl1-mesa-dev$(OOO_NO_OGLTRANS_ARCHS), libglu1-mesa-dev$(OOO_NO_OGLTRANS_ARCHS)
506 endif
507 ifeq "$(ENABLE_OPENGL)" "y"
508         CONFIGURE_FLAGS += --with-system-mesa-headers
509 else
510         CONFIGURE_FLAGS += --disable-opengl
511 endif
512
513 ifneq "$(PACKAGE_SDK)" "y"
514         CONFIGURE_FLAGS += --disable-odk
515 endif
516
517 ifeq "$(ENABLE_MINIMIZER)" "y"
518         CONFIGURE_FLAGS += --enable-ext-presenter-minimizer
519 endif
520 ifeq "$(ENABLE_PRESENTER_CONSOLE)" "y"
521         CONFIGURE_FLAGS += --enable-ext-presenter-console
522 endif
523 ifeq "$(ENABLE_PDFIMPORT)" "y"
524         CONFIGURE_FLAGS += --enable-ext-pdfimport
525         BUILD_DEPS += , libpoppler-dev (>= 0.8.0)
526         BUILD_DEPS += , libpoppler-cpp-dev
527 endif
528
529 # fails their tests
530 ifeq "$(ARCH)" "armel"
531 ENABLE_GRAPHITE=n
532 SYSTEM_STUFF := $(filter-out graphite, $(SYSTEM_STUFF))
533 endif
534 ifeq "$(ARCH)" "sparc"
535 ENABLE_GRAPHITE=n
536 SYSTEM_STUFF := $(filter-out graphite, $(SYSTEM_STUFF))
537 endif
538
539 ifeq "$(ENABLE_GRAPHITE)" "y"
540   ifneq (,$(filter graphite, $(SYSTEM_STUFF)))
541         BUILD_DEPS += , libgraphite2-dev (>= 0.9.3) [!armel !sparc]
542   endif
543 else
544         CONFIGURE_FLAGS += --disable-graphite
545 endif
546
547
548 ifneq (,$(filter libtextcat, $(SYSTEM_STUFF)))
549         BUILD_DEPS += , libtextcat-dev (>= 2.2-8)
550 endif
551 ifeq "$(USE_SYSTEM_TEXTCAT_DATA)" "y"
552         CONFIGURE_FLAGS += --with-external-libtextcat-data=/usr/share/libtextcat/LM
553   ifeq "$(SQUEEZE_BACKPORT)" "y"
554         TEXTCAT_DATA_RECOMMENDS := libtextcat-data-utf8
555   else
556         TEXTCAT_DATA_RECOMMENDS := libtextcat-data (>= 2.2-9)
557   endif
558 endif
559
560 ifeq "$(USE_LIBCURL4)" "y"
561         BUILD_DEPS += , libcurl4-$(CURL_SECTYPE)-dev
562 else
563         BUILD_DEPS += , libcurl3-$(CURL_SECTYPE)-dev
564 endif
565
566 ifneq (,$(filter openssl, $(SYSTEM_STUFF)))
567         BUILD_DEPS += , libssl-dev
568   ifeq "$(SQUEEZE_BACKPORTS)" "y"
569         DBG_DBG_SUGGESTS += , libssl$(shell readlink /usr/lib/libssl.so | cut -d"." -f3,4,5)-dbg
570   else
571         DBG_DBG_SUGGESTS += , libssl$(shell readlink /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/libssl.so | cut -d"." -f3,4,5)-dbg
572 endif
573 endif
574
575         BUILD_DEPS += , libdb-dev
576         DBG_DBG_SUGGESTS += , $(shell dpkg -s libdb-dev | grep Depends | awk '{ print $$2 }' | sed -e s/dev/dbg/)
577
578 ifneq "$(BUILD_DBG_PACKAGE)" "y"
579         # build with small symbols anyway
580         SMALL_SYMBOLS = y
581 else
582   ifeq "$(SQUEEZE_BACKPORTS)" "y"
583         SMALL_SYMBOLS = y
584   else
585     ifneq (,$(findstring i386,$(ARCH)))
586         SMALL_SYMBOLS = n
587         USE_XZ_COMPRESS = y
588     else
589       ifneq (,$(findstring amd64,$(ARCH)))
590         SMALL_SYMBOLS = n
591         USE_XZ_COMPRESS = y
592       else
593         SMALL_SYMBOLS = y
594       endif
595     endif
596   endif
597         DBG_DBG_SUGGESTS+= , libc6.1-dbg [alpha ia64], libc0.1-dbg [kfreebsd-i386 kfreebsd-amd64], libc0.3-dbg [hurd-i386], libc6-dbg [!ia64 !alpha !kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], libatk1.0-dbg, libglib2.0-0-dbg, libgnomevfs2-0-dbg, libstdc++6-$(SYSTEM_GCC_VERSION)-dbg, libx11-6-dbg, libxext6-dbg, libxaw7-dbg, libxml2-dbg, libgtk2.0-0-dbg, libxau6-dbg, libice6-dbg, libsm6-dbg, libxinerama1-dbg, libfontconfig1-dbg, libhunspell-$(shell pkg-config --modversion hunspell | cut -d. -f1,2)-0-dbg
598   ifeq "$(USE_LIBCURL4)" "y"
599         DBG_DBG_SUGGESTS+= , libcurl3-dbg
600   else
601         DBG_DBG_SUGGESTS+= , libcurl4-dbg
602   endif
603 endif
604 # Small symbols?
605 ifeq "$(SMALL_SYMBOLS)" "y"
606         CONFIGURE_FLAGS += --enable-symbols=SMALL
607         CFLAGS := $(shell echo $(CFLAGS) | sed -e "s/-g/-g1/")
608         CXXFLAGS := $(shell echo $(CXXFLAGS) | sed -e "s/-g/-g1/")
609 export CFLAGS CXXFLAGS
610 else
611         CONFIGURE_FLAGS += --enable-symbols
612 endif
613 ifeq (debug,$(findstring debug,$(DEB_BUILD_OPTIONS)))
614         CONFIGURE_FLAGS += --enable-debug
615 endif
616
617
618 ifeq (noopt,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
619         ARCH_FLAGS += -O0
620 endif
621
622 ifeq "$(USE_XZ_COMPRESS)" "y"
623         # used only for -dbg yet, so disabled and done manually
624         # in binary-arch
625         #BUILDDEB_OPTIONS = -- -Zxz
626         BUILD_DEPS += , dpkg-dev (>= 1.15.6)
627 else
628         BUILD_DEPS += , dpkg-dev (>= 1.15.1)
629 endif
630
631 # Build python depends from current python version
632 PYMAJOR:=$(shell python -c "import sys; print sys.version_info[0]")
633 PYMINOR:=$(shell python -c "import sys; print sys.version_info[1]")
634 PYMINORPLUS1:=$(shell python -c "import sys; print sys.version_info[1]+1")
635 PYTHON_SITE:=debian/python-uno/$(shell python -c 'from distutils import sysconfig; print(sysconfig.get_python_lib())')
636
637 ifeq "$(BUILD_PYUNO)" "y"
638         BUILD_DEPS += , python (>= 2.6.6-3+squeeze4)
639         DBG_DBG_SUGGESTS+= , python-dbg
640         BUILD_DEPS += , $(PYTHON)-dev
641 else
642         BUILD_DEPS += , python
643 endif
644
645         BUILD_DEPS += , debhelper (>= 7.2.3~)
646
647 ifeq "$(ENABLE_JAVA)" "y"
648   ifeq "$(BUILD_JARS_NATIVE)" "y"
649         STAMP_NATIVE_JARS = $(STAMP_DIR)/native-jars
650     ifeq "$(NEW_DPKG_SHLIBDEPS)" "n"
651         BUILD_DEPS += , dpkg-dev (>= 1.13.19)
652     endif
653         JAVA_GCJ_DEPENDS = libgcj-common (>= 1:4.1.1-14)
654   endif
655 endif
656
657 ifeq "$(RUN_SMOKETEST)" "y"
658         BUILD_DEPS += , epm
659 endif
660 ifeq "$(RUN_TESTTOOL)" "y"
661         CONFIGURE_FLAGS += --enable-hids
662 endif
663 ifneq (,$(filter cppunit, $(SYSTEM_STUFF)))
664         BUILD_DEPS += , libcppunit-dev (>= 1.12)
665 endif
666 ifeq "$(RUN_SUBSEQUENT_TESTS)" "y"
667         BUILD_DEPS += , tcsh
668   ifeq "$(ENABLE_JUNIT4)" "y"
669         BUILD_DEPS += , junit4 $(JUNIT_MIN_VER)
670   else
671         CONFIGURE_FLAGS += --without-junit
672   endif
673 else
674         CONFIGURE_FLAGS += --without-junit
675 endif
676
677 ifneq "$(BUILD_ONLY_EN_US)" "y"
678   ifeq (lang=,$(findstring lang=,$(DEB_BUILD_OPTIONS)))
679         ISOS=$(shell echo "$(DEB_BUILD_OPTIONS) " | sed -n 's/^.*lang=\([^\s].*\)\s.*/\1/p' | awk '{ print $$1 }' | sed -e 's/,/ /g')
680         HELPISOS=$(shell echo "$(DEB_BUILD_OPTIONS) " | sed -n 's/^.*lang=\([^\s].*\)\s.*/\1/p' | awk '{ print $$1 }' | sed -e 's/,/ /g')
681         LANGPACKISOS=$(shell echo "$(DEB_BUILD_OPTIONS) " | sed -n 's/^.*lang=\([^\s].*\)\s.*/\1/p' | awk '{ print $$1 }' | sed -e 's/,/ /g')
682   else
683         # Note that the first one here *has to be* en-US. the first one gets
684         # gid_Module_Root as filelist later and the rest gid_Module_Root.$iso
685         # but we can't/shouldn't do dynamic switching, so let en-US be the first
686         # one to that gid_Module_Root always is english and the other langpacks
687         # have gid_Module_Root.$iso
688         #ISOS=$(shell $(OOO_BUILD_TREE)/bin/openoffice-xlate-lang -i all')
689         ISOS:=en-US af ar as ast be bg bn br bs ca cs cy da de dz el \
690           en-GB en-ZA eo es et eu fa fi fr ga gl gu he hi hr hu id is it ja \
691           ka km ko ku lt lv mk mn ml mr nb ne nl nn nr nso oc om or \
692           pa-IN pl pt pt-BR ro ru rw si sk sl sr ss st sv \
693           ta te tg th tn tr ts ug uk uz ve vi xh zh-CN zh-TW zu
694         #HELPISOS:=$(shell $(OOO_BUILD_TREE)/bin/openoffice-xlate-lang -i all') 
695         HELPISOS:=en-US ca cs da de dz el en-GB es et eu fi fr gl hi hu it \
696           ja km ko nl om pl pt pt-BR ru sk sl sv zh-CN zh-TW
697         #LANGPACKISOS:=$(shell $(OOO_BUILD_TREE)/bin/openoffice-xlate-lang -i all')
698         LANGPACKISOS:=en-US af ar as ast be bg bn br bs ca cs cy da de dz el \
699           en-GB en-ZA eo es et eu fa fi fr ga gl gu he hi hr hu id is it ja \
700           ka km ko ku lt lv mk mn ml mr nb ne nl nn nr nso oc om or \
701           pa-IN pl pt pt-BR ro ru rw si sk sl sr ss st sv \
702           ta te tg th tn tr ts ug uk uz ve vi xh zh-CN zh-TW zu
703   endif
704 else
705         ISOS=en-US
706         HELPISOS=en-US
707         LANGPACKISOS=en-US
708 endif
709 BUILD_ISOS = $(ISOS)
710
711 ifneq "$(BUILD_ONLY_EN_US)" "y"
712   ifneq "$(BUILD_ISOS)" "en-US"
713         CONFIGURE_FLAGS += --with-lang="$(BUILD_ISOS)"
714   endif
715 endif
716
717 ifeq "$(VER)" ""
718         CONFIGURE_FLAGS += --with-binsuffix=no
719 else
720         CONFIGURE_FLAGS += --with-binsuffix=$(VER)
721 endif
722
723 ifeq "$(ENABLE_JAVA)" "y"
724   ifeq "$(JDK)" "default"
725         JAVA_HOME=/usr/lib/jvm/default-java
726         BUILD_DEPS += , default-jdk$(OOO_NO_JAVA_ARCHS)
727   endif
728   ifeq "$(JDK)" "java-gcj-compat"
729         JAVA_HOME=/usr/lib/jvm/java-gcj
730     ifneq (,$(findstring armel,$(OOO_JAVA_ARCHS)))
731         BUILD_DEPS += , gcj-4.3 (>= 4.3.1-2) [armel]
732     endif
733   endif
734   ifeq "$(JDK)" "gcj-jdk"
735         JAVA_HOME=/usr/lib/jvm/java-gcj
736         BUILD_DEPS += , gcj-jdk$(OOO_NO_JAVA_ARCHS)
737   endif
738   ifeq "$(JDK)" "openjdk"
739     ifeq "$(SQUEEZE_BACKPORT)" "y"
740         BUILD_DEPS += , openjdk-$(JAVA_MAINVER)-jdk [$(filter-out $(OOO_GCJ_JDK_ARCHS),$(OOO_JAVA_ARCHS))]
741         JAVA_HOME=/usr/lib/jvm/java-$(JAVA_MAINVER)-openjdk
742     else
743       ifeq "$(JAVA_MAINVER)" "6"
744         BUILD_DEPS += , openjdk-$(JAVA_MAINVER)-jdk (>= 6b23~pre8-2) [$(filter-out ia64,$(filter-out $(OOO_GCJ_JDK_ARCHS),$(OOO_JAVA_ARCHS))])
745         BUILD_DEPS += , openjdk-7-jdk [ia64]
746         ifeq "$(ARCH)" "ia64"
747         JAVA_MAINVER=7
748         endif
749       else
750         BUILD_DEPS += , openjdk-$(JAVA_MAINVER)-jdk [$(filter-out $(OOO_GCJ_JDK_ARCHS),$(OOO_JAVA_ARCHS))]
751       endif
752         JAVA_HOME=/usr/lib/jvm/java-$(JAVA_MAINVER)-openjdk-$(ARCH)
753     endif
754         CONFIGURE_FLAGS += --with-java-target-version=1.5
755   endif
756         TEST_JAVA_HOME=$(JAVA_HOME)
757   ifneq "$(OOO_GCJ_JDK_ARCHS)" ""
758         BUILD_DEPS += , gcj-jdk [$(OOO_GCJ_JDK_ARCHS)]
759         BUILD_DEPS += , gcj-native-helper [$(OOO_GCJ_ARCHS)], libgcj-common (>= 1:4.4.1) [$(OOO_GCJ_ARCHS)]
760   endif
761   ifeq "$(ENABLE_MEDIAWIKI)" "y"
762         BUILD_DEPS += , ant (>= 1.7.0)$(OOO_NO_JAVA_ARCHS), ant-optional (>= 1.7.0)$(OOO_NO_JAVA_ARCHS)
763   else
764         BUILD_DEPS += , ant (>= 1.6.5)$(OOO_NO_JAVA_ARCHS)
765   endif
766         GCJ_VERSION = $(shell basename `readlink $(JAVA_HOME)/bin/gcj` | sed -e s/gcj-//)
767 ifeq "$(SQUEEZE_BACKPORT)" "y"
768         GCJ_JAWT_DEPENDS= $(shell dpkg -S /usr/lib/`readlink /usr/lib/libgcj_bc.so.1` | cut -d: -f1 | sed -e s/$$/-awt/)
769 else
770         GCJ_JAWT_DEPENDS= $(shell dpkg -S /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/gcj-$(GCJ_JDK_VERSION)-*/libgcj_bc.so.1 | cut -d: -f1 | sed -e s/$$/-awt/)
771 endif
772         DBG_DBG_SUGGESTS+= , $(shell echo $(GCJ_AWT_DEPENDS) | sed -e s/awt/dbg/)
773         JAVA_RUNTIME_DEPENDS = default-jre | gcj-jre | java-gcj-compat
774 #  ifneq (,$(GCJ_JAWT_DEPENDS))
775 #       JAVA_RUNTIME_DEPENDS += | $(GCJ_JAWT_DEPENDS)
776 #  endif
777   ifneq (,$(filter $(ARCH), $(OOO_OPENJDK_ARCHS)))
778     ifneq "$(ARCH)" "ia64"
779         JAVA_RUNTIME_DEPENDS += | openjdk-6-jre | openjdk-7-jre
780     else
781         JAVA_RUNTIME_DEPENDS += | openjdk-7-jre
782     endif
783   endif
784   ifneq (,$(filter $(ARCH), amd64 i386))
785         JAVA_RUNTIME_DEPENDS += | sun-java5-jre | sun-java6-jre
786   endif
787         JAVA_RUNTIME_DEPENDS += | java5-runtime
788         # Suns Java "packages"
789         JAVA_RUNTIME_DEPENDS += | jre
790         GCJ_JAWT_DIR=$(shell dirname `dpkg -L $(GCJ_JAWT_DEPENDS) | grep libjawt.so | head -n 1`)
791 export JAVA_HOME
792         CONFIGURE_FLAGS += --with-jdk-home=$(JAVA_HOME)
793         JAVA_COMMON_DEPENDS= , libreoffice$(VER)-java-common
794         JAVA_COMMON_DEPENDS_VERSION:= (>= $(BASE_VERSION)~)
795   ifneq (,$(filter saxon, $(SYSTEM_STUFF)))
796         CONFIGURE_FLAGS += --with-system-saxon --with-saxon-jar=/usr/share/java/saxonb.jar
797         BUILD_DEPS += , libsaxonb-java$(OOO_NO_JAVA_ARCHS)
798   endif
799   ifeq "$(PACKAGE_SDK)" "y"
800     ifeq "$(DIST)" "Debian"
801         CONFIGURE_FLAGS += --enable-build-unowinreg
802       ifeq "$(SQUEEZE_BACKPORT)" "y"
803         BUILD_DEPS += , gcc-mingw32$(OOO_NO_JAVA_ARCHS), mingw32-runtime$(OOO_NO_JAVA_ARCHS)
804         CONFIGURE_FLAGS += --with-mingw=i586-mingw32msvc-g++
805         # this normally is done in configure with sed -e s/[cg]++/strip/ but that somehow
806         # doesn't work. Workaround. FIXME.
807 export MINGWSTRIP = i586-mingw32msvc-strip
808       else
809         BUILD_DEPS += , mingw-w64 (>= 1.0)$(OOO_NO_JAVA_ARCHS)
810         CONFIGURE_FLAGS += --with-mingw=i686-w64-mingw32-g++
811         # this normally is done in configure with sed -e s/[cg]++/strip/ but that somehow
812         # doesn't work. Workaround. FIXME.
813 export MINGWSTRIP = i686-w64-mingw32-strip
814       endif
815     endif
816   endif
817   ifeq "$(ENABLE_MEDIAWIKI)" "y"
818         CONFIGURE_FLAGS += --enable-ext-wiki-publisher
819     ifneq (,$(filter apache-commons, $(SYSTEM_STUFF)))
820         MEDIAWIKI_BUILD_DEPS += , libcommons-codec-java$(OOO_NO_JAVA_ARCHS), libcommons-httpclient-java$(OOO_NO_JAVA_ARCHS), libcommons-lang-java$(OOO_NO_JAVA_ARCHS), libcommons-logging-java$(OOO_NO_JAVA_ARCHS)
821         MEDIAWIKI_JAR_DEPENDS := , libcommons-codec-java, libcommons-httpclient-java, libcommons-lang-java, libcommons-logging-java
822         BUILD_DEPS += $(MEDIAWIKI_BUILD_DEPS)
823         CONFIGURE_FLAGS += --with-commons-codec-jar=/usr/share/java/commons-codec.jar --with-commons-lang-jar=/usr/share/java/commons-lang.jar --with-commons-httpclient-jar=/usr/share/java/commons-httpclient.jar --with-commons-logging-jar=/usr/share/java/commons-logging.jar
824         CONFIGURE_FLAGS += --with-system-servlet-api --with-servlet-api-jar=$(shell dpkg -L `dpkg -s libcommons-logging-java | grep Suggests | cut -d"," -f1 | sed -e s/^\ // | awk '{ print $$2 }'` | grep servlet-api.*\.jar$ | head -n 1)
825         BUILD_DEPS += , $(shell dpkg -s libcommons-logging-java | grep Suggests | cut -d"," -f1 | sed -e s/^\ // | awk '{ print $$2 }')
826     endif
827   endif
828   ifeq "$(ENABLE_REPORTDESIGN)" "y"
829         # report-builder
830     ifneq (,$(filter jfreereport, $(SYSTEM_STUFF)))
831         REPORT_BUILDER_BUILD_DEPS += , libbase-java$(OOO_NO_REPORTDESIGN_ARCHS), libsac-java$(OOO_NO_REPORTDESIGN_ARCHS), libxml-java (>= 1.1.6)$(OOO_NO_REPORTDESIGN_ARCHS), libflute-java (>= 1.1.6)$(OOO_NO_REPORTDESIGN_ARCHS), libpentaho-reporting-flow-engine-java (>= 0.9.4)$(OOO_NO_REPORTDESIGN_ARCHS), liblayout-java (>= 0.2.10)$(OOO_NO_REPORTDESIGN_ARCHS), libloader-java (>= 1.1.6)$(OOO_NO_REPORTDESIGN_ARCHS), libformula-java (>= 1.1.7)$(OOO_NO_REPORTDESIGN_ARCHS), librepository-java (>= 1.1.6)$(OOO_NO_REPORTDESIGN_ARCHS), libfonts-java (>= 1.1.6)$(OOO_NO_REPORTDESIGN_ARCHS), libserializer-java (>= 1.1.6)$(OOO_NO_REPORTDESIGN_ARCHS)
832         REPORT_BUILDER_JAR_DEPENDS := , libbase-java, libsac-java, libxml-java (>= 1.1.6), libflute-java (>= 1.1.6), libpentaho-reporting-flow-engine-java (>= 0.9.4), liblayout-java (>= 0.2.10), libloader-java (>= 1.1.6), libformula-java (>= 1.1.7), librepository-java (>= 1.1.6), libfonts-java (>= 1.1.6), libserializer-java (>= 1.1.6)
833         BUILD_DEPS += $(REPORT_BUILDER_BUILD_DEPS)
834         CONFIGURE_FLAGS += --with-libbase-jar=/usr/share/java/libbase.jar --with-libxml-jar=/usr/share/java/libxml.jar --with-flute-jar=/usr/share/java/flute.jar --with-jfreereport-jar=/usr/share/java/flow-engine.jar --with-liblayout-jar=/usr/share/java/liblayout.jar --with-libloader-jar=/usr/share/java/libloader.jar --with-libformula-jar=/usr/share/java/libformula.jar --with-librepository-jar=/usr/share/java/librepository.jar --with-libfonts-jar=/usr/share/java/libfonts.jar --with-libserializer-jar=/usr/share/java/libserializer.jar
835     endif
836     ifneq (,$(filter apache-commons, $(SYSTEM_STUFF)))
837         REPORT_BUILDER_BUILD_DEPS += , libcommons-logging-java$(OOO_NO_JAVA_ARCHS)
838         REPORT_BUILDER_JAR_DEPENDS += , libcommons-logging-java
839         CONFIGURE_FLAGS += --with-commons-logging-jar=/usr/share/java/commons-logging.jar
840         CONFIGURE_FLAGS += --with-system-servlet-api --with-servlet-api-jar=$(shell dpkg -L `dpkg -s libcommons-logging-java | grep Suggests | cut -d"," -f1 | sed -e s/^\ // | awk '{ print $$2 }'` | grep servlet-api.*\.jar$ | head -n 1)
841         BUILD_DEPS += , $(shell dpkg -s libcommons-logging-java | grep Suggests | cut -d"," -f1 | sed -e s/^\ // | awk '{ print $$2 }')
842     endif
843         CONFIGURE_FLAGS += --enable-ext-report-builder
844   endif
845         OOO_OFFICEBEAN_DEP = libreoffice$(VER)-officebean
846         BUILD_DEPS += , javahelper $(JAVAHELPER_MIN_VERSION)
847 else
848         CONFIGURE_FLAGS += --without-java
849         DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-officebean -Nlibreoffice$(VER)-java-common -Nlibreoffice$(VER)-filter-mobiledev -Nlibreoffice$(VER)-gcj -Nlibreoffice$(VER)-script-provider-bsh -Nlibreoffice$(VER)-script-provider-js
850 endif
851
852 ifneq "$(MOZILLA)" ""
853   ifneq "$(OOO_MOZILLA_ARCHS)" ""
854     ifeq "$(MOZILLA)" "xulrunner"
855         BUILD_DEPS+= , libxul-dev$(OOO_NO_MOZILLA_ARCHS), libnss3-dev (>= 3.12.3)$(OOO_NO_MOZILLA_ARCHS)
856         DBG_DBG_SUGGESTS+= , libnss3-1d-dbg, libnspr4-0d-dbg
857     else
858       ifeq "$(MOZILLA)" "libxul"
859         BUILD_DEPS+= , xulrunner-dev$(OOO_NO_MOZILLA_ARCHS), libnss3-dev (>= 3.12.3)$(OOO_NO_MOZILLA_ARCHS)
860       else
861         ifeq "$(MOZILLA)" "iceape"
862         BUILD_DEPS += , $(MOZILLA)-dev (>= 1.1.9-5)$(OOO_NO_MOZILLA_ARCHS), libnss3-dev (>= 3.12.3)$(OOO_NO_MOZILLA_ARCHS)]
863         else
864         BUILD_DEPS += , $(MOZILLA)-dev$(OOO_NO_MOZILLA_ARCHS)
865         endif
866       endif
867         DBG_DBG_SUGGESTS+= , libnss3-1d-dbg, libnspr4-0d-dbg
868     endif
869   endif
870 endif
871 ifneq (,$(findstring $(ARCH),$(OOO_MOZILLA_ARCHS)))
872         CONFIGURE_FLAGS += --with-system-mozilla=$(MOZILLA)
873 else
874         CONFIGURE_FLAGS += --disable-mozilla --without-system-mozilla
875         PACKAGE_NPSOPLUGIN=n
876 endif
877
878 ifeq "$(USE_SYSTEM_DMAKE)" "y"
879         BUILD_DEPS += , dmake (>= 1:4.11)
880 endif
881
882 ifneq "$(OOO_MONO_ARCHS)" ""
883   ifeq "$(MONO2)" "y"
884         BUILD_DEPS += , mono-devel $(MONO_MINVER) [$(OOO_MONO_ARCHS)], libmono-dev $(MONO_MINVER) [$(OOO_MONO_ARCHS)], mono-utils $(MONO_MINVER) [$(OOO_MONO_ARCHS)], cli-common-dev (>= 0.5.7) [$(OOO_MONO_ARCHS)]
885   else
886         # mono-gmcs for gmcs itself and mkbundle2
887         # mono-mcs for mcs itself and al
888         BUILD_DEPS += , mono-mcs $(MONO_MINVER) [$(OOO_MONO_ARCHS)], mono-gmcs $(MONO_MINVER) [$(OOO_MONO_ARCHS)], libmono-dev $(MONO_MINVER) [$(OOO_MONO_ARCHS)], mono-utils $(MONO_MINVER) [$(OOO_MONO_ARCHS)], cli-common-dev (>= 0.5.7) [$(OOO_MONO_ARCHS)], mono-1.0-devel [$(OOO_MONO_ARCHS)], mono-2.0-devel [$(OOO_MONO_ARCHS)]
889   endif
890 endif
891 ifeq "$(ENABLE_MONO)" "y"
892         # http://pkg-mono.alioth.debian.org/cli-policy/ch-mono.html#s7.3
893         MONO_SHARED_DIR = $(CURDIR)
894         export MONO_SHARED_DIR
895         CONFIGURE_FLAGS+= --enable-mono
896   ifeq "$(MONO2)" "y"
897 export MCS=/usr/bin/mono-csc
898 export GMCS=/usr/bin/mono-csc
899 export MKBUNDLE2=/usr/bin/mkbundle
900   endif
901         DBG_DBG_SUGGESTS += , mono-jit-dbg [$(OOO_MONO_ARCHS)], libmono0-dbg [$(OOO_MONO_ARCHS)], mono-dbg [$(OOO_MONO_ARCHS)]
902 else
903         CONFIGURE_FLAGS+= --disable-mono
904         DEBHELPER_OPTIONS += -Nlibuno-cli-basetypes1.0-cil -Nlibuno-cli-uretypes1.0-cil -Nlibuno-cli-oootypes1.0-cil -Nlibuno-cli-cppuhelper1.0-cil -Nlibuno-cli-ure1.0-cil
905 endif
906
907 ifneq (,$(filter hunspell, $(SYSTEM_STUFF)))
908         BUILD_DEPS += , libhunspell-dev $(HUNSPELL_MIN_VER)
909 endif
910         CONFIGURE_FLAGS += --with-external-dict-dir=$(DICT_DIR)
911
912 ifneq (,$(filter altlinuxhyph, $(SYSTEM_STUFF)))
913   ifeq "$(USE_LIBHYPHEN)" "y"
914         BUILD_DEPS += , libhyphen-dev $(LIBHYPHEN_MINVER)
915   else
916         BUILD_DEPS += , libaltlinuxhyph-dev $(LIBALTLINUXHYPH_MINVER)
917   endif
918 endif
919         CONFIGURE_FLAGS += --with-external-hyph-dir=$(HYPH_DIR)
920
921 ifeq "$(USE_AGG)" "y"
922         CONFIGURE_FLAGS+= --with-agg
923   ifneq (,$(filter agg, $(SYSTEM_STUFF)))
924         BUILD_DEPS += , libagg-dev (>= 2.3-2)
925   endif
926 endif
927
928 ifneq "$(OOO_STLPORT_ARCHS)" ""
929         LIBSTLPORT_MINVER= (>= 4.6.2-3)
930         BUILD_DEPS += , libstlport4.6-dev $(LIBSTLPORT_MINVER) [$(OOO_STLPORT_ARCHS)]
931         CONFIGURE_FLAGS += --without-stlport
932 endif
933
934 ifneq (,$(filter boost, $(SYSTEM_STUFF)))
935   ifeq "$(BOOST_VERSION)" "1.34"
936     ifeq "$(SYSTEM_GCC_VERSION)" "4.4"
937         BUILD_DEPS += , libboost-dev (>= 1.34.1-15)
938     else
939         BUILD_DEPS += , libboost-dev
940     endif
941   else
942     ifneq "$(BOOST_VERSION)" "default"
943         BUILD_DEPS += , libboost$(BOOST_VERSION)-dev $(BOOST_MINVER)
944         #BUILD_DEPS += , libboost-thread$(BOOST_VERSION)-dev, libboost-program-options$(BOOST_VERSION)-dev
945     else
946         BUILD_DEPS += , libboost-dev $(BOOST_MINVER)
947         #BUILD_DEPS += , libboost-thread-dev, libboost-program-options-dev
948     endif
949   endif
950 endif
951
952 ifneq (,$(filter mdds, $(SYSTEM_STUFF)))
953         BUILD_DEPS += , libmdds-dev (>= 0.5.0)
954 endif
955
956 ifneq (,$(filter vigra, $(SYSTEM_STUFF)))
957         BUILD_DEPS += , libvigraimpex-dev
958 endif
959
960 ifeq "$(USE_EXTERNAL_CXXLIBS)" "y"
961   ifneq (,$(filter libwpd, $(SYSTEM_STUFF)))
962         BUILD_DEPS += , libwpd-dev (>= 0.9.0)
963   endif
964   ifneq (,$(filter sablot, $(SYSTEM_STUFF)))
965         BUILD_DEPS += , libsablot0-dev (>= 1.0.2-4)
966   endif
967   ifneq (,$(filter mythes, $(SYSTEM_STUFF)))
968         BUILD_DEPS += , libmythes-dev (>= 2:1.2)
969   endif
970   ifneq (,$(filter libwps, $(SYSTEM_STUFF)))
971         BUILD_DEPS += , libwps-dev (>= 0.2.0)
972   endif
973   ifneq (,$(filter libwpg, $(SYSTEM_STUFF)))
974         BUILD_DEPS += , libwpg-dev (>= 0.2.0)
975   endif
976 endif
977         CONFIGURE_FLAGS += --with-external-thes-dir=$(THES_DIR)
978
979 ifneq (,$(filter icu, $(SYSTEM_STUFF)))
980         BUILD_DEPS += , libicu-dev $(ICU_MINVER)
981 endif
982
983 ifneq (,$(filter libxslt, $(SYSTEM_STUFF)))
984         BUILD_DEPS += , libxslt1-dev
985         DBG_DBG_SUGGESTS+= , libxslt1-dbg
986 endif
987
988 ifneq (,$(filter xmlsec, $(SYSTEM_STUFF)))
989   ifneq (,$(findstring xul,$(MOZILLA)))
990         BUILD_DEPS += , libxmlsec1-dev (>= 1.2.9-1.1), libxmlsec1-nss (>= 1.2.9-1.1), libxmlsec1-openssl (>= 1.2.9-1.1)
991   else
992         BUILD_DEPS += , libxmlsec1-dev (>= 1.2.9), libxmlsec1-nss (>= 1.2.9), libxmlsec1-openssl (>= 1.2.9)
993   endif
994 endif
995
996 ifeq "$(BUILD_CAIROCANVAS)" "y"
997   ifneq (,$(filter cairo, $(SYSTEM_STUFF)))
998         BUILD_DEPS+= , libcairo2-dev
999   endif
1000 else
1001         CONFIGURE_FLAGS+= --disable-cairo
1002 endif
1003
1004 ifeq "$(BUILD_KDE)" "n"
1005         CONFIGURE_FLAGS+= --disable-kde
1006         CONFIGURE_FLAGS-= --disable-kde4
1007         CONFIGURE_FLAGS+= --with-images="$(IMAGES)"
1008 else
1009         CONFIGURE_FLAGS += --disable-kde
1010         CONFIGURE_FLAGS += --enable-kde4
1011         KDE_ICONSET_DEP=libreoffice$(VER)-style-oxygen
1012         BUILD_DEPS += , kdelibs5-dev $(KDELIBS_MINVER)
1013         BUILD_DEPS += , libqt4-dev $(QT_MINVER)
1014         DBG_DBG_SUGGESTS+= , kdelibs5-dbg, libqt4-dbg
1015   ifeq "$(ENABLE_KDEAB)" "y"
1016         ADDITIONAL_SECTIONS += KDE4Experimental
1017         BUILD_DEPS += , kdepimlibs5-dev$(OOO_NO_BASE_ARCHS)
1018   else
1019         CONFIGURE_FLAGS+= --disable-kdeab
1020   endif
1021 endif
1022
1023 ifeq "$(ENABLE_MYSQLNATIVE)" "y"
1024         CONFIGURE_FLAGS += --enable-ext-mysql-connector
1025   ifneq (,$(filter mysql, $(SYSTEM_STUFF)))
1026         BUILD_DEPS += , libmysqlclient-dev
1027   endif
1028   ifneq (,$(filter mysql-cppconn, $(SYSTEM_STUFF)))
1029         BUILD_DEPS += , libmysqlcppconn-dev $(MYSQLCPPCONN_MINVER)
1030   endif
1031 endif
1032
1033 ifeq "$(BUILD_GTK)" "n"
1034         CONFIGURE_FLAGS+= --disable-gtk
1035         DEBHELPER_OPTIONS+= -Nlibreoffice$(VER)-gtk -Nlibreoffice$(VER)-gnome
1036         CONFIGURE_FLAGS+= --with-images="$(IMAGES)"
1037 endif
1038
1039 ifeq "$(ENABLE_EVO2)" "n"
1040         CONFIGURE_FLAGS += --disable-evolution2
1041 else
1042         CONFIGURE_FLAGS += --enable-evolution2
1043         BUILD_DEPS += , libebook1.2-dev$(OOO_NO_BASE_ARCHS)
1044 endif
1045
1046 ifeq "$(ENABLE_SDBC_POSTGRESQL)" "y"
1047         BUILD_DEPS += , libpq-dev (>= 9.0~)
1048         ADDITIONAL_SECTIONS += PostgreSQL
1049 endif
1050
1051 ifeq "$(ENABLE_RANDR)" "y"
1052         BUILD_DEPS += , libxrandr-dev
1053 else
1054         CONFIGURE_FLAGS += --disable-randr
1055 endif
1056
1057 ifneq "$(ENABLE_LAYOUT)" "y"
1058         CONFIGURE_FLAGS += --disable-layout
1059 endif
1060
1061 ifeq "$(BUILD_BINFILTERS)" "y"
1062         CONFIGURE_FLAGS+= --enable-binfilter
1063         OOO_BINFILTER_DEP = libreoffice$(VER)-filter-binfilter
1064 endif
1065
1066 ifneq "$(BUILD_PYUNO)" "y"
1067         DEBHELPER_OPTIONS+= -Npython-uno
1068         CONFIGURE_FLAGS += --disable-python
1069 else
1070   ifeq "$(ENABLE_SCRIPT_PROVIDER_PYTHON)" "y"
1071         CONFIGURE_FLAGS += --enable-ext-scripting-python
1072   endif
1073 endif
1074
1075 ifeq "$(ENABLE_JAVA)" "y"
1076   ifneq (,$(filter lucene, $(SYSTEM_STUFF)))
1077         BUILD_DEPS += , liblucene2-java (>= 2.3.2)$(OOO_NO_JAVA_ARCHS)
1078         LUCENE_DEPENDS = liblucene2-java (>= 2.3.2)
1079         # safety measure; e.g. lucene 2.9 index cannot be handled by lucene 2.4
1080         LUCENE_CONFLICTS = liblucene2-java (<< $(shell dpkg -l liblucene2-java | grep ^ii | awk '{ print $$3 }' | cut -d. -f1,2)~)
1081         CONFIGURE_FLAGS += --with-lucene-core-jar=/usr/share/java/lucene-core.jar --with-lucene-analyzers-jar=/usr/share/java/lucene-analyzers.jar
1082   endif
1083   ifneq (,$(filter hsqldb, $(SYSTEM_STUFF)))
1084         BUILD_DEPS += , libhsqldb-java $(HSQLDB_MINVER)$(OOO_NO_JAVA_ARCHS)
1085         BASE_HSQLDB_DEPENDS = libhsqldb-java $(HSQLDB_MINVER), libhsqldb-java (<< $(HSQLDB_TOONEWVER)~)
1086         JAVA_GCJ_DEPENDS += , libhsqldb-java-gcj [$(OOO_GCJ_ARCHS)]
1087   endif
1088   ifeq "$(ENABLE_SCRIPT_PROVIDER_BSH)" "y"
1089     ifneq (,$(filter beanshell, $(SYSTEM_STUFF)))
1090         BUILD_DEPS += , bsh (>= 2.0b4)$(OOO_NO_JAVA_ARCHS)
1091         BSH_DEPENDS = bsh (>= 2.0b4)
1092         JAVA_GCJ_DEPENDS += , bsh-gcj [$(OOO_GCJ_ARCHS)]
1093     endif
1094         CONFIGURE_FLAGS += --enable-ext-scripting-beanshell
1095   else
1096         DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-script-provider-bsh
1097   endif
1098   ifeq "$(ENABLE_SCRIPT_PROVIDER_JS)" "y"
1099         CONFIGURE_FLAGS += --enable-ext-scripting-javascript    
1100   else
1101         DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-script-provider-js
1102   endif
1103 endif
1104
1105 ifneq (,$(filter lpsolve, $(SYSTEM_STUFF)))
1106   ifeq "$(USE_SHARED_LPSOLVE)" "y"
1107         BUILD_DEPS += , liblpsolve55-dev $(LPSOLVE_MIN_VERSION), lp-solve $(LPSOLVE_MIN_VERSION)
1108         LPSOLVE_DEP = lp-solve $(LPSOLVE_MIN_VERSION)
1109   else
1110         BUILD_DEPS += , liblpsolve55-dev $(LPSOLVE_MIN_VERSION)
1111   endif
1112   ifeq "$(USE_LIBSUITESPARSE)" "y"
1113         DBG_DBG_SUGGESTS+= , libsuitesparse-dbg
1114         BUILD_DEPS += , libsuitesparse-dev $(SUITESPARSE_MIN_VERSION)
1115   else
1116         DBG_DBG_SUGGESTS+= , libufsparse-dbg
1117         BUILD_DEPS += , libufsparse-dev
1118   endif
1119 endif
1120
1121 ifeq "$(USE_DBUS)" "y"
1122         BUILD_DEPS += , libdbus-glib-1-dev (>= 0.60)
1123         CONFIGURE_FLAGS += --enable-dbus
1124 endif
1125
1126 ifeq "$(USE_GSTREAMER)" "y"
1127         BUILD_DEPS += , libgstreamer-plugins-base0.10-dev
1128         GSTREAMER_PLUGINS_SUGGESTS += , gstreamer0.10-plugins-base, gstreamer0.10-plugins-good, gstreamer0.10-plugins-ugly, gstreamer0.10-plugins-bad, gstreamer0.10-ffmpeg
1129         DBG_DBG_SUGGESTS+= , libgstreamer0.10-0-dbg
1130 else
1131         CONFIGURE_FLAGS += --disable-gstreamer
1132 endif
1133
1134 ifneq (,$(filter neon, $(SYSTEM_STUFF)))
1135   ifneq "$(NEON_SECTYPE)" "openssl"
1136         BUILD_DEPS += , libneon$(NEONSONR)-$(NEON_SECTYPE)-dev
1137         DBG_DBG_SUGGESTS+= , libneon$(NEONSONR)-$(NEON_SECTYPE)-dbg
1138   else
1139         BUILD_DEPS += , libneon$(NEONSONR)-dev
1140         DBG_DBG_SUGGESTS+= , libneon$(NEONSONR)-dbg
1141   endif
1142 endif
1143
1144 ifeq "$(HELPISOS)" ""
1145         CONFIGURE_FLAGS += --without-helppack-integration
1146 endif
1147
1148 ifneq (,$(filter redland, $(SYSTEM_STUFF)))
1149         BUILD_DEPS += , librdf0-dev (>= 1.0.8)
1150         SHLIBS_OVERRIDE += -Xunordf
1151 endif
1152
1153 # CairoFonts patchset is applied for sid and this patch needs Gtk 2.10
1154 ifneq "$(CAIRO_FONTS_PATCH)" "y"
1155         BUILD_DEPS += , libgtk2.0-dev
1156 else
1157         BUILD_DEPS += , libgtk2.0-dev (>= 2.10)
1158   # cairo canvas might be disabled, but the patch needs cairo headers
1159   ifneq "$(BUILD_CAIROCANVAS)" "y"
1160         BUILD_DEPS += , libcairo2-dev
1161         CONFIGURE_FLAGS += --with-system-cairo
1162   endif
1163 endif
1164
1165 ifeq "$(ENABLE_GIO)" "y"
1166         CONFIGURE_FLAGS += --enable-gio --disable-gnome-vfs
1167         BUILD_DEPS += , libglib2.0-dev (>= 2.15.0)
1168 endif
1169
1170 ifeq "$(ENABLE_GVFS)" "y"
1171         BUILD_DEPS += , libgnomevfs2-dev
1172 else
1173         CONFIGURE_FLAGS += --disable-gnome-vfs
1174 endif
1175
1176 ifeq "$(ENABLE_GCONF)" "y"
1177         BUILD_DEPS += , libgconf2-dev, liborbit2-dev
1178 else
1179         CONFIGURE_FLAGS += --disable-gconf
1180 endif
1181
1182 ifeq "$(PACKAGE_TTF_OPENSYMBOL)" "y"
1183         BUILD_DEPS_INDEP += , fontforge
1184 endif
1185
1186 ifneq "$(ISOS)" "en-US"
1187         CONFIGURE_FLAGS += --with-system-translate-toolkit
1188         BUILD_DEPS_INDEP += , translate-toolkit (>= 1.9)
1189 endif
1190
1191 # Use compiler cache?  Include ccache in DEB_BUILD_OPTIONS for much faster rebuild times
1192 # A complete build uses about 4.5G of compiler cache.
1193 ifeq (ccache,$(findstring ccache,$(DEB_BUILD_OPTIONS)))
1194         CONFIGURE_FLAGS += --with-gcc-speedup=ccache
1195 endif
1196
1197 ## Build n projects in parallel?
1198 ## DEB_BUILD_OPTIONS=parallel=<n>
1199 NUM_CPUS=$(shell echo "$(DEB_BUILD_OPTIONS) " | sed -n 's/^\(.* \)\?parallel=\([0-9]\+\).*$$/\2/p')
1200 AVAIL_CPUS := $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
1201 ifeq "$(NUM_CPUS)" ""
1202         NUM_CPUS := 1
1203   ifeq "$(PARALLEL_BUILD)" "y"
1204         # according to Pavel Janik, build -P<number of cores> -- -P2
1205         # is ideal. This sets the first -P according to the number
1206         # of CPUs (where dual-core CPUS report 2, too)
1207     ifneq ($(AVAIL_CPUS),1)
1208         NUM_CPUS := $(shell expr $(AVAIL_CPUS))
1209     endif
1210         # http://bugs.debian.org/622644
1211         BUILD_DEPS += , make (>= 3.82)
1212   endif
1213 else
1214   ifneq "$(PARALLEL_BUILD)" "y"
1215     # no more than 2, please. At least 6 seems to fail.
1216     ifneq ($(NUM_CPUS),1)
1217       ifneq ($(NUM_CPUS),2)
1218         NUM_CPUS := 2
1219       endif
1220     endif
1221   endif
1222 endif
1223 # disabled for now. needs fixed GNU make (#622644)
1224 #       CONFIGURE_FLAGS += --with-num-cpus=$(NUM_CPUS)
1225         # breaks. At least with 2
1226 #       CONFIGURE_FLAGS += --with-max-jobs=$(NUM_CPUS)
1227
1228 CURDIR ?= $(shell pwd)
1229
1230 ifeq ($(GCC_VERSION),)
1231         BUILD_PATH = /usr/lib/jvm/java-gcj/bin:$$PATH
1232 else
1233   ifeq ($(GCC_VERSION),snapshot)
1234         BUILD_PATH = /usr/lib/jvm/java-gcj/bin:/usr/lib/gcc-snapshot/bin:$$PATH
1235         BUILD_LD_LIBRARY_PATH = /usr/lib/gcc-snapshot/lib:$$LD_LIBRARY_PATH
1236         BUILD_DEPS += , gcc-snapshot
1237   else
1238         BUILD_PATH = /usr/lib/jvm/java-gcj/bin:$(CURDIR)/debian/usr/bin:$$PATH
1239     ifeq "$(GCJ_JDK_VERSION)" ""
1240         BUILD_DEPS += , gcc-$(GCC_VERSION), g++-$(GCC_VERSION)
1241     endif
1242   endif
1243 endif
1244 BUILD_PATH := $(CURDIR)/debian/usr/bin:$(BUILD_PATH)
1245 BUILD_LD_LIBRARY_PATH := /usr/lib/libfakeroot:$(BUILD_LD_LIBRARY_PATH):$(GCJ_JAWT_DIR)
1246
1247 ifeq "$(ENABLE_LDAP)" "y"
1248   ifeq "$(USE_OPENLDAP)" "y"
1249     BUILD_DEPS += , libldap2-dev
1250     LDAP_LIB := $(shell echo libldap-`grep LDAP_VENDOR_VERSION_M /usr/include/ldap_features.h | cut -d: -f2 | awk '{ print $$3 }' | xargs | sed -e "s/ /\./"`-`grep LDAP_VENDOR_VERSION_MAJOR /usr/include/ldap_features.h | cut -d: -f2 | awk '{ print $$3 }'`)
1251    else
1252      CONFIGURE_FLAGS += --without-openldap
1253    endif
1254 else
1255   CONFIGURE_FLAGS += --disable-ldap
1256 endif
1257
1258 # Because of the stampdir magic, when you actually want to run a rule
1259 # over, you would have to remove the stamp manually.  Now, just do
1260 # 'debian/rules <target> <target> ... FORCE=1', and the stamp files
1261 # that match the given targets will be removed automagically.
1262 stampdir_targets=files.backup icons.scale patch.apply build.prepare.artwork 
1263 stampdir_targets+=build.prepare configure
1264 stampdir_targets+=setupins setup install install-arch install-indep
1265 stampdir_targets+=langpacks binary-common binary-arch binary-indep
1266 ifdef FORCE
1267  DUMMY:=$(shell rm -f $(patsubst %,$(STAMP_DIR)/%,$(filter $(stampdir_targets),$(MAKECMDGOALS))))
1268 endif
1269
1270 # If this is defined, then none of the 'long' commands will be run.  Useful
1271 # for testing.
1272 # test_rules=1
1273
1274 # Since the final stages use up a large amount of diskspace, provide targets to
1275 # remove them without needing a full rebuild
1276
1277 # Clean up the package directories (about 830M) 
1278 clean-debdir:
1279         dh_testdir
1280         rm -f debian/*.postinst debian/*.postrm debian/*.preinst debian/*.prerm debian/*.triggers
1281         rm -f $(STAMP_DIR)/setup
1282         dh_clean
1283
1284 # Clean compilation results, but leave solver (about 600Mb in addition to instsetoo)
1285 clean-objectdirs: clean-instsetoo
1286         dh_testdir
1287         find $(SOURCE_TREE) -maxdepth 2 -name $(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT) -type d -exec rm -rf {} \;
1288
1289 clean:
1290         dh_testroot
1291         dh_testdir
1292
1293         # openoffice.applications and openoffice*.keys are not removed via make distclean
1294         # although they are generated files. Work around this.
1295         # FIXME: Fix the makefiles in ooo-build directly
1296         if [ -e $(OOO_BUILD_TREE)/desktop/openoffice.applications ]; then \
1297                 $(MAKE) -C $(OOO_BUILD_TREE)//desktop clean || true;\
1298         fi
1299         if [ -r $(OOO_BUILD_TREE)/Makefile ]; then \
1300           $(MAKE) -C $(OOO_BUILD_TREE) distclean || true ;\
1301         fi
1302
1303         # remove file with space in the name
1304         rm -f $(OOO_BUILD_TREE)/test/macro/clock\ chart.xls
1305
1306         rm -rf $(OOO_BUILD_TREE)/autom4ate.cache
1307         rm -rf $(OOO_BUILD_TREE)/build
1308         rm -rf $(OOO_BUILD_TREE)/desktop/*.desktop
1309         rm -f $(OOO_BUILD_TREE)/fonts/symbols.xls
1310         rm -f $(OOO_BUILD_TREE)/po/.intltool-merge-cache
1311         rm -f $(OOO_BUILD_TREE)/src/GSI*.sdf
1312         rm -f $(OOO_BUILD_TREE)/src/accessories*langpack.sdf
1313         rm -f $(OOO_BUILD_TREE)/src/extensions*langpack.sdf
1314         rm -rf $(OOO_BUILD_TREE)/bin/localize-*.err
1315         find $(OOO_BUILD_TREE)/stamp -type f ! -name "Make*" ! -name "README" -exec rm {} \;
1316
1317         # remove generated symlinks / java wrappers
1318         rm -rf debian/usr
1319
1320         # stlport home
1321         rm -rf $(CURDIR)/stlport
1322         # convenience link
1323         rm -f build
1324
1325         rm -f $(OOO_BUILD_TREE)/src/GSI*err
1326         rm -f $(OOO_BUILD_TREE)/config.*
1327
1328 ifneq "$(OOO_L10N_DIR)" ""
1329         rm -rf $(OOO_L10N_DIR)
1330 endif
1331
1332         dh_clean
1333
1334         # Files created in debian directory
1335         rm -f debian/*.postinst debian/*.postrm debian/*.preinst debian/*.prerm
1336         find debian -name "*.links" ! -name "libreoffice-common*.links" -exec rm {} \;
1337         if [ -d "$(STAMP_DIR)" ]; then rm -rf "$(STAMP_DIR)"; fi
1338         rm -f debian/shlibs.override.stdlibs
1339         rm -f debian/*.bug-script
1340         rm -f debian/scripts/aotcompile.py*
1341
1342 ifeq "$(ENABLE_MONO)" "y"
1343         rm -rf $(MONO_SHARED_DIR)/.wapi
1344 endif
1345
1346 ifeq "$(HELPISOS)" ""
1347         rm -rf images*
1348 endif
1349
1350         rm -f l10n.fdupes
1351         rm -f debian/shlibs.local
1352         rm -f debian/*.templates
1353
1354         rm -f debian/libreoffice-dev-doc.doc-base.*
1355         rm -f debian/*.menu
1356         for i in base calc core common draw impress math writer; do \
1357                 rm -f debian/libreoffice-$$i.lintian-overrides; \
1358         done
1359         rm -f debian/*.install debian/*.dirs
1360         rm -f debian/catalog.xml
1361         rm -f debian/openoffice.org-dtd-officedocument1.0.xmlcatalogs
1362         rm -f download.list
1363
1364         rm -f $(OOO_BUILD_TREE)/src/libreoffice-$(OOO_BUILD_TARBAL_VERSION)*
1365         rm -f $(OOO_BUILD_TREE)/src/GSI*
1366         rm -f $(OOO_BUILD_TREE)/src/*.log
1367
1368         for i in ext-sources-$(OOO_BUILD_TREE)/*; do \
1369                 rm -f $(OOO_BUILD_TREE)/src/`basename $$i`; \
1370         done
1371
1372         for i in `find $(OOO_BUILD_TREE)/patches/dev300 -name "*.in" ! -name "Makefile*"`; do \
1373                 if [ -e `echo $$i | sed -e s/\.in$$//` ]; then \
1374                         rm `echo $$i | sed -e s/\.in$$//`; \
1375                 fi; \
1376         done
1377         rm -f $(OOO_BUILD_TREE)/bin/setup
1378         rm -f $(OOO_BUILD_TREE)/bin/piece/sys-setup
1379         rm -f $(OOO_BUILD_TREE)/download
1380         rm -f $(OOO_BUILD_TREE)/distro-configs/*.conf
1381         rm -f $(OOO_BUILD_TREE)/patches/apply.pl
1382         find $(OOO_BUILD_TREE) -name "Makefile" | xargs rm -f
1383         rm -f $(OOO_BUILD_TREE)/intltool-extract \
1384                 $(OOO_BUILD_TREE)/intltool-merge \
1385                 $(OOO_BUILD_TREE)/intltool-update
1386         rm -f $(OOO_BUILD_TREE)/scratch/place
1387
1388         # left-over from ooo-pack-sources
1389         rm -rf .releases
1390
1391         $(MAKE) -f debian/rules control
1392
1393
1394 # Generate control file, because we have so many different languages
1395 # Based on script by Martin Quinson <Martin.Quinson@tuxfamily.org>
1396 control: debian/control
1397 debian/control: $(wildcard debian/control*in) $(OOO_BUILD_TREE)/bin/openoffice-xlate-lang  debian/rules
1398         chmod 755 $(OOO_BUILD_TREE)/bin/openoffice-xlate-lang
1399         sed -e "s#libreofficeVER#libreoffice$(VER)#g" \
1400             -e "s#libreofficeVER#libreoffice$(VER)#g" \
1401             -e "s#%$(DIST)=\([^%]*\)%#, \1#g#" \
1402             -e "s#%[A-Za-z]*=[^%]*%##g#" \
1403             -e "s#%BUILD_DEPS%#$(strip $(BUILD_DEPS))#g" \
1404             -e "s#%BUILD_DEPS_INDEP%#$(strip $(BUILD_DEPS_INDEP))#g" \
1405             -e "s#@PYTHON_VERSION@#$(PYTHON_VERSION)#g" \
1406             -e "s#@BUGS@#$(BUGS)#g" \
1407             < debian/control.in > debian/control
1408
1409 ifeq "$(ENABLE_LDAP)" "y"
1410         # build-depends might not be satified when running debian/rules control. prevent bad subsitition with
1411         # nothing (libldap--)
1412         if [ ! -f /usr/include/ldap_features.h ]; then \
1413                 echo "/usr/include/ldap_features.h not found. Is libldap2-dev installed?"; \
1414                 echo 'Needed for properly setting $$(LDAP_LIB). Stopping,'; \
1415                 exit 1; \
1416         fi
1417 endif
1418
1419         for LNUM in $(filter-out en-US,$(LANGPACKISOS)) ; do \
1420             [ "$$LNUM" = en-US -a "$(PKGSOURCE)" = "libreoffice$(VER)-l10n" ] && continue; \
1421             LNAME=`$(OOO_BUILD_TREE)/bin/openoffice-xlate-lang -l $$LNUM | perl -e 'print ucfirst(<STDIN>);'`; \
1422             LCODE=`$(OOO_BUILD_TREE)/bin/openoffice-xlate-lang -i $$LNUM | tr A-Z a-z`; \
1423             CCODE=`echo $$LCODE | sed 's/-.*//'`; \
1424             case "$$LCODE" in \
1425                 bn|gu|pa-in|ml|or|te|ta) \
1426                         FONT_SUGGESTS=", ttf-`echo $$LNAME | tr A-Z a-z`-fonts"; \
1427                         ;; \
1428                 hi-in|ne|mr) \
1429                         FONT_SUGGESTS=", ttf-devanagari-fonts"; \
1430                         ;; \
1431                 he) \
1432                         FONT_SUGGESTS=", culmus"; \
1433                         ;; \
1434                 km) \
1435                         FONT_SUGGESTS=", ttf-khmeros"; \
1436                         ;; \
1437                 ar) \
1438                         FONT_SUGGESTS=", ttf-arabeyes"; \
1439                         ;; \
1440                 fa) \
1441                         FONT_SUGGESTS=", ttf-farsiweb"; \
1442                         ;; \
1443                 dz) \
1444                         FONT_SUGGESTS=", ttf-dzongkha"; \
1445                         ;; \
1446                 th) \
1447                         if [ "$(SQUEEZE_BACKPORTS)" != "y" ]; then \
1448                         FONT_SUGGESTS=", fonts-thai-tlwg"; else \
1449                         FONT_SUGGESTS=", ttf-thai-tlwg"; fi; \
1450                         ;; \
1451                 *) \
1452                         FONT_SUGGESTS= ;; \
1453             esac; \
1454             case "$$LCODE" in \
1455                 rw) \
1456                         LOCALES_DEPENDS="locales (>= 2.3.6) | belocs-locales-data | locales-all (>= 2.3.6)" \
1457                         ;; \
1458                 ss|ts|km|ns|tn) \
1459                         LOCALES_DEPENDS="locales (>= 2.3.5-12) | belocs-locales-data | locales-all" \
1460                         ;; \
1461                 sr) \
1462                         LOCALES_DEPENDS="locales (>= 2.3.6.ds1-5) |  belocs-locales-data | locales-all" \
1463                         ;; \
1464                 as|or|nr) \
1465                         LOCALES_DEPENDS="locales (>= 2.3.6.ds1-1) | locales-all (>= 2.3.6.ds1-1)" \
1466                         ;; \
1467                 sw) \
1468                         LOCALES_DEPENDS="locales (>= 2.13-5) | locales-all (>= 2.13-5)" \
1469                         ;; \
1470                 *) \
1471                         LOCALES_DEPENDS="locales | belocs-locales-data | locales-all" \
1472                         ;; \
1473             esac; \
1474             sed -e "s|@LNAME@|$$LNAME|g" -e "s|@LCODE@|$$LCODE|g" \
1475                 -e "s|@CCODE@|$$CCODE|g" \
1476                 -e "s|@FONT_SUGGESTS@|$$FONT_SUGGESTS|g" \
1477                 -e "s:@LOCALES_DEPENDS@:$$LOCALES_DEPENDS:g" \
1478                         -e "s|libreofficeVER|libreoffice$(VER)|g" \
1479                 -e "s|@LDAP_LIB@|$(LDAP_LIB)|g" \
1480                 >> debian/control < debian/control.lang.in; \
1481         done
1482
1483 ifneq "$(HELPISOS)" ""
1484         for LNUM in $(HELPISOS) ; do \
1485             LNAME=`$(OOO_BUILD_TREE)/bin/openoffice-xlate-lang -l $$LNUM | perl -e 'print ucfirst(<STDIN>);'`; \
1486             LCODE=`$(OOO_BUILD_TREE)/bin/openoffice-xlate-lang -i $$LNUM | tr A-Z a-z`; \
1487             CCODE=`echo $$LCODE | sed 's/-.*//'`; \
1488             sed -e "s|@LNAME@|$$LNAME|g" -e "s|@LCODE@|$$LCODE|g" \
1489                 -e "s|@CCODE@|$$CCODE|g" \
1490                         -e "s|libreofficeVER|libreoffice$(VER)|g" \
1491                 >> debian/control < debian/control.help.in; \
1492         done
1493         # en_US is in -common
1494         perl -pi -e 's|(Depends: libreoffice$(VER)-writer \| language-support-translations-en), libreoffice$(VER)-l10n-en-us|\1|' \
1495                 debian/control
1496         perl -pi -e 's|(Depends: libreoffice$(VER)-writer, libreoffice$(VER)-l10n-en-us)|\1, ttf-devanagari-fonts|' \
1497                 debian/control
1498 endif
1499         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1500                 >> debian/control < debian/control.ure.in
1501 ifeq "$(ENABLE_JAVA)" "y"
1502         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1503                 >> debian/control < debian/control.gcj.in
1504 endif
1505 ifneq "$(OOO_MONO_ARCHS)" ""
1506         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1507                 >> debian/control < debian/control.mono.in
1508 endif
1509 ifneq "$(OOO_NPSOPLUGIN_ARCHS)" ""
1510         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1511                 >> debian/control < debian/control.mozilla.in
1512 endif
1513 ifneq "$(OOO_OGLTRANS_ARCHS)" ""
1514         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1515                 >> debian/control < debian/control.ogltrans.in
1516 endif
1517 ifeq "$(ENABLE_JAVA)" "y"
1518   ifeq "$(ENABLE_MEDIAWIKI)" "y"
1519         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1520                 >> debian/control < debian/control.mediawiki.in
1521   endif
1522   ifeq "$(ENABLE_REPORTDESIGN)" "y"
1523         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1524                 >> debian/control < debian/control.reportdesign.in
1525   endif
1526 endif
1527 ifeq "$(ENABLE_MINIMIZER)" "y"
1528         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1529                 >> debian/control < debian/control.minimizer.in
1530 endif
1531 ifeq "$(ENABLE_PRESENTER_CONSOLE)" "y"
1532         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1533                 >> debian/control < debian/control.presenter.in
1534 endif
1535 ifeq "$(ENABLE_PDFIMPORT)" "y"
1536         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1537                 >> debian/control < debian/control.pdfimport.in
1538 endif
1539 ifeq "$(PACKAGE_TTF_OPENSYMBOL)" "y"
1540         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1541                 >> debian/control < debian/control.fonts.in
1542 endif
1543 ifeq "$(BUILD_DBG_PACKAGE)" "y"
1544         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1545                 >> debian/control < debian/control.debug.in
1546 endif
1547 ifeq "$(PACKAGE_SDK)" "y"
1548         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1549                 >> debian/control < debian/control.sdk.in
1550 endif
1551 ifeq "$(BUILD_KDE)" "y"
1552         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1553                 >> debian/control < debian/control.kde.in
1554           perl -pi -e 's/ libreoffice$(VER)-gnome,/ libreoffice-gnome | libreoffice$(VER)-kde,/' debian/control
1555 endif
1556 ifeq "$(ENABLE_SDBC_POSTGRESQL)" "y"
1557         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1558                 >> debian/control < debian/control.postgresql.in
1559 endif
1560 ifeq "$(ENABLE_MYSQLNATIVE)" "y"
1561         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1562                 >> debian/control < debian/control.mysql.in
1563 endif
1564 ifeq "$(ENABLE_EVO2)" "y"
1565         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1566                 >> debian/control < debian/control.evolution.in
1567 endif
1568 ifeq "$(BUILD_BINFILTERS)" "y"
1569         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1570                 >> debian/control < debian/control.binfilter.in
1571 endif
1572 ifeq "$(ENABLE_KDEAB)" "y"
1573         sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
1574                 >> debian/control < debian/control.kab.in
1575 endif
1576
1577         perl -pi -e "s,%OOO_ARCHS%,$(OOO_ARCHS),g" debian/control
1578         perl -pi -e "s,%OOO_BASE_ARCHS%,$(OOO_BASE_ARCHS),g" debian/control
1579         perl -pi -e "s,%OOO_NO_BASE_ARCHS%,$(OOO_NO_BASE_ARCHS),"g debian/control
1580         perl -pi -e "s,%OOO_JAVA_ARCHS%,$(OOO_JAVA_ARCHS),g" debian/control
1581         perl -pi -e "s,%OOO_GCJ_ARCHS%,$(OOO_GCJ_ARCHS),g" debian/control
1582         perl -pi -e "s,%OOO_MONO_ARCHS%,$(OOO_MONO_ARCHS),g" debian/control
1583         perl -pi -e "s,%OOO_NPSOPLUGIN_ARCHS%,$(OOO_NPSOPLUGIN_ARCHS),g" debian/control
1584         perl -pi -e "s,%OOO_OGLTRANS_ARCHS%,$(OOO_OGLTRANS_ARCHS),g" debian/control
1585         perl -pi -e "s,%OOO_BINFILTER_ARCHS%,$(OOO_BINFILTER_ARCHS),g" debian/control
1586         perl -pi -e "s,%OOO_STLPORT_ARCHS%,$(OOO_STLPORT_ARCHS),g" debian/control
1587         perl -pi -e "s,%OOO_GCJ_JDK_ARCHS%,$(OOO_GCJ_JDK_ARCHS),g" debian/control
1588         perl -pi -e "s,%OOO_ARCH_DEP_EXTENSIONS_ARCHS%,$(OOO_ARCH_DEP_EXTENSIONS_ARCHS),g" debian/control
1589
1590 ifeq (sk,$(findstring sk,$(HELPISOS)))
1591         perl -pi -e 's/(Depends:.*)libreoffice-l10n-sk(.*)$$/\1libreoffice-l10n-sk, libreoffice-help-cs\2/' debian/control
1592 endif
1593 ifeq (pt-BR,$(findstring pt-BR,$(LANGPACKISOS)))
1594         perl -pi -e 's/libreoffice2-l10n-pt-br$$/libreoffice2-l10n-pt-br, broffice/' debian/control
1595         perl -pi -e 's/libreoffice2-l10n-pt-br$$/libreoffice2-l10n-pt-br, broffice/' debian/control
1596         perl -pi -e 's/libreoffice2-l10n-pt-br$$/libreoffice2-l10n-pt-br, broffice/' debian/control
1597 endif
1598         perl -pi -e 's/Package: libreoffice$(VER)-help-en-us/Package: libreoffice$(VER)-help-en-us\nReplaces: libreoffice$(VER)-common (<< 1:3.0.0~dev300m28)/' debian/control
1599
1600 ifeq "$(ENABLE_GIO)" "y"
1601         perl -pi -e 's/VFS/GIO/' debian/control
1602         # fix up "GNOME GIO"
1603         perl -pi -e 's/GNOME GIO/GIO/' debian/control
1604 endif
1605
1606 ifneq "$(SQUEEZE_BACKPORT)" "y" 
1607         perl -pi -e "s/(Build-Conflicts: .*)/\1, base-files (= 6.0), base-files (= 6.0squeeze1)/" debian/control
1608 endif
1609
1610 ifneq (,$(filter hsqldb, $(SYSTEM_STUFF)))
1611         perl -pi -e "s/(Build-Conflicts: .*)/\1, libhsqldb-java (>= $(HSQLDB_TOONEWVER)~)/" debian/control
1612 endif
1613
1614 ifeq (4.4,$(SYSTEM_GCC_VERSION))
1615         perl -pi -e 's/flex \|/flex (>= 2.5.25-7) |/' debian/control
1616 endif
1617
1618         python debian/scripts/joinctrl.py < debian/control > debian/control.tmp
1619         mv debian/control.tmp debian/control
1620
1621 ifeq "$(VER)" ""
1622         # no conflict with "universal Linux packages" as they have the version in their
1623         # names thankfully now
1624         perl -pi -e 's/libreoffice-unbundled, //' debian/control
1625 endif
1626
1627         # make -l10n-fi suggest libreoffice-spellcheck-fi to
1628         # match myspell-fi and libreoffice-soikko/-voikko
1629         perl -pi -e 's/myspell-dictionary-fi/myspell-dictionary-fi | libreoffice-spellcheck-fi/' debian/control
1630         # similar for tr (libreoffice-zemberek)
1631         perl -pi -e 's/myspell-dictionary-tr/myspell-dictionary-tr | libreoffice-spellcheck-tr/' debian/control
1632
1633 ifeq "$(BUILD_KDE)" "y"
1634         perl -pi -e 's/GConf backend$$/GConf backend\n  * libreoffice$(VER)-kde: KDE UI Plugin and KDE File Picker support/' debian/control
1635 endif
1636
1637 ifeq "$(ENABLE_LDAP)" "y"
1638         perl -pi -e 's/paperconf$$/paperconf\n  * $(LDAP_LIB): LDAP client library; needed for LibreOffice getting its\n    profiles from LDAP/' debian/control
1639 endif
1640
1641 ifneq "$(DICT_DIR)" "/usr/share/hunspell"
1642         perl -pi -e 's/^Breaks:.*myspell.*\n//' debian/control
1643 endif
1644
1645 .DELETE_ON_ERROR: debian/control
1646
1647 build: build-arch build-indep
1648 build-arch: $(STAMP_DIR)/build
1649 build-indep: $(STAMP_DIR)/build
1650
1651 # All 'important' targets have 2 lines.  The one that is run by
1652 # dpkg-buildpackage or the user, and the one that does the actual work.  This
1653 # indirection is needed so that the 'stamp' files that signify when a rule is
1654 # done can be located in a separate 'stampdir'.  Recall that make has no way to
1655 # know when a goal has been met for a phony target (like "build" or "install").
1656 #
1657 # At the end of each stampdir target, be sure to run the command 'touch $@'
1658 # so that the target will not be run again.  Removing the file will make
1659 # make run the target over.
1660
1661 configure: $(OOO_BUILD_TREE)/config.status
1662 $(OOO_BUILD_TREE)/config.status: $(OOO_BUILD_TREE)/configure
1663         dh_testdir
1664
1665         # Make sure needed scripts are executable
1666         set -e;\
1667         for FILE in debian/scripts/move-if-change \
1668                     debian/scripts/cleandupes \
1669                     debian/scripts/get_libebook_dep.sh \
1670                     $(OOO_BUILD_TREE)/configure \
1671                     $(OOO_BUILD_TREE)/bin/[a-z]* \
1672                     $(OOO_BUILD_TREE)/bin/piece/[a-z]*; \
1673         do \
1674           chmod 755 $$FILE ;\
1675         done
1676
1677         mkdir -p $(STAMP_DIR)
1678
1679 ifeq "$(USE_SOURCE_TARBALLS)" "y"
1680         cp -a sources/* $(OOO_BUILD_TREE)/src
1681 endif
1682         cp -a ext-sources-$(OOO_BUILD_TREE)/* $(OOO_BUILD_TREE)/src
1683
1684 ifneq ($(GCC_VERSION),)
1685   ifneq ($(GCC_VERSION),snapshot)
1686         # create links for gcc and g++ (and gij and gcj), ooo-build does not
1687         # honour overriding CC and CXX and we need to use gcc/g++ 4.0 or /
1688         # ant.mk wants gcj at the moment...
1689         mkdir -p $(CURDIR)/debian/usr/bin
1690         ln -sf /usr/bin/$(CC_PREFIX)gcc-$(GCC_VERSION) $(CURDIR)/debian/usr/bin/gcc
1691         ln -sf /usr/bin/$(CC_PREFIX)g++-$(GCC_VERSION) $(CURDIR)/debian/usr/bin/g++
1692         ln -sf /usr/bin/$(CC_PREFIX)gcc-$(GCC_VERSION) $(CURDIR)/debian/usr/bin/$(CC_PREFIX)gcc
1693         ln -sf /usr/bin/$(CC_PREFIX)g++-$(GCC_VERSION) $(CURDIR)/debian/usr/bin/$(CC_PREFIX)g++
1694         #ln -sf /usr/bin/$(CC_PREFIX)gcj-$(GCC_VERSION) $(CURDIR)/debian/usr/bin/gcj
1695         #ln -sf /usr/bin/gij-$(GCC_VERSION) $(CURDIR)/debian/usr/bin/gij
1696   else
1697     ifneq "$(CC_PREFIX)" ""
1698         mkdir -p $(CURDIR)/debian/usr/bin
1699         ln -sf /usr/lib/gcc-snapshot/bin/$(CC_PREFIX)gcc $(CURDIR)/debian/usr/bin/gcc
1700         ln -sf /usr/lib/gcc-snapshot/bin/$(CC_PREFIX)g++ $(CURDIR)/debian/usr/bin/g++
1701         ln -sf /usr/lib/gcc-snapshot/bin/$(CC_PREFIX)gcj $(CURDIR)/debian/usr/bin/gcj
1702         ln -sf /usr/lib/gcc-snapshot/bin/$(CC_PREFIX)gij $(CURDIR)/debian/usr/bin/gij
1703     endif
1704   endif
1705 endif
1706
1707 ifneq "$(BUILD_ONLY_EN_US)" "y"
1708   ifneq "$(LANGPACKISOS)" "en-US"
1709         # copy and extract extra GSIs 
1710         #cp translation-updates-*/GSI*.sdf.* $(OOO_BUILD_TREE)/src
1711         find $(OOO_BUILD_TREE)/src -name "*.sdf.bz2" -exec bunzip2 -k \{\} \;
1712         for i in `find $(OOO_BUILD_TREE)/src/*.sdf.gz`; do gunzip -dc "$$i" > \
1713                 $(OOO_BUILD_TREE)/src/`basename $$i .gz`; done
1714         # work around broken stuff in the GSI breaking the build in svx
1715         for iso in lv sh-YU sr-CS; do \
1716           case " $(LANGPACKISOS) " in *\ $$iso\ *) ;; *) continue; esac; \
1717           [ -f $(OOO_BUILD_TREE)/src/GSI_$$iso.sdf ] || continue; \
1718           TMP=`mktemp -q`; \
1719           grep -v OOO_LICENSE $(OOO_BUILD_TREE)/src/GSI_$$iso.sdf \
1720             > $$TMP && mv $$TMP $(OOO_BUILD_TREE)/src/GSI_$$iso.sdf; \
1721         done
1722         # we change the message, and those translations therefore don't match anymore.
1723         for iso in $(LANGPACKISOS); do \
1724           [ -f $(OOO_BUILD_TREE)/src/GSI_$$iso.sdf ] || continue; \
1725           if [ "$$iso" = "ku" ]; then continue; fi; \
1726           TMP=`mktemp -q`; \
1727           grep -v ExtensionNotPresent\.src.*RID_STR_EXTENSION_NOT_PRESENT $(OOO_BUILD_TREE)/src/GSI_$$iso.sdf \
1728             > $$TMP && mv $$TMP $(OOO_BUILD_TREE)/src/GSI_$$iso.sdf; \
1729         done
1730     ifeq (he,$(findstring he,$(LANGPACKISOS)))
1731         # TKOS_BUILD_DATE is bogus, too
1732         if [ -f $(OOO_BUILD_TREE)/src/GSI_he.sdf ]; then \
1733          TMP=`mktemp -q`; \
1734          sed -e "s/TKOS_BUILD_DATE//g" < $(OOO_BUILD_TREE)/src/GSI_he.sdf \
1735            > $$TMP && mv $$TMP $(OOO_BUILD_TREE)/src/GSI_he.sdf ; \
1736         fi
1737     endif
1738     ifeq (da,$(findstring da,$(LANGPACKISOS)))
1739         if [ -f $(OOO_BUILD_TREE)/src/GSI_da.sdf ]; then \
1740           perl -pi -e 's/\s\(.*på engelsk\)//' $(OOO_BUILD_TREE)/src/GSI_da.sdf; \
1741         fi
1742     endif
1743     ifeq (es,$(findstring es,$(LANGPACKISOS)))
1744         if [ -f $(OOO_BUILD_TREE)/src/GSI_es.sdf ]; then \
1745           perl -pi -e 's/(.*SC_OPCODE_SUBSTITUTE.*)REEMPLAZAR(.*)/\1SUSTITUIR\2/' $(OOO_BUILD_TREE)/src/GSI_es.sdf; \
1746         fi
1747     endif
1748   endif
1749 endif
1750
1751         # Make convenience link
1752         if [ ! -L build ]; then ln -s $(SOURCE_TREE) build ; fi
1753
1754         # Make sure we have /proc mounted - otherwise idlc will fail later.
1755         test -r /proc/version
1756
1757         # hrmpf. Empty in ooo-build and patch does not give them to us but
1758         # configure need them. Create them...
1759         touch $(OOO_BUILD_TREE)/distro-configs/Win32.conf.in
1760         touch $(OOO_BUILD_TREE)/distro-configs/Solaris.conf.in
1761
1762         cd $(OOO_BUILD_TREE) ; \
1763                 PATH=$(BUILD_PATH) LD_LIBRARY_PATH=$(BUILD_LD_LIBRARY_PATH) ../$(OOO_BUILD_TREE)/configure $(CONFIGURE_FLAGS)
1764
1765         touch $@
1766
1767 build: $(STAMP_DIR)/build
1768 $(STAMP_DIR)/build: $(OOO_BUILD_TREE)/config.status
1769         dh_testdir
1770
1771 ifeq "$(BUILD_KDE)" "n"
1772         # hack to tell we want crystal icons nevertheless and they should be
1773         # extracted...
1774         if ! grep -q crystal $(OOO_BUILD_TREE)/bin/setup; then \
1775                 cp $(OOO_BUILD_TREE)/bin/setup $(OOO_BUILD_TREE)/bin/setup.bak && \
1776                 cat $(OOO_BUILD_TREE)/bin/setup.bak \
1777                         | sed -e s/\'industrial/\'industrial\ crystal/ \
1778                         > $(OOO_BUILD_TREE)/bin/setup && rm $(OOO_BUILD_TREE)/bin/setup.bak; \
1779         fi
1780 endif
1781
1782 ifeq ($(ON_BUILDD),y)
1783         cd $(OOO_BUILD_TREE) ; PATH=$(BUILD_PATH) LD_LIBRARY_PATH=$(BUILD_LD_LIBRARY_PATH) DEFAULT_TO_ENGLISH_FOR_PACKING=1 ARCH_FLAGS=$(ARCH_FLAGS) TMP=`mktemp -q -d` CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" $(MAKE) build
1784 else
1785         cd $(OOO_BUILD_TREE) ; PATH=$(BUILD_PATH) LD_LIBRARY_PATH=$(BUILD_LD_LIBRARY_PATH) DEFAULT_TO_ENGLISH_FOR_PACKING=1 VERBOSE=true ARCH_FLAGS=$(ARCH_FLAGS) TMP=`mktemp -q -d` CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" $(MAKE) build
1786 endif
1787
1788         # apparently setting this here globally doesn't work, so hack around.
1789         # If we don't do this we get loads of harmless, but log-bloating
1790         # warnings
1791         if ! grep fakeroot $(OOO_BUILD_TREE)/bin/setup; then \
1792                 perl -pi -e 's,LD_LIBRARY_PATH=\"(.*)\",LD_LIBRARY_PATH=\"/usr/lib/libfakeroot:\1\",' $(OOO_BUILD_TREE)/bin/setup; \
1793         fi
1794
1795         # DPKG is only set on with-EPM build what we don't do and the menu stuff
1796         # is only built wenn DPKG is set.. Same with PKGFORMAT.
1797         cd $(SOURCE_TREE)/sysui; \
1798                 . $(CURDIR)/$(SOURCE_TREE)/*Env*.sh; \
1799                 PATH=$(BUILD_PATH) DPKG="dpkg" PKGFORMAT="deb" NO_PKG_MANGLE=go-away \
1800                 ../solenv/bin/build.pl && ../solenv/bin/deliver.pl
1801
1802 ifeq "$(PACKAGE_SDK)" "y"
1803         # build gengal...
1804         cd $(SOURCE_TREE)/svx/source/gengal; \
1805                 . $(CURDIR)/$(SOURCE_TREE)/*Env*.sh; \
1806                 PATH=$(BUILD_PATH) \
1807                 dmake
1808 endif
1809
1810 ifneq (nocheck,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
1811         $(CURDIR)/debian/rules test
1812 endif
1813
1814         touch $@
1815
1816 test: 
1817         # some test library needed for the tests...
1818         if [ ! -f $(SOURCE_TREE)/test/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/lib/libtest.so ]; then \
1819                 cd $(SOURCE_TREE)/test && \
1820                         . $(CURDIR)/$(SOURCE_TREE)/*Env*.sh; \
1821                         export PATH=$(BUILD_PATH); \
1822                         ../solenv/bin/build.pl; \
1823                         ../solenv/bin/deliver.pl; \
1824         fi
1825 ifeq "$(RUN_SMOKETEST)" "y"
1826         # sigh. the new smoketest needs a archive/install/en-US/OOo_*_install_*.tar.gz
1827         # build it.
1828         if [ ! -d $(SOURCE_TREE)/instsetoo_native/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/OpenOffice/archive/install/en-US ]; then \
1829                 cd $(SOURCE_TREE)/instsetoo_native/util && \
1830                         . $(CURDIR)/$(SOURCE_TREE)/*Env*.sh; \
1831                         export PATH=$(BUILD_PATH); \
1832                         EPM=yes PKGFORMAT=archive WITH_LANG="en-US" dmake openoffice; \
1833         fi
1834         # smoketest
1835 ifeq "$(ARCH)" "armel"
1836         cd $(SOURCE_TREE)/smoketestoo_native && \
1837                 patch -p1 < $(CURDIR)/debian/smoketest/patches/smoketest-disable-db-insert-delete-seek-tests.diff
1838 endif
1839         cd $(SOURCE_TREE)/smoketestoo_native && \
1840                 . $(CURDIR)/$(SOURCE_TREE)/*Env*.sh; \
1841                 export PATH=$(BUILD_PATH); \
1842                 export TMPDIR=$(CURDIR)/debian/smoketest; \
1843                 export JAVA_HOME=$(TEST_JAVA_HOME); \
1844                 export SAL_USE_VCLPLUGIN="svp"; \
1845                 export HOME=$(CURDIR)/debian/smoketest; \
1846                  ../solenv/bin/build.pl
1847         # doesn't get cleaned up.. (at least the dirs, the contents are gone)
1848         cd $(CURDIR)/debian/smoketest && \
1849         find . -noleaf -maxdepth 1 ! -name "patches" ! -name "." -exec rm -rf {} \;
1850 ifeq "$(ARCH)" "armel"
1851         cd $(SOURCE_TREE)/smoketestoo_native && \
1852                 patch -p1 -R < $(CURDIR)/debian/smoketest/patches/smoketest-disable-db-insert-delete-seek-tests.diff
1853 endif
1854 endif
1855 ifeq "$(RUN_SUBSEQUENT_TESTS)" "y"
1856         cd $(SOURCE_TREE) && \
1857                 export PATH=$(BUILD_PATH); \
1858                 . $(CURDIR)/$(SOURCE_TREE)/*Env*.sh; \
1859                 chmod 755 solenv/bin/subsequenttests && \
1860                 solenv/bin/subsequenttests
1861 endif
1862
1863 install: $(STAMP_DIR)/install
1864 $(STAMP_DIR)/install: $(STAMP_DIR)/build
1865         dh_testdir
1866         dh_testroot
1867
1868         if [ -x /usr/bin/dh_prep ]; then dh_prep; else dh_clean -k; fi
1869         rm -f debian/*.install debian/*.dirs
1870
1871         # remove those for safety in case the languages might change on
1872         # testbuilds. then the /*/ in dh_installdocs in binary-* won't work
1873         # anymore (different dirs)
1874         rm -rf $(SOURCE_TREE)/instsetoo_native/util/LibreOffice
1875
1876         # install LibreOffice.
1877         # somehow in the installer LD_LIBRARY_PATH doesn't contain
1878         # /usr/lib/libfakeroot anymore, causiong loads of ERROR:'s from
1879         # ld.so. Set LD_PRELOAD to the full path here manually.
1880         cd $(SOURCE_TREE)/; \
1881                  . $(CURDIR)/$(SOURCE_TREE)/*Env*.sh; \
1882                  PATH=$(BUILD_PATH) \
1883                  LD_LIBRARY_PATH="/usr/lib/libfakeroot:$(BUILD_LD_LIBRARY_PATH)" \
1884                  LD_PRELOAD=/usr/lib/libfakeroot/libfakeroot-$(shell update-alternatives --query fakeroot | grep Value: | cut -d"-" -f2).so \
1885                  DESTDIR=$(CURDIR)/debian/tmp \
1886                  solenv/bin/ooinstall /$(OOBRANDDIR)
1887         # FIXME: Move here so that we don't rely on libreoffice-build here.
1888         # Would also obsolete disable-ooinstall-in-package-ooo.diff
1889         cd $(OOO_BUILD_TREE)/bin; \
1890                 export OODESTDIR=$(CURDIR)/debian/tmp; \
1891                 ./package-ooo
1892
1893         # prepare install/dir files for dh
1894         for i in `cd $(CURDIR)/debian/tmp/pkg; ls -1 | xargs`; do \
1895                 echo "$${i}/usr/* usr" > debian/$$i.install; \
1896                 if [ "$$i" = "libreoffice-common" ]; then \
1897                         echo "$${i}/etc/* etc" >> debian/$$i.install; \
1898                 fi; \
1899                 (cd debian/tmp/pkg/$$i; find . -type d | sed -e "s,\./,,") \
1900                         > debian/$$i.dirs; \
1901         done
1902
1903         # the english resources should be in -common
1904         cat debian/libreoffice-l10n-en-US.dirs >> debian/libreoffice-common.dirs
1905         cat debian/libreoffice-l10n-en-US.install >> debian/libreoffice-common.install
1906         rm -f debian/libreoffice-l10n-en-US.dirs debian/libreoffice-l10n-en-US.install
1907
1908         # fixup case (-l10n-pt-BR -> l10n-pt-br etc.)
1909         for iso in $(ISOS); do \
1910                 pkgiso=`echo $$iso | tr A-Z a-z`; \
1911                 if [ "$$iso" != "$$pkgiso" ]; then \
1912                         if [ "$$iso" != "en-US" -a \
1913                           -e debian/libreoffice-l10n-$$iso.dirs -a \
1914                           -e debian/libreoffice-l10n-$$iso.install ]; then \
1915                                 mv debian/libreoffice-l10n-$$iso.dirs \
1916                                         debian/libreoffice-l10n-$$pkgiso.dirs; \
1917                                 mv debian/libreoffice-l10n-$$iso.install \
1918                                         debian/libreoffice-l10n-$$pkgiso.install; \
1919                         fi; \
1920                         if [ -e debian/libreoffice-help-$$iso.dirs -a \
1921                           -e debian/libreoffice-help-$$iso.install ]; then \
1922                                 mv debian/libreoffice-help-$$iso.dirs \
1923                                         debian/libreoffice-help-$$pkgiso.dirs; \
1924                                 mv debian/libreoffice-help-$$iso.install \
1925                                         debian/libreoffice-help-$$pkgiso.install; \
1926                         fi; \
1927                 fi; \
1928         done
1929
1930         # fix up still sneaking in ./. They break dh_install (it installs
1931         # but wrongly complains about it as not-installed files)
1932         perl -pi -e 's,\./,,' debian/libreoffice$(VER)-common.install
1933         perl -pi -e 's,\./,,' debian/ure.install
1934
1935 ifneq "$(HELPISOS)" ""
1936         # remove non-packaged localized help. This a) saves space 
1937         # and b) we need this for the following dh_install as there will be
1938         # no .install files created and dh_install will warn/fail due
1939         # to non-installed files.
1940         for iso in $(filter-out en-US,$(LANGPACKISOS)); do \
1941                 if ! `echo $(HELPISOS) | grep -q $$iso` || [ "$$iso" = "sk" ] ; then \
1942                         pkgiso=`echo $$iso | tr A-Z a-z`; \
1943                         rm -rf debian/tmp/pkg/libreoffice-help-$$iso; \
1944                         rm -f debian/libreoffice-help-$$pkgiso.dirs; \
1945                         rm -f debian/libreoffice-help-$$pkgiso.install; \
1946                 fi; \
1947         done
1948 endif
1949
1950         # FIXME: Fix in ooo-build
1951         rm -rf debian/tmp/pkg/libreoffice-qa-tools
1952
1953         dh_installdirs -A
1954         dh_install -A --sourcedir=debian/tmp/pkg --fail-missing
1955
1956         rm -rf debian/tmp/pkg
1957
1958         # move help to /usr/share
1959         for iso in $(HELPISOS); do \
1960                 pkgiso=`echo $$iso | tr A-Z a-z`; \
1961                 if [ -e $(PKGDIR)-help-$$pkgiso/usr ]; then \
1962                         mv $(PKGDIR)-help-$$pkgiso/usr/lib \
1963                                 $(PKGDIR)-help-$$pkgiso/usr/share; \
1964                 fi; \
1965         done
1966
1967 ifeq (sk,$(findstring sk,$(HELPISOS)))
1968         # add fake sk help
1969         mkdir -p $(PKGDIR)-help-sk/$(shell echo $(OOBASISDIR) | sed -e s/lib/share/)/help
1970         ln -s cs \
1971                 $(PKGDIR)-help-sk/$(shell echo $(OOBASISDIR) | sed -e s/lib/share/)/help/sk
1972 endif
1973
1974 ifeq "$(ENABLE_JAVA)" "y"
1975         # move officebean.jar into -officebean (They will be moved out of -core
1976         # in the install-arch target). Do the /usr/share move here already
1977         mkdir -p $(PKGDIR)-core/$(shell echo $(OOBASISDIR) | sed -e s/lib/share/)/program/classes; \
1978         mv $(PKGDIR)-common/$(OODIR)/program/classes/officebean.jar \
1979                 $(PKGDIR)-core/$(shell echo $(OOBASISDIR) | sed -e s/lib/share/)/program/classes
1980         # fix the classpath
1981         jh_classpath --classpath="ridl.jar unoil.jar jurt.jar juh.jar" \
1982                 $(PKGDIR)-core/$(shell echo $(OOBASISDIR) | sed -e s/lib/share/)/program/classes/officebean.jar
1983         
1984   ifeq "$(PACKAGE_BASE)" "y"
1985         # move sdbc_hsqldb.jar into -base (do the move
1986         # to /usr/share/java here directly, we do it for the "rest"
1987         # later
1988         mkdir -p $(PKGDIR)-base/$(shell echo $(OOBASISDIR) | sed -e s/lib/share/)/program/classes; \
1989         mkdir -p $(PKGDIR)-base/$(OODIR)/program/classes; \
1990         mv $(PKGDIR)-common/$(OODIR)/program/classes/sdbc_hsqldb.jar \
1991                 $(PKGDIR)-base/$(shell echo $(OOBASISDIR) | sed -e s/lib/share/)/program/classes; \
1992         ln -s $(shell echo /$(OOBASISDIR) | sed -e s/lib/share/)/program/classes/sdbc_hsqldb.jar \
1993                 $(PKGDIR)-base/$(OODIR)/program/classes/sdbc_hsqldb.jar
1994
1995     ifeq (,$(filter hsqldb, $(SYSTEM_STUFF)))
1996         # we need this in -base. Otherwise we get unwanted package differences
1997         # in the unstable version and backports which might use internal hsqldb
1998         mkdir -p $(PKGDIR)-base/$(OODIR)/program/classes
1999         mv $(PKGDIR)-common/$(OODIR)/program/classes/hsqldb.jar \
2000                 $(PKGDIR)-base/$(OODIR)/program/classes
2001     endif
2002   else
2003         # remove sdbc_hsqldb.jar. otherwise ends up in -java-common
2004         rm -f $(PKGDIR)-common/$(OODIR)/program/classes/sdbc_hsqldb.jar
2005   endif
2006 endif
2007
2008 ifeq "$(ENABLE_MONO)" "y"
2009         mkdir -p $(PKGDIR)-core/$(OOBRANDDIR)/ure/lib; \
2010         mv $(PKGDIR)-common/$(OOBRANDDIR)/ure/lib/cli_uno_bridge.dll*  \
2011                 $(PKGDIR)-core/$(OOBRANDDIR)/ure/lib
2012         mv $(PKGDIR)-common/$(OOBRANDDIR)/ure/lib/mono_loader*.uno.so \
2013                 $(PKGDIR)-core/$(OOBRANDDIR)/ure/lib
2014         for i in `dh_listpackages | grep libuno-cli`; do \
2015                 if echo "$$i" | grep -q oootypes; then p=libreoffice-common; d=$(OODIR)/program; \
2016                 else p=ure; d=$(OOBRANDDIR)/ure/lib; fi; \
2017                 rm -rf debian/$$i && mkdir -p -m755 debian/$$i/usr/lib/cli/uno-`echo $$i | perl -pi -e 's/.*(\d.\d).*/$$1/'`; \
2018                 mv debian/$$p/$$d/`echo $$i | sed -e "s/libuno-//" | sed -e "s/-cil$$//" | sed -e "s/-/_/" | perl -pi -e 's/\d.\d//'`.dll \
2019                         debian/$$i/usr/lib/cli/uno-`echo $$i | perl -pi -e 's/.*(\d.\d).*/$$1/'`; \
2020                 mv debian/$$p/$$d/`echo $$i | sed -e "s/libuno-//" | sed -e "s/-cil$$//" | sed -e "s/-/_/" | perl -pi -e 's/\d.\d//'`.config \
2021                         debian/$$i/usr/lib/cli/uno-`echo $$i | perl -pi -e 's/.*(\d.\d).*/$$1/'`/`echo $$i | sed -e "s/libuno-//" | sed -e "s/-cil$$//" | sed -e "s/-/_/" | perl -pi -e 's/\d.\d//'`.dll.config; \
2022         ln -s `echo $$i | sed -e "s/libuno-//" | sed -e "s/-cil$$//" | sed -e "s/-/_/" | perl -pi -e 's/\d.\d//'`.dll.config \
2023                         debian/$$i/usr/lib/cli/uno-`echo $$i | perl -pi -e 's/.*(\d.\d).*/$$1/'`/`echo $$i | sed -e "s/libuno-//" | sed -e "s/-cil$$//" | sed -e "s/-/_/" | perl -pi -e 's/\d.\d//'`.config; \
2024                 mv debian/$$p/$$d/policy.*.`echo $$i | sed -e "s/libuno-//" | sed -e "s/-cil$$//" | sed -e "s/-/_/" | perl -pi -e 's/\d.\d//'`.dll \
2025                         debian/$$i/usr/lib/cli/uno-`echo $$i | perl -pi -e 's/.*(\d.\d).*/$$1/'`; \
2026         done
2027 endif
2028
2029         # remove eventually sneaked in .testtoolrc
2030         rm -f $(PKGDIR)-common/$(OODIR)/program/.testtoolrc
2031
2032 ifeq "$(BUILD_GTK)" "y"
2033         # Gtk quickstarter, so to -gtk (via -gnome)
2034         mkdir -p -m755 $(PKGDIR)-gnome/$(OOBRANDDIR)/share/xdg
2035         mv $(PKGDIR)-common/$(OOBRANDDIR)/share/xdg/qstart.desktop \
2036                 $(PKGDIR)-gnome/$(OOBRANDDIR)/share/xdg
2037         # gnome config stuff, should land in gnome upstream even but...
2038         mkdir -p $(PKGDIR)-gnome/$(OODIR)/share/registry
2039         mv $(PKGDIR)-common/$(OODIR)/share/registry/gnome.xcd \
2040                 $(PKGDIR)-gnome/$(OODIR)/share/registry
2041 endif
2042
2043 ifeq "$(PACKAGE_SDK)" "y"
2044         # move SDK documentation into own package
2045         rm -rf $(PKGDIR)-dev-doc
2046         mkdir -p $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev-doc
2047         mv $(PKGDIR)-dev/usr/share/doc/libreoffice \
2048                 $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev && \
2049         mv $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev/sdk/docs \
2050                 $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev
2051         mkdir -p $(PKGDIR)-dev-doc/$(OOSDKDIR)
2052         mv $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev/sdk/index.html \
2053                 $(PKGDIR)-dev-doc/$(OOSDKDIR)
2054         rm -f $(PKGDIR)-dev/$(OOSDKDIR)/index.html
2055         rm -rf $(PKGDIR)-dev/usr/share/doc/libreoffice \
2056                 $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev/sdk
2057         mv $(PKGDIR)-dev/$(OOSDKDIR)/examples \
2058                 $(PKGDIR)-dev-doc/$(OOSDKDIR)
2059 endif
2060
2061         # fixup ure-link symlink. The move is done in install-arch
2062         # but the link is in -common so we need to do it here.
2063         cd $(PKGDIR)-common/$(OOBASISDIR) && \
2064                 rm ure-link && ln -sf /$(OOUREDIR) ure-link
2065
2066 ifeq "$(ENABLE_EVO2)" "y"
2067         mkdir -p $(PKGDIR)-evolution/$(OODIR)/presets/database
2068         mv $(PKGDIR)-common/$(OODIR)/presets/database/evolocal.odb \
2069                 $(PKGDIR)-evolution/$(OODIR)/presets/database
2070 endif
2071
2072         find debian/tmp ! -perm -200 | xargs -r chmod u+w
2073
2074         touch $@
2075
2076 #
2077 # Generate maintainer scripts
2078 maintscripts: $(STAMP_DIR)/maintscripts
2079 $(STAMP_DIR)/maintscripts: $(wildcard debian/shell-lib*Env*.sh) $(wildcard debian/*.preinst.in) $(wildcard debian/*.postinst.in) $(wildcard debian/*.prerm.in) $(wildcard debian/*.postrm.in) debian/scripts/vars.$(ARCH) debian/control
2080         dh_testdir
2081
2082         rm -f debian/*.{pre,post}{inst,rm}
2083
2084         # generate maintainer scripts from *.in
2085         for PKG in $(PACKAGES); do \
2086           for FILE in postinst postrm preinst prerm triggers; do \
2087             MAINTSCRIPT=debian/$$PKG.$$FILE ; \
2088             if [ -e $$MAINTSCRIPT.in ]; then \
2089               sed -n '1,/^#INCLUDE_SHELL_LIB#$$/p' < $$MAINTSCRIPT.in | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' > $$MAINTSCRIPT; \
2090               if echo $(ARCH_DEP_PACKAGES) | grep -q $$PKG; then \
2091                 grep LIBSUFFIX debian/scripts/vars.$(ARCH) >> $$MAINTSCRIPT; \
2092                 grep PLATFORMID debian/scripts/vars.$(ARCH) >> $$MAINTSCRIPT; \
2093               fi; \
2094               echo "" >> $$MAINTSCRIPT; \
2095               if egrep -q "(add|remove|validate|sync)_extension" $$MAINTSCRIPT.in; then \
2096                  cat debian/shell-lib-extensions.sh >> $$MAINTSCRIPT; \
2097               fi; \
2098               if grep -q services_rdb $$MAINTSCRIPT.in; then \
2099                  cat debian/shell-lib-components.sh >> $$MAINTSCRIPT; \
2100               fi; \
2101               sed -n '/^#INCLUDE_SHELL_LIB#$$/,$$p' < $$MAINTSCRIPT.in | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >> $$MAINTSCRIPT; \
2102               perl -pi -e "s/\@LANGPACKISOS\@/$(LANGPACKISOS)/" $$MAINTSCRIPT; \
2103               perl -pi -e "s,\@OODIR\@,$(OODIR),g" $$MAINTSCRIPT; \
2104               perl -pi -e "s,\@OOBRANDDIR\@,$(OOBRANDDIR),g" $$MAINTSCRIPT; \
2105               perl -pi -e "s,\@OOBASISDIR\@,$(OOBASISDIR),g" $$MAINTSCRIPT; \
2106               perl -pi -e "s/\@VER\@/$(VER)/g" $$MAINTSCRIPT; \
2107             fi; \
2108           done; \
2109         done
2110
2111         touch $@
2112
2113 # Install files generated by setup into package directories
2114 langpacks: $(STAMP_DIR)/langpacks
2115 $(STAMP_DIR)/langpacks: $(STAMP_DIR)/install $(STAMP_DIR)/install-indep $(OOO_BUILD_TREE)/bin/openoffice-xlate-lang
2116
2117         # remove empty uno_packages dirs somehow in the langpacks(?)
2118         for iso in `echo $(LANGPACKISOS) | tr A-Z a-z`; do \
2119                 rm -rf $(PKGDIR)-l10n-$$iso/$(OODIR)/share/uno_packages; \
2120         done
2121
2122         # remove ooo dirs somehow in the langpacks(?)
2123         for iso in `echo $(LANGPACKISOS) | tr A-Z a-z`; do \
2124                 rm -rf $(PKGDIR)-l10n-$$iso/$(OODIR)/share/dict/ooo; \
2125         done
2126
2127         # remove extra license files
2128         for iso in `echo $(LANGPACKISOS) | tr A-Z a-z`; do \
2129                 rm -rf $(PKGDIR)-l10n-$$iso/$(OOBRANDDIR)/licenses; \
2130                 rm -f $(PKGDIR)-l10n-$$iso/$(OOBRANDDIR)/share/readme/LICENSE*; \
2131         done
2132
2133         # remove extra readme files
2134         for iso in `echo $(LANGPACKISOS) | tr A-Z a-z`; do \
2135                 rm -rf $(PKGDIR)-l10n-$$iso/$(OOBRANDDIR)/readmes; \
2136                 rm -f $(PKGDIR)-l10n-$$iso/$(OOBRANDDIR)/share/readme/README*; \
2137         done
2138
2139         # remove empty help directories
2140         for iso in `echo $(LANGPACKISOS) | tr A-Z a-z`; do \
2141                 rm -rf $(PKGDIR)-l10n-$$iso/$(shell echo $(OODIR) | sed -e s/lib/share/)/help; \
2142                 rm -rf $(PKGDIR)-l10n-$$iso/$(OODIR)/help; \
2143         done
2144
2145         # install technical.dic
2146         for iso in $(LANGPACKISOS); do \
2147                 if [ "$$iso" = "en-US" ]; then pkg=common; else pkg=l10n-`echo $$iso | tr A-Z a-z`; fi; \
2148                 mkdir -p $(PKGDIR)-$$pkg/$(OODIR)/share/wordbook/$$iso; \
2149                 install -m644 $(SOURCE_TREE)/extras/source/wordbook/technical.dic \
2150                         $(PKGDIR)-$$pkg/$(OODIR)/share/wordbook/$$iso/technical.dic; \
2151         done
2152
2153         # replace duplicate files in the langpacks with symlinks
2154         TMP=`mktemp -q`; \
2155                 fdupes --quiet --recurse --sameline --size \
2156                 debian/libreoffice$(VER)-common/$(OODIR) \
2157                 $(foreach d,$(shell echo $(filter-out en-US,$(LANGPACKISOS)) | tr A-Z a-z),debian/libreoffice$(VER)-l10n-$(d)/$(OODIR)) \
2158                 > $$TMP && \
2159         debian/scripts/cleandupes --base=libreoffice$(VER) --prefix=debian < $$TMP && rm -f $$TMP
2160
2161 ifeq "$(DIST)" "Debian"
2162         # install Debian presentation template
2163         otps=`cd debian/templates; echo *.otp`; \
2164         for iso in $(LANGPACKISOS); do \
2165           [ "$$iso" = "en-US" ] && continue; \
2166           pkgiso=`echo $$iso | tr \[:upper:\] \[:lower:\]`; \
2167           mkdir -p $(PKGDIR)-l10n-$$pkgiso/$(OODIR)/share/template/$$iso/presnt; \
2168           for otp in $$otps; do \
2169             ln -sf ../../en-US/presnt/$$otp \
2170             $(PKGDIR)-l10n-$$pkgiso/$(OODIR)/share/template/$$iso/presnt/$$odt; \
2171           done; \
2172         done
2173 endif
2174
2175 ifeq (pt-BR,$(findstring pt-BR,$(LANGPACKISOS)))
2176         # move pt-BR ("BrOffice") splashs into -l10n-pt-br
2177         mkdir -p $(PKGDIR)-l10n-pt-br/$(OOBRANDDIR)/program
2178         mv $(PKGDIR)-common/$(OOBRANDDIR)/program/intro-pt_BR.png \
2179                 $(PKGDIR)-l10n-pt-br/$(OOBRANDDIR)/program/intro-pt_BR.png
2180         mv $(PKGDIR)-common/$(OOBRANDDIR)/program/about-pt_BR.png \
2181                 $(PKGDIR)-l10n-pt-br/$(OOBRANDDIR)/program/about-pt_BR.png
2182 else
2183         # remove them, unneeded and would gerate file conflicts
2184         rm -f $(PKGDIR)-common/$(OOBRANDDIR)/program/intro-pt_BR.png
2185         rm -f $(PKGDIR)-common/$(OOBRANDDIR)/program/about-pt_BR.png
2186 endif
2187
2188 ifeq (he,$(findstring he,$(LANGPACKISOS)))
2189         perl -pi -e 's#<prop oor:name="CTLSequenceChecking"><value>true</value></prop>#<prop oor:name="CTLSequenceChecking"><value>false</value></prop>#' $(PKGDIR)-l10n-he/$(OOBASISDIR)/share/registry/ctl_he.xcd
2190 endif
2191
2192         touch $@
2193
2194 native-jars: $(STAMP_NATIVE_JARS)
2195 $(STAMP_NATIVE_JARS): $(STAMP_DIR)/install
2196 ifeq "$(BUILD_JARS_NATIVE)" "y"
2197         rm -rf debian/tmp/native-jars
2198         mkdir -p debian/tmp/native-jars/gcj
2199         cp -a \
2200             $(PKGDIR)-common/$(OOBASISDIR)/program/classes/*.jar \
2201                 debian/tmp/native-jars/
2202         cp -a \
2203             $(PKGDIR)-core/$(shell echo $(OOBASISDIR) | sed -e s/lib/share/)/program/classes/*.jar \
2204                 debian/tmp/native-jars/
2205 ifeq "$(PACKAGE_BASE)" "y"
2206         cp -a \
2207             $(PKGDIR)-base/$(OODIR)/program/classes/*.jar \
2208                 debian/tmp/native-jars/
2209 endif
2210         : # remove problematic ones
2211         rm -f debian/tmp/native-jars/ridl.jar
2212 ifneq "$(USE_SYSTEM_SAXON)" "y"
2213         rm -f debian/tmp/native-jars/saxon9.jar
2214 endif
2215         : # compile the others
2216         # the Debian i386 buildd, although having much ram still OOMs without
2217         # this (at unoil.jar).
2218         # Also the native jar build is MUCH faster with this. But it
2219         # won't be accepted into the official java-gcj-compat package so this
2220         # hack here is needed.
2221         if [ -e /usr/lib/gcc/aotcompile.py ]; then \
2222                 aotcompile_py=/usr/lib/gcc/aotcompile.py; \
2223         elif [ -e /usr/share/pyshared/aotcompile.py ]; then \
2224                 aotcompile_py=/usr/share/pyshared/aotcompile.py; \
2225         fi && \
2226         cp $$aotcompile_py debian/scripts
2227         cd debian/scripts && \
2228                 patch -p0 < $(CURDIR)/debian/aotcompile-256M-default.diff
2229         PYTHONPATH="debian/scripts:$(shell echo $(PYTHON_SITE) | sed -e s,debian/python-uno,,)" \
2230         AOT_MAKEFLAGS=-j$(NUM_CPUS) aot-compile -L /usr/lib/gcj/$(OODIRNAME) \
2231             debian/tmp/native-jars debian/tmp/native-jars/gcj
2232         gcj-dbtool -n debian/tmp/native-jars/tmp.db 64
2233         find debian/tmp/native-jars/gcj -name '*.db' -print0 \
2234             | xargs -r -0 \
2235                 gcj-dbtool -m debian/tmp/native-jars/tmp.db debian/tmp/native-jars/tmp.db || exit 1
2236         rm -f debian/tmp/native-jars/gcj/*.db
2237 endif
2238         touch $@
2239
2240 # Install files generated by setup into arch-dependent package directories
2241 install-arch: $(STAMP_DIR)/install-arch
2242 $(STAMP_DIR)/install-arch: $(STAMP_DIR)/install $(STAMP_NATIVE_JARS)
2243         dh_testdir
2244         dh_testroot
2245         umask 022
2246
2247         # move the URE to /usr/lib/ure
2248         mv debian/ure/$(OOBRANDDIR)/ure debian/ure/usr/lib
2249         rmdir debian/ure/$(OOBRANDDIR)
2250         # move URE Java stuff to /usr/share/java
2251         mkdir -p debian/ure/usr/share/java
2252 ifeq "$(ENABLE_JAVA)" "y"
2253         mv debian/ure/$(OOUREDIR)/share/java/* \
2254                 debian/ure/usr/share/java
2255         cd debian/ure/$(OOUREDIR)/share/java && \
2256                 for i in $(CURDIR)/debian/ure/usr/share/java/*.jar; do \
2257                         ln -sf `echo $$i | sed -e 's,$(CURDIR)/debian/ure,,'` `basename $$i`; \
2258                 done
2259         # fix up Class-Path of jurt.jar to be able to find libjpipe.so.
2260         # See See http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=27765
2261         jh_classpath --classpath="ridl.jar unoloader.jar ../../lib /$(OOUREDIR)/lib/ ../bin/" \
2262                 $(CURDIR)/debian/ure/usr/share/java/jurt.jar
2263 endif
2264         # and the public libs to uno-libs3
2265         mkdir -p debian/uno-libs3/$(OOUREDIR)/lib
2266         for i in debian/ure/$(OOUREDIR)/lib/libuno_*so.3; do \
2267                 mv $$i debian/uno-libs3/$(OOUREDIR)/lib; \
2268                 ln -sf /$(OOUREDIR)/lib/`basename $$i` debian/uno-libs3/usr/lib/`basename $$i`; \
2269         done
2270
2271 ifeq "$(BUILD_KDE)" "y"
2272         mkdir -p -m755 $(PKGDIR)-kde/$(OODIR)/program
2273         mkdir -p -m755 $(PKGDIR)-kde/$(OOBRANDDIR)/program
2274         for f in fps_kde*.uno.so libvclplug_kde*.so; do \
2275           mv $(PKGDIR)-core/$(OODIR)/program/$$f $(PKGDIR)-kde/$(OODIR)/program || exit 1 ;\
2276         done
2277
2278         # install files for KDEs "create new" ...
2279         mkdir -p $(PKGDIR)-kde/usr/share/templates/.source
2280         for i in $(SOURCE_TREE)/extras/source/shellnew/*; do \
2281                 cp $$i $(PKGDIR)-kde/usr/share/templates/.source/`basename $$i`; \
2282         done
2283         cat debian/templates/soffice-template.desktop.in \
2284                 | sed -e "s/@APP@/Writer/" \
2285                 | sed -e "s/@EXT@/odt/" \
2286                 | sed -e "s/@TYPE@/text/" \
2287                 > $(PKGDIR)-kde/usr/share/templates/soffice.odt.desktop
2288         cat debian/templates/soffice-template.desktop.in \
2289                 | sed -e "s/@APP@/Calc/" \
2290                 | sed -e "s/@EXT@/ods/" \
2291                 | sed -e "s/@TYPE@/spreadsheet/" \
2292                 > $(PKGDIR)-kde/usr/share/templates/soffice.ods.desktop
2293         cat debian/templates/soffice-template.desktop.in \
2294                 | sed -e "s/@APP@/Impress/" \
2295                 | sed -e "s/@EXT@/odp/" \
2296                 | sed -e "s/@TYPE@/presentation/" \
2297                 > $(PKGDIR)-kde/usr/share/templates/soffice.odp.desktop
2298         cat debian/templates/soffice-template.desktop.in \
2299                 | sed -e "s/@APP@/Draw/" \
2300                 | sed -e "s/@EXT@/odg/" \
2301                 | sed -e "s/@TYPE@/drawing/" \
2302                 > $(PKGDIR)-kde/usr/share/templates/soffice.odg.desktop
2303 endif
2304 ifeq "$(ENABLE_KDEAB)" "y"
2305         rm -rf $(PKGDIR)-kab
2306         mkdir -p -m755 $(PKGDIR)-kab/$(OODIR)/program
2307         for f in libkab*so; do \
2308           mv $(PKGDIR)-core/$(OODIR)/program/$$f $(PKGDIR)-kab/$(OODIR)/program || exit 1 ;\
2309         done
2310         mkdir -p $(PKGDIR)-kab/$(OODIR)/registered-components
2311         install -m644 $(SOURCE_TREE)/solver/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$UPD/$$OUTPATH$$PROEXT)/xml/kab1.component \
2312                 $(PKGDIR)-kab/$(OODIR)/registered-components/kab1.component
2313 endif
2314
2315         # move the GNOME stuff which are *not* in gid_Module_Optional_Gnome
2316         # (which is moved into -gnome in package-ooo) into -gnome
2317         mkdir -p -m755 $(PKGDIR)-gnome/$(OODIR)/program
2318         mv $(PKGDIR)-core/$(OODIR)/program/gnome-open-url.bin $(PKGDIR)-gnome/$(OODIR)/program || exit 1
2319 ifeq "$(BUILD_GTK)" "y"
2320         for f in fps_gnome.uno.so libvclplug_gtk*.so; do \
2321           mv $(PKGDIR)-core/$(OODIR)/program/$$f $(PKGDIR)-gnome/$(OODIR)/program || exit 1;\
2322         done
2323         mv $(PKGDIR)-core/$(OODIR)/program/libqstart_gtk* $(PKGDIR)-gnome/$(OODIR)/program || exit 1
2324 endif
2325
2326         # split out gtk stuff
2327         rm -rf $(PKGDIR)-gtk
2328         mkdir -p -m755 $(PKGDIR)-gtk/$(OODIR)/program
2329         mv $(PKGDIR)-gnome/$(OODIR)/program/* $(PKGDIR)-gtk/$(OODIR)/program/
2330         mkdir -p -m755 $(PKGDIR)-gtk/$(OOBRANDDIR)/share
2331 ifeq "$(BUILD_GTK)" "y"
2332         mv $(PKGDIR)-gnome/$(OOBRANDDIR)/share/xdg $(PKGDIR)-gtk/$(OOBRANDDIR)/share && \
2333                 rmdir $(PKGDIR)-gnome/$(OOBRANDDIR)/share
2334   ifeq "$(ENABLE_GIO)" "y"
2335         mv $(PKGDIR)-gtk/$(OODIR)/program/ucpgio1.uno.so \
2336                 $(PKGDIR)-gnome/$(OODIR)/program/
2337   endif
2338   ifeq "$(ENABLE_GVFS)" "y"
2339         mv $(PKGDIR)-gtk/$(OODIR)/program/ucpgvfs1.uno.so \
2340                 $(PKGDIR)-gnome/$(OODIR)/program/
2341   endif
2342   ifeq "$(ENABLE_GCONF)" "y"
2343         mv $(PKGDIR)-core/$(OODIR)/program/gconfbe* \
2344                 $(PKGDIR)-gnome/$(OODIR)/program
2345   endif
2346 endif
2347
2348 ifeq "$(ENABLE_EVO2)" "y"
2349         mkdir -p -m755 $(PKGDIR)-evolution/$(OODIR)/program
2350         mv $(PKGDIR)-core/$(OODIR)/program/libevoab*.so $(PKGDIR)-evolution/$(OODIR)/program
2351         mkdir -p $(PKGDIR)-evolution/$(OODIR)/registered-components
2352         install -m644 $(SOURCE_TREE)/solver/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$UPD/$$OUTPATH$$PROEXT)/xml/evoab.component \
2353                 $(PKGDIR)-evolution/$(OODIR)/registered-components/evoab.component
2354 endif
2355
2356 ifeq "$(BUILD_BINFILTERS)" "y"
2357         mkdir -p $(PKGDIR)-filter-binfilter/$(OODIR)/registered-components
2358         for i in bf_migratefilter bindet; do \
2359                 install -m644 $(SOURCE_TREE)/solver/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$UPD/$$OUTPATH$$PROEXT)/xml/$$i.component \
2360                 $(PKGDIR)-filter-binfilter/$(OODIR)/registered-components/$$i.component; \
2361         done
2362 endif
2363
2364 ifeq "$(PACKAGE_NPSOPLUGIN)" "y"
2365         # libnpsoplugins.so two times with different sizes? Oh my.
2366         # Upstream has it this way, too, but..
2367         mkdir -p -m755 debian/mozilla-libreoffice$(VER)/$(OODIR)/program
2368         mkdir -p -m755 debian/mozilla-libreoffice$(VER)/$(OOBRANDDIR)/program
2369         for f in libnpsoplugin.so nsplugin; do \
2370                 mv $(PKGDIR)-core/$(OODIR)/program/$$f debian/mozilla-libreoffice$(VER)/$(OODIR)/program; \
2371         done
2372         mv $(PKGDIR)-core/$(OOBRANDDIR)/program/libnpsoplugin.so debian/mozilla-libreoffice$(VER)/$(OOBRANDDIR)/program
2373         cd debian/mozilla-libreoffice$(VER) && \
2374                 mkdir -p usr/lib/mozilla/plugins && \
2375                         ln -sf /$(OOBRANDDIR)/program/libnpsoplugin.so \
2376                            usr/lib/mozilla/plugins/libnpsoplugin.so
2377 else
2378         rm -f $(PKGDIR)-core/$(OODIR)/program/libnpsoplugin.so
2379         rm -f $(PKGDIR)-core/$(OODIR)/program/nsplugin
2380 endif
2381
2382         # OOo's package split sucks...
2383         mv $(PKGDIR)-core/$(OODIR)/program/libsw* \
2384                 $(PKGDIR)-writer/$(OODIR)/program
2385         mv $(PKGDIR)-core/$(OODIR)/program/libsd$(LIBSUFFIX)* \
2386            $(PKGDIR)-core/$(OODIR)/program/libsdd* \
2387            $(PKGDIR)-core/$(OODIR)/program/libsdui* \
2388            $(PKGDIR)-core/$(OODIR)/program/libsdfilt* \
2389                 $(PKGDIR)-draw/$(OODIR)/program
2390         mv $(PKGDIR)-core/$(OODIR)/program/slideshow.uno.so \
2391                 $(PKGDIR)-impress/$(OODIR)/program
2392         mkdir -p -m755 $(PKGDIR)-base/$(OODIR)/program
2393         mv $(PKGDIR)-core/$(OODIR)/program/libdba* \
2394                 $(PKGDIR)-base/$(OODIR)/program
2395         # except for libdba680l?.so itself
2396         rm -rf $(PKGDIR)-base-core
2397         mkdir -p $(PKGDIR)-base-core/$(OODIR)/program
2398         mv $(PKGDIR)-base/$(OODIR)/program/libdba$(LIBSUFFIX).so \
2399                  $(PKGDIR)-base-core/$(OODIR)/program
2400         for i in odbcbase dbpool2 odbc sdbc2 mysql adabas; do \
2401                 mv $(PKGDIR)-core/$(OODIR)/program/lib$$i* \
2402                    $(PKGDIR)-base/$(OODIR)/program; \
2403         done
2404 ifeq "$(ENABLE_JAVA)" "y"
2405         for i in jdbc hsqldb; do \
2406                 mv $(PKGDIR)-core/$(OODIR)/program/lib$$i* \
2407                    $(PKGDIR)-base/$(OODIR)/program; \
2408         done
2409 endif
2410         mv $(PKGDIR)-core/$(OODIR)/program/libflat*so \
2411                 $(PKGDIR)-base/$(OODIR)/program
2412         # http://www.openoffice.org/issues/show_bug.cgi?id=107779
2413         mv $(PKGDIR)-calc/$(OODIR)/program/libcalc*so \
2414                 $(PKGDIR)-base/$(OODIR)/program; \
2415
2416         # linked (amongst others) to libsc*
2417         mv $(PKGDIR)-core/$(OODIR)/program/vbaobj*uno.so \
2418                         $(PKGDIR)-calc/$(OODIR)/program
2419         # linked (amongst others) to libsw*
2420         mv $(PKGDIR)-core/$(OODIR)/program/vbaswobj*uno.so \
2421                         $(PKGDIR)-writer/$(OODIR)/program
2422
2423 ifeq "$(ENABLE_JAVA)" "y"
2424   ifneq (,$(filter hsqldb, $(SYSTEM_STUFF)))
2425         # link to system hsqldb
2426         mkdir -p $(PKGDIR)-base/$(OODIR)/program/classes
2427         ln -sf /usr/share/java/hsqldb.jar \
2428                 $(PKGDIR)-base/$(OODIR)/program/classes/hsqldb.jar
2429   endif
2430 endif
2431
2432 ifeq "$(ENABLE_JAVA)" "y"
2433         rm -rf $(PKGDIR)-officebean
2434         mkdir -p -m755 $(PKGDIR)-officebean/$(OODIR)/program/classes
2435         mkdir -p -m755 $(PKGDIR)-officebean/$(shell echo $(OOBASISDIR) | sed -e s/lib/share/)/program/classes
2436         mv $(PKGDIR)-core/$(shell echo $(OOBASISDIR) | sed -e s/lib/share/)/program/classes/officebean.jar \
2437                 $(PKGDIR)-officebean/$(shell echo $(OOBASISDIR) | sed -e s/lib/share/)/program/classes
2438         ln -s $(shell echo /$(OOBASISDIR) | sed -e s/lib/share/)/program/classes/officebean.jar \
2439                  $(PKGDIR)-officebean/$(OODIR)/program/classes/officebean.jar
2440         mv $(PKGDIR)-core/$(OODIR)/program/libofficebean.so \
2441                 $(PKGDIR)-officebean/$(OODIR)/program
2442 endif
2443
2444         mkdir -p -m755 $(PKGDIR)-base/usr/share/applications \
2445                        $(PKGDIR)-core/usr/share/applications
2446
2447 ifeq "$(USE_OOO_BUILD_DESKTOPS)" "n"
2448         # menu files from sysui
2449         dirname="`cd $(SOURCE_TREE)/sysui/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/misc/desktopshare >/dev/null; pwd`" ;\
2450         for p in writer calc impress draw math base; do \
2451                 mkdir -p -m755 $(PKGDIR)-$$p/usr/share/applications ;\
2452                 sed -e 's,Exec=$${UNIXBASISROOTNAME} \(.*\) %U,Exec=libreoffice$(VER) \1 %U,' \
2453                     -e 's,Icon=$${WITHOUTDOTUNIXPRODUCTNAME},Icon=libreoffice,' \
2454                     -e 's,Name=$${PRODUCTNAME} $${PRODUCTVERSION},Name=LibreOffice $(VER),' \
2455                     -e 's,Name\[pt_BR\]=$${PRODUCTNAME_BR} $${PRODUCTVERSION},Name[pt_BR]=BrOffice $(VER),' \
2456                     -e 's/  / /' \
2457                    < $$dirname/$$p.desktop \
2458                    > $(PKGDIR)-$$p/usr/share/applications/libreoffice$(VER)-$$p.desktop || exit 1 ;\
2459         done
2460   ifeq (tr,$(findstring tr,$(LANGPACKISOS)))
2461         sed -i 's,Comment\[tr\]=$${PRODUCTNAME} $${PRODUCTVERSION},Comment[tr]=LibreOffice $(VER),' \
2462                 $(PKGDIR)-calc/usr/share/applications/libreoffice$(VER)-calc.desktop
2463   endif
2464   ifeq (da,$(findstring da,$(LANGPACKISOS)))
2465         sed -i 's,Comment\[da\]=$${PRODUCTNAME} $${PRODUCTVERSION},Comment[da]=LibreOffice $(VER),' \
2466                 $(PKGDIR)-writer/usr/share/applications/libreoffice$(VER)-writer.desktop
2467   endif
2468   ifeq "$(BUILD_GTK)" "y"
2469         # qstart.desktop is different to the above. Should be handled by
2470         # --with-unix-wrapper of ooo-build but that somehow doesn't work as
2471         # expected. FIXME.
2472         PRODUCTVERSION=`grep PRODUCTVERSION $(SOURCE_TREE)/sysui/desktop/productversion.mk | head -n 1 | cut -d"=" -f2 | sed -e s/\ //g`; \
2473         sed -i -e "s,Exec=libreoffice$$PRODUCTVERSION,Exec=ooffice$(VER)," \
2474                 -e "s,Name=LibreOffice $$PRODUCTVERSION,Name=LibreOffice $(VER)," \
2475                 -e "s/  / /" \
2476                 $(PKGDIR)-gtk/$(OOBRANDDIR)/share/xdg/qstart.desktop
2477   endif
2478         # we don't need the share/xdgs except qstart
2479         for f in `find debian -name '*.desktop' | grep xdg | grep -v qstart`; do \
2480                 rm -f $$f; done
2481         for f in `find debian -name '*.desktop' ! -name "*soffice.od*"`; do \
2482                 sed -i -e '/^Comment\[de\]/s/- *\([a-zA-Z0-9]*\) *macht.*glich.*$$/mit \1/' $$f; \
2483                 if ! grep -q X-KDE-Protocols $$f; then \
2484                         echo 'X-KDE-Protocols=file,http,smb,ftp,webdav' >> $$f; \
2485                 fi; \
2486         done
2487         sed -i -e 's/Office;/Office;Graphics;/' $(PKGDIR)-draw/usr/share/applications/libreoffice$(VER)-draw.desktop
2488         # invalid, according to lintian. make it shut up.
2489         for i in writer calc impress draw math base; do \
2490                 perl -pi -e 's/Application;//; s/X-Red-Hat-Base;//; s/X-SuSE-Core-Office;//; s/X-MandrivaLinux-.*;//;' $(PKGDIR)-$$i/usr/share/applications/libreoffice$(VER)-$$i.desktop; \
2491         done
2492         perl -pi -e 's/Application;//' $(PKGDIR)-gtk/$(OOBRANDDIR)/share/xdg/qstart.desktop
2493 else
2494         # menu files from $(OOO_BUILD_TREE)/desktop
2495         for p in writer calc impress draw math base; do \
2496                 mkdir -p -m755 $(PKGDIR)-$$p/usr/share/applications ;\
2497                         sed -e '/^TryExec=.*/d' \
2498                             -e "s,^Exec=.*,Exec=ooffice$(VER) -$$p %U," \
2499                             -e "s,^Icon=.*,Icon=ooo-$$p," \
2500                             -e '/^Name=/s,  , ,' \
2501                             -e 's/@STARTUPNOTIFY@/true/' \
2502                             -e '/^Categories/s/Office/Application;Office/' \
2503                                 $(OOO_BUILD_TREE)/desktop/$$p.desktop \
2504                                 > $(PKGDIR)-$$p/usr/share/applications/libreoffice$(VER)-$$p.desktop || exit 1 ;\
2505         done
2506 endif
2507         # add version to .menu and .lintian-overrides
2508         for i in base calc draw impress math writer; do \
2509                 cat debian/libreoffice$(VER)-$$i.menu.in \
2510                         | sed -e s/@VER@/$(VER)/ \
2511                         | sed -e s,@ICONVERSION@,$(shell echo $(OOVER) | sed -e "s/\.//g"), \
2512                         > debian/libreoffice$(VER)-$$i.menu; \
2513         done; \
2514         for i in base calc core draw impress math writer; do \
2515                 cat debian/libreoffice$(VER)-$$i.lintian-overrides.in \
2516                         | sed -e s/@VER@/$(VER)/ \
2517                         | sed -e s/@BASIS_VERSION@/$(BASIS_VERSION)/ \
2518                         > debian/libreoffice$(VER)-$$i.lintian-overrides; \
2519         done
2520
2521 ifeq "$(BUILD_PYUNO)" "y"
2522         # PyUNO packaging
2523         install -d $(PYTHON_SITE)
2524         mv debian/python-uno/$(OODIR)/program/uno.py $(PYTHON_SITE)
2525         mv debian/python-uno/$(OODIR)/program/unohelper.py $(PYTHON_SITE)
2526         touch debian/python-uno/$(OODIR)/program/pythonloader.unorc
2527         chmod u+w debian/python-uno/$(OODIR)/program/pythonloader.unorc
2528         ( echo '[Bootstrap]'; \
2529           echo 'PYTHONHOME=file:///usr/lib/python$(PYMAJOR).$(PYMINOR)' ;\
2530           echo 'PYTHONPATH=$$PYTHONHOME $$PYTHONHOME/site-packages $$PYTHONHOME/lib-dynload $$PYTHONHOME/lib-tk $$ORIGIN' \
2531         ) > debian/python-uno/$(OODIR)/program/pythonloader.unorc
2532         chmod u-w debian/python-uno/$(OODIR)/program/pythonloader.unorc
2533   ifeq "$(ENABLE_SCRIPT_PROVIDER_PYTHON)" "y"
2534         mkdir -p debian/python-uno/$(OOBRANDDIR)/share/extensions
2535         mv debian/tmp/$(OOBRANDDIR)/share/extensions/script-provider-for-python \
2536                 debian/python-uno/$(OOBRANDDIR)/share/extensions
2537         rm -f debian/python-uno/$(OOBRANDDIR)/share/extensions/script-provider-for-python/registration/LICENSE
2538   endif
2539
2540         mkdir -p debian/python-uno/usr/share/doc/python-uno
2541         cp -r $(SOURCE_TREE)/pyuno/demo \
2542           debian/python-uno/usr/share/doc/python-uno; \
2543         for i in $(SOURCE_TREE)/pyuno/doc/*; do \
2544                 cp $$i debian/python-uno/usr/share/doc/python-uno; \
2545         done
2546         cd debian/python-uno/usr/share/doc/python-uno && \
2547                 find . -type d -name "CVS" | xargs -r rm -rf
2548 endif
2549
2550 ifeq "$(ENABLE_MONO)" "y"
2551         # Mono bindings
2552         mkdir -p -m755 debian/cli-uno-bridge/$(OOUREDIR)/lib
2553         mv $(PKGDIR)-core/$(OOBRANDDIR)/ure/lib/cli_uno_bridge.dll \
2554                 debian/cli-uno-bridge/$(OOUREDIR)/lib
2555         mv $(PKGDIR)-core/$(OOBRANDDIR)/ure/lib/mono_loader*.uno.so \
2556                 debian/cli-uno-bridge/$(OOUREDIR)/lib
2557
2558         mv debian/ure/$(OOUREDIR)/lib/libcli* \
2559                 debian/cli-uno-bridge/$(OOUREDIR)/lib
2560         mkdir -p debian/cli-uno-bridge/usr/lib/pkgconfig
2561         cat debian/tmp/usr/lib/pkgconfig/mono-$(OODIRNAME).pc \
2562                 | sed -e s,/usr/lib/mono/openoffice,/usr/lib/cli/uno-1.0,g \
2563                 | sed -e s,/usr/lib/cli/uno-1.0/cli_uno_bridge.dll,/$(OOUREDIR)/lib/cli_uno_bridge.dll, \
2564                 > debian/cli-uno-bridge/usr/lib/pkgconfig/mono-$(OODIRNAME).pc
2565 endif
2566
2567         # should be empty now, remove if there
2568         rm -rf $(PKGDIR)-core/$(OOBRANDDIR)/ure
2569
2570 ifeq "$(PACKAGE_SDK)" "y"
2571   ifeq "$(ENABLE_JAVA)" "y"
2572         # move SDK Java stuff into /usr/share/java
2573         rm -f $(PKGDIR)-dev/$(OOSDKDIR)/classes
2574         mkdir -p $(PKGDIR)-dev/$(shell echo $(OOSDKDIR) | sed -e s/lib/share/)/classes/win
2575         mkdir -p $(PKGDIR)-dev/$(OOSDKDIR)/classes/win
2576         mkdir -p $(PKGDIR)-dev/$(OOSDKDIR)/classes/com/sun/star/lib/loader
2577         mkdir -p $(PKGDIR)-dev/$(shell echo $(OOSDKDIR) | sed -e s/lib/share/)/classes/com/sun/star/lib/loader
2578         mv $(PKGDIR)-dev/usr/share/libreoffice/sdk/classes/com/sun/star/lib/loader/* \
2579                 $(PKGDIR)-dev/$(shell echo $(OOSDKDIR) | sed -e s/lib/share/)/classes/com/sun/star/lib/loader && \
2580         mv $(PKGDIR)-dev/usr/share/$(OODIRNAME)/sdk/classes/win \
2581                 $(PKGDIR)-dev/$(shell echo $(OOSDKDIR) | sed -e s/lib/share/)/classes
2582         chmod 644 $(PKGDIR)-dev/$(shell echo $(OOSDKDIR) | sed -e s/lib/share/)/classes/win/unowinreg.dll
2583         cd $(PKGDIR)-dev/$(OOSDKDIR)/classes/com/sun/star/lib/loader && \
2584                 for i in $(CURDIR)/$(PKGDIR)-dev/$(shell echo $(OOSDKDIR) | sed -e s/lib/share/)/classes/com/sun/star/lib/loader/*.class; do \
2585                         ln -s `echo $$i | sed -e 's,$(CURDIR)/$(PKGDIR)-dev,,'` `basename $$i`; \
2586                 done
2587         ln -s $(PKGDIR)-dev/$(shell echo $(OOSDKDIR) | sed -e s/lib/share/)/classes/win/unowinreg.dll \
2588                 $(PKGDIR)-dev/$(OOSDKDIR)/classes/win/unowinreg.dll
2589         rm -rf $(PKGDIR)-dev/usr/share/libreoffice/sdk
2590   endif
2591         chmod 644 $(PKGDIR)-dev/$(OOSDKDIR)/configure.pl
2592         for i in csh csh.in; do \
2593                 perl -pi -e 's,/usr/bin/csh,/bin/csh,'\
2594                         $(PKGDIR)-dev/$(OOSDKDIR)/setsdkenv_unix.$$i; \
2595         done
2596         # create wrapper scripts
2597         cd $(PKGDIR)-dev/$(OOSDKDIR)/bin && \
2598         for i in *; do \
2599                 mv $$i $$i.bin && \
2600                 ( \
2601                   echo "#!/bin/sh"; \
2602                   echo "# wrapper script for OOos SDK programs"; \
2603                   echo ""; \
2604                   echo 'LD_LIBRARY_PATH=/$(OOUREDIR)/lib /$(OOSDKDIR)/bin/`basename $$0`.bin "$$@"'; \
2605                 ) > $$i; \
2606                 chmod 755 $$i; \
2607         done
2608         # remove symlink, it should be in -dev-doc
2609         cd $(PKGDIR)-dev/$(OOSDKDIR) && \
2610                 rm docs
2611
2612         # install gsicheck into -dev
2613         mkdir -p $(PKGDIR)-dev/$(OODIR)/program
2614         install -m755 $(SOURCE_TREE)/solver/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$UPD/$$OUTPATH$$PROEXT)/bin/gsicheck \
2615                 $(PKGDIR)-dev/$(OODIR)/program/gsicheck.bin
2616         ( \
2617           echo '#! /bin/sh'; \
2618           echo 'LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}/$(OODIR)/program'; \
2619           echo 'export LD_LIBRARY_PATH'; \
2620           echo 'exec /$(OODIR)/program/gsicheck.bin "$$@"'; \
2621         ) > $(PKGDIR)-dev/$(OODIR)/program/gsicheck
2622         chmod 755 $(PKGDIR)-dev/$(OODIR)/program/gsicheck
2623
2624         # fix permissions
2625         find $(PKGDIR)-dev/usr/share/idl/$(OODIRNAME) -type f -exec chmod 644 {} \;
2626
2627 endif
2628
2629 ifeq "$(INTERNAL_STDLIBS)" "y"
2630         # we have to do this manually; specifying --without-system-stdlibs
2631         # won't work because the odering of the configure arguments...
2632         LIBSTDCPP=`readlink `PATH=$(BUILD_PATH) g++ --print-file-name=libstdc++.so``; \
2633         LIBGCC=`readlink `PATH=$(BUILD_PATH) gcc --print-file-name=libgcc_s.so``; \
2634         LIBSTDCPP_SOVER=`echo $$LIBSTDCPP | sed -e 's/.*\.//'`; \
2635         LIBGCC_SOVER=`echo $$LIBGCC | sed -e 's/.*\.//'`; \
2636         cp $$LIBSTDCPP debian/ure/$(OOUREDIR)/lib; \
2637         cp $$LIBGCC debian/ure/$(OOUREDIR)/lib; \
2638         echo "libstdc++ $$LIBSTDCPP_SOVER" > debian/shlibs.override.stdlibs; \
2639         echo "libgcc_s  $$LIBGCC_SOVER" >> debian/shlibs.override.stdlibs
2640 endif
2641 ifeq "$(LINK_TO_STLPORT)" "y"
2642         rm -f debian/ure/$(OOUREDIR)/lib/libstlport*
2643         ln -s `readlink -f /usr/lib/libstlport_gcc.so` \
2644                 debian/ure/$(OOUREDIR)/lib/libstlport_gcc.so
2645 endif
2646
2647 ifeq "$(ENABLE_JAVA)" "y"
2648   ifeq "$(BUILD_JARS_NATIVE)" "y"
2649     ifneq "$(PKGSOURCE)" "libreoffice$(VER)-l10n"
2650         rm -rf $(PKGDIR)-gcj/usr/lib/gcj
2651         mkdir -p $(PKGDIR)-gcj/usr/lib/gcj/$(OODIRNAME)
2652         cp -p debian/tmp/native-jars/gcj/* $(PKGDIR)-gcj/usr/lib/gcj/$(OODIRNAME)
2653         mkdir -p $(PKGDIR)-gcj/usr/share/gcj/classmap.d
2654         cp -p debian/tmp/native-jars/tmp.db \
2655                 $(PKGDIR)-gcj/usr/share/gcj/classmap.d/libreoffice.db
2656     endif
2657   endif
2658 endif
2659
2660         # install some docs.
2661         mkdir -p $(PKGDIR)-base/usr/share/doc/libreoffice$(VER)-base
2662         cp $(OOO_BUILD_TREE)/doc/using-mysql-databases.txt \
2663                 $(PKGDIR)-base/usr/share/doc/libreoffice$(VER)-base
2664         cp $(OOO_BUILD_TREE)/doc/data-from-remote-mysql-server.txt \
2665                 $(PKGDIR)-base/usr/share/doc/libreoffice$(VER)-base
2666
2667 ifeq "$(PACKAGE_SDK)" "y"
2668   ifeq "$(ENABLE_JAVA)" "y"
2669         # install the UNO Java sources for e.g. eclipse
2670         mkdir -p $(CURDIR)/$(PKGDIR)-dev/usr/share/java
2671         cd $(SOURCE_TREE)/solver/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$UPD)/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/bin && \
2672                 for i in juh jurt jut ridl unoloader; do \
2673                         cp $${i}_src.zip \
2674                           $(CURDIR)/$(PKGDIR)-dev/usr/share/java; \
2675                 done
2676   endif
2677 endif
2678
2679 ifeq "$(ENABLE_JAVA)" "y"
2680         # hrmpf, again something like that, we really need to find the root cause for that
2681         ln -s libjava_uno.so \
2682                 debian/ure/$(OOUREDIR)/lib/libjava_uno
2683 endif
2684
2685         # remove empty resource directories
2686         for i in draw base writer impress calc math; do \
2687                 rm -rf $(PKGDIR)-$$i/$(OODIR)/program/resource; \
2688         done
2689
2690 ifneq "$(ENABLE_REPORTDESIGN)" "y"
2691         # unneeded. a no-Java arch, so the report-builder can't work anyway.
2692         # (and we need to remove it here anyway as it otherwise would end up
2693         # in -base)
2694         rm -f $(PKGDIR)-base/$(OODIR)/program/librpt*
2695 else
2696   ifeq "$(PACKAGE_BASE)" "y"
2697         # move rpt stuff into -report-builder-bin
2698         rm -rf $(PKGDIR)-report-builder
2699         rm -rf $(PKGDIR)-report-builder-bin
2700         mkdir -p $(PKGDIR)-report-builder-bin/$(OODIR)/program
2701         mv $(PKGDIR)-base/$(OODIR)/program/librpt* \
2702                 $(PKGDIR)-report-builder-bin/$(OODIR)/program
2703   endif
2704 endif
2705
2706 ifeq "$(ENABLE_MINIMIZER)" "y"
2707         rm -rf $(PKGDIR)-presentation-minimizer
2708         mkdir -p $(PKGDIR)-presentation-minimizer/$(OOBRANDDIR)/share/extensions
2709         mv debian/tmp/$(OOBRANDDIR)/share/extensions/presentation-minimizer \
2710                 $(PKGDIR)-presentation-minimizer/$(OOBRANDDIR)/share/extensions
2711         rm -f $(PKGDIR)-presentation-minimizer/$(OOBRANDDIR)/share/extensions/presentation-minimizer/registration/LICENSE
2712 endif
2713
2714 ifeq "$(ENABLE_PRESENTER_CONSOLE)" "y"
2715         rm -rf $(PKGDIR)-presenter-console
2716         mkdir -p $(PKGDIR)-presenter-console/$(OOBRANDDIR)/share/extensions
2717         mv debian/tmp/$(OOBRANDDIR)/share/extensions/presenter-screen \
2718                 $(PKGDIR)-presenter-console/$(OOBRANDDIR)/share/extensions
2719 endif
2720
2721 ifeq "$(ENABLE_SDBC_POSTGRESQL)" "y"
2722         rm -rf $(PKGDIR)-sdbc-postgresql
2723         mkdir -p $(PKGDIR)-sdbc-postgresql/$(OOBRANDDIR)/share/extensions/postgresql-sdbc-$(shell grep ^PQ_SDBC_M $(SOURCE_TREE)/connectivity/source/drivers/postgresql/makefile.mk | cut -d"=" -f2 | xargs | sed -e s/\ /\./g)
2724         cd $(PKGDIR)-sdbc-postgresql/$(OOBRANDDIR)/share/extensions/postgresql-sdbc-$(shell grep ^PQ_SDBC_M $(SOURCE_TREE)/connectivity/source/drivers/postgresql/makefile.mk | cut -d"=" -f2 | xargs | sed -e s/\ /\./g) && \
2725                 unzip $(CURDIR)/$(SOURCE_TREE)/connectivity/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/lib/postgresql-sdbc-$(shell grep ^PQ_SDBC_M $(SOURCE_TREE)/connectivity/source/drivers/postgresql/makefile.mk | cut -d"=" -f2 | xargs | sed -e s/\ /\./g).oxt 
2726 endif
2727
2728 ifeq "$(ENABLE_MYSQLNATIVE)" "y"
2729         rm -rf $(PKGDIR)-mysql-connector
2730         mkdir -p $(PKGDIR)-mysql-connector/$(OOBRANDDIR)/share/extensions
2731         mv debian/tmp/$(OOBRANDDIR)/share/extensions/mysql-connector-ooo \
2732                 $(PKGDIR)-mysql-connector/$(OOBRANDDIR)/share/extensions
2733         rm -f $(PKGDIR)-mysql-connector/$(OOBRANDDIR)/share/extensions/mysql-connector-ooo/registration/LICENSE
2734 endif
2735
2736 ifeq "$(ENABLE_PDFIMPORT)" "y"
2737         rm -rf $(PKGDIR)-pdfimport
2738         mkdir -p $(PKGDIR)-pdfimport/$(OOBRANDDIR)/share/extensions
2739         mv debian/tmp/$(OOBRANDDIR)/share/extensions/pdfimport \
2740                 $(PKGDIR)-pdfimport/$(OOBRANDDIR)/share/extensions
2741         rm -f $(PKGDIR)-pdfimport/$(OOBRANDDIR)/share/extensions/pdfimport/registration/LICENSE
2742 endif
2743
2744         # move "default" services.rdb to a hidden file
2745         mv $(PKGDIR)-core/usr/lib/$(OODIRNAME)/basis$(OOVER)/program/services.rdb \
2746                 $(PKGDIR)-core/usr/lib/$(OODIRNAME)/basis$(OOVER)/program/.services.rdb
2747         # create dir for services.rdb which is read. like when we merged
2748         # additional/optional components
2749         mkdir -p $(PKGDIR)-core/var/lib/$(OODIRNAME)/basis$(OOVER)/program
2750         ln -s /var/lib/$(OODIRNAME)/basis$(OOVER)/program/services.rdb \
2751                 $(PKGDIR)-core/usr/lib/$(OODIRNAME)/basis$(OOVER)/program/services.rdb
2752
2753 ifeq "$(PACKAGE_SDK)" "y"
2754         # install gengal stuff into -dev
2755         mkdir -p $(PKGDIR)-dev/$(OODIR)/program
2756         install -m755 $(SOURCE_TREE)/svx/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/bin/gengal \
2757                 $(PKGDIR)-dev/$(OODIR)/program/gengal
2758         install -m755 $(SOURCE_TREE)/svx/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/bin/gengal.bin \
2759                 $(PKGDIR)-dev/$(OODIR)/program/gengal.bin
2760 endif
2761
2762         for i in $(ARCH_DEP_PACKAGES); do \
2763                 if [ -e debian/$$i.bug-script.in ]; then \
2764                         cat debian/$$i.bug-script.in \
2765                                 | sed -e "s/@PLATFORMID@/$(PLATFORMID)/" \
2766                                 | sed -e "s/@BASIS_VERSION@/$(BASIS_VERSION)/" \
2767                                 > debian/$$i.bug-script; \
2768                 fi ;\
2769         done
2770         # generate .links files from *.in       
2771         for PKG in $(ARCH_DEP_PACKAGES); do \
2772           LINKS=debian/$$PKG.links ; \
2773           if [ -e $$LINKS.in ]; then \
2774             sed -e "s/\@LIBSUFFIX\@/$(LIBSUFFIX)/g" \
2775                 -e "s#\@OOBASISDIR\@#$(OOBASISDIR)#g" \
2776                 < $$LINKS.in > $$LINKS ; \
2777           fi; \
2778         done
2779
2780
2781         touch $@
2782
2783 # Install files generated by setup into arch-independent package directories
2784 install-indep: $(STAMP_DIR)/install-indep
2785 #$(STAMP_DIR)/install-indep: debian/libreoffice$(VER).install 
2786 #$(STAMP_DIR)/install-indep: debian/libreoffice$(VER)-mimelnk.install 
2787 #$(STAMP_DIR)/install-indep: debian/libreoffice$(VER).dirs
2788 $(STAMP_DIR)/install-indep: $(STAMP_DIR)/install
2789         dh_testdir
2790         dh_testroot
2791
2792         perl -pi -e 's,/bin,/usr/bin,' \
2793                  debian/libreoffice$(VER)-emailmerge/$(OODIR)/program/mailmerge.py
2794
2795 ifneq "$(USE_GSTREAMER)" "y"
2796         # sound doesn't work anyway, remove the .wav files to save space
2797         rm -rf $(PKGDIR)-common/$(OODIR)/share/gallery/sounds
2798         rm -f $(PKGDIR)-common/$(OODIR)/share/gallery/sg9.*
2799 endif
2800
2801         rm -f $(PKGDIR)-common/$(OODIR)/program/oo_product.bmp
2802
2803         # Extract and install icons
2804         cd $(SOURCE_TREE)/sysui/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/bin/desktop-integration && dpkg --extract libreoffice$(OOVER)-debian-menus_*_all.deb . && cd usr/share/icons && \
2805         rm -rf gnome locolor && \
2806         for d in `find -type d`; do \
2807           install -d -m755 $(CURDIR)/$(PKGDIR)-common/usr/share/icons/$$d || exit 1 ;\
2808         done &&\
2809         for f in `find -type f`; do \
2810           install -m644 $$f $(CURDIR)/$(PKGDIR)-common/usr/share/icons/$$f || exit 1 ;\
2811         done && cd ../../.. && rm -rf usr etc
2812
2813 ifeq "$(USE_OOO_BUILD_DESKTOPS)" "n"
2814         # menu files from sysui
2815         dirname="`cd $(SOURCE_TREE)/sysui/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/misc/desktopshare >/dev/null; pwd`" ;\
2816         mkdir -p -m755 $(PKGDIR)-common/usr/share/applications ;\
2817         sed -e 's,Exec=$${UNIXBASISROOTNAME} %U,Exec=libreoffice$(VER) %U,' \
2818             -e 's,Icon=$${WITHOUTDOTUNIXPRODUCTNAME},Icon=libreoffice,' \
2819             -e 's,Name=$${PRODUCTNAME} $${PRODUCTVERSION},Name=LibreOffice $(VER),' \
2820             -e 's,Name\[pt_BR\]=$${PRODUCTNAME_BR} $${PRODUCTVERSION},Name[pt_BR]=BrOffice $(VER),' \
2821             -e 's/  / /' \
2822            < $$dirname/startcenter.desktop \
2823            > $(PKGDIR)-common/usr/share/applications/libreoffice$(VER)-startcenter.desktop || exit 1
2824         # remove Sun reference 
2825         perl -pi -e 's/ Supported by Sun Microsystems.//' $(PKGDIR)-common//usr/share/applications/libreoffice$(VER)-startcenter.desktop
2826         # invalid, according to lintian. make it shut up.
2827         perl -pi -e 's/Application;//; s/X-Red-Hat-Base;//; s/X-SuSE-Core-Office;//; s/X-MandrivaLinux-.*;//;' $(PKGDIR)-common/usr/share/applications/libreoffice$(VER)-startcenter.desktop
2828 endif
2829
2830         # install .applications, .keys, .mime and openoffice.org.xml for
2831         # shared-mime-info
2832         mkdir -p $(PKGDIR)-common/usr/share/application-registry && \
2833         cat $(SOURCE_TREE)/sysui/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/misc/libreoffice/openoffice.applications \
2834                 | sed -e s/OFFICENAME/ooffice/g \
2835                 | sed -e s/\%PRODUCTNAME/LibreOffice/g \
2836                 > $(PKGDIR)-common/usr/share/application-registry/openoffice.applications
2837         mkdir -p $(PKGDIR)-common/usr/share/mime/packages && \
2838         mkdir -p $(PKGDIR)-common/usr/share/mime-info && \
2839         install -m644 $(SOURCE_TREE)/sysui/desktop/mimetypes/openoffice.mime \
2840                 $(PKGDIR)-common/usr/share/mime-info && \
2841         rm -f $(PKGDIR)-common/usr/share/mime-info/openoffice.keys; \
2842         for i in $(SOURCE_TREE)/sysui/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/misc/libreoffice/*.keys; do \
2843                 cat $$i >> $(PKGDIR)-common/usr/share/mime-info/openoffice.keys; \
2844         done
2845         install -m644 $(SOURCE_TREE)/sysui/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/misc/libreoffice/openoffice.org.xml \
2846                 $(PKGDIR)-common/usr/share/mime/packages
2847
2848         mkdir -p $(PKGDIR)-common/usr/share/applications
2849
2850         # install openoffice-xlate-lang
2851         install -d -m755 $(PKGDIR)-common/usr/share/$(OODIRNAME)/bin
2852         install -m755 $(OOO_BUILD_TREE)/bin/openoffice-xlate-lang \
2853                 $(PKGDIR)-common/usr/share/$(OODIRNAME)/bin
2854
2855 ifeq "$(HELPISOS)" ""
2856         # when we don't build helpcontent2 here we are missing helpxsl.zip so
2857         # this file doesn't get installed either. Do it manually..
2858         mkdir -p -m755 $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/help && \
2859         cp $(SOURCE_TREE)/helpcontent2/source/auxiliary/main_transform.xsl \
2860                 $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/help
2861         cp $(SOURCE_TREE)/helpcontent2/source/auxiliary/idxcaption.xsl \
2862                 $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/help
2863         cp $(SOURCE_TREE)/helpcontent2/source/auxiliary/idxcontent.xsl \
2864                 $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/help
2865 endif
2866
2867 ifeq "$(PACKAGE_SDK)" "y"
2868         rm -f $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev-doc/LICENSE
2869         perl -pi -e 's,license.html,http://www.gnu.org/licenses/lgpl.html,' \
2870                 $(PKGDIR)-dev-doc/$(OOSDKDIR)/index.html
2871         find $(PKGDIR)-dev-doc/$(OOBASISDIR)/sdk/examples -type f -exec chmod 644 {} \;
2872
2873   ifeq "$(ENABLE_JAVA)" "y"
2874         # fix links
2875         cd $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev/docs/java/ref && \
2876         for i in `find . -type f | xargs`; do \
2877                 perl -pi -e 's,file:$(CURDIR)/$(OOO_BUILD_TREE)/build/$(TAG)/odk/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/bin/odkcommon/docs/common/ref/,,g' $$i; \
2878         done
2879   endif
2880 endif
2881
2882 ifeq "$(ENABLE_JAVA)" "y"
2883         # move common Java stuff to -java-common
2884         rm -rf $(PKGDIR)-java-common
2885         mkdir -p $(PKGDIR)-java-common/$(OODIR)/program/classes
2886         mkdir -p $(PKGDIR)-java-common/$(OODIR)/share/Scripts
2887         mkdir -p $(PKGDIR)-java-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes
2888         mv $(PKGDIR)-common/$(OODIR)/share/Scripts/java \
2889                 $(PKGDIR)-java-common/$(OODIR)/share/Scripts
2890         mv $(PKGDIR)-common/$(OODIR)/program/classes/* \
2891                 $(PKGDIR)-java-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes
2892         cd $(PKGDIR)-java-common/$(OODIR)/program/classes && \
2893                 for i in $(CURDIR)/$(PKGDIR)-java-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes/*; do \
2894                         case "`basename $$i`" in aportisdoc.jar|pexcel.jar|pocketword.jar) continue ;; \
2895                         *) ln -s `echo $$i | sed -e 's,$(CURDIR)/$(PKGDIR)-java-common,,'` `basename $$i` ;; esac; \
2896         done
2897
2898         # move into extra package
2899         rm -rf $(PKGDIR)-filter-mobiledev
2900         mkdir -p $(PKGDIR)-filter-mobiledev/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes
2901         mkdir -p $(PKGDIR)-filter-mobiledev/$(OODIR)/program/classes
2902         for i in aportisdoc pexcel pocketword; do \
2903           mv $(PKGDIR)-java-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes/$$i.jar \
2904                 $(PKGDIR)-filter-mobiledev/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes; \
2905           ln -s /$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes/$$i.jar \
2906                 $(PKGDIR)-filter-mobiledev/$(OODIR)/program/classes; \
2907         done
2908         for i in pocketexcel palm pocketword; do \
2909           mkdir -p $(PKGDIR)-filter-mobiledev/$(OODIR)/share/registry && \
2910           mv $(PKGDIR)-common/$(OODIR)/share/registry/$$i.xcd \
2911                 $(PKGDIR)-filter-mobiledev/$(OODIR)/share/registry; \
2912         done
2913 ifeq "$(USE_OOO_BUILD_DESKTOPS)" "n"
2914         # menu files from sysui
2915         dirname="`cd $(SOURCE_TREE)/sysui/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/misc/desktopshare >/dev/null; pwd`" ;\
2916         mkdir -p -m755 $(PKGDIR)-filter-mobiledev/usr/share/applications ;\
2917         sed -e 's,Exec=$${UNIXBASISROOTNAME} \(.*\) %U,Exec=libreoffice$(VER) \1 %U,' \
2918                 -e 's,Icon=$${WITHOUTDOTUNIXPRODUCTNAME},Icon=libreoffice,' \
2919                 -e 's,Name=$${PRODUCTNAME} $${PRODUCTVERSION},Name=LibreOffice $(VER),' \
2920                 -e 's,Name\[pt_BR\]=$${PRODUCTNAME_BR} $${PRODUCTVERSION},Name[pt_BR]=BrOffice $(VER),' \
2921                 -e 's/  / /' \
2922                 < $$dirname/javafilter.desktop \
2923                 > $(PKGDIR)-filter-mobiledev/usr/share/applications/libreoffice$(VER)-javafilter.desktop || exit 1
2924 endif
2925 endif
2926
2927         # fix permissions
2928         for i in editpic poll savepic show webcast; do \
2929                 chmod 755 $(PKGDIR)-common/$(OODIR)/share/config/webcast/$$i.pl; \
2930         done
2931         chmod 644 $(PKGDIR)-common/$(OOBRANDDIR)/LICENSE.odt
2932         chmod 644 $(PKGDIR)-common/$(OOBRANDDIR)/CREDITS.odt
2933
2934         rm -rf $(PKGDIR)-common/$(OOBRANDDIR)/LICENSE
2935
2936         # move uno_packages/cache to /var and create symlink for for
2937         # documentation referencing it...
2938         rm -rf $(PKGDIR)-common/$(OOBRANDDIR)/share/uno_packages/cache
2939         mkdir -p $(PKGDIR)-common/var/spool/$(OODIRNAME)/uno_packages/cache
2940         ln -s /var/spool/$(OODIRNAME)/uno_packages/cache \
2941                 $(PKGDIR)-common/$(OOBRANDDIR)/share/uno_packages/cache
2942         perl -pi -e \
2943               's,\$$UNO_SHARED_PACKAGES/cache,file:///var/spool/$(OODIRNAME)/uno_packages/cache,g' \
2944                 $(PKGDIR)-common/$(OODIR)/program/unorc
2945         # FIXME: What is this? unorc per default only mentiones
2946         # share/uno_packages/cache...
2947         rm -rf $(PKGDIR)-common/$(OODIR)/presets/uno_packages
2948
2949         # move javasettingsunopkginstall.xml to /var/lib
2950         mkdir -p $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/usr/var/)/share/config
2951         mv $(PKGDIR)-common/$(OODIR)/share/config/javasettingsunopkginstall.xml \
2952                 $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/usr/var/)/share/config/javasettingsunopkginstall.xml
2953         ln -s /$(shell echo $(OODIR) | sed -e s/usr/var/)/share/config/javasettingsunopkginstall.xml \
2954                 $(PKGDIR)-common/$(OODIR)/share/config/javasettingsunopkginstall.xml
2955         # set PYTHONPATH in unopkg
2956         perl -pi -e 's,unset XENVIRONMENT,unset XENVIRONMENT\n\nexport PYTHONPATH=\"/$(OOBASISDIR)/program\"\n\n,' \
2957                 $(PKGDIR)-common/$(OOBRANDDIR)/program/unopkg
2958
2959         # install DicOOo; we need to do this manually; the
2960         # dictionaries/ module isn't built with --without-myspell-dicts
2961         # and those two somehow (why?) are in there...
2962         mkdir -p $(PKGDIR)-common/usr/share/myspell/dicts
2963         install -m644 $(SOURCE_TREE)/dictionaries/diclst/DicOOo.sxw \
2964                 $(PKGDIR)-common/usr/share/myspell/dicts
2965
2966 ifeq "$(PACKAGE_TTF_OPENSYMBOL)" "y"
2967         mkdir -p debian/ttf-opensymbol/usr/share/fonts/truetype/openoffice
2968         mv $(PKGDIR)-common/$(OODIR)/share/fonts/truetype/opens___.ttf \
2969                 debian/ttf-opensymbol/usr/share/fonts/truetype/openoffice
2970         rm -rf $(PKGDIR)-common/$(OODIR)/share/fonts/truetype
2971 else
2972         rm -f $(PKGDIR)-common/$(OODIR)/share/fonts/truetype/opens___.ttf
2973 endif
2974
2975         # convert icons to xpm; we need them for the Debian menu policy...
2976         cd $(PKGDIR)-common/usr/share/icons/hicolor/32x32/apps && \
2977           for x in *.png; do convert $$x `basename $$x .png`.xpm; done
2978
2979 ifeq "$(ENABLE_JAVA)" "y"
2980   ifneq (,$(filter saxon, $(SYSTEM_STUFF)))
2981         ln -sf /usr/share/java/saxonb.jar \
2982                 $(PKGDIR)-java-common/$(OODIR)/program/classes/saxon9.jar
2983   endif
2984 endif
2985         # remove extra license files
2986         rm -rf $(PKGDIR)-common/$(OOBRANDDIR)/licenses
2987         rm -f $(PKGDIR)-common/$(OOBRANDDIR)/share/readme/LICENSE*
2988         rm -f $(PKGDIR)-common/$(OOBRANDDIR)/THIRDPARTYLICENSEREADME.html
2989         rm -f $(PKGDIR)-common/$(OOBRANDDIR)/LICENSE.html
2990
2991         # remove extra readme files
2992         rm -rf $(PKGDIR)-common/$(OOBRANDDIR)/readmes
2993         rm -f $(PKGDIR)-common/$(OOBRANDDIR)/share/readme/README*
2994         rm -f $(PKGDIR)-common/$(OOBRANDDIR)/README.html
2995         rm -f $(PKGDIR)-common/$(OOBRANDDIR)/README
2996
2997         # URE got moved to /usr/lib, so this is obsolete
2998         for i in ure/lib ure; do \
2999                 if [ -e $(PKGDIR)-common/$(OOBRANDDIR)/$$i ]; then \
3000                         rmdir $(PKGDIR)-common/$(OOBRANDDIR)/$$i; \
3001                 fi; \
3002         done
3003
3004 ifeq "$(USE_OOO_BUILD_DESKTOPS)" "y"
3005         # install ooo-build desktop icons
3006         for r in 16x16 22x22 24x24 32x32 48x48; do \
3007                 mkdir -p $(PKGDIR)-common/usr/share/icons/hicolor/$$r/apps; \
3008                 cp $(OOO_BUILD_TREE)/desktop/$$r/*.png \
3009                         $(PKGDIR)-common/usr/share/icons/hicolor/$$r/apps; \
3010         done
3011 endif
3012
3013         # move psprint.conf into /etc
3014         mkdir -p $(PKGDIR)-common/etc/$(OODIRNAME)
3015         mv $(PKGDIR)-common/$(OODIR)/share/psprint/psprint.conf \
3016                 $(PKGDIR)-common/etc/$(OODIRNAME)
3017         ln -s /etc/$(OODIRNAME)/psprint.conf \
3018                 $(PKGDIR)-common/$(OODIR)/share/psprint/psprint.conf
3019
3020         # prepare a fake sofficerc in the place where OOo expects it
3021         # which does nothing except reference the "normal" one
3022         # which we put into /etc
3023         mv $(PKGDIR)-common/$(OOBRANDDIR)/program/sofficerc \
3024                 $(PKGDIR)-common/etc/$(OODIRNAME)/sofficerc
3025         ( \
3026           echo "# *DO NOT* CHANGE THIS FILE. IT ONLY TAKES THE SETTINGS FROM"; \
3027           echo "# /etc/$(OODIRNAME)/sofficerc. CHANGE THAT FILE IF YOU"; \
3028           echo "# REALLY WANT TO CHANGE SOMETHING."; \
3029           echo "FHS_CONFIG_FILE=file:///etc/$(OODIRNAME)/sofficerc"; \
3030           echo "" >> $(PKGDIR)-common/$(OOBRANDDIR)/program/sofficerc; \
3031         ) > $(PKGDIR)-common/$(OOBRANDDIR)/program/sofficerc
3032         cat $(PKGDIR)-common/etc/$(OODIRNAME)/sofficerc \
3033                 | perl -p -e 's/(.*)=(.*)/$$1=\$${\$$FHS_CONFIG_FILE:Bootstrap:$$1}/' \
3034                 >> $(PKGDIR)-common/$(OOBRANDDIR)/program/sofficerc
3035         # except for URE_BOOTSTRAP...
3036         TMP=`mktemp -q`; \
3037                 grep -v URE_BOOTSTRAP $(PKGDIR)-common/$(OOBRANDDIR)/program/sofficerc > $$TMP && mv $$TMP $(PKGDIR)-common/$(OOBRANDDIR)/program/sofficerc && \
3038                 grep URE_BOOTSTRAP $(PKGDIR)-common/etc/$(OODIRNAME)/sofficerc >> $(PKGDIR)-common/$(OOBRANDDIR)/program/sofficerc && \
3039                 grep -v URE_BOOTSTRAP $(PKGDIR)-common/etc/$(OODIRNAME)/sofficerc > $$TMP && mv $$TMP $(PKGDIR)-common/etc/$(OODIRNAME)/sofficerc
3040
3041         install -m 644 debian/soffice.sh \
3042           $(PKGDIR)-common/etc/$(OODIRNAME)/soffice.sh
3043
3044 ifeq "$(HELPISOS)" ""
3045         # the helpimgs are not included when we don't build with help here.
3046         # Add them now because libreoffice-help-* packaged in contrib or so
3047         # will need them
3048         set -e; \
3049         for i in $(IMAGES); do \
3050                 s=_$$i.zip; \
3051                 case "$$i" in $(DEFAULT_IMAGE)) s=.zip; esac; \
3052                 z=images$$s; \
3053                 echo "adding helpimgs to $$z..."; \
3054                 rm -rf $$z; mkdir $$z; \
3055                 cd $$z; \
3056                 unzip -q $(CURDIR)/$(PKGDIR)-common/$(OODIR)/share/config/$$z && \
3057                 cp -r $(CURDIR)/$(SOURCE_TREE)/default_images/res/helpimg res && \
3058                 chmod +w $(CURDIR)/$(PKGDIR)-common/$(OODIR)/share/config/$$z && \
3059                 zip -q -r $(CURDIR)/$(PKGDIR)-common/$(OODIR)/share/config/$$z *; \
3060                 cd ..; \
3061                 rm -rf $$z; \
3062         done
3063 endif
3064         set -e; \
3065         for i in $(IMAGES); do \
3066                 z=images_$$i.zip; p=$$i; \
3067                 case "$$i" in $(DEFAULT_IMAGE)) z=images.zip; esac; \
3068                 mkdir -p $(PKGDIR)-style-$$p/$(shell echo $(OODIR) | sed -e s/lib/share/)/share/config; \
3069                 mv $(PKGDIR)-common/$(OODIR)/share/config/$$z \
3070                         $(PKGDIR)-style-$$p/$(shell echo $(OODIR) | sed -e s/lib/share/)/share/config/; \
3071         done
3072
3073         rm -rf debian/openoffice.org-dtd-officedocument1.0
3074         mkdir -p debian/openoffice.org-dtd-officedocument1.0/$(shell echo $(OODIR) | sed -e s/libreoffice/openoffice/)/share/dtd
3075         mv $(PKGDIR)-common/$(OODIR)/share/dtd/officedocument \
3076                 debian/openoffice.org-dtd-officedocument1.0/$(shell echo $(OODIR) | sed -e s/libreoffice/openoffice/)/share/dtd
3077         cat debian/catalog.xml.in \
3078                 | sed -e "s,\@OOBASISDIR\@,$(shell echo $(OOBASISDIR) | sed -e s/libreoffice/openoffice/)," \
3079                 > debian/openoffice.org-dtd-officedocument1.0/$(shell echo $(OODIR) | sed -e s/libreoffice/openoffice/)/share/dtd/officedocument/1_0/catalog.xml
3080         cat debian/openoffice.org-dtd-officedocument1.0.xmlcatalogs.in \
3081                 | sed -e "s,\@OOBASISDIR\@,$(shell echo $(OOBASISDIR) | sed -e s/libreoffice/openoffice/)," \
3082                 > debian/openoffice.org-dtd-officedocument1.0.xmlcatalogs
3083         # symlink, as it's in a openoffice.org-* package
3084         cd debian/openoffice.org-dtd-officedocument1.0 && \
3085                 mkdir -p $(OODIR)/share/dtd && \
3086                 cd $(OODIR)/share/dtd && ln -s /$(shell echo $(OODIR) | sed -e s/libreoffice/openoffice/)/share/dtd/officedocument
3087
3088 ifeq "$(DIST)" "Debian"
3089         # install Debian presentation template
3090         mkdir -p $(PKGDIR)-common/$(OODIR)/share/template/en-US/presnt
3091         install -m644 debian/templates/*.otp $(PKGDIR)-common/$(OODIR)/share/template/en-US/presnt/
3092 endif
3093
3094 ifeq "$(PACKAGE_SDK)" "y"
3095         # add symlinks for docs and examples
3096         cd $(PKGDIR)-dev-doc/$(OOSDKDIR) && \
3097                 rm -rf docs && \
3098                 ln -sf /usr/share/doc/libreoffice-dev/docs docs
3099         cd $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev-doc && \
3100                 ln -s /usr/share/doc/libreoffice-dev/docs docs
3101         cd $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev-doc && \
3102                 ln -s /$(OOSDKDIR)/examples examples
3103         cd $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev && \
3104                 ln -s /$(OOSDKDIR)/examples examples
3105         # and the index
3106         cd $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev && \
3107                 ln -s /$(OOSDKDIR)/index.html index.html
3108 endif
3109
3110 ifeq "$(ENABLE_JAVA)" "y"
3111   ifeq "$(ENABLE_SCRIPT_PROVIDER_BSH)" "y"
3112         rm -rf $(PKGDIR)-script-provider-bsh
3113         mkdir -p $(PKGDIR)-script-provider-bsh/$(OOBRANDDIR)/share/extensions
3114         mv debian/tmp/$(OOBRANDDIR)/share/extensions/script-provider-for-beanshell \
3115                 $(PKGDIR)-script-provider-bsh/$(OOBRANDDIR)/share/extensions
3116         rm -f $(PKGDIR)-script-provider-bsh/$(OOBRANDDIR)/share/extensions/script-provider-for-beanshell/registration/LICENSE
3117     ifneq (,$(filter beanshell, $(SYSTEM_STUFF)))
3118         ln -sf /usr/share/java/bsh.jar \
3119                 $(PKGDIR)-script-provider-bsh/$(OOBRANDDIR)/share/extensions/script-provider-for-beanshell/bsh.jar
3120     endif
3121         mkdir -p $(PKGDIR)-script-provider-bsh/$(OODIR)/share/Scripts
3122         mv $(PKGDIR)-common/$(OODIR)/share/Scripts/beanshell \
3123                 $(PKGDIR)-script-provider-bsh/$(OODIR)/share/Scripts
3124   endif
3125
3126   ifeq "$(ENABLE_SCRIPT_PROVIDER_JS)" "y"
3127         rm -rf $(PKGDIR)-script-provider-js
3128         mkdir -p $(PKGDIR)-script-provider-js/$(OOBRANDDIR)/share/extensions
3129         mv debian/tmp/$(OOBRANDDIR)/share/extensions/script-provider-for-javascript \
3130                 $(PKGDIR)-script-provider-js/$(OOBRANDDIR)/share/extensions
3131         mkdir -p $(PKGDIR)-script-provider-js/$(OODIR)/share/Scripts
3132         mv $(PKGDIR)-common/$(OODIR)/share/Scripts/javascript \
3133                 $(PKGDIR)-script-provider-js/$(OODIR)/share/Scripts
3134   endif
3135 endif
3136
3137 ifeq "$(ENABLE_REPORTDESIGN)" "y"
3138   ifeq "$(ENABLE_JAVA)" "y"
3139         rm -rf $(PKGDIR)-report-builder
3140         mkdir -p $(PKGDIR)-report-builder/$(OOBRANDDIR)/share/extensions
3141         mv debian/tmp/$(OOBRANDDIR)/share/extensions/report-builder \
3142                 $(PKGDIR)-report-builder/$(OOBRANDDIR)/share/extensions
3143         # unneeded license files
3144         for i in THIRDPARTYREADMELICENSE.html readme_en-US.html readme_en-US.txt \
3145                 registration/LICENSE; do \
3146                 rm -f $(PKGDIR)-report-builder/$(OOBRANDDIR)/share/extensions/report-builder/$$i; \
3147         done
3148   endif
3149 endif
3150
3151 ifeq "$(ENABLE_MEDIAWIKI)" "y"
3152         rm -rf $(PKGDIR)-wiki-publisher
3153         mkdir -p $(PKGDIR)-wiki-publisher/$(OOBRANDDIR)/share/extensions
3154         mv debian/tmp/$(OOBRANDDIR)/share/extensions/wiki-publisher \
3155                 $(PKGDIR)-wiki-publisher/$(OOBRANDDIR)/share/extensions
3156         rm -f $(PKGDIR)-wiki-publisher/$(OOBRANDDIR)/share/extensions/wiki-publisher/license/THIRDPARTYLICENSEREADME.html
3157 endif
3158
3159         # add version to  .lintian-overrides
3160         for i in common; do \
3161                 cat debian/libreoffice$(VER)-$$i.lintian-overrides.in \
3162                         | sed -e s/@BASIS_VERSION@/$(BASIS_VERSION)/ \
3163                         > debian/libreoffice$(VER)-$$i.lintian-overrides; \
3164         done
3165
3166         # unopkg creates stuff in there.
3167         mkdir -p $(PKGDIR)-common/$(OOBRANDDIR)/share/prereg
3168         mkdir -p $(PKGDIR)-common/$(shell echo $(OOBRANDDIR) | sed -e s/usr/var/)/share/prereg/bundled
3169         ln -s /$(shell echo $(OOBRANDDIR) | sed -e s/usr/var/)/share/prereg/bundled \
3170                 $(PKGDIR)-common/$(OOBRANDDIR)/share/prereg/bundled
3171
3172         for i in $(ARCH_INDEP_PACKAGES); do \
3173                 if [ -e debian/$$i.bug-script.in ]; then \
3174                         cat debian/$$i.bug-script.in \
3175                                 | sed -e "s/@PLATFORMID@/$(PLATFORMID)/" \
3176                                 | sed -e "s/@BASIS_VERSION@/$(BASIS_VERSION)/" \
3177                                 > debian/$$i.bug-script; \
3178                 fi ;\
3179         done
3180         # generate .links files from *.in       
3181         for PKG in $(ARCH_INDEP_PACKAGES); do \
3182           LINKS=debian/$$PKG.links ; \
3183           if [ -e $$LINKS.in ]; then \
3184             sed -e "s/\@LIBSUFFIX\@/$(LIBSUFFIX)/g" \
3185                 -e "s#\@OOBASISDIR\@#$(OOBASISDIR)#g" \
3186                 -e "s/@ICONVERSION@/$(shell echo $(OOVER) | sed -e "s/\.//g")/" \
3187                 < $$LINKS.in > $$LINKS ; \
3188           fi; \
3189         done
3190
3191 ifeq "$(USE_SYSTEM_TEXTCAT_DATA)" "y"
3192   ifneq "$(SQUEEZE_BACKPORT)" "y"
3193         echo "usr/share/libtextcat/LM $(OOBASISDIR)/share/fingerprint" >> debian/libreoffice-common.links
3194   else
3195         # remove duplicated textcat data and replace with symlinks
3196         cd $(PKGDIR)-common/$(OOBASISDIR)/share && \
3197         for i in `fdupes -n -f -1 fingerprint/ /usr/share/libtextcat/LM`; do \
3198                 ln -sf /usr/share/libtextcat/LM/`basename $$i` fingerprint/`basename $$i`; \
3199         done
3200   endif
3201 endif
3202
3203 ifeq "$(USE_OOO_BUILD_DESKTOPS)" "n"
3204         # menu files from sysui
3205         dirname="`cd $(SOURCE_TREE)/sysui/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/misc/libreoffice >/dev/null; pwd`" ;\
3206         mkdir -p -m755 $(PKGDIR)-common/usr/share/mimelnk/application ;\
3207         sed -e 's,Comment=Extension,Comment=LibreOffice $(VER) Extension,' \
3208             -e 's,Icon=openofficeorg[0123456789]-extension,Icon=application-vnd.openofficeorg.extension.png,' \
3209             -e 's/  / /' \
3210             < $$dirname/extension.desktop \
3211             > $(PKGDIR)-common/usr/share/mimelnk/application/vnd.openofficeorg.extension.desktop || exit 1
3212         perl -pi -e "s/Icon=openofficeorg.*-extension/Icon=application-vnd.openofficeorg.extension.png/" $(PKGDIR)-common/usr/share/mimelnk/application/vnd.openofficeorg.extension.desktop
3213 endif
3214
3215         # install extension shell lib for use by extensions not from here
3216         install -D -m644 debian/shell-lib-extensions.sh \
3217                 $(PKGDIR)-common/usr/share/$(OODIRNAME)/shell-lib-extensions.sh
3218
3219         # those are needed in /usr/share, too
3220         mkdir -p $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)
3221         mv $(PKGDIR)-common/$(OODIR)/help \
3222                 $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)
3223         # help is in /usr/share
3224         sed -i 's,$$(instpath)/help,/$(shell echo $(OODIR) | sed -e s/lib/share/)/help,' \
3225                 $(PKGDIR)-common/$(OOBASISDIR)/share/registry/main.xcd
3226
3227         # compat dirs, the split icons thing need it
3228         mkdir -p $(PKGDIR)-common/$(shell echo $(OOBRANDDIR) | sed -e s/lib/share/)/program
3229         mkdir -p $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/program
3230         # three-layer symlinks also for /usr/share
3231         ln -s basis$(OOVER) \
3232                 $(PKGDIR)-common/$(shell echo $(OOBRANDDIR) | sed -e s/lib/share/)/basis-link
3233         ln -s /$(OOUREDIR) \
3234                 $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/ure-link
3235
3236         # enable session handling and recovery
3237         perl -pi -e 's,<prop oor:name="DocumentStoreUIEnabled" oor:type="xs:boolean"><value>false</value></prop>,<prop oor:name="DocumentStoreUIEnabled" oor:type="xs:boolean"><value>true</value></prop>,' $(PKGDIR)-common/$(OODIR)/share/registry/main.xcd
3238
3239         # examples. move where they belong
3240         mkdir -p $(PKGDIR)-common/usr/share/doc/libreoffice-common/examples
3241         for i in oo-ldap.xcd.sample oo-ad-ldap.xcd.sample; do \
3242                 mv $(PKGDIR)-common/$(OOBASISDIR)/share/registry/$$i \
3243                         $(PKGDIR)-common/usr/share/doc/libreoffice-common/examples; \
3244                 ln -s /usr/share/doc/libreoffice-common/examples/$$i $(PKGDIR)-common/$(OOBASISDIR)/share/registry/$$i; \
3245         done
3246
3247         # install font config. Doesn't get installed with
3248         # --without-fonts.
3249         # FIXME: Shouldn't this be in /etc/fonts/conf.d with a symlink here?
3250         install -m644 -D $(SOURCE_TREE)/more_fonts/fonts/fc_local.conf \
3251                 $(PKGDIR)-common/$(OODIR)/share/fonts/truetype/fc_local.conf
3252
3253         # register technical.dic
3254         perl -pi -e 's/standard.dic;/standard.dic;technical.dic;/' $(PKGDIR)-common/$(OODIR)/share/registry/main.xcd
3255
3256 ifeq "$(PACKAGE_SDK)" "y"
3257         # install gengal stuff into -dev
3258         mkdir -p $(PKGDIR)-dev/$(OODIR)/program
3259         install -m644 $(SOURCE_TREE)/svx/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/bin/gengalrc \
3260                 $(PKGDIR)-common/$(OODIR)/program/gengalrc
3261 endif
3262         touch $@
3263
3264 binary-arch: $(STAMP_DIR)/binary-arch
3265 $(STAMP_DIR)/binary-arch: $(STAMP_DIR)/install-arch debian/control $(STAMP_DIR)/maintscripts
3266         dh_testdir
3267         dh_testroot
3268
3269         for pkg in $(ARCH_DEP_PACKAGES) ; do \
3270           rm -f debian/$$pkg.*.debhelper;\
3271           rm -rf debian/$$pkg/DEBIAN;\
3272         done
3273
3274         dh_installdocs -s -A debian/README.Debian \
3275                 $(SOURCE_TREE)/instsetoo_native/util/LibreOffice/replace_file/*/en-US/README_en-US \
3276                 $(OOO_BUILD_TREE)/NEWS
3277         dh_installdebconf -s
3278         dh_installman -s
3279         for i in writer calc draw base math impress; do \
3280                 for i in `find $(PKGDIR)-$$i -type l -name "lo*.1"`; do \
3281                         mv $$i $$i.gz; \
3282                         if [ "`readlink $$i`" != "libreoffice.1.gz" ]; then \
3283                                 ln -sf libreoffice.1.gz $$i.gz; \
3284                         fi; \
3285                 done; \
3286         done
3287         dh_installchangelogs -s -k
3288         dh_installmime -s
3289         dh_installmenu -s
3290 ifeq "$(ENABLE_JAVA)" "y"
3291   ifeq "$(BUILD_JARS_NATIVE)" "y"
3292         dh_nativejava -plibreoffice$(VER)-gcj -o
3293   endif
3294 endif
3295         dh_python2 -ppython-uno --no-guessing-versions --no-guessing-deps
3296         dh_lintian -s
3297         dh_bugfiles -s -A
3298         dh_link -s
3299         dh_fixperms -s
3300 ifeq "$(BUILD_DBG_PACKAGE)" "y"
3301         dh_strip -s -Nure -Nuno-libs3 --dbg-package=libreoffice$(VER)-dbg
3302         dh_strip -pure --dbg-package=ure-dbg
3303         dh_strip -puno-libs3 --dbg-package=uno-libs3-dbg
3304         # dh_strip --dbg-package= is not idempotent, force copying of the binaries
3305         # again...
3306         rm -f $(STAMP_DIR)/install-arch
3307 else
3308         dh_strip -s
3309 endif
3310         dh_icons -s
3311 ifeq "$(ENABLE_MONO)" "y"
3312         dh_installcligac -s
3313 endif
3314         dh_compress -s -X.py -X.mk -X.sxd
3315         dh_makeshlibs -puno-libs3 -V"ure (>= $(shell grep UREPACKAGEVERSION $(SOURCE_TREE)/instsetoo_native/util/openoffice.lst | awk '{ print $$2 }'))" -- -c0 -v`echo $(BINARY_VERSION) | cut -d: -f2`
3316         dh_makeshlibs -n -pure -V"ure (>= $(shell grep UREPACKAGEVERSION $(SOURCE_TREE)/instsetoo_native/util/openoffice.lst | awk '{ print $$2 }'))" -- -v`echo $(BINARY_VERSION) | cut -d: -f2`
3317         # ugly hack, but why does that happen? It's not in .symbols...
3318         TMP=`mktemp -q`; \
3319         grep -v PRIVATE debian/uno-libs3/DEBIAN/symbols > $$TMP && \
3320         mv $$TMP debian/uno-libs3/DEBIAN/symbols && \
3321         chmod 644 debian/uno-libs3/DEBIAN/symbols
3322         dh_installdeb -s
3323 ifeq "$(BUILD_KFREEBSD)" "y"
3324         cat debian/shlibs.override.libc >> debian/shlibs.local
3325 endif
3326 ifneq (,$(filter icu, $(SYSTEM_STUFF)))
3327         cat debian/shlibs.override.icu >> debian/shlibs.local
3328 endif
3329 ifeq "$(INTERNAL_STDLIBS)" "y"
3330         cat debian/shlibs.override.stdlibs >> debian/shlibs.local
3331 endif
3332         # we need to do it in two steps. The new dpkg-shlibdeps doesn't find
3333         # /usr/lib/libgcj-bc.so when specifying -l$(GCJ_JAWT_DIR)
3334         # and therefore we must not use it for -gcj. But we *do* need it
3335         # for -officebean (libjawt.so is referenced there)
3336         LD_LIBRARY_PATH="/usr/lib/libfakeroot:debian/uno-libs3/$(OOUREDIR)/lib:debian/ure/$(OOUREDIR)/lib:$(PKGDIR)-core/$(OODIR)/program:$(PKGDIR)-base-core/$(OODIR)/program:$(PKGDIR)-base/$(OODIR)/program:$(PKGDIR)-writer/$(OODIR)/program" \
3337                 dh_shlibdeps -s -Nlibreoffice$(VER)-officebean \
3338                         -Lure -Luno-libs3 \
3339                         -ldebian/uno-libs3/$(OOUREDIR)/lib:debian/ure/$(OOUREDIR)/lib:$(PKGDIR)-core/$(OODIR)/program:$(PKGDIR)-base/$(OODIR)/program:$(shell dirname $(shell dpkg -L `echo $(GCJ_JAWT_DEPENDS) | sed -e s/-awt//` | grep _bc)) \
3340                         $(SHLIBS_OVERRIDE)
3341 ifneq (,$(filter redland, $(SYSTEM_STUFF)))
3342         # dpkg-shlibdeps "in practice" always will look for this in
3343         # /usr/lib/openoffice/basisX.Y/program due to the RPATH and the
3344         # dh_shlibdeps would fail. It's excluded, and we now need to do it
3345         # manually. Saves us a versioned build-conflict with ourselves
3346         # which quickly can get outdated
3347         perl -pi -e 's/(shlibs.*$$)/$$1, $(shell cat /var/lib/dpkg/info/$(shell dpkg -S /usr/lib/`objdump -p $(PKGDIR)-core/$(OOBASISDIR)/program/libunordf*.so | grep NEEDED | grep librdf | awk '{ print $$2 }'` | cut -d: -f1).shlibs | awk '{ print $$3,$$4,$$5 }')/' $(PKGDIR)-core.substvars
3348 endif
3349         # don't make uno-libs3 depend on ure...
3350         perl -pi -e 's/, ure \(.*\)$$//' debian/uno-libs3.substvars
3351         # .. and prevent ure to depend on itself..
3352         perl -pi -e 's/, ure \(.*\)$$//' debian/ure.substvars
3353 ifeq "$(ENABLE_JAVA)" "y"
3354         LD_LIBRARY_PATH="/usr/lib/libfakeroot:debian/uno-libs3/$(OOUREDIR)/lib:debian/ure/$(OOUREDIR)/lib:$(PKGDIR)-core/$(OODIR)/program" \
3355                 dh_shlibdeps -plibreoffice$(VER)-officebean \
3356                         -Lure -Luno-libs3 \
3357                         -ldebian/uno-libs3/$(OOUREDIR)/lib:debian/ure/$(OOUREDIR)/lib:$(PKGDIR)-core/$(OODIR)/program:$(GCJ_JAWT_DIR) \
3358                         $(SHLIBS_OVERRIDE)
3359 endif
3360 ifeq "$(LINK_TO_STLPORT)" "y"
3361         perl -pi -e 's/(shlibs.*$$)/$$1, $(shell cat /var/lib/dpkg/info/libstlport4.6*.shlibs | awk '{ print $$3,$$4,$$5 }')/' debian/ure.substvars
3362 endif
3363 ifeq "$(ENABLE_MONO)" "y"
3364         dh_makeclilibs -s
3365         dh_clideps -s
3366 endif
3367 ifeq "$(ENABLE_JAVA)" "y"
3368         jh_depends -s -Xlibreoffice$(VER)-gcj -Xlibreoffice$(VER)-dbg -Xure
3369   ifeq "$(PACKAGE_BASE)" "y"
3370         perl -pi -e "s/libhsqldb-java/$(BASE_HSQLDB_DEPENDS)/" \
3371                 debian/libreoffice$(VER)-base.substvars
3372   endif
3373         # jh_depends adds ure (${source:Version}) entries. They are overly strict
3374         # and do not fit anyway given ure has a different versioning scheme. Excluded
3375         # above, readd here  unversioned
3376         perl -pi -e 's/^(java:Depends.*$$)/\1, ure/' \
3377                 debian/libreoffice$(VER)-officebean.substvars
3378 endif
3379 # This switch to dh_shlibdeps reduces the 'libXXX not found' warnings but
3380 # causes ldd crashes sometimes when used with fakeroot:
3381 #          -l $(PKGDIR)-core/$(OPENOFFICEDIR)/program
3382         dh_gencontrol -s $(DEBHELPER_OPTIONS) -Nure -Nure-dbg -Nuno-libs3 -Nuno-libs3-dbg \
3383                 -Nlibreoffice$(VER)-presentation-minimizer \
3384                 -Nlibreoffice$(VER)-presenter-console \
3385                 -Nlibreoffice$(VER)-pdfimport \
3386                 -Nlibreoffice$(VER)-sdbc-postgresql \
3387                 -Nlibreoffice$(VER)-mysql-connector -- \
3388                 -V"ure:Version=$(shell grep UREPACKAGEVERSION $(SOURCE_TREE)/instsetoo_native/util/openoffice.lst | awk '{ print $$2 }')" \
3389                 -V'base-version=$(BASE_VERSION)' \
3390                 -V'help-l10n-virtual-version=$(HELP_L10N_VIRTUAL_VERSION)' \
3391                 -V'base-hsqldb-depends=$(BASE_HSQLDB_DEPENDS)' \
3392                 -V'java-common-depends=$(JAVA_COMMON_DEPENDS) $(JAVA_COMMON_DEPENDS_VERSION)' \
3393                 -V'java-runtime-depends=$(JAVA_RUNTIME_DEPENDS)' \
3394                 -V'java-gcj-depends=$(JAVA_GCJ_DEPENDS)' \
3395                 -V'mozilla-nss-depends=$(MOZILLA_NSS_DEPENDS)' \
3396                 -V'lucene-depends=$(LUCENE_DEPENDS)' \
3397                 -V'Binary-Version=$(BINARY_VERSION)' \
3398                 -V'ooo-binfilter-dep=$(OOO_BINFILTER_DEP)' \
3399                 -V'ooo-officebean-dep=$(OOO_OFFICEBEAN_DEP)' \
3400                 -V'kde-iconset-dep=$(KDE_ICONSET_DEP)' \
3401                 -V'lpsolve-dep=$(LPSOLVE_DEP)' \
3402                 -V'gstreamer-plugins-suggests=$(GSTREAMER_PLUGINS_SUGGESTS)' \
3403                 -V'libebook-dep=$(shell debian/scripts/get_libebook_dep.sh)' \
3404                 -V'libldap-suggests=$(LDAP_LIB)' \
3405                 -V'dbg-dbg-suggests=$(DBG_DBG_SUGGESTS)' \
3406                 -v$(BINARY_VERSION)
3407 ifeq "$(ENABLE_JAVA)" "y"
3408         perl -pi -e "s/java-gcj-compat/java-gcj-compat (>= 1.0.77-4)/" \
3409                 debian/libreoffice$(VER)-officebean/DEBIAN/control
3410 endif
3411 ifneq (,$(findstring $(ARCH),$(OOO_ARCH_DEP_EXTENSIONS_ARCHS)))
3412 ifeq "$(ENABLE_PDFIMPORT)" "y"
3413         dh_gencontrol -plibreoffice$(VER)-pdfimport -- \
3414                 -v$(shell grep "<version" $(SOURCE_TREE)/sdext/source/pdfimport/config/description.xml | perl -pi -e 's,<version.*value=\"(.*)\" />,\1,; s/^\s+//')+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
3415 endif
3416 ifeq "$(ENABLE_MINIMIZER)" "y"
3417         dh_gencontrol -plibreoffice$(VER)-presentation-minimizer -- \
3418                 -v$(shell grep "<version" $(SOURCE_TREE)/sdext/source/minimizer/description.xml | perl -pi -e 's,<version value=\"(.*)\"/>,\1,; s/^\s+//')+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
3419 endif
3420 ifeq "$(ENABLE_PRESENTER_CONSOLE)" "y"
3421         dh_gencontrol -plibreoffice$(VER)-presenter-console -- \
3422                 -v$(shell grep "<version" $(SOURCE_TREE)/sdext/source/presenter/description.xml | perl -pi -e 's,<version value=\"(.*)\" />,\1,; s/^\s+//')+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
3423 endif
3424 ifeq "$(PACKAGE_BASE)" "y"
3425   ifeq "$(ENABLE_SDBC_POSTGRESQL)" "y"
3426         dh_gencontrol -plibreoffice$(VER)-sdbc-postgresql -- \
3427                 -v`echo $(BINARY_VERSION) | cut -d: -f1`:$(shell grep ^PQ_SDBC_M $(SOURCE_TREE)/connectivity/source/drivers/postgresql/makefile.mk | cut -d"=" -f2 | xargs | sed -e s/\ /\./g)+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
3428   endif
3429   ifeq "$(ENABLE_MYSQLNATIVE)" "y"
3430         dh_gencontrol -plibreoffice$(VER)-mysql-connector -- \
3431                 -v$(shell grep "<version" $(SOURCE_TREE)/mysqlc/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/misc/description.xml | perl -pi -e 's,<version value=\"(.*)\" />,\1,; s/^\s+//; s/\s+$$//')+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
3432   endif
3433 endif
3434 endif
3435         dh_gencontrol -pure -pure-dbg -puno-libs3 -puno-libs3-dbg -- \
3436                 -V"ure:Version=`echo $(BINARY_VERSION) | cut -d: -f2`" \
3437                 -v"`echo $(BINARY_VERSION) | cut -d: -f2`"
3438         dh_md5sums -s
3439 ifeq "$(USE_XZ_COMPRESS)" "y"
3440         dh_builddeb -Nlibreoffice$(VER)-dbg -s $(DEBHELPER_OPTIONS) $(BUILDDEB_OPTIONS)
3441         dh_builddeb -plibreoffice$(VER)-dbg $(DEBHELPER_OPTIONS) $(filter-out -Zbzip2 -Zlzma,$(BUILDDEB_OPTIONS)) -Zxz
3442 else
3443         dh_builddeb -s $(DEBHELPER_OPTIONS) $(BUILDDEB_OPTIONS)
3444 endif
3445
3446         touch $@
3447
3448 binary-indep: $(GSI_EXPORT_STAMP) $(STAMP_DIR)/binary-indep
3449 $(STAMP_DIR)/binary-indep: $(STAMP_DIR)/install-indep debian/control $(STAMP_DIR)/maintscripts $(STAMP_DIR)/langpacks
3450 ifneq ($(ARCH),$(findstring $(ARCH),$(OOO_JAVA_ARCHS)))
3451         echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
3452         echo "For uploads with binary-all packages, please use arches where Java is enabled!!!!!"
3453         echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
3454 endif
3455 ifneq ($(ARCH),$(findstring $(ARCH),$(OOO_MONO_ARCHS)))
3456         echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
3457         echo "For uploads with binary-all packages, please use arches where Mono is enabled!!!!!"
3458         echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
3459 endif
3460         dh_testdir
3461         dh_testroot
3462
3463         for pkg in $(ARCH_INDEP_PACKAGES) ; do \
3464           rm -f debian/$$pkg.*.debhelper;\
3465           rm -rf debian/$$pkg/DEBIAN;\
3466         done
3467
3468 ifeq "$(PACKAGE_SDK)" "y"
3469         . $(SOURCE_TREE)/solenv/inc/udkversion.mk && \
3470         for i in common cpp java; do \
3471                 cat debian/udk-$$i-ref.in \
3472                         | sed -e "s/@UDK_MAJOR@/$$UDK_MAJOR/" \
3473                               -e "s/@UDK_MINOR@/$$UDK_MINOR/" \
3474                               -e "s/@UDK_MICRO@/$$UDK_MICRO/" \
3475                               -e "s/@VER@/$(VER)/" \
3476                         > debian/libreoffice-dev-doc.doc-base.udk-$$i-ref; \
3477         done
3478         # remove Autodoc_DiagnosticMessages.txt
3479         find $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev \
3480                 -name "Autodoc_DiagnosticMessages.txt" -exec rm {} \;
3481         UDK_CPP_FILES=`find $(CURDIR)/debian/libreoffice-dev-doc/usr/share/doc/libreoffice-dev/docs/cpp/ref | sed -e 's,$(CURDIR)/debian/libreoffice-dev-doc,,g' | xargs`; \
3482         echo "Files: $$UDK_CPP_FILES" >> debian/libreoffice-dev-doc.doc-base.udk-cpp-ref
3483   ifeq "$(ENABLE_JAVA)" "y"
3484         UDK_JAVA_FILES=`find $(CURDIR)/debian/libreoffice-dev-doc/usr/share/doc/libreoffice-dev/docs/java/ref | sed -e 's,$(CURDIR)/debian/libreoffice-dev-doc,,g' | xargs`; \
3485         echo "Files: $$UDK_JAVA_FILES" >> debian/libreoffice-dev-doc.doc-base.udk-java-ref
3486   endif
3487         # xargs strips the many files here so we need to post-process it.
3488         UDK_COMMON_FILES=`find $(CURDIR)/debian/libreoffice-dev-doc/usr/share/doc/libreoffice-dev/docs/common/ref | sed -e 's,$(CURDIR)/debian/libreoffice-dev-doc,,g' | xargs`; \
3489         TMP=`mktemp -q`; \
3490         cp debian/libreoffice-dev-doc.doc-base.udk-common-ref $$TMP; \
3491         echo "Files: $$UDK_COMMON_FILES" >> $$TMP; \
3492         cat $$TMP | perl -e 'while(<>) { if (/^Files/) {$$f=1;} if ($$f eq "1") { chomp(); } print $$_; }' > debian/libreoffice-dev-doc.doc-base.udk-common-ref; \
3493         rm -f $$TMP
3494         # no idea why this happens; afais this can't come from above
3495         # since it doesn't affect the files at the end of the lines...
3496         # But fix it..
3497         perl -pi -e 's,html/,html /,g' debian/libreoffice-dev-doc.doc-base.udk-common-ref
3498 endif
3499         dh_installdocs -i -A debian/README.Debian \
3500                 $(SOURCE_TREE)/instsetoo_native/util/LibreOffice/replace_file/*/en-US/README_en-US \
3501                 $(OOO_BUILD_TREE)/NEWS
3502         # note libreoffice.1 is already installed into -common by libreoffice-builds package-ooo
3503         dh_installman -i
3504         for i in `find $(PKGDIR)-common -type l -name "lo*.1"`; do \
3505                 mv $$i $$i.gz; \
3506                 if [ "`readlink $$i`" != "libreoffice.1.gz" ]; then \
3507                         ln -sf libreoffice.1.gz $$i.gz; \
3508                 fi; \
3509         done
3510         dh_installchangelogs -i -k
3511         dh_installmime -i
3512         dh_lintian -i
3513         dh_bugfiles -i -A
3514         dh_link -i
3515         dh_fixperms -i
3516         dh_icons -i
3517         dh_installxmlcatalogs -i
3518 ifeq "$(ENABLE_MONO)" "y"
3519         dh_installcligac -i
3520 endif
3521         dh_compress -i -X.py -X.mk -X.sxd -X.xcd.sample
3522         dh_installdeb -i
3523 ifeq "$(ENABLE_MONO)" "y"
3524         dh_makeclilibs -i
3525         dh_clideps -i
3526 endif
3527 ifeq "$(ENABLE_JAVA)" "y"
3528         # the help recommends lucene. this is enough. no need for a hard depend in
3529         # -common, IMHO
3530         jh_depends -i -Xlibreoffice$(VER)-gcj -Xlibreoffice$(VER)-dbg -Xliblucene2-java
3531 endif
3532         dh_gencontrol -i $(DEBHELPER_OPTIONS) \
3533                 -Nlibreoffice$(VER)-report-builder \
3534                 -Nlibreoffice$(VER)-wiki-publisher \
3535                 -Nlibuno-cli-basetypes1.0-cil \
3536                 -Nlibuno-cli-uretypes1.0-cil \
3537                 -Nlibuno-cli-oootypes1.0-cil \
3538                 -Nlibuno-cli-cppuhelper1.0-cil \
3539                 -Nlibuno-cli-ure1.0-cil \
3540                 -Nttf-opensymbol \
3541                 -Nopenoffice.org-dtd-officedocument1.0 -- \
3542                 -V'base-version=$(BASE_VERSION)' \
3543                 -V'basis-version=$(BASIS_VERSION)' \
3544                 -V'next-basis-version=$(NEXT_BASIS_VERSION)' \
3545                 -V'help-l10n-virtual-version=$(HELP_L10N_VIRTUAL_VERSION)' \
3546                 -V'bsh-depends=$(BSH_DEPENDS)' \
3547                 -V'java-common-depends=$(JAVA_COMMON_DEPENDS)' \
3548                 -V'java-runtime-depends=$(JAVA_RUNTIME_DEPENDS)' \
3549                 -V'lucene-depends=$(LUCENE_DEPENDS)' \
3550                 -V'lucene-conflicts=$(LUCENE_CONFLICTS)' \
3551                 -V'textcat-data-recommends=$(TEXTCAT_DATA_RECOMMENDS)' \
3552                 -V'Binary-Version=$(BINARY_VERSION)' \
3553                 -V'ooo-binfilter-dep=$(OOO_BINFILTER_DEP)' \
3554                 -V'dbg-dbg-suggests=$(DBG_DBG_SUGGESTS)' \
3555                 -v$(BINARY_VERSION)
3556 ifeq "$(ENABLE_MONO)" "y"
3557         # although this version gets increased before every OOo release
3558         # we need the +LibO anyway when we build milestones..
3559         dh_gencontrol -plibuno-cli-basetypes1.0-cil -- \
3560                 -v$(shell grep CLI_BASETYPES_NEW_VERSION $(SOURCE_TREE)/cli_ure/version/version.txt | cut -d"=" -f2)+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
3561         dh_gencontrol -plibuno-cli-uretypes1.0-cil -- \
3562                 -v$(shell grep CLI_URETYPES_NEW_VERSION $(SOURCE_TREE)/cli_ure/version/version.txt | cut -d"=" -f2)+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
3563         dh_gencontrol -plibuno-cli-oootypes1.0-cil -- \
3564                 -v$(shell grep CLI_OOOTYPES_NEW_VERSION $(SOURCE_TREE)/unoil/climaker/version.txt | cut -d"=" -f2)+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
3565         dh_gencontrol -plibuno-cli-cppuhelper1.0-cil -- \
3566                 -v$(shell grep CLI_CPPUHELPER_NEW_VERSION $(SOURCE_TREE)/cli_ure/version/version.txt | cut -d"=" -f2)+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
3567         dh_gencontrol -plibuno-cli-ure1.0-cil -- \
3568                 -v$(shell grep CLI_URE_NEW_VERSION $(SOURCE_TREE)/cli_ure/version/version.txt | cut -d"=" -f2)+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
3569 endif
3570 ifeq "$(PACKAGE_TTF_OPENSYMBOL)" "y"
3571         dh_gencontrol -pttf-opensymbol -- \
3572                 -v$(shell echo `echo $(BINARY_VERSION) | cut -d: -f1` + 1 | bc):$(shell fontforge -lang=ff -c 'Open($$1); Print ($$fontversion); Quit(0);' debian/ttf-opensymbol/usr/share/fonts/truetype/openoffice/opens___.ttf)+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
3573 endif
3574 ifeq "$(ENABLE_MEDIAWIKI)" "y"
3575         dh_gencontrol -plibreoffice$(VER)-wiki-publisher -- \
3576                 -V'mediawiki-jar-depends=$(MEDIAWIKI_JAR_DEPENDS)' \
3577                 -V'lucene-depends=$(LUCENE_DEPENDS)' \
3578                 -V'java-runtime-depends=$(JAVA_RUNTIME_DEPENDS)' \
3579                 -v$(shell grep "<version" $(SOURCE_TREE)/swext/mediawiki/src/description.xml | perl -pi -e 's,<version value=\"(.*)\"/>,\1,; s/^\s+//')+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
3580 endif
3581 ifeq "$(ENABLE_REPORTDESIGN)" "y"
3582         dh_gencontrol -plibreoffice$(VER)-report-builder -- \
3583                 -V'base-version=$(BASE_VERSION)' \
3584                 -V'report-builder-jar-depends=$(REPORT_BUILDER_JAR_DEPENDS)' \
3585                 -V'java-runtime-depends=$(JAVA_RUNTIME_DEPENDS)' \
3586                 -v`echo $(BINARY_VERSION) | cut -d: -f1`:$(shell grep "<version" $(SOURCE_TREE)/reportbuilder/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/misc/description.xml | perl -pi -e 's,<version value=\"(.*)\"/>,\1,; s/^\s+//')+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
3587 endif
3588         dh_gencontrol -popenoffice.org-dtd-officedocument1.0 -- \
3589                 -v$(shell echo `echo $(BINARY_VERSION) | cut -d: -f1` + 1 | bc):1.0+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
3590         dh_md5sums -i -Xjavasettingsunopkginstall.xml
3591         dh_builddeb -i $(DEBHELPER_OPTIONS) $(BUILDDEB_OPTIONS)
3592
3593         touch $@
3594
3595 binary: binary-arch binary-indep
3596
3597 # Get ooo-build
3598 get-ooo-build:
3599         if echo $(OOO_BUILD_VERSION) | egrep -q "\."; then \
3600                 wget http://download.go-oo.org/$(MWS)/ooo-build-$(OOO_BUILD_TARBALL_VERSION).tar.gz && \
3601                 mv ooo-build-$(OOO_BUILD_TARBALL_VERSION).tar.gz ../libreoffice_$(UPSTREAM_VERSION).orig-ooo-build-$(OOO_BUILD_TARBALL_VERSION).tar.gz && \
3602                 tar xfvz ooo-build-$(OOO_BUILD_TARBALL_VERSION).tar.gz && \
3603                 mv ooo-build-$(OOO_BUILD_TARBALL_VERSION) $(OOO_BUILD_TREE); \
3604         else \
3605                 if test -n "$$TMP"; then \
3606                         TMPD=`mktemp -d -p $$TMP`; \
3607                 else \
3608                         TMPD=`mktemp -d`; \
3609                 fi && \
3610                 cd $$TMPD && pwd && \
3611                 $(CURDIR)/$(OOO_BUILD_TREE)/bin/ooo-pack-sources --force --no-lo-pieces $(CURDIR)/$(OOO_BUILD_TREE) && \
3612                 tar xfvz ooo-build-$(OOO_BUILD_TARBALL_VERSION).tar.gz && \
3613                 mv ooo-build-$(OOO_BUILD_TARBALL_VERSION) $(OOO_BUILD_TREE) && \
3614                 rm ooo-build-$(OOO_BUILD_TARBALL_VERSION).tar.gz archive/ooo-build-$(OOO_BUILD_TARBALL_VERSION).tar.gz && \
3615                 tar cfvz $(CURDIR)/../libreoffice_$(UPSTREAM_VERSION).orig-ooo-build-$(OOO_BUILD_VERSION).tar.gz $(OOO_BUILD_TREE) && \
3616                 rm -rf $$TMPD; \
3617         fi
3618
3619 # Get upstream external sources
3620 get-ext-sources:
3621         rm -rf $(TARFIILE_LOCATION)
3622         mkdir -p $(TARFILE_LOCATION)
3623         wget http://cgit.freedesktop.org/ooo-build/bootstrap/plain/fetch_tarballs.sh?id=ooo/$(GIT_TAG) -O fetch_tarballs.sh && chmod 755 fetch_tarballs.sh && \
3624         wget http://cgit.freedesktop.org/ooo-build/bootstrap/plain/ooo.lst?id=ooo/$(GIT_TAG) -O ooo.lst && \
3625         ./fetch_tarballs.sh ooo.lst; \
3626         rm -f fetch_tarballs.sh ooo.lst
3627
3628 get-orig-source:
3629         if ! which git >/dev/null 2>/dev/null; then \
3630                 echo "You need git."; \
3631                 exit 1; \
3632         fi; \
3633         if test -n "$$TMP"; then \
3634                 TMPD=`mktemp -d -p $$TMP`; \
3635         else \
3636                 TMPD=`mktemp -d`; \
3637         fi && \
3638         cd $$TMPD && \
3639         mkdir -p libreoffice-$(UPSTREAM_VERSION) && \
3640         cd libreoffice-$(UPSTREAM_VERSION) && \
3641                 cp -ra $(CURDIR)/$(OOO_BUILD_TREE) $(OOO_BUILD_TREE); \
3642                 cd $(OOO_BUILD_TREE) && \
3643                         ./configure --with-tag=$(TAG) --with-distro=$(PATCHSET) \
3644                                 --with-git --with-lang="$(BUILD_ISOS)" && \
3645                         ./download && \
3646                         mkdir ../ext-sources-$(OOO_BUILD_TREE) && \
3647                         for i in biblio.tar.bz2 extras-3.tar.bz2 ????????????????????????????????-*; do \
3648                                 mv src/$$i ../ext-sources-$(OOO_BUILD_TREE); \
3649                         done && \
3650                 cd .. && \
3651                 tar cfvz $(CURDIR)/../libreoffice_$(UPSTREAM_VERSION).orig-ext-sources-$(OOO_BUILD_TREE).tar.gz ext-sources-$(OOO_BUILD_TREE) && \
3652                 rm -rf ext-sources-$(OOO_BUILD_TREE) && \
3653                 cd $(OOO_BUILD_TREE) && \
3654                         ./bin/ooo-pack-sources --force --no-lo-build . && \
3655                         mv archive ../archive-$(OOO_BUILD_TREE) && \
3656                 cd ../archive-$(OOO_BUILD_TREE) && \
3657                 tar xfvj ooo-build-$(OOO_BUILD_TARBALL_VERSION)-libs-extern-sys.tar.bz2 && \
3658                 for i in da_DK en_GB ru_RU; do \
3659                         if [ "$$i" = "en_GB" ]; then j=en; else j=$$i; fi; \
3660                         rm ooo-build-$(OOO_BUILD_TARBALL_VERSION)-libs-extern-sys/dictionaries/$$j/hyph_$${i}.dic; \
3661                 done && \
3662                 tar cfvj ooo-build-$(OOO_BUILD_TARBALL_VERSION)-libs-extern-sys.tar.bz2.dfsg ooo-build-$(OOO_BUILD_TARBALL_VERSION)-libs-extern-sys && \
3663                 ln -sf ooo-build-$(OOO_BUILD_TARBALL_VERSION)-libs-extern-sys.tar.bz2.dfsg ooo-build-$(OOO_BUILD_TARBALL_VERSION)-libs-extern-sys.tar.bz2 && \
3664                 rm -rf ooo-build-$(OOO_BUILD_TARBALL_VERSION)-libs-extern-sys && \
3665                 cd $$TMPD/libreoffice-$(UPSTREAM_VERSION) && tar cfvz libreoffice_$(UPSTREAM_VERSION).orig-archive-$(OOO_BUILD_VERSION).tar.gz archive-$(OOO_BUILD_VERSION) && \
3666                 rm -rf libreoffice-$(UPSTREAM_VERSION) && \
3667                 mv libreoffice_$(UPSTREAM_VERSION).orig-archive-$(OOO_BUILD_VERSION).tar.gz $(CURDIR)/.. && \
3668                 rm -rf $$TMPD
3669         if test -n "$$TMP"; then \
3670                 TMPD=`mktemp -d -p $$TMP`; \
3671         else \
3672                 TMPD=`mktemp -d`; \
3673         fi && \
3674         cd $$TMPD && \
3675                 export TARFILE_LOCATION=`basename $(TARFILE_LOCATION)`; \
3676                 $(CURDIR)/debian/rules get-ext-sources && \
3677                 zip -d $$TARFILE_LOCATION/*liblayout.zip resource/rfc1345.txt && \
3678                 rm $$TARFILE_LOCATION/*JLanguageTool && \
3679                 tar cfvz libreoffice_$(UPSTREAM_VERSION).orig-$$TARFILE_LOCATION.tar.gz $$TARFILE_LOCATION && \
3680                 mv libreoffice_$(UPSTREAM_VERSION).orig-$$TARFILE_LOCATION.tar.gz $(CURDIR)/.. && \
3681                 rm -rf $$TMPD
3682         # get ooo-build
3683         if test -n "$$TMP"; then \
3684                 TMPD=`mktemp -d -p $$TMP`; \
3685         else \
3686                 TMPD=`mktemp -d`; \
3687         fi && \
3688         if [ ! -d $(OOO_BUILD_TREE) ]; then ./debian/rules get-ooo-build; fi
3689         tar cfvz ../libreoffice_$(UPSTREAM_VERSION).orig-$(OOO_BUILD_TREE).tar.gz $(OOO_BUILD_TREE)
3690
3691 # Download the latest sources needed for ooo-build. Note that is
3692 # might download more than actually needed here....
3693 download: $(OOO_BUILD_TREE)/config.status
3694         $(OOO_BUILD_TREE)/download      
3695
3696 .PHONY: control
3697 .PHONY: clean-debdir clean-instsetoo clean-objectdirs clean default configure
3698 .PHONY: build build-indep build-arch install-arch install-indep
3699 .PHONY: $(stampdir_targets)
3700
3701 # vim:set noet ai sts=8 sw=8 tw=0: