PageRenderTime 70ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/rules

https://bitbucket.org/markjenkins/libreoffice_ubuntu-debian-fixes_againt_packaging
Makefile | 3133 lines | 2515 code | 293 blank | 325 comment | 166 complexity | 9115ea07ade6e5734c2c80f94d52e9be MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception
  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. vafilt = $(subst $(2)=,,$(filter $(2)=%,$(1)))
  17. include /usr/share/dpkg/pkg-info.mk
  18. CURDIR ?= $(realpath $(dir $(firstword $(MAKEFILE_LIST)))/..)
  19. BASE_VERSION:=$(shell echo $(DEB_VERSION) | cut -d: -f1):$(DEB_VERSION_UPSTREAM)
  20. BINARY_VERSION=$(DEB_VERSION)
  21. #HELP_L10N_VIRTUAL_VERSION:=$(shell echo $(DEB_VERSION_UPSTREAM) | cut -d: -f2 | tr [~] [\\-])
  22. HELP_L10N_VIRTUAL_VERSION:=3.5
  23. #VER:=3
  24. OOVER:=3.5
  25. NEXT_OOVER:=$(shell echo "$(OOVER) + 0.1" | bc)
  26. ARCH_INDEP_PACKAGES := $(shell dh_listpackages -i)
  27. ARCH_DEP_PACKAGES := $(shell dh_listpackages -s)
  28. PACKAGES := $(ARCH_INDEP_PACKAGES) $(ARCH_DEP_PACKAGES)
  29. include /usr/share/dpkg/architecture.mk
  30. include /usr/share/dpkg/vendor.mk
  31. DISTREL := $(shell lsb_release -cs)
  32. SHELL:=/bin/bash
  33. SYSTEM_GCC_VERSION = $(shell gcc --version | sed -n '/^gcc/s/.*\(.\..\)\..$$/\1/p')
  34. # Debian buildds run as user `buildd', other are using /CurrentlyBuilding
  35. ON_BUILDD := $(shell if [ "`whoami`" = buildd -o -f /CurrentlyBuilding ] || echo $(CURDIR) | grep -q \/build\/buildd; then echo y; else echo n; fi)
  36. PKGDIR:=debian/libreoffice$(VER)
  37. OODIRNAME=libreoffice$(VER)
  38. OODIR:=usr/lib/$(OODIRNAME)
  39. OOUREDIR:=usr/lib/ure
  40. OOSDKDIR:=$(OODIR)/sdk
  41. # Figure out who's building this package.
  42. OOO_VENDOR:=The Document Foundation/Debian
  43. ifeq "$(DEB_VENDOR)" "Ubuntu"
  44. OOO_VENDOR=The Document Foundation, Debian and Ubuntu
  45. endif
  46. export OOO_VENDOR
  47. # debhelper
  48. export DH_OPTIONS
  49. export DH_ALWAYS_EXCLUDE=CVS:.svn:.bzr:.git
  50. #export DH_VERBOSE=1
  51. # quilt
  52. export QUILT_PATCHES=debian/patches
  53. export QUILT_OPTIONS="-p1 -F0"
  54. SOURCE_TREE=.
  55. STAMP_DIR=debian/stampdir
  56. TARFILE_LOCATION=$(CURDIR)/src
  57. export TARFILE_LOCATION
  58. USE_SOURCE_TARBALLS=y
  59. USE_GIT_TARBALLS=n
  60. ifeq "$(USE_GIT_TARBALLS)" "y"
  61. GIT_BASEURL:=git://anongit.freedesktop.org/libreoffice
  62. lo_sources_ver=3.5.4.2
  63. # NOT in proper libreoffice-3-5 branch
  64. # use ./g checkout -b tag-libreoffice-3.5.4.2 libreoffice-3.5.4.2
  65. GIT_TAG=libreoffice-$(lo_sources_ver)
  66. GIT_BRANCH=tag-libreoffice-$(lo_sources_ver)
  67. endif
  68. ifeq "$(USE_SOURCE_TARBALLS)" "y"
  69. lo_sources_ver=$(shell cat $(CURDIR)/sources.ver | cut -d= -f2)
  70. endif
  71. ifeq "$(DISTREL)" "squeeze"
  72. SQUEEZE_BACKPORT=y
  73. endif
  74. #########
  75. # Default package configuration
  76. #
  77. OOO_ARCHS = alpha amd64 armel armhf hppa i386 ia64 mips mipsel powerpc powerpcspe ppc64 s390 s390x sparc kfreebsd-amd64 kfreebsd-i386
  78. PATCHSET=$(DEB_VENDOR)
  79. BUILD_DEPS=
  80. # These are components which can be built from internal copies, or used from the
  81. # distribution. See configure --help for valid values (--with-system-<value>).
  82. SYSTEM_STUFF = dicts
  83. BUILD_PYUNO=y
  84. ENABLE_PYTHON3=y
  85. ifeq "$(BUILD_PYUNO)" "y"
  86. ENABLE_SCRIPT_PROVIDER_PYTHON=y
  87. endif
  88. # THIS IS ONLY FOR TESTING. When building against a specified pythonX.Y
  89. # this will work inside OOo but *not* from outside OOo unless the user
  90. # uses pythonX.Y directly (and the dh_pycentral-created dependencies allow
  91. # also the non-working default python then) - see e.g. #587402. Also
  92. # note we are NOT working with python < 2.6 anymore!
  93. PYTHON_VERSION=current
  94. ifeq "$(PYTHON_VERSION)" "current"
  95. PYTHON=python (>= 2.6)
  96. export PYTHON=python
  97. else
  98. PYTHON=python$(PYTHON_VERSION)
  99. export PYTHON=python$(PYTHON_VERSION)
  100. endif
  101. ifeq "$(ENABLE_PYTHON3)" "y"
  102. PYTHON3_VERSION=current
  103. ifeq "$(PYTHON3_VERSION)" "current"
  104. PYTHON3=python3
  105. else
  106. PYTHON3=python$(PYTHON3_VERSION)
  107. endif
  108. endif
  109. PACKAGE_TTF_OPENSYMBOL=y
  110. BUILD_BINFILTERS=y
  111. BUILD_ONLY_EN_US=n
  112. ENABLE_JAVA=y
  113. ifeq "$(ENABLE_JAVA)" "y"
  114. JDK=openjdk
  115. JAVA_MAINVER=6
  116. ifneq (,$(filter hppa kfreebsd%, $(DEB_HOST_ARCH)))
  117. JDK=gcj-jdk
  118. endif
  119. endif
  120. JAVAHELPER_MIN_VERSION= (>= 0.37~)
  121. SYSTEM_STUFF += hunspell
  122. HUNSPELL_MIN_VER= (>= 1.1.5-2)
  123. SYSTEM_STUFF += altlinuxhyph
  124. USE_LIBHYPHEN=y
  125. LIBALTLINUXHYPH_MINVER= (>= 0.1.1-11)
  126. LIBHYPHEN_MINVER= (>= 2.4)
  127. SYSTEM_STUFF += boost
  128. BOOST_VERSION=default
  129. ifeq "$(BOOST_VERSION)" "default"
  130. BOOST_MINVER= (>= 1.38)
  131. endif
  132. ifeq "$(BOOST_VERSION)" "1.39"
  133. BOOST_MINVER= (>= 1.39.0-2)
  134. endif
  135. SYSTEM_STUFF += mdds
  136. SYSTEM_STUFF += vigra
  137. USE_EXTERNAL_CXXLIBS=y
  138. #SYSTEM_STUFF += sablot
  139. SYSTEM_STUFF += mythes
  140. SYSTEM_STUFF += icu
  141. ICU_MINVER= (>= 4.0)
  142. SYSTEM_STUFF += libwpd libwpg libwps
  143. SYSTEM_STUFF += libvisio
  144. #SYSTEM_STUFF += xmlsec
  145. BUILD_CAIROCANVAS=y
  146. SYSTEM_STUFF += cairo
  147. CAIRO_FONTS_PATCH=y
  148. BUILD_KDE=y
  149. # not ported to KDE 4
  150. ENABLE_KDEAB=n
  151. ifeq "$(SYSTEM_GCC_VERSION)" "4.7"
  152. # < 4.8 fails with gcc 4.7, see #667911
  153. QT_MINVER= (>= 4:4.8)
  154. else
  155. QT_MINVER= (>= 4:4.5)
  156. endif
  157. KDELIBS_MINVER= (>= 4:4.3.4)
  158. BUILD_DBG_PACKAGE=y
  159. ifeq "$(BUILD_DBG_PACKAGE)" "y"
  160. ENABLE_SYMBOLS=y
  161. SMALL_SYMBOLS=y
  162. endif
  163. ifeq "$(ENABLE_JAVA)" "y"
  164. # NOTE: If you change this while gcj/ant multiarch combo is still broken
  165. # you need to disable bsh scripting engine completely (see disable-rhino.diff)
  166. # See http://lists.debian.org/debian-java/2011/06/msg00108.html and replies
  167. SYSTEM_STUFF += beanshell
  168. SYSTEM_STUFF += hsqldb
  169. HSQLDB_MINVER= (>> 1.8.0.10)
  170. HSQLDB_TOONEWVER=1.8.1
  171. # disabled because system-saxon breaks all kinds exports using XSLT transforms
  172. # (e.g. M$ Word/Excel 2003 XML, Mediawiki, XHTML, UOF, ...)
  173. # It does *NOT* fail with _plain_ saxon 9.0.0.8 built with OOos build.xml
  174. # for UOF, but still for e.g. M$.
  175. #SYSTEM_STUFF += saxon
  176. SYSTEM_STUFF += lucene
  177. endif
  178. SYSTEM_STUFF += lpsolve
  179. USE_SHARED_LPSOLVE=y
  180. LPSOLVE_MIN_VERSION= (>= 5.5.0.13-5+b1)
  181. USE_DBUS=y
  182. USE_GSTREAMER=y
  183. SYSTEM_STUFF += neon
  184. NEON_SECTYPE=gnutls
  185. NEONSONR=27
  186. SYSTEM_STUFF += redland
  187. PACKAGE_SDK=y
  188. ifeq "$(ENABLE_JAVA)" "y"
  189. ifeq "$(JDK)" "openjdk"
  190. RUN_MAKE_CHECK=y
  191. ENABLE_JUNIT4=y
  192. endif
  193. else
  194. RUN_MAKE_CHECK=n
  195. ENABLE_JUNIT4=n
  196. endif
  197. ifeq "$(ENABLE_JUNIT4)" "y"
  198. JUNIT_MIN_VER= (>= 4.8.2-2)
  199. endif
  200. USE_LIBCURL4=y
  201. CURL_SECTYPE=gnutls
  202. USE_SYSTEM_DMAKE=y
  203. USE_LIBSUITESPARSE=y
  204. SUITESPARSE_MIN_VERSION= (>= 1:3.4.0)
  205. PARALLEL_BUILD=y
  206. ENABLE_LDAP=y
  207. USE_OPENLDAP=y
  208. ENABLE_OPENGL=y
  209. SYSTEM_STUFF += openssl
  210. NEW_DPKG_SHLIBDEPS=y
  211. ifeq "$(ENABLE_JAVA)" "y"
  212. ENABLE_REPORTDESIGN=y
  213. SYSTEM_STUFF += jfreereport
  214. ENABLE_MEDIAWIKI=y
  215. SYSTEM_STUFF += apache-commons
  216. ENABLE_SCRIPT_PROVIDER_BSH=y
  217. ENABLE_SCRIPT_PROVIDER_JS=y
  218. else
  219. ENABLE_REPORTDESIGN=n
  220. ENABLE_MEDIAWIKI=n
  221. ENABLE_SCRIPT_PROVIDER_BSH=n
  222. ENABLE_SCRIPT_PROVIDER_JS=n
  223. endif
  224. ENABLE_SDBC_POSTGRESQL=y
  225. ENABLE_MINIMIZER=y
  226. ENABLE_PRESENTER_CONSOLE=y
  227. ENABLE_PDFIMPORT=y
  228. BUILD_GTK=y
  229. #ifeq "$(DEB_DISTRIBUTION)" "experimental"
  230. BUILD_GTK3=y
  231. #endif
  232. ENABLE_EVO2=y
  233. ENABLE_GVFS=n
  234. ENABLE_GCONF=y
  235. ENABLE_GIO=y
  236. ENABLE_RANDR=y
  237. ifeq "$(BUILD_GTK)" "y"
  238. PACKAGE_NSPLUGIN=n
  239. ifeq "$(PACKAGE_NSPLUGIN)" "y"
  240. SYSTEM_STUFF += mozilla-headers
  241. endif
  242. endif
  243. PACKAGE_BASE=y
  244. ENABLE_GRAPHITE=y
  245. SYSTEM_STUFF += graphite
  246. ALLOC=system
  247. SYSTEM_STUFF += libexttextcat
  248. SYSTEM_STUFF += cppunit
  249. ENABLE_LIBRSVG=y
  250. SYSTEM_LIBRSVG=y
  251. # when we have a package we want to have to be installed on older things with some older
  252. # C++ ABI (like it was the case with libreoffice2), we need to set this. Don't touch
  253. # otherwise
  254. SYSTEM_STUFF += stdlibs
  255. DEFAULT_IMAGE=galaxy
  256. IMAGES:=$(DEFAULT_IMAGE) crystal hicontrast tango oxygen
  257. ENABLE_MYSQLNATIVE=y
  258. # cannot be disabled, unless you have a internal MySQL/PostgreSQL somewhere :-)
  259. SYSTEM_STUFF += mysql mysql-cppconn
  260. MYSQLCPPCONN_MINVER= (>= 1.1.0~r791)
  261. SYSTEM_STUFF += postgresql
  262. DICT_DIR=/usr/share/hunspell
  263. HYPH_DIR=/usr/share/hyphen
  264. THES_DIR=/usr/share/mythes
  265. SYSTEM_STUFF += libcmis
  266. SYSTEM_STUFF += jpeg
  267. SYSTEM_STUFF += libxml
  268. SYSTEM_STUFF += expat
  269. SYSTEM_STUFF += odbc
  270. SYSTEM_STUFF += curl
  271. SYSTEM_STUFF += sane
  272. SYSTEM_STUFF += xextensions-headers
  273. SYSTEM_STUFF += mesa-headers
  274. SYSTEM_STUFF += db
  275. SYSTEM_STUFF += poppler
  276. SYSTEM_STUFF += libpng
  277. SYSTEM_STUFF += nss
  278. SYSTEM_STUFF += sampleicc
  279. PACKAGE_UNOWINREG_DLL=y
  280. ifeq "$(DEB_VENDOR)" "Debian"
  281. BUILD_UNOWINREG_DLL=y
  282. endif
  283. # Default flags to pass to configure
  284. CONFIGURE_FLAGS= \
  285. --with-vendor='$(OOO_VENDOR)' \
  286. --with-install-dirname=$(OODIRNAME) \
  287. --prefix=/usr --mandir=/usr/share/man \
  288. --docdir=/usr/share/doc/libreoffice \
  289. --disable-strip-solver \
  290. --enable-lockdown \
  291. --libdir=/usr/lib \
  292. --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
  293. --enable-extension-integration \
  294. --disable-online-update \
  295. --disable-fetch-external \
  296. --enable-release-build \
  297. --without-fonts \
  298. --without-myspell-dicts
  299. ifneq ($(ON_BUILDD),y)
  300. CONFIGURE_FLAGS += --enable-verbose
  301. endif
  302. CONFIGURE_FLAGS += --with-alloc=$(ALLOC)
  303. #############
  304. # Architecture-specific changes
  305. # helper to generate no_archs macros (pass name of source macro)
  306. define gen_no_archs
  307. _no_arch_macro = $(subst OOO_,OOO_NO_,$1)
  308. _no_arch_tmp_$1 = $$(foreach _a,$$(filter-out $$(call $1),$(OOO_ARCHS)),!$$(_a))
  309. $$(_no_arch_macro) = $$(if $$(_no_arch_tmp_$1),$$(_empty) [$$(_no_arch_tmp_$1)])
  310. endef
  311. PLATFORMID := $(shell grep PLATFORMID debian/vars.$(DEB_HOST_ARCH) | cut -d"=" -f2)
  312. # ./configure defaults to STLport on i386 and we should keep it for
  313. # ABI-compatability
  314. OOO_STLPORT_ARCHS= i386
  315. ifeq "$(DEB_HOST_ARCH)" "i386"
  316. LINK_TO_STLPORT=y
  317. endif
  318. ifneq (,$(findstring mips,$(OOO_ARCHS)))
  319. BUILD_DEPS += , gcc-4.4 [mips mipsel], g++-4.4 [mips mipsel]
  320. ifneq (,$(findstring mips,$(DEB_HOST_ARCH)))
  321. GCC_VERSION := 4.4
  322. endif
  323. endif
  324. ifeq "$(ENABLE_OPENGL)" "y"
  325. # doesn't make that much sense on armel and mips(el), does it? :)
  326. OOO_OGLTRANS_ARCHS = $(filter-out armel mips%, $(OOO_ARCHS))
  327. ifeq (,$(filter $(DEB_HOST_ARCH),$(OOO_OGLTRANS_ARCHS)))
  328. ENABLE_OPENGL=n
  329. endif
  330. $(eval $(call gen_no_archs,OOO_OGLTRANS_ARCHS))
  331. endif
  332. ifneq (,$(findstring arm,$(DEB_HOST_ARCH)))
  333. ifneq (stdlibs,$(findstring stdlibs,$(SYSTEM_STUFF)))
  334. $(error sal does not build on arm with internal stdlibs!)
  335. endif
  336. endif
  337. OOO_64BIT_ARCHS = $(filter alpha amd64 ia64 kfreebsd-amd64 ppc64 s390x, $(OOO_ARCHS))
  338. # Java...
  339. OOO_JAVA_ARCHS = $(OOO_ARCHS)
  340. $(eval $(call gen_no_archs,OOO_JAVA_ARCHS))
  341. OOO_GCJ_ARCHS = $(filter-out $(OOO_OPENJDK_ARCHS), $(OOO_JAVA_ARCHS))
  342. $(eval $(call gen_no_archs,OOO_GCJ_ARCHS))
  343. OOO_GCJ_JDK_ARCHS := hppa kfreebsd-i386 kfreebsd-amd64
  344. OOO_OPENJDK_ARCHS := $(filter-out $(OOO_GCJ_JDK_ARCHS),$(OOO_JAVA_ARCHS))
  345. $(eval $(call gen_no_archs,OOO_OPENJDK_ARCHS))
  346. OOO_UNOWINREG_DLL_ARCHS := i386 amd64
  347. ifneq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),$(OOO_UNOWINREG_DLL_ARCHS)))
  348. PACKAGE_UNOWINREG_DLL=n
  349. endif
  350. OOO_ARCH_DEP_EXTENSIONS_ARCHS := $(OOO_ARCHS)
  351. OOO_EXTENSIONS_ARCHS := $(OOO_ARCH_DEP_EXTENSIONS_ARCHS)
  352. OOO_BASE_ARCHS := $(OOO_JAVA_ARCHS)
  353. $(eval $(call gen_no_archs,OOO_BASE_ARCHS))
  354. OOO_REPORTDESIGN_ARCHS := $(filter-out $(OOO_GCJ_JDK_ARCHS),$(OOO_JAVA_ARCHS))
  355. $(eval $(call gen_no_archs,OOO_REPORTDESIGN_ARCHS))
  356. ifneq (,$(findstring $(DEB_HOST_ARCH),$(OOO_NO_BASE_ARCHS)))
  357. ifneq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),$(OOO_BASE_ARCHS)))
  358. PACKAGE_BASE=n
  359. ENABLE_SDBC_POSTGRESQL=n
  360. ENABLE_MYSQLNATIVE=n
  361. ENABLE_EVO2=n
  362. ENABLE_KDEAB=n
  363. ENABLE_REPORTDESIGN=n
  364. DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-base libreoffice$(VER)-base-core
  365. DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-evolution -Nlibreoffice$(VER)-kab
  366. DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-sdbc-postgresql -Nlibreoffice$(VER)-mysql-connector
  367. DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-report-builder-bin -Nlibreoffice$(VER)-report-builder
  368. endif
  369. endif
  370. ifeq (,$(findstring $(DEB_HOST_ARCH),$(OOO_ARCH_DEP_EXTENSIONS_ARCHS)))
  371. ENABLE_MINIMIZER=n
  372. ENABLE_PDFIMPORT=n
  373. ENABLE_PRESENTER_CONSOLE=n
  374. ENABLE_MYSQLNATIVE=n
  375. DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-mysql-connector
  376. DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-report-builder-bin -Nlibreoffice$(VER)-report-builder
  377. DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-pdfimport -Nlibreoffice$(VER)-presentation-minimizer
  378. DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-presenter-console
  379. endif
  380. ifeq (,$(findstring $(DEB_HOST_ARCH),$(OOO_EXTENSIONS_ARCHS)))
  381. ENABLE_MEDIAWIKI=n
  382. ENABLE_REPORTDESIGN=n
  383. DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-report-builder-bin -Nlibreoffice$(VER)-report-builder
  384. DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-wiki-publisher -Nlibreoffice$(VER)-script-provider-python
  385. endif
  386. ifeq (,$(filter $(DEB_HOST_ARCH),$(OOO_JAVA_ARCHS)))
  387. ENABLE_JAVA=n
  388. ENABLE_REPORTDESIGN=n
  389. ENABLE_MEDIAWIKI=n
  390. DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-wiki-publisher
  391. DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-report-builder-bin -Nlibreoffice$(VER)-report-builder
  392. endif
  393. ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),$(OOO_GCJ_JDK_ARCHS)))
  394. ifneq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),$(OOO_OPENJDK_ARCHS)))
  395. ENABLE_REPORTDESIGN=n
  396. SYSTEM_STUFF := $(filter-out jfreereport, $(SYSTEM_STUFF))
  397. DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-report-builder-bin -Nlibreoffice$(VER)-report-builder
  398. endif
  399. endif
  400. # disable SRB on ia64 when building with internal jfreereport.
  401. # fails to build. ("The system is out of resources."). FIXME.
  402. ifeq (ia64,$(findstring ia64,$(OOO_OPENJDK_ARCHS)))
  403. ifeq (,$(findstring jfreereport,$(SYSTEM_STUFF)))
  404. OOO_REPORTDESIGN_ARCHS := $(filter-out ia64,$(OOO_REPORTDESIGN_ARCHS))
  405. ifeq "$(DEB_HOST_ARCH)" "ia64"
  406. ENABLE_REPORTDESIGN=n
  407. endif
  408. endif
  409. endif
  410. ifneq (,$(filter $(DEB_HOST_ARCH),$(OOO_GCJ_ARCHS)))
  411. BUILD_JARS_NATIVE=y
  412. endif
  413. ifeq "$(PACKAGE_NSPLUGIN)" "y"
  414. OOO_NSPLUGIN_ARCHS = $(OOO_ARCHS)
  415. else
  416. OOO_NSPLUGIN_ARCHS=
  417. endif
  418. $(eval $(call gen_no_archs,OOO_NSPLUGIN_ARCHS))
  419. # builds long and is for legacy filters. probably not needed on {arm,mips}{,el}
  420. ifneq (,$(filter arm% mips% m68k, $(DEB_HOST_ARCH)))
  421. BUILD_BINFILTERS=n
  422. endif
  423. OOO_BINFILTER_ARCHS:=$(filter-out arm% mips% m68k, $(OOO_ARCHS))
  424. #############
  425. # Distro-specific overrides
  426. # Debian
  427. ifeq "$(DEB_VENDOR)" "Debian"
  428. # we don't need to build all languages and the thesaurus on the buildds;
  429. # they do binary-only builds anyway
  430. ifeq ($(ON_BUILDD),y)
  431. BUILD_ONLY_EN_US=y
  432. endif
  433. CONFIGURE_FLAGS += --with-intro-progressbar-color=215,7,81
  434. endif
  435. # Debian Squeeze
  436. ifeq "$(SQUEEZE_BACKPORT)" "y"
  437. BUGS=mailto:debian-backports@lists.debian.org
  438. SYSTEM_STUFF := $(filter-out libwpd libwpg libwps mythes mdds libexttextcat graphite jfreereport libvisio poppler libcmis, $(SYSTEM_STUFF))
  439. JUNIT_MIN_VER=
  440. PARALLEL_BUILD=n
  441. ENABLE_PDFIMPORT=n
  442. endif
  443. CONFIGURE_FLAGS += $(foreach i, $(SYSTEM_STUFF),--with-system-$(i))
  444. CC_PREFIX:=$(shell gcc -dumpmachine)-
  445. ifneq "$(GCC_VERSION)" ""
  446. ifneq "$(SYSTEM_GCC_VERSION)" "$(GCC_VERSION)"
  447. BUILD_DEPS += , gcc-$(GCC_VERSION), g++-$(GCC_VERSION)
  448. endif
  449. endif
  450. BUILDDEB_OPTIONS = -- -Zxz
  451. ifneq "$(OOO_OGLTRANS_ARCHS)" ""
  452. ifneq (,$(findstring mesa-headers,$(SYSTEM_STUFF)))
  453. BUILD_DEPS += , libgl1-mesa-dev$(OOO_NO_OGLTRANS_ARCHS), libglu1-mesa-dev$(OOO_NO_OGLTRANS_ARCHS)
  454. endif
  455. endif
  456. ifneq "$(ENABLE_OPENGL)" "y"
  457. CONFIGURE_FLAGS += --disable-opengl
  458. endif
  459. ifneq "$(PACKAGE_SDK)" "y"
  460. CONFIGURE_FLAGS += --disable-odk
  461. endif
  462. ifneq "$(ENABLE_MINIMIZER)" "y"
  463. CONFIGURE_FLAGS += --disable-ext-presenter-minimizer
  464. endif
  465. ifneq "$(ENABLE_PRESENTER_CONSOLE)" "y"
  466. CONFIGURE_FLAGS += --disable-ext-presenter-console
  467. endif
  468. ifeq "$(ENABLE_PDFIMPORT)" "y"
  469. BUILD_DEPS += , libpoppler-dev (>= 0.8.0), libpoppler-private-dev, libpoppler-cpp-dev
  470. else
  471. CONFIGURE_FLAGS += --disable-ext-pdfimport
  472. endif
  473. # fails their tests
  474. ifeq "$(DEB_HOST_ARCH)" "alpha"
  475. ENABLE_GRAPHITE=n
  476. SYSTEM_STUFF := $(filter-out graphite, $(SYSTEM_STUFF))
  477. endif
  478. ifeq "$(DEB_HOST_ARCH)" "armel"
  479. ENABLE_GRAPHITE=n
  480. SYSTEM_STUFF := $(filter-out graphite, $(SYSTEM_STUFF))
  481. endif
  482. ifeq "$(DEB_HOST_ARCH)" "sparc"
  483. ENABLE_GRAPHITE=n
  484. SYSTEM_STUFF := $(filter-out graphite, $(SYSTEM_STUFF))
  485. endif
  486. ifeq "$(ENABLE_GRAPHITE)" "y"
  487. ifneq (,$(filter graphite, $(SYSTEM_STUFF)))
  488. BUILD_DEPS += , libgraphite2-dev (>= 0.9.3) [!alpha !armel !sparc]
  489. endif
  490. else
  491. CONFIGURE_FLAGS += --disable-graphite
  492. endif
  493. ifneq (,$(filter libexttextcat, $(SYSTEM_STUFF)))
  494. BUILD_DEPS += , libexttextcat-dev (>= 3.1.1)
  495. TEXTCAT_DATA_RECOMMENDS := libexttextcat-data
  496. endif
  497. ifneq (,$(filter jpeg, $(SYSTEM_STUFF)))
  498. BUILD_DEPS += , libjpeg-dev
  499. endif
  500. ifneq (,$(filter libxml, $(SYSTEM_STUFF)))
  501. BUILD_DEPS += , libxml2-dev
  502. BUILD_DEPS += , libxslt1-dev
  503. DBG_DBG_SUGGESTS+= , libxslt1-dbg
  504. endif
  505. ifneq (,$(filter expat, $(SYSTEM_STUFF)))
  506. BUILD_DEPS += , libexpat1-dev
  507. endif
  508. ifneq (,$(filter odbc, $(SYSTEM_STUFF)))
  509. BUILD_DEPS += , unixodbc-dev (>= 2.2.11)
  510. endif
  511. ifneq (,$(filter sane, $(SYSTEM_STUFF)))
  512. BUILD_DEPS += , libsane-dev
  513. endif
  514. ifneq (,$(filter xextensions-headers, $(SYSTEM_STUFF)))
  515. BUILD_DEPS += , libxrender-dev
  516. endif
  517. ifneq (,$(filter libpng, $(SYSTEM_STUFF)))
  518. BUILD_DEPS += , libpng12-dev
  519. endif
  520. ifeq (,$(filter curl, $(SYSTEM_STUFF)))
  521. BUILD_DEPS += , libcurl4-$(CURL_SECTYPE)-dev
  522. endif
  523. ifneq (,$(filter openssl, $(SYSTEM_STUFF)))
  524. BUILD_DEPS += , libssl-dev
  525. ifeq "$(SQUEEZE_BACKPORT)" "y"
  526. DBG_DBG_SUGGESTS += , libssl$(shell readlink /usr/lib/libssl.so | cut -d"." -f3,4,5)-dbg
  527. else
  528. DBG_DBG_SUGGESTS += , libssl$(shell readlink /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/libssl.so | cut -d"." -f3,4,5)-dbg
  529. endif
  530. endif
  531. ifneq "$(ENABLE_RSVG)" "y"
  532. ifeq "$(SYSTEM_LIBRSVG)" "y"
  533. BUILD_DEPS += , librsvg2-dev
  534. CONFIGURE_FLAGS += --enable-librsvg=auto
  535. else
  536. CONFIGURE_FLAGS += --enable-librsvg=internal
  537. endif
  538. else
  539. CONFIGURE_FLAGS += --enable-librsvg=no
  540. endif
  541. ifneq (,$(findstring db,$(SYSTEM_STUFF)))
  542. BUILD_DEPS += , libdb-dev
  543. DBG_DBG_SUGGESTS += , $(shell dpkg -s libdb-dev | grep Depends | awk '{ print $$2 }' | sed -e s/dev/dbg/)
  544. endif
  545. ifeq "$(BUILD_DBG_PACKAGE)" "y"
  546. ifneq (,$(findstring i386,$(DEB_HOST_ARCH)))
  547. SMALL_SYMBOLS = n
  548. else
  549. ifneq (,$(findstring amd64,$(DEB_HOST_ARCH)))
  550. SMALL_SYMBOLS = n
  551. endif
  552. endif
  553. 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, libcurl4-dbg
  554. endif
  555. ifeq "$(ENABLE_SYMBOLS)" "y"
  556. # Small symbols?
  557. ifeq "$(SMALL_SYMBOLS)" "y"
  558. CONFIGURE_FLAGS += --enable-symbols=SMALL
  559. CFLAGS := $(shell echo $(CFLAGS) | sed -e "s/-g/-g1/")
  560. CXXFLAGS := $(shell echo $(CXXFLAGS) | sed -e "s/-g/-g1/")
  561. export CFLAGS CXXFLAGS
  562. else
  563. CONFIGURE_FLAGS += --enable-symbols
  564. endif
  565. endif
  566. ifeq (debug,$(findstring debug,$(DEB_BUILD_OPTIONS)))
  567. CONFIGURE_FLAGS += --enable-debug
  568. endif
  569. # Build python depends from current python version
  570. PYMAJOR:=$(shell python -c "import sys; print sys.version_info[0]")
  571. PYMINOR:=$(shell python -c "import sys; print sys.version_info[1]")
  572. PYMINORPLUS1:=$(shell python -c "import sys; print sys.version_info[1]+1")
  573. PYTHON_SITE:=debian/python-uno/$(shell python -c 'from distutils import sysconfig; print(sysconfig.get_python_lib())')
  574. PY3MAJOR:=$(shell python3 -c "import sys; print (sys.version_info[0])")
  575. PY3MINOR:=$(shell python3 -c "import sys; print (sys.version_info[1])")
  576. PY3MINORPLUS1:=$(shell python3 -c "import sys; print (sys.version_info[1]+1)")
  577. PYTHON3_SITE:=debian/python3-uno/$(shell python3 -c 'from distutils import sysconfig; print(sysconfig.get_python_lib())')
  578. ifeq "$(BUILD_PYUNO)" "y"
  579. BUILD_DEPS += , python (>= 2.6.6-3+squeeze4)
  580. DBG_DBG_SUGGESTS+= , python-dbg
  581. BUILD_DEPS += , $(PYTHON)-dev (>= 2.6)
  582. ifeq "$(ENABLE_PYTHON3)" "y"
  583. BUILD_DEPS += , $(PYTHON3)-dev (>= 3.2)
  584. endif
  585. else
  586. BUILD_DEPS += , python
  587. endif
  588. BUILD_DEPS += , debhelper (>= 7.2.3~)
  589. ifeq "$(ENABLE_JAVA)" "y"
  590. ifeq "$(BUILD_JARS_NATIVE)" "y"
  591. STAMP_NATIVE_JARS = $(STAMP_DIR)/native-jars
  592. JAVA_GCJ_DEPENDS = libgcj-common (>= 1:4.1.1-14)
  593. endif
  594. endif
  595. ifeq "$(RUN_TESTTOOL)" "y"
  596. CONFIGURE_FLAGS += --enable-hids
  597. endif
  598. ifneq (,$(filter cppunit, $(SYSTEM_STUFF)))
  599. BUILD_DEPS += , libcppunit-dev (>= 1.12)
  600. endif
  601. ifeq "$(RUN_MAKE_CHECK)" "y"
  602. BUILD_DEPS += , gdb
  603. ifeq "$(ENABLE_JUNIT4)" "y"
  604. BUILD_DEPS += , junit4 $(JUNIT_MIN_VER)
  605. else
  606. CONFIGURE_FLAGS += --without-junit
  607. endif
  608. else
  609. CONFIGURE_FLAGS += --without-junit
  610. endif
  611. ifneq "$(BUILD_ONLY_EN_US)" "y"
  612. ifeq (lang=,$(findstring lang=,$(DEB_BUILD_OPTIONS)))
  613. ISOS=$(shell echo "$(DEB_BUILD_OPTIONS) " | sed -n 's/^.*lang=\([^\s].*\)\s.*/\1/p' | awk '{ print $$1 }' | sed -e 's/,/ /g')
  614. HELPISOS=$(shell echo "$(DEB_BUILD_OPTIONS) " | sed -n 's/^.*lang=\([^\s].*\)\s.*/\1/p' | awk '{ print $$1 }' | sed -e 's/,/ /g')
  615. LANGPACKISOS=$(shell echo "$(DEB_BUILD_OPTIONS) " | sed -n 's/^.*lang=\([^\s].*\)\s.*/\1/p' | awk '{ print $$1 }' | sed -e 's/,/ /g')
  616. else
  617. # Note that the first one here *has to be* en-US. the first one gets
  618. # gid_Module_Root as filelist later and the rest gid_Module_Root.$iso
  619. # but we can't/shouldn't do dynamic switching, so let en-US be the first
  620. # one to that gid_Module_Root always is english and the other langpacks
  621. # have gid_Module_Root.$iso
  622. #ISOS=$(shell $(SOURCE_TREE)/bin/lo-xlate-lang -i all')
  623. ISOS:=en-US af ar as ast be bg bn br bs ca ca-XV cs cy da de dz el \
  624. en-GB en-ZA eo es et eu fa fi fr ga gl gu he hi hr hu id is it ja \
  625. ka km ko ku lt lv mk mn ml mr nb ne nl nn nr nso oc om or \
  626. pa-IN pl pt pt-BR ro ru rw si sk sl sr ss st sv \
  627. ta te tg th tn tr ts ug uk uz ve vi xh zh-CN zh-TW zu
  628. #HELPISOS:=$(shell $(SOURCE_TREE)/bin/lo-xlate-lang -i all')
  629. HELPISOS:=en-US ca ca-XV cs da de dz el en-GB es et eu fi fr gl hi hu it \
  630. ja km ko nl om pl pt pt-BR ru sk sl sv zh-CN zh-TW
  631. #LANGPACKISOS:=$(shell $(SOURCE_TREE)/bin/lo-xlate-lang -i all')
  632. LANGPACKISOS:=en-US af ar as ast be bg bn br bs ca ca-XV cs cy da de dz el \
  633. en-GB en-ZA eo es et eu fa fi fr ga gl gu he hi hr hu id is it ja \
  634. ka km ko ku lt lv mk mn ml mr nb ne nl nn nr nso oc om or \
  635. pa-IN pl pt pt-BR ro ru rw si sk sl sr ss st sv \
  636. ta te tg th tn tr ts ug uk uz ve vi xh zh-CN zh-TW zu
  637. endif
  638. else
  639. ISOS=en-US
  640. HELPISOS=en-US
  641. LANGPACKISOS=en-US
  642. endif
  643. BUILD_ISOS = $(ISOS)
  644. ifneq "$(BUILD_ONLY_EN_US)" "y"
  645. ifneq "$(BUILD_ISOS)" "en-US"
  646. CONFIGURE_FLAGS += --with-lang="$(BUILD_ISOS)"
  647. endif
  648. endif
  649. ifeq "$(ENABLE_JAVA)" "y"
  650. ifeq "$(JDK)" "default"
  651. JAVA_HOME=/usr/lib/jvm/default-java
  652. BUILD_DEPS += , default-jdk$(OOO_NO_JAVA_ARCHS)
  653. endif
  654. ifeq "$(JDK)" "java-gcj-compat"
  655. JAVA_HOME=/usr/lib/jvm/java-gcj
  656. ifneq (,$(findstring armel,$(OOO_JAVA_ARCHS)))
  657. BUILD_DEPS += , gcj-4.3 (>= 4.3.1-2) [armel]
  658. endif
  659. endif
  660. ifeq "$(JDK)" "gcj-jdk"
  661. JAVA_HOME=/usr/lib/jvm/java-gcj
  662. BUILD_DEPS += , gcj-jdk$(OOO_NO_JAVA_ARCHS)
  663. endif
  664. ifeq "$(JDK)" "openjdk"
  665. ifeq "$(SQUEEZE_BACKPORT)" "y"
  666. BUILD_DEPS += , openjdk-$(JAVA_MAINVER)-jdk [$(filter-out $(OOO_GCJ_JDK_ARCHS),$(OOO_JAVA_ARCHS))]
  667. JAVA_HOME=/usr/lib/jvm/java-$(JAVA_MAINVER)-openjdk
  668. else
  669. ifeq "$(JAVA_MAINVER)" "6"
  670. BUILD_DEPS += , openjdk-$(JAVA_MAINVER)-jdk (>= 6b23~pre8-2) [$(filter-out ia64,$(filter-out $(OOO_GCJ_JDK_ARCHS),$(OOO_JAVA_ARCHS))])
  671. BUILD_DEPS += , openjdk-7-jdk [ia64]
  672. ifeq "$(DEB_HOST_ARCH)" "ia64"
  673. JAVA_MAINVER=7
  674. endif
  675. else
  676. BUILD_DEPS += , openjdk-$(JAVA_MAINVER)-jdk [$(filter-out $(OOO_GCJ_JDK_ARCHS),$(OOO_JAVA_ARCHS))]
  677. endif
  678. JAVA_HOME=/usr/lib/jvm/java-$(JAVA_MAINVER)-openjdk-$(DEB_HOST_ARCH)
  679. endif
  680. CONFIGURE_FLAGS += --with-java-target-version=1.5
  681. endif
  682. TEST_JAVA_HOME=$(JAVA_HOME)
  683. ifneq "$(OOO_GCJ_JDK_ARCHS)" ""
  684. BUILD_DEPS += , gcj-jdk [$(OOO_GCJ_JDK_ARCHS)]
  685. BUILD_DEPS += , gcj-native-helper [$(OOO_GCJ_ARCHS)], libgcj-common (>= 1:4.4.1) [$(OOO_GCJ_ARCHS)]
  686. endif
  687. ifeq "$(ENABLE_MEDIAWIKI)" "y"
  688. BUILD_DEPS += , ant (>= 1.7.0)$(OOO_NO_JAVA_ARCHS), ant-optional (>= 1.7.0)$(OOO_NO_JAVA_ARCHS)
  689. else
  690. BUILD_DEPS += , ant (>= 1.6.5)$(OOO_NO_JAVA_ARCHS)
  691. endif
  692. GCJ_VERSION = $(shell basename `readlink $(JAVA_HOME)/bin/gcj` | sed -e s/gcj-//)
  693. ifeq "$(SQUEEZE_BACKPORT)" "y"
  694. GCJ_JAWT_DEPENDS= $(shell dpkg -S /usr/lib/`readlink /usr/lib/libgcj_bc.so.1` | cut -d: -f1 | sed -e s/$$/-awt/)
  695. else
  696. 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/)
  697. endif
  698. DBG_DBG_SUGGESTS+= , $(shell echo $(GCJ_AWT_DEPENDS) | sed -e s/awt/dbg/)
  699. JAVA_RUNTIME_DEPENDS = default-jre | gcj-jre | java-gcj-compat
  700. # ifneq (,$(GCJ_JAWT_DEPENDS))
  701. # JAVA_RUNTIME_DEPENDS += | $(GCJ_JAWT_DEPENDS)
  702. # endif
  703. ifneq (,$(filter $(DEB_HOST_ARCH), $(OOO_OPENJDK_ARCHS)))
  704. ifneq "$(DEB_HOST_ARCH)" "ia64"
  705. JAVA_RUNTIME_DEPENDS += | openjdk-6-jre | openjdk-7-jre
  706. else
  707. JAVA_RUNTIME_DEPENDS += | openjdk-7-jre
  708. endif
  709. endif
  710. ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386))
  711. JAVA_RUNTIME_DEPENDS += | sun-java5-jre | sun-java6-jre
  712. endif
  713. JAVA_RUNTIME_DEPENDS += | java5-runtime
  714. # Suns Java "packages"
  715. JAVA_RUNTIME_DEPENDS += | jre
  716. GCJ_JAWT_DIR=$(shell dirname `dpkg -L $(GCJ_JAWT_DEPENDS) | grep libjawt.so | head -n 1`)
  717. export JAVA_HOME
  718. CONFIGURE_FLAGS += --with-jdk-home=$(JAVA_HOME)
  719. JAVA_COMMON_DEPENDS= , libreoffice$(VER)-java-common
  720. JAVA_COMMON_DEPENDS_VERSION:= (>= $(BASE_VERSION)~)
  721. ifneq (,$(filter saxon, $(SYSTEM_STUFF)))
  722. CONFIGURE_FLAGS += --with-system-saxon --with-saxon-jar=/usr/share/java/saxonb.jar
  723. BUILD_DEPS += , libsaxonb-java$(OOO_NO_JAVA_ARCHS)
  724. endif
  725. ifeq "$(PACKAGE_SDK)" "y"
  726. ifeq "$(PACKAGE_UNOWINREG_DLL)" "y"
  727. ifeq "$(BUILD_UNOWINREG_DLL)" "y"
  728. CONFIGURE_FLAGS += --enable-build-unowinreg
  729. ifeq "$(SQUEEZE_BACKPORT)" "y"
  730. BUILD_DEPS += , gcc-mingw32 [$(OOO_UNOWINREG_DLL_ARCHS)], mingw32-runtime[$(OOO_UNOWINREG_DLL_ARCHS)]
  731. CONFIGURE_FLAGS += --with-mingw-cross-compiler=i586-mingw32msvc-g++
  732. else
  733. BUILD_DEPS += , g++-mingw-w64-i686 [$(OOO_UNOWINREG_DLL_ARCHS)]
  734. CONFIGURE_FLAGS += --with-mingw-cross-compiler=i686-w64-mingw32-g++
  735. endif
  736. endif
  737. endif
  738. endif
  739. ifeq "$(ENABLE_MEDIAWIKI)" "y"
  740. CONFIGURE_FLAGS += --enable-ext-wiki-publisher
  741. ifneq (,$(filter apache-commons, $(SYSTEM_STUFF)))
  742. 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)
  743. MEDIAWIKI_JAR_DEPENDS := , libcommons-codec-java, libcommons-httpclient-java, libcommons-lang-java, libcommons-logging-java
  744. BUILD_DEPS += $(MEDIAWIKI_BUILD_DEPS)
  745. 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
  746. CONFIGURE_FLAGS += --with-system-servlet-api
  747. ifeq "$(SQUEEZE_BACKPORT)" "y"
  748. BUILD_DEPS += (<< 1.1.1-9), $(shell dpkg -s libcommons-logging-java | grep Suggests | cut -d"," -f1 | sed -e s/^\ // | awk '{ print $$2 }')
  749. CONFIGURE_FLAGS += --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)
  750. else
  751. BUILD_DEPS += (>= 1.1.1-9), $(shell dpkg -s libcommons-logging-java | grep Suggests | cut -d"," -f5 | sed -e s/^\ // | awk '{ print $$1 }')
  752. CONFIGURE_FLAGS += --with-servlet-api-jar=$(shell dpkg -L `dpkg -s libcommons-logging-java | grep Suggests | cut -d"," -f5 | sed -e s/^\ // | awk '{ print $$1 }'` | grep servlet-api.*\.jar$ | head -n 1)
  753. endif
  754. endif
  755. endif
  756. ifeq "$(ENABLE_REPORTDESIGN)" "y"
  757. # report-builder
  758. ifneq (,$(filter jfreereport, $(SYSTEM_STUFF)))
  759. 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)
  760. 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)
  761. BUILD_DEPS += $(REPORT_BUILDER_BUILD_DEPS)
  762. 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
  763. endif
  764. ifneq (,$(filter apache-commons, $(SYSTEM_STUFF)))
  765. REPORT_BUILDER_BUILD_DEPS += , libcommons-logging-java$(OOO_NO_JAVA_ARCHS)
  766. REPORT_BUILDER_JAR_DEPENDS += , libcommons-logging-java
  767. CONFIGURE_FLAGS += --with-commons-logging-jar=/usr/share/java/commons-logging.jar
  768. ifeq "$(SQUEEZE_BACKPORT)" "y"
  769. BUILD_DEPS += (<< 1.1.1-9), $(shell dpkg -s libcommons-logging-java | grep Suggests | cut -d"," -f1 | sed -e s/^\ // | awk '{ print $$2 }')
  770. CONFIGURE_FLAGS += --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)
  771. else
  772. BUILD_DEPS += (>= 1.1.1-9), $(shell dpkg -s libcommons-logging-java | grep Suggests | cut -d"," -f5 | sed -e s/^\ // | awk '{ print $$1 }')
  773. CONFIGURE_FLAGS += --with-servlet-api-jar=$(shell dpkg -L `dpkg -s libcommons-logging-java | grep Suggests | cut -d"," -f5 | sed -e s/^\ // | awk '{ print $$1 }'` | grep servlet-api.*\.jar$ | head -n 1)
  774. endif
  775. endif
  776. else
  777. CONFIGURE_FLAGS += --disable-ext-report-builder
  778. endif
  779. OOO_OFFICEBEAN_DEP = libreoffice$(VER)-officebean
  780. BUILD_DEPS += , javahelper $(JAVAHELPER_MIN_VERSION)
  781. else
  782. CONFIGURE_FLAGS += --without-java
  783. 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
  784. endif
  785. ifneq (,$(filter nss, $(SYSTEM_STUFF)))
  786. BUILD_DEPS+= , libnss3-dev (>= 3.12.3)
  787. DBG_DBG_SUGGESTS+= , libnss3-1d-dbg
  788. endif
  789. ifneq (,$(filter mozilla-headers, $(SYSTEM_STUFF)))
  790. BUILD_DEPS+= , xulrunner-dev$(OOO_NO_NSPLUGIN_ARCHS)
  791. endif
  792. CONFIGURE_FLAGS += --disable-build-mozilla --disable-mozilla
  793. ifeq (,$(findstring $(DEB_HOST_ARCH),$(OOO_NSPLUGIN_ARCHS)))
  794. PACKAGE_NSPLUGIN=n
  795. CONFIGURE_FLAGS += --disable-nsplugin
  796. endif
  797. ifeq "$(USE_SYSTEM_DMAKE)" "y"
  798. BUILD_DEPS += , dmake (>= 1:4.11)
  799. endif
  800. ifneq (,$(filter hunspell, $(SYSTEM_STUFF)))
  801. BUILD_DEPS += , libhunspell-dev $(HUNSPELL_MIN_VER)
  802. endif
  803. CONFIGURE_FLAGS += --with-external-dict-dir=$(DICT_DIR)
  804. ifneq (,$(filter altlinuxhyph, $(SYSTEM_STUFF)))
  805. ifeq "$(USE_LIBHYPHEN)" "y"
  806. BUILD_DEPS += , libhyphen-dev $(LIBHYPHEN_MINVER)
  807. else
  808. BUILD_DEPS += , libaltlinuxhyph-dev $(LIBALTLINUXHYPH_MINVER)
  809. endif
  810. endif
  811. CONFIGURE_FLAGS += --with-external-hyph-dir=$(HYPH_DIR)
  812. ifneq "$(OOO_STLPORT_ARCHS)" ""
  813. LIBSTLPORT_MINVER= (>= 4.6.2-3)
  814. BUILD_DEPS += , libstlport4.6-dev $(LIBSTLPORT_MINVER) [$(OOO_STLPORT_ARCHS)]
  815. CONFIGURE_FLAGS += --without-stlport
  816. endif
  817. ifneq (,$(filter boost, $(SYSTEM_STUFF)))
  818. ifeq "$(BOOST_VERSION)" "1.34"
  819. ifeq "$(SYSTEM_GCC_VERSION)" "4.4"
  820. BUILD_DEPS += , libboost-dev (>= 1.34.1-15)
  821. else
  822. BUILD_DEPS += , libboost-dev
  823. endif
  824. ifeq "$(SYSTEM_GCC_VERSION)" "4.6"
  825. BUILD_DEPS += , g++-4.6 (>= 4.6.2-12)
  826. endif
  827. else
  828. ifneq "$(BOOST_VERSION)" "default"
  829. BUILD_DEPS += , libboost$(BOOST_VERSION)-dev $(BOOST_MINVER)
  830. #BUILD_DEPS += , libboost-thread$(BOOST_VERSION)-dev, libboost-program-options$(BOOST_VERSION)-dev
  831. else
  832. BUILD_DEPS += , libboost-dev $(BOOST_MINVER)
  833. #BUILD_DEPS += , libboost-thread-dev, libboost-program-options-dev
  834. endif
  835. endif
  836. endif
  837. ifneq (,$(filter mdds, $(SYSTEM_STUFF)))
  838. BUILD_DEPS += , libmdds-dev (>= 0.5.0)
  839. endif
  840. ifneq (,$(filter vigra, $(SYSTEM_STUFF)))
  841. BUILD_DEPS += , libvigraimpex-dev
  842. endif
  843. ifneq (,$(filter sampleicc, $(SYSTEM_STUFF)))
  844. BUILD_DEPS += , libsampleicc-dev, libicc-utils-dev
  845. endif
  846. ifeq "$(USE_EXTERNAL_CXXLIBS)" "y"
  847. ifneq (,$(filter libwpd, $(SYSTEM_STUFF)))
  848. BUILD_DEPS += , libwpd-dev (>= 0.9.0)
  849. endif
  850. ifneq (,$(filter sablot, $(SYSTEM_STUFF)))
  851. BUILD_DEPS += , libsablot0-dev (>= 1.0.2-4)
  852. endif
  853. ifneq (,$(filter mythes, $(SYSTEM_STUFF)))
  854. BUILD_DEPS += , libmythes-dev (>= 2:1.2)
  855. endif
  856. ifneq (,$(filter libwps, $(SYSTEM_STUFF)))
  857. BUILD_DEPS += , libwps-dev (>= 0.2.0)
  858. endif
  859. ifneq (,$(filter libwpg, $(SYSTEM_STUFF)))
  860. BUILD_DEPS += , libwpg-dev (>= 0.2.0)
  861. endif
  862. ifneq (,$(filter libvisio, $(SYSTEM_STUFF)))
  863. BUILD_DEPS += , libvisio-dev
  864. endif
  865. ifneq (,$(filter libcmis, $(SYSTEM_STUFF)))
  866. BUILD_DEPS += , libcmis-dev
  867. endif
  868. endif
  869. CONFIGURE_FLAGS += --with-external-thes-dir=$(THES_DIR)
  870. ifneq (,$(filter icu, $(SYSTEM_STUFF)))
  871. BUILD_DEPS += , libicu-dev $(ICU_MINVER)
  872. endif
  873. ifneq (,$(filter xmlsec, $(SYSTEM_STUFF)))
  874. BUILD_DEPS += , libxmlsec1-dev (>= 1.2.9), libxmlsec1-nss (>= 1.2.9), libxmlsec1-openssl (>= 1.2.9)
  875. endif
  876. ifeq "$(BUILD_CAIROCANVAS)" "y"
  877. ifneq (,$(filter cairo, $(SYSTEM_STUFF)))
  878. BUILD_DEPS+= , libcairo2-dev
  879. endif
  880. else
  881. CONFIGURE_FLAGS+= --disable-cairo
  882. endif
  883. ifeq "$(BUILD_KDE)" "n"
  884. CONFIGURE_FLAGS+= --disable-kde
  885. CONFIGURE_FLAGS-= --disable-kde4
  886. CONFIGURE_FLAGS+= --with-theme="$(patsubst $(DEFAULT_IMAGE),default,$(IMAGES))"
  887. else
  888. CONFIGURE_FLAGS += --disable-kde
  889. CONFIGURE_FLAGS += --enable-kde4
  890. KDE_ICONSET_DEP=libreoffice$(VER)-style-oxygen
  891. BUILD_DEPS += , kdelibs5-dev $(KDELIBS_MINVER)
  892. BUILD_DEPS += , libqt4-dev $(QT_MINVER)
  893. DBG_DBG_SUGGESTS+= , kdelibs5-dbg, libqt4-dbg
  894. ifeq "$(ENABLE_KDEAB)" "y"
  895. ADDITIONAL_SECTIONS += KDE4Experimental
  896. BUILD_DEPS += , kdepimlibs5-dev$(OOO_NO_BASE_ARCHS)
  897. else
  898. CONFIGURE_FLAGS+= --disable-kdeab
  899. endif
  900. endif
  901. ifeq "$(ENABLE_MYSQLNATIVE)" "y"
  902. CONFIGURE_FLAGS += --enable-ext-mysql-connector
  903. ifneq (,$(filter mysql, $(SYSTEM_STUFF)))
  904. ifneq (,$(filter mysql-cppconn, $(SYSTEM_STUFF)))
  905. BUILD_DEPS += , libmysqlclient-dev
  906. else
  907. BUILD_DEPS += , libmysqlclient-dev (>= 5.5~)
  908. endif
  909. endif
  910. ifneq (,$(filter mysql-cppconn, $(SYSTEM_STUFF)))
  911. BUILD_DEPS += , libmysqlcppconn-dev $(MYSQLCPPCONN_MINVER)
  912. endif
  913. endif
  914. ifeq "$(BUILD_GTK)" "n"
  915. CONFIGURE_FLAGS+= --disable-gtk
  916. DEBHELPER_OPTIONS+= -Nlibreoffice$(VER)-gtk -Nlibreoffice$(VER)-gnome
  917. CONFIGURE_FLAGS+= --with-theme="$(patsubst galaxy,default,$(IMAGES))"
  918. else
  919. BUILD_DEPS += , libgtk2.0-dev (>= 2.10)
  920. endif
  921. ifeq "$(BUILD_GTK3)" "y"
  922. BUILD_DEPS += , libgtk-3-dev (>= 3.2~)
  923. CONFIGURE_FLAGS+= --enable-gtk3
  924. ifneq (cairo,$(findstring cairo,$(SYSTEM_STUFF)))
  925. $(error GTK3 build fails without system-cairo!!)
  926. endif
  927. else
  928. DEBHELPER_OPTIONS+= -Nlibreoffice$(VER)-gtk3
  929. endif
  930. ifeq "$(ENABLE_EVO2)" "n"
  931. CONFIGURE_FLAGS += --disable-evolution2
  932. DEBHELPER_OPTIONS += -Nlibreoffice-evolution
  933. else
  934. CONFIGURE_FLAGS += --enable-evolution2
  935. BUILD_DEPS += , libebook1.2-dev$(OOO_NO_BASE_ARCHS)
  936. endif
  937. ifeq "$(ENABLE_SDBC_POSTGRESQL)" "y"
  938. BUILD_DEPS += , libpq-dev (>= 9.0~)
  939. else
  940. CONFIGURE_FLAGS += --disable-postgresql-sdbc
  941. endif
  942. ifeq "$(ENABLE_RANDR)" "y"
  943. BUILD_DEPS += , libxrandr-dev
  944. else
  945. CONFIGURE_FLAGS += --disable-randr
  946. endif
  947. ifeq "$(BUILD_BINFILTERS)" "y"
  948. CONFIGURE_FLAGS+= --enable-binfilter
  949. OOO_BINFILTER_DEP = libreoffice$(VER)-filter-binfilter
  950. endif
  951. ifneq "$(BUILD_PYUNO)" "y"
  952. DEBHELPER_OPTIONS+= -Npython-uno -Npython3-uno -Nlibreoffice-script-provider-python
  953. CONFIGURE_FLAGS += --disable-python
  954. endif
  955. ifeq "$(ENABLE_JAVA)" "y"
  956. ifneq (,$(filter lucene, $(SYSTEM_STUFF)))
  957. BUILD_DEPS += , liblucene2-java (>= 2.3.2)$(OOO_NO_JAVA_ARCHS)
  958. LUCENE_DEPENDS = liblucene2-java (>= 2.3.2)
  959. # safety measure; e.g. lucene 2.9 index cannot be handled by lucene 2.4
  960. LUCENE_CONFLICTS = liblucene2-java (<< $(shell dpkg -l liblucene2-java | grep ^ii | awk '{ print $$3 }' | cut -d. -f1,2)~)
  961. CONFIGURE_FLAGS += --with-lucene-core-jar=/usr/share/java/lucene-core.jar --with-lucene-analyzers-jar=/usr/share/java/lucene-analyzers.jar
  962. endif
  963. ifneq (,$(filter hsqldb, $(SYSTEM_STUFF)))
  964. BUILD_DEPS += , libhsqldb-java $(HSQLDB_MINVER)$(OOO_NO_JAVA_ARCHS)
  965. BASE_HSQLDB_DEPENDS = libhsqldb-java $(HSQLDB_MINVER), libhsqldb-java (<< $(HSQLDB_TOONEWVER)~)
  966. JAVA_GCJ_DEPENDS += , libhsqldb-java-gcj [$(OOO_GCJ_ARCHS)]
  967. else
  968. ifneq "$(JDK)" "openjdk"
  969. # hsqldb with jdk7 buildfix from jdk7.diff fails with gcj
  970. $(error hsqldb with jdk7 buildfix from jdk7.diff fails with gcj)
  971. endif
  972. endif
  973. ifeq "$(ENABLE_SCRIPT_PROVIDER_BSH)" "y"
  974. ifneq (,$(filter beanshell, $(SYSTEM_STUFF)))
  975. BUILD_DEPS += , bsh (>= 2.0b4)$(OOO_NO_JAVA_ARCHS)
  976. BSH_DEPENDS = bsh (>= 2.0b4)
  977. JAVA_GCJ_DEPENDS += , bsh-gcj [$(OOO_GCJ_ARCHS)]
  978. endif
  979. CONFIGURE_FLAGS += --enable-ext-scripting-beanshell
  980. else
  981. DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-script-provider-bsh
  982. endif
  983. ifeq "$(ENABLE_SCRIPT_PROVIDER_JS)" "y"
  984. CONFIGURE_FLAGS += --enable-ext-scripting-javascript
  985. else
  986. DEBHELPER_OPTIONS += -Nlibreoffice$(VER)-script-provider-js
  987. endif
  988. endif
  989. ifneq (,$(filter lpsolve, $(SYSTEM_STUFF)))
  990. ifeq "$(USE_SHARED_LPSOLVE)" "y"
  991. BUILD_DEPS += , liblpsolve55-dev $(LPSOLVE_MIN_VERSION), lp-solve $(LPSOLVE_MIN_VERSION)
  992. LPSOLVE_DEP = lp-solve $(LPSOLVE_MIN_VERSION)
  993. else
  994. BUILD_DEPS += , liblpsolve55-dev $(LPSOLVE_MIN_VERSION)
  995. endif
  996. ifeq "$(USE_LIBSUITESPARSE)" "y"
  997. DBG_DBG_SUGGESTS+= , libsuitesparse-dbg
  998. BUILD_DEPS += , libsuitesparse-dev $(SUITESPARSE_MIN_VERSION)
  999. else
  1000. DBG_DBG_SUGGESTS+= , libufsparse-dbg
  1001. BUILD_DEPS += , libufsparse-dev
  1002. endif
  1003. endif
  1004. ifeq "$(USE_DBUS)" "y"
  1005. BUILD_DEPS += , libdbus-glib-1-dev (>= 0.70)
  1006. CONFIGURE_FLAGS += --enable-dbus
  1007. endif
  1008. ifeq "$(USE_GSTREAMER)" "y"
  1009. BUILD_DEPS += , libgstreamer-plugins-base0.10-dev
  1010. GSTREAMER_PLUGINS_SUGGESTS += , gstreamer0.10-plugins-base, gstreamer0.10-plugins-good, gstreamer0.10-plugins-ugly, gstreamer0.10-plugins-bad, gstreamer0.10-ffmpeg
  1011. DBG_DBG_SUGGESTS+= , libgstreamer0.10-0-dbg
  1012. else
  1013. CONFIGURE_FLAGS += --disable-gstreamer
  1014. endif
  1015. ifneq (,$(filter neon, $(SYSTEM_STUFF)))
  1016. ifneq "$(NEON_SECTYPE)" "openssl"
  1017. BUILD_DEPS += , libneon$(NEONSONR)-$(NEON_SECTYPE)-dev
  1018. DBG_DBG_SUGGESTS+= , libneon$(NEONSONR)-$(NEON_SECTYPE)-dbg
  1019. else
  1020. BUILD_DEPS += , libneon$(NEONSONR)-dev
  1021. DBG_DBG_SUGGESTS+= , libneon$(NEONSONR)-dbg
  1022. endif
  1023. endif
  1024. ifeq "$(HELPISOS)" ""
  1025. CONFIGURE_FLAGS += --without-helppack-integration
  1026. endif
  1027. ifneq (,$(filter redland, $(SYSTEM_STUFF)))
  1028. BUILD_DEPS += , librdf0-dev (>= 1.0.8)
  1029. SHLIBS_OVERRIDE += -Xunordf
  1030. endif
  1031. ifeq "$(ENABLE_GIO)" "y"
  1032. CONFIGURE_FLAGS += --enable-gio --disable-gnome-vfs
  1033. BUILD_DEPS += , libglib2.0-dev (>= 2.15.0)
  1034. endif
  1035. ifeq "$(ENABLE_GVFS)" "y"
  1036. BUILD_DEPS += , libgnomevfs2-dev
  1037. else
  1038. CONFIGURE_FLAGS += --disable-gnome-vfs
  1039. endif
  1040. ifeq "$(ENABLE_GCONF)" "y"
  1041. BUILD_DEPS += , libgconf2-dev, liborbit2-dev
  1042. else
  1043. CONFIGURE_FLAGS += --disable-gconf
  1044. endif
  1045. BUILD_DEPS += , gettext
  1046. ifeq "$(PACKAGE_TTF_OPENSYMBOL)" "y"
  1047. BUILD_DEPS_INDEP += , fontforge
  1048. endif
  1049. # Use compiler cache? Include ccache in DEB_BUILD_OPTIONS for much faster rebuild times
  1050. # A complete build uses about 9G of compiler cache.
  1051. ifneq (ccache,$(findstring ccache,$(DEB_BUILD_OPTIONS)))
  1052. CONFIGURE_FLAGS += --disable-ccache
  1053. endif
  1054. ## Build n projects in parallel?
  1055. ## DEB_BUILD_OPTIONS=parallel=<n>
  1056. ## if not specified LibreOffices configure tries to find it out itself
  1057. NUM_CPUS=$(shell echo "$(DEB_BUILD_OPTIONS) " | sed -n 's/^\(.* \)\?parallel=\([0-9]\+\).*$$/\2/p')
  1058. AVAIL_CPUS := $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
  1059. ifeq "$(PARALLEL_BUILD)" "y"
  1060. # http://bugs.debian.org/622644
  1061. BUILD_DEPS += , make (>= 3.81-8.2)
  1062. ifneq "$(NUM_CPUS)" "$(AVAIL_CPUS)"
  1063. CONFIGURE_FLAGS += --with-num-cpus=$(NUM_CPUS)
  1064. endif
  1065. else
  1066. CONFIGURE_FLAGS += --with-num-cpus=1
  1067. endif
  1068. ifeq ($(GCC_VERSION),)
  1069. BUILD_PATH = /usr/lib/jvm/java-gcj/bin:$$PATH
  1070. else
  1071. ifeq ($(GCC_VERSION),snapshot)
  1072. BUILD_PATH = /usr/lib/jvm/java-gcj/bin:/usr/lib/gcc-snapshot/bin:$$PATH
  1073. BUILD_LD_LIBRARY_PATH = /usr/lib/gcc-snapshot/lib:$$LD_LIBRARY_PATH
  1074. BUILD_DEPS += , gcc-snapshot
  1075. else
  1076. BUILD_PATH = /usr/lib/jvm/java-gcj/bin:$(CURDIR)/debian/usr/bin:$$PATH
  1077. endif
  1078. endif
  1079. BUILD_PATH := $(CURDIR)/debian/usr/bin:$(BUILD_PATH)
  1080. BUILD_LD_LIBRARY_PATH := $(BUILD_LD_LIBRARY_PATH):$(GCJ_JAWT_DIR)
  1081. ifeq "$(ENABLE_LDAP)" "y"
  1082. ifeq "$(USE_OPENLDAP)" "y"
  1083. BUILD_DEPS += , libldap2-dev
  1084. 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 }'`)
  1085. CONFIGURE_FLAGS += --with-openldap
  1086. endif
  1087. else
  1088. CONFIGURE_FLAGS += --disable-ldap
  1089. endif
  1090. # Because of the stampdir magic, when you actually want to run a rule
  1091. # over, you would have to remove the stamp manually. Now, just do
  1092. # 'debian/rules <target> <target> ... FORCE=1', and the stamp files
  1093. # that match the given targets will be removed automagically.
  1094. stampdir_targets=files.backup icons.scale patch.apply build.prepare.artwork
  1095. stampdir_targets+=build.prepare configure
  1096. stampdir_targets+=setupins setup install install-arch install-indep
  1097. stampdir_targets+=langpacks binary-common binary-arch binary-indep
  1098. ifdef FORCE
  1099. DUMMY:=$(shell rm -f $(patsubst %,$(STAMP_DIR)/%,$(filter $(stampdir_targets),$(MAKECMDGOALS))))
  1100. endif
  1101. # If this is defined, then none of the 'long' commands will be run. Useful
  1102. # for testing.
  1103. # test_rules=1
  1104. # Since the final stages use up a large amount of diskspace, provide targets to
  1105. # remove them without needing a full rebuild
  1106. # Clean up the package directories (about 830M)
  1107. clean-debdir:
  1108. dh_testdir
  1109. rm -f debian/*.postinst debian/*.postrm debian/*.preinst debian/*.prerm debian/*.triggers
  1110. dh_clean
  1111. clean:
  1112. dh_testroot
  1113. dh_testdir
  1114. # remove generated symlinks / java wrappers
  1115. rm -rf debian/usr
  1116. if [ -f config.status ]; then \
  1117. $(MAKE) distclean; \
  1118. rm -f config.status; \
  1119. fi
  1120. find $(SOURCE_TREE)/solenv/gdb -name "*.pyc" -exec rm {} \;
  1121. rm -rf */*.pro.obsolete
  1122. rm -rf $(SOURCE_TREE)/file-lists
  1123. rm -rf $(SOURCE_TREE)/pyuno-py3
  1124. rm -f configure aclocal.m4
  1125. rm -f build_error.log
  1126. ifeq "$(HELPISOS)" ""
  1127. rm -rf images*
  1128. endif
  1129. # Files created in debian directory
  1130. $(MAKE) -f debian/rules clean-debdir
  1131. find debian -name "*.links" -exec rm {} \;
  1132. if [ -d "$(STAMP_DIR)" ]; then rm -rf "$(STAMP_DIR)"; fi
  1133. rm -f debian/shlibs.override.stdlibs
  1134. rm -f debian/*.bug-script
  1135. rm -f debian/scripts/aotcompile.py*
  1136. rm -f l10n.fdupes
  1137. rm -f debian/shlibs.local
  1138. rm -f debian/*.templates
  1139. rm -f debian/libreoffice-dev-doc.doc-base.*
  1140. rm -f debian/*.menu
  1141. for i in base calc core common draw impress math writer; do \
  1142. rm -f debian/libreoffice-$$i.lintian-overrides; \
  1143. done
  1144. rm -f debian/*.install debian/*.dirs debian/*.changelog
  1145. rm -f debian/catalog.xml
  1146. rm -f debian/openoffice.org-dtd-officedocument1.0.xmlcatalogs
  1147. rm -f download.list
  1148. $(MAKE) -f debian/rules control
  1149. # Generate control file, because we have so many different languages
  1150. # Based on script by Martin Quinson <Martin.Quinson@tuxfamily.org>
  1151. control: debian/control
  1152. debian/control: $(wildcard debian/control*in) $(SOURCE_TREE)/bin/lo-xlate-lang debian/rules
  1153. chmod 755 $(SOURCE_TREE)/bin/lo-xlate-lang
  1154. sed -e "s#libreofficeVER#libreoffice$(VER)#g" \
  1155. -e "s#libreofficeVER#libreoffice$(VER)#g" \
  1156. -e "s#%$(DEB_VENDOR)=\([^%]*\)%#, \1#g#" \
  1157. -e "s#%[A-Za-z]*=[^%]*%##g#" \
  1158. -e "s#%BUILD_DEPS%#$(strip $(BUILD_DEPS))#g" \
  1159. -e "s#%BUILD_DEPS_INDEP%#$(strip $(BUILD_DEPS_INDEP))#g" \
  1160. -e "s#@PYTHON_VERSION@#$(PYTHON_VERSION)#g" \
  1161. -e "s#@BUGS@#$(BUGS)#g" \
  1162. < debian/control.in > debian/control
  1163. ifeq "$(ENABLE_LDAP)" "y"
  1164. # build-depends might not be satified when running debian/rules control. prevent bad subsitition with
  1165. # nothing (libldap--)
  1166. if [ ! -f /usr/include/ldap_features.h ]; then \
  1167. echo "/usr/include/ldap_features.h not found. Is libldap2-dev installed?"; \
  1168. echo 'Needed for properly setting $$(LDAP_LIB). Stopping,'; \
  1169. exit 1; \
  1170. fi
  1171. endif
  1172. for LNUM in $(filter-out en-US,$(LANGPACKISOS)) ; do \
  1173. LNAME=`$(SOURCE_TREE)/bin/lo-xlate-lang -l $$LNUM | perl -e 'print ucfirst(<STDIN>);'`; \
  1174. LCODE=`$(SOURCE_TREE)/bin/lo-xlate-lang -i $$LNUM | tr A-Z a-z`; \
  1175. [ "$$LNUM" = ca-XV ] && continue; \
  1176. CCODE=`echo $$LCODE | sed 's/-.*//'`; \
  1177. case "$$LCODE" in \
  1178. bn|gu|pa-in|ml|or|te|ta) \
  1179. FONT_SUGGESTS=", ttf-`echo $$LNAME | tr A-Z a-z`-fonts"; \
  1180. ;; \
  1181. hi-in|ne|mr) \
  1182. FONT_SUGGESTS=", ttf-devanagari-fonts"; \
  1183. ;; \
  1184. he) \
  1185. FONT_SUGGESTS=", culmus"; \
  1186. ;; \
  1187. km) \
  1188. FONT_SUGGESTS=", ttf-khmeros"; \
  1189. ;; \
  1190. ar) \
  1191. FONT_SUGGESTS=", ttf-arabeyes"; \
  1192. ;; \
  1193. fa) \
  1194. FONT_SUGGESTS=", ttf-farsiweb"; \
  1195. ;; \
  1196. dz) \
  1197. FONT_SUGGESTS=", ttf-dzongkha"; \
  1198. ;; \
  1199. th) \
  1200. if [ "$(SQUEEZE_BACKPORT)" != "y" ]; then \
  1201. FONT_SUGGESTS=", fonts-thai-tlwg"; else \
  1202. FONT_SUGGESTS=", ttf-thai-tlwg"; fi; \
  1203. ;; \
  1204. *) \
  1205. FONT_SUGGESTS= ;; \
  1206. esac; \
  1207. case "$$LCODE" in \
  1208. rw) \
  1209. LOCALES_DEPENDS="locales (>= 2.3.6) | belocs-locales-data | locales-all (>= 2.3.6)" \
  1210. ;; \
  1211. ss|ts|km|ns|tn) \
  1212. LOCALES_DEPENDS="locales (>= 2.3.5-12) | belocs-locales-data | locales-all" \
  1213. ;; \
  1214. sr) \
  1215. LOCALES_DEPENDS="locales (>= 2.3.6.ds1-5) | belocs-locales-data | locales-all" \
  1216. ;; \
  1217. as|or|nr) \
  1218. LOCALES_DEPENDS="locales (>= 2.3.6.ds1-1) | locales-all (>= 2.3.6.ds1-1)" \
  1219. ;; \
  1220. sw) \
  1221. LOCALES_DEPENDS="locales (>= 2.13-5) | locales-all (>= 2.13-5)" \
  1222. ;; \
  1223. *) \
  1224. LOCALES_DEPENDS="locales | belocs-locales-data | locales-all" \
  1225. ;; \
  1226. esac; \
  1227. sed -e "s|@LNAME@|$$LNAME|g" -e "s|@LCODE@|$$LCODE|g" \
  1228. -e "s|@CCODE@|$$CCODE|g" \
  1229. -e "s|@FONT_SUGGESTS@|$$FONT_SUGGESTS|g" \
  1230. -e "s:@LOCALES_DEPENDS@:$$LOCALES_DEPENDS:g" \
  1231. -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1232. -e "s|@LDAP_LIB@|$(LDAP_LIB)|g" \
  1233. >> debian/control < debian/control.lang.in; \
  1234. done
  1235. ifneq "$(HELPISOS)" ""
  1236. for LNUM in $(HELPISOS) ; do \
  1237. LNAME=`$(SOURCE_TREE)/bin/lo-xlate-lang -l $$LNUM | perl -e 'print ucfirst(<STDIN>);'`; \
  1238. LCODE=`$(SOURCE_TREE)/bin/lo-xlate-lang -i $$LNUM | tr A-Z a-z`; \
  1239. [ "$$LNUM" = ca-XV ] && continue; \
  1240. CCODE=`echo $$LCODE | sed 's/-.*//'`; \
  1241. sed -e "s|@LNAME@|$$LNAME|g" -e "s|@LCODE@|$$LCODE|g" \
  1242. -e "s|@CCODE@|$$CCODE|g" \
  1243. -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1244. >> debian/control < debian/control.help.in; \
  1245. done
  1246. # en_US is in -common
  1247. perl -pi -e 's|(Depends: libreoffice$(VER)-writer \| language-support-translations-en), libreoffice$(VER)-l10n-en-us|\1|' \
  1248. debian/control
  1249. perl -pi -e 's|(Depends: libreoffice$(VER)-writer, libreoffice$(VER)-l10n-en-us)|\1, ttf-devanagari-fonts|' \
  1250. debian/control
  1251. endif
  1252. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1253. >> debian/control < debian/control.ure.in
  1254. ifeq "$(ENABLE_JAVA)" "y"
  1255. ifneq "$(OOO_GCJ_JDK_ARCHS)" ""
  1256. # ifeq "$(BUILD_JARS_NATIVE)" "y"
  1257. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1258. >> debian/control < debian/control.gcj.in
  1259. # endif
  1260. endif
  1261. endif
  1262. ifneq "$(OOO_NSPLUGIN_ARCHS)" ""
  1263. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1264. >> debian/control < debian/control.mozilla.in
  1265. endif
  1266. ifneq "$(OOO_OGLTRANS_ARCHS)" ""
  1267. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1268. >> debian/control < debian/control.ogltrans.in
  1269. endif
  1270. ifeq "$(ENABLE_JAVA)" "y"
  1271. ifeq "$(ENABLE_MEDIAWIKI)" "y"
  1272. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1273. >> debian/control < debian/control.mediawiki.in
  1274. endif
  1275. ifeq "$(ENABLE_REPORTDESIGN)" "y"
  1276. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1277. >> debian/control < debian/control.reportdesign.in
  1278. endif
  1279. endif
  1280. ifeq "$(ENABLE_MINIMIZER)" "y"
  1281. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1282. >> debian/control < debian/control.minimizer.in
  1283. endif
  1284. ifeq "$(ENABLE_PRESENTER_CONSOLE)" "y"
  1285. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1286. >> debian/control < debian/control.presenter.in
  1287. endif
  1288. ifeq "$(ENABLE_PDFIMPORT)" "y"
  1289. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1290. >> debian/control < debian/control.pdfimport.in
  1291. endif
  1292. ifeq "$(PACKAGE_TTF_OPENSYMBOL)" "y"
  1293. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1294. >> debian/control < debian/control.fonts.in
  1295. endif
  1296. ifeq "$(BUILD_DBG_PACKAGE)" "y"
  1297. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1298. >> debian/control < debian/control.debug.in
  1299. endif
  1300. ifeq "$(PACKAGE_SDK)" "y"
  1301. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1302. >> debian/control < debian/control.sdk.in
  1303. endif
  1304. ifeq "$(BUILD_KDE)" "y"
  1305. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1306. >> debian/control < debian/control.kde.in
  1307. perl -pi -e 's/ libreoffice$(VER)-gnome,/ libreoffice-gnome | libreoffice$(VER)-kde,/' debian/control
  1308. endif
  1309. ifeq "$(ENABLE_SDBC_POSTGRESQL)" "y"
  1310. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1311. >> debian/control < debian/control.postgresql.in
  1312. endif
  1313. ifeq "$(ENABLE_MYSQLNATIVE)" "y"
  1314. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1315. >> debian/control < debian/control.mysql.in
  1316. endif
  1317. ifeq "$(ENABLE_EVO2)" "y"
  1318. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1319. >> debian/control < debian/control.evolution.in
  1320. endif
  1321. ifeq "$(BUILD_BINFILTERS)" "y"
  1322. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1323. >> debian/control < debian/control.binfilter.in
  1324. endif
  1325. ifeq "$(ENABLE_KDEAB)" "y"
  1326. sed -e "s|libreofficeVER|libreoffice$(VER)|g" \
  1327. >> debian/control < debian/control.kab.in
  1328. endif
  1329. perl -pi -e "s,%OOO_ARCHS%,$(OOO_ARCHS),g" debian/control
  1330. perl -pi -e "s,%OOO_BASE_ARCHS%,$(OOO_BASE_ARCHS),g" debian/control
  1331. perl -pi -e "s,%OOO_NO_BASE_ARCHS%,$(OOO_NO_BASE_ARCHS),"g debian/control
  1332. perl -pi -e "s,%OOO_JAVA_ARCHS%,$(OOO_JAVA_ARCHS),g" debian/control
  1333. perl -pi -e "s,%OOO_GCJ_ARCHS%,$(OOO_GCJ_ARCHS),g" debian/control
  1334. perl -pi -e "s,%OOO_NSPLUGIN_ARCHS%,$(OOO_NSPLUGIN_ARCHS),g" debian/control
  1335. perl -pi -e "s,%OOO_OGLTRANS_ARCHS%,$(OOO_OGLTRANS_ARCHS),g" debian/control
  1336. perl -pi -e "s,%OOO_BINFILTER_ARCHS%,$(OOO_BINFILTER_ARCHS),g" debian/control
  1337. perl -pi -e "s,%OOO_STLPORT_ARCHS%,$(OOO_STLPORT_ARCHS),g" debian/control
  1338. perl -pi -e "s,%OOO_GCJ_JDK_ARCHS%,$(OOO_GCJ_JDK_ARCHS),g" debian/control
  1339. perl -pi -e "s,%OOO_ARCH_DEP_EXTENSIONS_ARCHS%,$(OOO_ARCH_DEP_EXTENSIONS_ARCHS),g" debian/control
  1340. perl -pi -e "s,%OOO_REPORTDESIGN_ARCHS%,$(OOO_REPORTDESIGN_ARCHS),g" debian/control
  1341. perl -pi -e "s,%OOO_NO_REPORTDESIGN_ARCHS%,$(OOO_NO_REPORTDESIGN_ARCHS),g" debian/control
  1342. ifeq (sk,$(findstring sk,$(HELPISOS)))
  1343. perl -pi -e 's/(Depends:.*)libreoffice-l10n-sk(.*)$$/\1libreoffice-l10n-sk, libreoffice-help-cs\2/' debian/control
  1344. endif
  1345. ifeq (pt-BR,$(findstring pt-BR,$(LANGPACKISOS)))
  1346. perl -pi -e 's/libreoffice2-l10n-pt-br$$/libreoffice2-l10n-pt-br, broffice/' debian/control
  1347. perl -pi -e 's/libreoffice2-l10n-pt-br$$/libreoffice2-l10n-pt-br, broffice/' debian/control
  1348. perl -pi -e 's/libreoffice2-l10n-pt-br$$/libreoffice2-l10n-pt-br, broffice/' debian/control
  1349. endif
  1350. 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
  1351. ifeq "$(ENABLE_GIO)" "y"
  1352. perl -pi -e 's/VFS/GIO/' debian/control
  1353. # fix up "GNOME GIO"
  1354. perl -pi -e 's/GNOME GIO/GIO/' debian/control
  1355. endif
  1356. ifneq "$(SQUEEZE_BACKPORT)" "y"
  1357. perl -pi -e "s/(Build-Conflicts: .*)/\1, base-files (= 6.0), base-files (= 6.0squeeze1)/" debian/control
  1358. endif
  1359. ifneq (,$(filter hsqldb, $(SYSTEM_STUFF)))
  1360. perl -pi -e "s/(Build-Conflicts: .*)/\1, libhsqldb-java (>= $(HSQLDB_TOONEWVER)~)/" debian/control
  1361. endif
  1362. ifeq (4.4,$(SYSTEM_GCC_VERSION))
  1363. perl -pi -e 's/flex \|/flex (>= 2.5.25-7) |/' debian/control
  1364. endif
  1365. python debian/scripts/joinctrl.py < debian/control > debian/control.tmp
  1366. mv debian/control.tmp debian/control
  1367. ifeq "$(VER)" ""
  1368. # no conflict with "universal Linux packages" as they have the version in their
  1369. # names thankfully now
  1370. perl -pi -e 's/libreoffice-unbundled, //' debian/control
  1371. endif
  1372. # make -l10n-fi suggest libreoffice-spellcheck-fi to
  1373. # match myspell-fi and libreoffice-soikko/-voikko
  1374. perl -pi -e 's/myspell-dictionary-fi/myspell-dictionary-fi | libreoffice-spellcheck-fi/' debian/control
  1375. # similar for tr (libreoffice-zemberek)
  1376. perl -pi -e 's/myspell-dictionary-tr/myspell-dictionary-tr | libreoffice-spellcheck-tr/' debian/control
  1377. ifeq "$(BUILD_KDE)" "y"
  1378. perl -pi -e 's/GConf backend$$/GConf backend\n * libreoffice$(VER)-kde: KDE UI Plugin and KDE File Picker support/' debian/control
  1379. endif
  1380. ifeq "$(ENABLE_LDAP)" "y"
  1381. perl -pi -e 's/paperconf$$/paperconf\n * $(LDAP_LIB): LDAP client library; needed for LibreOffice getting its\n profiles from LDAP/' debian/control
  1382. endif
  1383. ifneq "$(DICT_DIR)" "/usr/share/hunspell"
  1384. perl -pi -e 's/^Breaks:.*myspell.*\n//' debian/control
  1385. endif
  1386. .DELETE_ON_ERROR: debian/control
  1387. build: build-arch build-indep
  1388. build-arch: $(STAMP_DIR)/build
  1389. build-indep: $(STAMP_DIR)/build
  1390. # All 'important' targets have 2 lines. The one that is run by
  1391. # dpkg-buildpackage or the user, and the one that does the actual work. This
  1392. # indirection is needed so that the 'stamp' files that signify when a rule is
  1393. # done can be located in a separate 'stampdir'. Recall that make has no way to
  1394. # know when a goal has been met for a phony target (like "build" or "install").
  1395. #
  1396. # At the end of each stampdir target, be sure to run the command 'touch $@'
  1397. # so that the target will not be run again. Removing the file will make
  1398. # make run the target over.
  1399. config.status:
  1400. dh_testdir
  1401. # Make sure needed scripts are executable
  1402. set -e;\
  1403. for FILE in debian/scripts/move-if-change \
  1404. debian/scripts/cleandupes \
  1405. debian/scripts/get_libebook_dep.sh \
  1406. autogen.sh; \
  1407. do \
  1408. chmod 755 $$FILE ;\
  1409. done
  1410. mkdir -p $(STAMP_DIR)
  1411. ifneq ($(GCC_VERSION),)
  1412. ifneq ($(GCC_VERSION),snapshot)
  1413. # create links for gcc and g++ (and gij and gcj), ooo-build does not
  1414. # honour overriding CC and CXX and we need to use gcc/g++ 4.0 or /
  1415. # ant.mk wants gcj at the moment...
  1416. mkdir -p $(CURDIR)/debian/usr/bin
  1417. ln -sf /usr/bin/$(CC_PREFIX)gcc-$(GCC_VERSION) $(CURDIR)/debian/usr/bin/gcc
  1418. ln -sf /usr/bin/$(CC_PREFIX)g++-$(GCC_VERSION) $(CURDIR)/debian/usr/bin/g++
  1419. ln -sf /usr/bin/$(CC_PREFIX)gcc-$(GCC_VERSION) $(CURDIR)/debian/usr/bin/$(CC_PREFIX)gcc
  1420. ln -sf /usr/bin/$(CC_PREFIX)g++-$(GCC_VERSION) $(CURDIR)/debian/usr/bin/$(CC_PREFIX)g++
  1421. #ln -sf /usr/bin/$(CC_PREFIX)gcj-$(GCC_VERSION) $(CURDIR)/debian/usr/bin/gcj
  1422. #ln -sf /usr/bin/gij-$(GCC_VERSION) $(CURDIR)/debian/usr/bin/gij
  1423. else
  1424. ifneq "$(CC_PREFIX)" ""
  1425. mkdir -p $(CURDIR)/debian/usr/bin
  1426. ln -sf /usr/lib/gcc-snapshot/bin/$(CC_PREFIX)gcc $(CURDIR)/debian/usr/bin/gcc
  1427. ln -sf /usr/lib/gcc-snapshot/bin/$(CC_PREFIX)g++ $(CURDIR)/debian/usr/bin/g++
  1428. ln -sf /usr/lib/gcc-snapshot/bin/$(CC_PREFIX)gcj $(CURDIR)/debian/usr/bin/gcj
  1429. ln -sf /usr/lib/gcc-snapshot/bin/$(CC_PREFIX)gij $(CURDIR)/debian/usr/bin/gij
  1430. endif
  1431. endif
  1432. endif
  1433. # Make sure we have /proc mounted - otherwise idlc will fail later.
  1434. test -r /proc/version
  1435. ifneq "$(PACKAGE_UNOWINREG_DLL)" "y"
  1436. ifneq "$(BUILD_UNOWINREG_DLL)" "y"
  1437. # create fake file if file not there; we don't use it anyways.
  1438. if [ ! -f $(TARFILE_LOCATION)/185d60944ea767075d27247c3162b3bc-unowinreg.dll ]; then \
  1439. touch $(TARFILE_LOCATION)/185d60944ea767075d27247c3162b3bc-unowinreg.dll; \
  1440. fi
  1441. endif
  1442. endif
  1443. # FIXME: Theoretically this should call ./configure instead of
  1444. # it exists but that causes the configure flags NOT to be hnoured
  1445. # somehow...
  1446. PATH=$(BUILD_PATH) LD_LIBRARY_PATH=$(BUILD_LD_LIBRARY_PATH) ./autogen.sh $(CONFIGURE_FLAGS)
  1447. touch $@
  1448. build: $(STAMP_DIR)/build
  1449. #$(STAMP_DIR)/build: config.status | src/fetch.log
  1450. $(STAMP_DIR)/build: config.status
  1451. dh_testdir
  1452. 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 gb_FULLDEPS= gb_Deliver_HARDLINK=T
  1453. ifeq "$(BUILD_PYUNO)" "y"
  1454. ifeq "$(ENABLE_PYTHON3)" "y"
  1455. # FIXME: won't work when pyuno is migrated to gbuild as all is directly in solver
  1456. # then...
  1457. rm -rf $(SOURCE_TREE)/pyuno-py3
  1458. cp -ra $(SOURCE_TREE)/pyuno $(SOURCE_TREE)/pyuno-py3
  1459. cd $(SOURCE_TREE)/pyuno-py3; \
  1460. rm -rf $(shell . $(SOURCE_TREE)/Env.Host.sh; echo $$OUTPATH$$PROEXT); \
  1461. . $(CURDIR)/$(SOURCE_TREE)/Env.Host.sh; \
  1462. PATH=$(BUILD_PATH) PYTHON=$(PYTHON3) PYTHON_CFLAGS=$(shell pkg-config --cflags python-$(PY3MAJOR).$(PY3MINOR)mu) PYTHON_LIBS=$(shell pkg-config --libs python-$(PY3MAJOR).$(PY3MINOR)mu) \
  1463. ../solenv/bin/build.pl # NO DELIVER!
  1464. endif
  1465. endif
  1466. ifneq (nocheck,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
  1467. $(CURDIR)/debian/rules check
  1468. endif
  1469. touch $@
  1470. check:
  1471. ifeq "$(RUN_MAKE_CHECK)" "y"
  1472. ifneq (,$(findstring $(DEB_HOST_ARCH),$(OOO_NO_BASE_ARCHS)))
  1473. patch -p1 < $(CURDIR)/debian/patches/disable-db-tests.diff
  1474. endif
  1475. ifeq (,$(findstring $(DEB_HOST_ARCH),$(OOO_EXTENSIONS_ARCHS)))
  1476. cd $(SOURCE_TREE)/smoketest && \
  1477. patch -p1 < $(CURDIR)/debian/patches/smoketest-disable-extension-tests.diff
  1478. endif
  1479. t=`mktemp -q -d`; \
  1480. cd $(SOURCE_TREE) && \
  1481. export PATH=$(BUILD_PATH); \
  1482. export TMPDIR=$$t; \
  1483. export HOME=$$t; \
  1484. export SAL_USE_VCLPLUGIN="svp"; \
  1485. if [ -x /usr/bin/gdb ]; then ulimit -c unlimited; fi && \
  1486. $(MAKE) -k check gb_FULLDEPS= gb_Deliver_HARDLINK=T && \
  1487. rm -rf $$t
  1488. ifneq (,$(findstring $(DEB_HOST_ARCH),$(OOO_NO_BASE_ARCHS)))
  1489. patch -p1 -R < $(CURDIR)/debian/patches/disable-db-tests.diff
  1490. endif
  1491. ifeq (,$(findstring $(DEB_HOST_ARCH),$(OOO_EXTENSIONS_ARCHS)))
  1492. cd $(SOURCE_TREE)/smoketest && \
  1493. patch -p1 -R < $(CURDIR)/debian/patches/smoketest-disable-extension-tests.diff
  1494. endif
  1495. endif
  1496. install: $(STAMP_DIR)/install
  1497. $(STAMP_DIR)/install: $(STAMP_DIR)/build
  1498. dh_testdir
  1499. dh_testroot
  1500. if [ -x /usr/bin/dh_prep ]; then dh_prep; else dh_clean -k; fi
  1501. rm -f debian/*.install debian/*.dirs
  1502. # remove those for safety in case the languages might change on
  1503. # testbuilds. then the /*/ in dh_installdocs in binary-* won't work
  1504. # anymore (different dirs)
  1505. rm -rf $(SOURCE_TREE)/instsetoo_native/util/LibreOffice
  1506. rm -rf $(SOURCE_TREE)/file-lists
  1507. # install LibreOffice.
  1508. cd $(SOURCE_TREE)/; \
  1509. . $(CURDIR)/$(SOURCE_TREE)/Env.Host.sh; \
  1510. PATH=$(BUILD_PATH) \
  1511. DESTDIR=$(CURDIR)/debian/tmp \
  1512. $(MAKE) distro-pack-install
  1513. export DESTDIR=$(CURDIR)/debian/tmp ;\
  1514. export VERSION=$(OOVER); \
  1515. export OOINSTBASE=$(OODIR); \
  1516. export OOO_LANGS_LIST="$(ISOS)"; \
  1517. $(CURDIR)/debian/scripts/gid2pkgdirs.sh
  1518. # prepare install/dir files for dh
  1519. for i in `cd $(CURDIR)/debian/tmp/pkg; ls -1 | xargs`; do \
  1520. echo "$${i}/usr/* usr" > debian/$$i.install; \
  1521. if [ "$$i" = "libreoffice-common" ]; then \
  1522. echo "$${i}/etc/* etc" >> debian/$$i.install; \
  1523. fi; \
  1524. (cd debian/tmp/pkg/$$i; find . -type d | sed -e "s,\./,,") \
  1525. > debian/$$i.dirs; \
  1526. done
  1527. # the english resources should be in -common
  1528. cat debian/libreoffice-l10n-en-US.dirs >> debian/libreoffice-common.dirs
  1529. cat debian/libreoffice-l10n-en-US.install >> debian/libreoffice-common.install
  1530. rm -f debian/libreoffice-l10n-en-US.dirs debian/libreoffice-l10n-en-US.install
  1531. # and ca-XV in -ca...
  1532. ifeq (ca-XV,$(findstring ca-XV,$(LANGPACKISOS)))
  1533. cat debian/libreoffice-l10n-ca-XV.dirs >> debian/libreoffice-l10n-ca.dirs
  1534. cat debian/libreoffice-l10n-ca-XV.install >> debian/libreoffice-l10n-ca.install
  1535. rm -f debian/libreoffice-l10n-ca-XV.dirs debian/libreoffice-l10n-ca-XV.install
  1536. endif
  1537. ifeq (ca-XV,$(findstring ca-XV,$(HELPISOS)))
  1538. cat debian/libreoffice-help-ca-XV.dirs >> debian/libreoffice-help-ca.dirs
  1539. cat debian/libreoffice-help-ca-XV.install >> debian/libreoffice-help-ca.install
  1540. rm -f debian/libreoffice-help-ca-XV.dirs debian/libreoffice-help-ca-XV.install
  1541. endif
  1542. # fixup case (-l10n-pt-BR -> l10n-pt-br etc.)
  1543. for iso in $(ISOS); do \
  1544. pkgiso=`echo $$iso | tr A-Z a-z`; \
  1545. if [ "$$iso" != "$$pkgiso" ]; then \
  1546. if [ "$$iso" != "en-US" -a \
  1547. -e debian/libreoffice-l10n-$$iso.dirs -a \
  1548. -e debian/libreoffice-l10n-$$iso.install ]; then \
  1549. mv debian/libreoffice-l10n-$$iso.dirs \
  1550. debian/libreoffice-l10n-$$pkgiso.dirs; \
  1551. mv debian/libreoffice-l10n-$$iso.install \
  1552. debian/libreoffice-l10n-$$pkgiso.install; \
  1553. fi; \
  1554. if [ -e debian/libreoffice-help-$$iso.dirs -a \
  1555. -e debian/libreoffice-help-$$iso.install ]; then \
  1556. mv debian/libreoffice-help-$$iso.dirs \
  1557. debian/libreoffice-help-$$pkgiso.dirs; \
  1558. mv debian/libreoffice-help-$$iso.install \
  1559. debian/libreoffice-help-$$pkgiso.install; \
  1560. fi; \
  1561. fi; \
  1562. done
  1563. # fix up still sneaking in ./. They break dh_install (it installs
  1564. # but wrongly complains about it as not-installed files)
  1565. perl -pi -e 's,\./,,' debian/libreoffice$(VER)-common.install
  1566. perl -pi -e 's,\./,,' debian/ure.install
  1567. ifneq "$(HELPISOS)" ""
  1568. # remove non-packaged localized help. This a) saves space
  1569. # and b) we need this for the following dh_install as there will be
  1570. # no .install files created and dh_install will warn/fail due
  1571. # to non-installed files.
  1572. for iso in $(filter-out en-US,$(LANGPACKISOS)); do \
  1573. if ! `echo $(HELPISOS) | grep -q $$iso` || [ "$$iso" = "sk" ] ; then \
  1574. pkgiso=`echo $$iso | tr A-Z a-z`; \
  1575. rm -rf debian/tmp/pkg/libreoffice-help-$$iso; \
  1576. rm -f debian/libreoffice-help-$$pkgiso.dirs; \
  1577. rm -f debian/libreoffice-help-$$pkgiso.install; \
  1578. fi; \
  1579. done
  1580. endif
  1581. ifneq "$(BUILD_BINFILTERS)" "y"
  1582. # somewhow there's a libreoffice-filter-binfilter here even when binfilter disabled.
  1583. # go sure.
  1584. rm -rf debian/tmp/pkg/libreoffice-filter-binfilter/usr/share/applications
  1585. endif
  1586. dh_installdirs -A
  1587. dh_install -A --sourcedir=debian/tmp/pkg --fail-missing
  1588. rm -rf debian/tmp/pkg
  1589. # move desktop files to their correct packages
  1590. for i in base calc draw impress math writer binfilter; do \
  1591. if [ "$$i" = "binfilter" ]; then j=filter-binfilter; else j=$$i; fi; \
  1592. mkdir -p $(PKGDIR)-$$j/$(OODIR)/share/xdg; \
  1593. mv $(PKGDIR)-common/$(OODIR)/share/xdg/$$i.desktop \
  1594. $(PKGDIR)-$$j/$(OODIR)/share/xdg; \
  1595. done
  1596. # move help to /usr/share
  1597. for iso in $(HELPISOS); do \
  1598. pkgiso=`echo $$iso | tr A-Z a-z`; \
  1599. if [ -e $(PKGDIR)-help-$$pkgiso/usr ]; then \
  1600. mv $(PKGDIR)-help-$$pkgiso/usr/lib \
  1601. $(PKGDIR)-help-$$pkgiso/usr/share; \
  1602. fi; \
  1603. done
  1604. ifeq (sk,$(findstring sk,$(HELPISOS)))
  1605. # add fake sk help
  1606. mkdir -p $(PKGDIR)-help-sk/$(shell echo $(OODIR) | sed -e s/lib/share/)/help
  1607. ln -s cs \
  1608. $(PKGDIR)-help-sk/$(shell echo $(OODIR) | sed -e s/lib/share/)/help/sk
  1609. endif
  1610. ifeq "$(ENABLE_JAVA)" "y"
  1611. # move officebean.jar into -officebean (They will be moved out of -core
  1612. # in the install-arch target). Do the /usr/share move here already
  1613. mkdir -p $(PKGDIR)-core/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes; \
  1614. mv $(PKGDIR)-common/$(OODIR)/program/classes/officebean.jar \
  1615. $(PKGDIR)-core/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes
  1616. # fix the classpath
  1617. jh_classpath --classpath="ridl.jar unoil.jar jurt.jar juh.jar" \
  1618. $(PKGDIR)-core/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes/officebean.jar
  1619. ifeq "$(PACKAGE_BASE)" "y"
  1620. # move sdbc_hsqldb.jar into -base (do the move
  1621. # to /usr/share/java here directly, we do it for the "rest"
  1622. # later
  1623. mkdir -p $(PKGDIR)-base/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes; \
  1624. mkdir -p $(PKGDIR)-base/$(OODIR)/program/classes; \
  1625. mv $(PKGDIR)-common/$(OODIR)/program/classes/sdbc_hsqldb.jar \
  1626. $(PKGDIR)-base/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes; \
  1627. ln -s $(shell echo /$(OODIR) | sed -e s/lib/share/)/program/classes/sdbc_hsqldb.jar \
  1628. $(PKGDIR)-base/$(OODIR)/program/classes/sdbc_hsqldb.jar
  1629. ifeq (,$(filter hsqldb, $(SYSTEM_STUFF)))
  1630. # we need this in -base. Otherwise we get unwanted package differences
  1631. # in the unstable version and backports which might use internal hsqldb
  1632. mkdir -p $(PKGDIR)-base/$(OODIR)/program/classes
  1633. mv $(PKGDIR)-common/$(OODIR)/program/classes/hsqldb.jar \
  1634. $(PKGDIR)-base/$(OODIR)/program/classes
  1635. endif
  1636. else
  1637. # remove sdbc_hsqldb.jar. otherwise ends up in -java-common
  1638. rm -f $(PKGDIR)-common/$(OODIR)/program/classes/sdbc_hsqldb.jar
  1639. endif
  1640. endif
  1641. ifeq "$(BUILD_GTK)" "y"
  1642. # Gtk quickstarter, so to -gtk (via -gnome)
  1643. mkdir -p -m755 $(PKGDIR)-gnome/$(OODIR)/share/xdg
  1644. mv $(PKGDIR)-common/$(OODIR)/share/xdg/qstart.desktop \
  1645. $(PKGDIR)-gnome/$(OODIR)/share/xdg
  1646. endif
  1647. ifeq "$(PACKAGE_SDK)" "y"
  1648. # move SDK documentation into own package
  1649. rm -rf $(PKGDIR)-dev-doc
  1650. mkdir -p $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev/docs
  1651. mv $(PKGDIR)-dev/usr/share/doc/libreoffice/sdk/docs/* \
  1652. $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev/docs
  1653. rmdir $(PKGDIR)-dev/usr/share/doc/libreoffice/sdk/docs
  1654. mkdir -p $(PKGDIR)-dev-doc/$(OOSDKDIR)
  1655. ln -sf /usr/share/doc/libreoffice-dev/docs \
  1656. $(PKGDIR)-dev/$(OOSDKDIR)/docs
  1657. mv $(PKGDIR)-dev/$(OOSDKDIR)/examples \
  1658. $(PKGDIR)-dev-doc/$(OOSDKDIR)
  1659. endif
  1660. # fixup ure-link symlink. The move is done in install-arch
  1661. # but the link is in -common so we need to do it here.
  1662. cd $(PKGDIR)-common/$(OODIR) && \
  1663. rm ure-link && ln -sf /$(OOUREDIR) ure-link
  1664. ifeq "$(ENABLE_EVO2)" "y"
  1665. mkdir -p $(PKGDIR)-evolution/$(OODIR)/presets/database
  1666. mkdir -p $(PKGDIR)-evolution/$(OODIR)/share/registry
  1667. mv $(PKGDIR)-common/$(OODIR)/presets/database/evolocal.odb \
  1668. $(PKGDIR)-evolution/$(OODIR)/presets/database
  1669. endif
  1670. find debian/tmp ! -perm -200 | xargs -r chmod u+w
  1671. touch $@
  1672. #
  1673. # Generate maintainer scripts
  1674. maintscripts: $(STAMP_DIR)/maintscripts
  1675. $(STAMP_DIR)/maintscripts: $(wildcard debian/shell-lib*.sh) $(wildcard debian/*.preinst.in) $(wildcard debian/*.postinst.in) $(wildcard debian/*.prerm.in) $(wildcard debian/*.postrm.in) debian/vars.$(DEB_HOST_ARCH) debian/control
  1676. dh_testdir
  1677. rm -f debian/*.{pre,post}{inst,rm}
  1678. # generate maintainer scripts from *.in
  1679. for PKG in $(PACKAGES); do \
  1680. for FILE in postinst postrm preinst prerm triggers; do \
  1681. MAINTSCRIPT=debian/$$PKG.$$FILE ; \
  1682. if [ -e $$MAINTSCRIPT.in ]; then \
  1683. sed -n '1,/^#INCLUDE_SHELL_LIB#$$/p' < $$MAINTSCRIPT.in | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' > $$MAINTSCRIPT; \
  1684. if echo $(ARCH_DEP_PACKAGES) | grep -q $$PKG && [ "$$FILE" != "triggers" ]; then \
  1685. grep PLATFORMID debian/vars.$(DEB_HOST_ARCH) >> $$MAINTSCRIPT; \
  1686. fi; \
  1687. echo "" >> $$MAINTSCRIPT; \
  1688. if egrep -q "(add|remove|validate|sync)_extension" $$MAINTSCRIPT.in; then \
  1689. cat debian/shell-lib-extensions.sh >> $$MAINTSCRIPT; \
  1690. fi; \
  1691. sed -n '/^#INCLUDE_SHELL_LIB#$$/,$$p' < $$MAINTSCRIPT.in | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >> $$MAINTSCRIPT; \
  1692. perl -pi -e "s/\@LANGPACKISOS\@/$(LANGPACKISOS)/" $$MAINTSCRIPT; \
  1693. perl -pi -e "s,\@OODIR\@,$(OODIR),g" $$MAINTSCRIPT; \
  1694. perl -pi -e "s/\@VER\@/$(VER)/g" $$MAINTSCRIPT; \
  1695. fi; \
  1696. done; \
  1697. done
  1698. touch $@
  1699. # Install files generated by setup into package directories
  1700. langpacks: $(STAMP_DIR)/langpacks
  1701. $(STAMP_DIR)/langpacks: $(STAMP_DIR)/install $(STAMP_DIR)/install-indep $(SOURCE_TREE)/bin/lo-xlate-lang
  1702. # remove empty uno_packages dirs somehow in the langpacks(?)
  1703. for iso in `echo $(LANGPACKISOS) | tr A-Z a-z`; do \
  1704. rm -rf $(PKGDIR)-l10n-$$iso/$(OODIR)/share/uno_packages; \
  1705. done
  1706. # remove ooo dirs somehow in the langpacks(?)
  1707. for iso in `echo $(LANGPACKISOS) | tr A-Z a-z`; do \
  1708. rm -rf $(PKGDIR)-l10n-$$iso/$(OODIR)/share/dict/ooo; \
  1709. done
  1710. # remove extra license files
  1711. for iso in `echo $(LANGPACKISOS) | tr A-Z a-z`; do \
  1712. rm -rf $(PKGDIR)-l10n-$$iso/$(OODIR)/licenses; \
  1713. rm -f $(PKGDIR)-l10n-$$iso/$(OODIR)/share/readme/LICENSE*; \
  1714. done
  1715. # remove extra readme files
  1716. for iso in `echo $(LANGPACKISOS) | tr A-Z a-z`; do \
  1717. rm -rf $(PKGDIR)-l10n-$$iso/$(OODIR)/readmes; \
  1718. rm -f $(PKGDIR)-l10n-$$iso/$(OODIR)/share/readme/README*; \
  1719. done
  1720. # remove empty help directories
  1721. for iso in `echo $(LANGPACKISOS) | tr A-Z a-z`; do \
  1722. rm -rf $(PKGDIR)-l10n-$$iso/$(shell echo $(OODIR) | sed -e s/lib/share/)/help; \
  1723. rm -rf $(PKGDIR)-l10n-$$iso/$(OODIR)/help; \
  1724. done
  1725. # install technical.dic
  1726. for iso in $(LANGPACKISOS); do \
  1727. if [ "$$iso" = "en-US" ]; then pkg=common; \
  1728. elif [ "$$iso" = "ca-XV" ]; then pkg=l10n-ca; else pkg=l10n-`echo $$iso | tr A-Z a-z`; \
  1729. fi; \
  1730. mkdir -p $(PKGDIR)-$$pkg/$(OODIR)/share/wordbook/$$iso; \
  1731. install -m644 $(SOURCE_TREE)/extras/source/wordbook/technical.dic \
  1732. $(PKGDIR)-$$pkg/$(OODIR)/share/wordbook/$$iso/technical.dic; \
  1733. done
  1734. # replace duplicate files in the langpacks with symlinks
  1735. TMP=`mktemp -q`; \
  1736. fdupes --quiet --recurse --sameline --size \
  1737. debian/libreoffice$(VER)-common/$(OODIR) \
  1738. $(foreach d,$(shell echo $(filter-out en-US ca-XV,$(LANGPACKISOS)) | tr A-Z a-z),debian/libreoffice$(VER)-l10n-$(d)/$(OODIR)) \
  1739. > $$TMP && \
  1740. debian/scripts/cleandupes --base=libreoffice$(VER) --prefix=debian < $$TMP && rm -f $$TMP
  1741. ifeq "$(DEB_VENDOR)" "Debian"
  1742. # install Debian presentation template
  1743. otps=`cd debian/templates; echo *.otp`; \
  1744. for iso in $(LANGPACKISOS); do \
  1745. [ "$$iso" = "en-US" ] && continue; \
  1746. pkgiso=`echo $$iso | tr \[:upper:\] \[:lower:\]`; \
  1747. [ "$$pkgiso" = "ca-xv" ] && pkgiso=ca; \
  1748. mkdir -p $(PKGDIR)-l10n-$$pkgiso/$(OODIR)/share/template/$$iso/presnt; \
  1749. for otp in $$otps; do \
  1750. ln -sf ../../en-US/presnt/$$otp \
  1751. $(PKGDIR)-l10n-$$pkgiso/$(OODIR)/share/template/$$iso/presnt/$$odt; \
  1752. done; \
  1753. done
  1754. endif
  1755. ifeq (he,$(findstring he,$(LANGPACKISOS)))
  1756. perl -pi -e 's#<prop oor:name="CTLSequenceChecking"><value>true</value></prop>#<prop oor:name="CTLSequenceChecking"><value>false</value></prop>#' $(PKGDIR)-l10n-he/$(OODIR)/share/registry/ctl_he.xcd
  1757. endif
  1758. touch $@
  1759. native-jars: $(STAMP_NATIVE_JARS)
  1760. $(STAMP_NATIVE_JARS): $(STAMP_DIR)/install
  1761. ifeq "$(BUILD_JARS_NATIVE)" "y"
  1762. rm -rf debian/tmp/native-jars
  1763. mkdir -p debian/tmp/native-jars/gcj
  1764. cp -a \
  1765. $(PKGDIR)-common/$(OODIR)/program/classes/*.jar \
  1766. debian/tmp/native-jars/
  1767. cp -a \
  1768. $(PKGDIR)-core/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes/*.jar \
  1769. debian/tmp/native-jars/
  1770. ifeq "$(PACKAGE_BASE)" "y"
  1771. cp -a \
  1772. $(PKGDIR)-base/$(OODIR)/program/classes/*.jar \
  1773. debian/tmp/native-jars/
  1774. endif
  1775. : # remove problematic ones
  1776. rm -f debian/tmp/native-jars/ridl.jar
  1777. ifneq "$(USE_SYSTEM_SAXON)" "y"
  1778. rm -f debian/tmp/native-jars/saxon9.jar
  1779. endif
  1780. : # compile the others
  1781. # the Debian i386 buildd, although having much ram still OOMs without
  1782. # this (at unoil.jar).
  1783. # Also the native jar build is MUCH faster with this. But it
  1784. # won't be accepted into the official java-gcj-compat package so this
  1785. # hack here is needed.
  1786. if [ -e /usr/lib/gcc/aotcompile.py ]; then \
  1787. aotcompile_py=/usr/lib/gcc/aotcompile.py; \
  1788. elif [ -e /usr/share/pyshared/aotcompile.py ]; then \
  1789. aotcompile_py=/usr/share/pyshared/aotcompile.py; \
  1790. fi && \
  1791. cp $$aotcompile_py debian/scripts
  1792. cd debian/scripts && \
  1793. patch -p0 < $(CURDIR)/debian/aotcompile-256M-default.diff
  1794. PYTHONPATH="debian/scripts:$(shell echo $(PYTHON_SITE) | sed -e s,debian/python-uno,,)" \
  1795. AOT_MAKEFLAGS=-j$(NUM_CPUS) aot-compile -L /usr/lib/gcj/$(OODIRNAME) \
  1796. debian/tmp/native-jars debian/tmp/native-jars/gcj
  1797. gcj-dbtool -n debian/tmp/native-jars/tmp.db 64
  1798. find debian/tmp/native-jars/gcj -name '*.db' -print0 \
  1799. | xargs -r -0 \
  1800. gcj-dbtool -m debian/tmp/native-jars/tmp.db debian/tmp/native-jars/tmp.db || exit 1
  1801. rm -f debian/tmp/native-jars/gcj/*.db
  1802. endif
  1803. touch $@
  1804. # Install files generated by setup into arch-dependent package directories
  1805. install-arch: $(STAMP_DIR)/install-arch
  1806. $(STAMP_DIR)/install-arch: $(STAMP_DIR)/install $(STAMP_NATIVE_JARS)
  1807. dh_testdir
  1808. dh_testroot
  1809. umask 022
  1810. # move the URE to /usr/lib/ure
  1811. mv debian/ure/$(OODIR)/ure debian/ure/usr/lib
  1812. chmod 644 debian/ure/$(OOUREDIR)/lib/unorc
  1813. rmdir debian/ure/$(OODIR)
  1814. # move URE Java stuff to /usr/share/java
  1815. mkdir -p debian/ure/usr/share/java
  1816. ifeq "$(ENABLE_JAVA)" "y"
  1817. mv debian/ure/$(OOUREDIR)/share/java/* \
  1818. debian/ure/usr/share/java
  1819. cd debian/ure/$(OOUREDIR)/share/java && \
  1820. for i in $(CURDIR)/debian/ure/usr/share/java/*.jar; do \
  1821. ln -sf `echo $$i | sed -e 's,$(CURDIR)/debian/ure,,'` `basename $$i`; \
  1822. done
  1823. # fix up Class-Path of jurt.jar to be able to find libjpipe.so.
  1824. # See See http://www.openoffice.org/servlets/ReadMsg?list=dev&msgNo=27765
  1825. jh_classpath --classpath="ridl.jar unoloader.jar ../../lib /$(OOUREDIR)/lib/ ../bin/" \
  1826. $(CURDIR)/debian/ure/usr/share/java/jurt.jar
  1827. endif
  1828. # and the public libs to uno-libs3
  1829. mkdir -p debian/uno-libs3/$(OOUREDIR)/lib
  1830. for i in debian/ure/$(OOUREDIR)/lib/libuno_*so.3; do \
  1831. mv $$i debian/uno-libs3/$(OOUREDIR)/lib; \
  1832. ln -sf /$(OOUREDIR)/lib/`basename $$i` debian/uno-libs3/usr/lib/`basename $$i`; \
  1833. done
  1834. ifeq "$(BUILD_KDE)" "y"
  1835. # install files for KDEs "create new" ...
  1836. mkdir -p $(PKGDIR)-kde/usr/share/templates/.source
  1837. for i in $(SOURCE_TREE)/extras/source/shellnew/*; do \
  1838. cp $$i $(PKGDIR)-kde/usr/share/templates/.source/`basename $$i`; \
  1839. done
  1840. cat debian/templates/soffice-template.desktop.in \
  1841. | sed -e "s/@APP@/Writer/" \
  1842. | sed -e "s/@EXT@/odt/" \
  1843. | sed -e "s/@TYPE@/text/" \
  1844. > $(PKGDIR)-kde/usr/share/templates/soffice.odt.desktop
  1845. cat debian/templates/soffice-template.desktop.in \
  1846. | sed -e "s/@APP@/Calc/" \
  1847. | sed -e "s/@EXT@/ods/" \
  1848. | sed -e "s/@TYPE@/spreadsheet/" \
  1849. > $(PKGDIR)-kde/usr/share/templates/soffice.ods.desktop
  1850. cat debian/templates/soffice-template.desktop.in \
  1851. | sed -e "s/@APP@/Impress/" \
  1852. | sed -e "s/@EXT@/odp/" \
  1853. | sed -e "s/@TYPE@/presentation/" \
  1854. > $(PKGDIR)-kde/usr/share/templates/soffice.odp.desktop
  1855. cat debian/templates/soffice-template.desktop.in \
  1856. | sed -e "s/@APP@/Draw/" \
  1857. | sed -e "s/@EXT@/odg/" \
  1858. | sed -e "s/@TYPE@/drawing/" \
  1859. > $(PKGDIR)-kde/usr/share/templates/soffice.odg.desktop
  1860. endif
  1861. # split out gtk stuff
  1862. rm -rf $(PKGDIR)-gtk
  1863. mkdir -p -m755 $(PKGDIR)-gtk/$(OODIR)/program
  1864. ifeq "$(BUILD_GTK3)" "y"
  1865. rm -rf $(PKGDIR)-gtk3
  1866. mkdir -p -m755 $(PKGDIR)-gtk3/$(OODIR)/program
  1867. mv $(PKGDIR)-gnome/$(OODIR)/program/libvclplug_gtk3lo.so $(PKGDIR)-gtk3/$(OODIR)/program/
  1868. endif
  1869. mv $(PKGDIR)-gnome/$(OODIR)/program/* $(PKGDIR)-gtk/$(OODIR)/program/
  1870. ifeq "$(BUILD_GTK)" "y"
  1871. mkdir -p -m755 $(PKGDIR)-gtk/$(OODIR)/share
  1872. mv $(PKGDIR)-gnome/$(OODIR)/share/xdg $(PKGDIR)-gtk/$(OODIR)/share
  1873. ifeq "$(ENABLE_GIO)" "y"
  1874. mv $(PKGDIR)-gtk/$(OODIR)/program/ucpgio1.uno.so \
  1875. $(PKGDIR)-gnome/$(OODIR)/program/
  1876. endif
  1877. ifeq "$(ENABLE_GVFS)" "y"
  1878. mv $(PKGDIR)-gtk/$(OODIR)/program/ucpgvfs1.uno.so \
  1879. $(PKGDIR)-gnome/$(OODIR)/program/
  1880. endif
  1881. ifeq "$(ENABLE_GCONF)" "y"
  1882. mv $(PKGDIR)-gtk/$(OODIR)/program/gconfbe* \
  1883. $(PKGDIR)-gnome/$(OODIR)/program
  1884. endif
  1885. endif
  1886. ifeq "$(ENABLE_EVO2)" "y"
  1887. mkdir -p -m755 $(PKGDIR)-evolution/$(OODIR)/program
  1888. mv $(PKGDIR)-gtk/$(OODIR)/program/libevoab*.so $(PKGDIR)-evolution/$(OODIR)/program
  1889. mv $(PKGDIR)-gnome/$(OODIR)/share/registry/evoab.xcd \
  1890. $(PKGDIR)-evolution/$(OODIR)/share/registry
  1891. # FIXME: When the rdb is correctly generated, move here, too.
  1892. endif
  1893. ifeq "$(PACKAGE_NSPLUGIN)" "y"
  1894. mkdir -p -m755 debian/mozilla-libreoffice$(VER)/$(OODIR)/program
  1895. for f in libnpsoplugin.so nsplugin; do \
  1896. mv $(PKGDIR)-core/$(OODIR)/program/$$f debian/mozilla-libreoffice$(VER)/$(OODIR)/program; \
  1897. done
  1898. cd debian/mozilla-libreoffice$(VER) && \
  1899. mkdir -p usr/lib/mozilla/plugins && \
  1900. ln -sf /$(OODIR)/program/libnpsoplugin.so \
  1901. usr/lib/mozilla/plugins/libnpsoplugin.so
  1902. endif
  1903. ifeq "$(PACKAGE_BASE)" "y"
  1904. mkdir -p $(PKGDIR)-base-core/$(OODIR)/program
  1905. mv $(PKGDIR)-base/$(OODIR)/program/libdbalo.so \
  1906. $(PKGDIR)-base-core/$(OODIR)/program
  1907. endif
  1908. ifeq "$(ENABLE_JAVA)" "y"
  1909. ifneq (,$(filter hsqldb, $(SYSTEM_STUFF)))
  1910. # link to system hsqldb
  1911. mkdir -p $(PKGDIR)-base/$(OODIR)/program/classes
  1912. ln -sf /usr/share/java/hsqldb.jar \
  1913. $(PKGDIR)-base/$(OODIR)/program/classes/hsqldb.jar
  1914. endif
  1915. endif
  1916. ifeq "$(ENABLE_JAVA)" "y"
  1917. rm -rf $(PKGDIR)-officebean
  1918. mkdir -p -m755 $(PKGDIR)-officebean/$(OODIR)/program/classes
  1919. mkdir -p -m755 $(PKGDIR)-officebean/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes
  1920. mv $(PKGDIR)-core/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes/officebean.jar \
  1921. $(PKGDIR)-officebean/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes
  1922. ln -s $(shell echo /$(OODIR) | sed -e s/lib/share/)/program/classes/officebean.jar \
  1923. $(PKGDIR)-officebean/$(OODIR)/program/classes/officebean.jar
  1924. mv $(PKGDIR)-core/$(OODIR)/program/libofficebean.so \
  1925. $(PKGDIR)-officebean/$(OODIR)/program
  1926. endif
  1927. mkdir -p -m755 $(PKGDIR)-base/usr/share/applications \
  1928. $(PKGDIR)-core/usr/share/applications
  1929. for f in `find debian -name 'xdg/*.desktop' ! -name "*soffice.od*"`; do \
  1930. if ! grep -q X-KDE-Protocols $$f; then \
  1931. echo 'X-KDE-Protocols=file,http,smb,ftp,webdav' >> $$f; \
  1932. fi; \
  1933. done
  1934. sed -i -e 's/Office;/Office;Graphics;/' $(PKGDIR)-draw/$(OODIR)/share/xdg/draw.desktop
  1935. # invalid, according to lintian. make it shut up.
  1936. for i in writer calc impress draw math base; do \
  1937. perl -pi -e 's/Application;//; s/X-Red-Hat-Base;//; s/X-SuSE-Core-Office;//; s/X-MandrivaLinux-.*;//;' $(PKGDIR)-$$i/$(OODIR)/share/xdg/$$i.desktop; \
  1938. done
  1939. perl -pi -e 's/Application;//' $(PKGDIR)-gtk/$(OODIR)/share/xdg/qstart.desktop
  1940. # add version to .menu and .lintian-overrides
  1941. for i in base calc draw impress math writer; do \
  1942. cat debian/libreoffice$(VER)-$$i.menu.in \
  1943. | sed -e s/@VER@/$(VER)/ \
  1944. > debian/libreoffice$(VER)-$$i.menu; \
  1945. done; \
  1946. for i in base calc core draw impress math writer; do \
  1947. cat debian/libreoffice$(VER)-$$i.lintian-overrides.in \
  1948. | sed -e s/@VER@/$(VER)/ \
  1949. > debian/libreoffice$(VER)-$$i.lintian-overrides; \
  1950. done
  1951. ifeq "$(BUILD_PYUNO)" "y"
  1952. # PyUNO packaging
  1953. install -d $(PYTHON_SITE)
  1954. mv debian/python-uno/$(OODIR)/program/uno.py $(PYTHON_SITE)
  1955. mv debian/python-uno/$(OODIR)/program/unohelper.py $(PYTHON_SITE)
  1956. touch debian/python-uno/$(OODIR)/program/pythonloader.unorc
  1957. chmod u+w debian/python-uno/$(OODIR)/program/pythonloader.unorc
  1958. ( echo '[Bootstrap]'; \
  1959. echo 'PYTHONHOME=file:///usr/lib/python$(PYMAJOR).$(PYMINOR)' ;\
  1960. echo 'PYTHONPATH=$$PYTHONHOME $$PYTHONHOME/site-packages $$PYTHONHOME/lib-dynload $$PYTHONHOME/lib-tk $$ORIGIN' \
  1961. ) > debian/python-uno/$(OODIR)/program/pythonloader.unorc
  1962. chmod u-w debian/python-uno/$(OODIR)/program/pythonloader.unorc
  1963. ifeq "$(ENABLE_PYTHON3)" "y"
  1964. install -d $(PYTHON3_SITE)
  1965. cp $(PYTHON_SITE)/uno.py \
  1966. $(PYTHON3_SITE)
  1967. cp $(PYTHON_SITE)/unohelper.py \
  1968. $(PYTHON3_SITE)
  1969. mkdir -p debian/python3-uno/$(OODIR)/program
  1970. mkdir -p debian/python3-uno/$(OODIR)/share/registry
  1971. mkdir -p debian/python3-uno/$(OODIR)/share/Scripts
  1972. cat debian/python-uno/$(OODIR)/program/pythonloader.unorc \
  1973. | sed -e "s/$(PYMAJOR).$(PYMINOR)/$(PY3MAJOR).$(PY3MINOR)/" \
  1974. > debian/python3-uno/$(OODIR)/program/pythonloader.unorc
  1975. for i in pyuno.so pythonloader.uno.so libpyuno.so; do \
  1976. install -m644 $(SOURCE_TREE)/pyuno-py3/$(shell . $(SOURCE_TREE)/Env.Host.sh; echo $$OUTPATH$$PROEXT)/lib/$$i \
  1977. debian/python3-uno/$(OODIR)/program/$$i; \
  1978. done
  1979. cp debian/python-uno/$(OODIR)/program/pythonloader.py \
  1980. debian/python3-uno/$(OODIR)/program
  1981. cp debian/python-uno/$(OODIR)/share/registry/pyuno.xcd \
  1982. debian/python3-uno/$(OODIR)/share/registry
  1983. cp -r debian/python-uno/$(OODIR)/share/Scripts/python \
  1984. debian/python3-uno/$(OODIR)/share/Scripts
  1985. endif
  1986. ifeq "$(ENABLE_SCRIPT_PROVIDER_PYTHON)" "y"
  1987. rm -f debian/libreoffice$(VER)-script-provider-python/$(OODIR)/share/extensions/script-provider-for-python/registration/LICENSE
  1988. endif
  1989. mkdir -p debian/python-uno/usr/share/doc/python-uno
  1990. cp -r $(SOURCE_TREE)/pyuno/demo \
  1991. debian/python-uno/usr/share/doc/python-uno; \
  1992. for i in $(SOURCE_TREE)/pyuno/doc/*; do \
  1993. cp $$i debian/python-uno/usr/share/doc/python-uno; \
  1994. done
  1995. cd debian/python-uno/usr/share/doc/python-uno && \
  1996. find . -type d -name "CVS" | xargs -r rm -rf
  1997. ifeq "$(ENABLE_PYTHON3)" "y"
  1998. mkdir -p debian/python3-uno/usr/share/doc/python3-uno
  1999. cp -r $(SOURCE_TREE)/pyuno/demo \
  2000. debian/python3-uno/usr/share/doc/python3-uno; \
  2001. for i in $(SOURCE_TREE)/pyuno/doc/*; do \
  2002. cp $$i debian/python3-uno/usr/share/doc/python3-uno; \
  2003. done
  2004. cd debian/python3-uno/usr/share/doc/python3-uno && \
  2005. find . -type d -name "CVS" | xargs -r rm -rf
  2006. endif
  2007. endif
  2008. # should be empty now, remove if there
  2009. rm -rf $(PKGDIR)-core/$(OODIR)/ure
  2010. ifeq "$(PACKAGE_SDK)" "y"
  2011. ifeq "$(ENABLE_JAVA)" "y"
  2012. # compat/safety symlink for SDK Java stuff moved to /usr/share
  2013. rm -f $(PKGDIR)-dev/$(OOSDKDIR)/classes
  2014. mkdir -p $(PKGDIR)-dev/$(OOSDKDIR)/classes/com/sun/star/lib/loader
  2015. cd $(PKGDIR)-dev/$(OOSDKDIR)/classes/com/sun/star/lib/loader && \
  2016. for i in $(CURDIR)/$(PKGDIR)-dev/$(shell echo $(OOSDKDIR) | sed -e s/lib/share/)/classes/com/sun/star/lib/loader/*.class; do \
  2017. ln -s `echo $$i | sed -e 's,$(CURDIR)/$(PKGDIR)-dev,,'` `basename $$i`; \
  2018. done
  2019. ifeq "$(PACKAGE_UNOWINREG_DLL)" "y"
  2020. mkdir -p $(PKGDIR)-dev/$(OOSDKDIR)/classes/win
  2021. chmod 644 $(PKGDIR)-dev/$(shell echo $(OOSDKDIR) | sed -e s/lib/share/)/classes/win/unowinreg.dll
  2022. ln -s /$(shell echo $(OOSDKDIR) | sed -e s/lib/share/)/classes/win/unowinreg.dll \
  2023. $(PKGDIR)-dev/$(OOSDKDIR)/classes/win/unowinreg.dll
  2024. else
  2025. rm -rf $(PKGDIR)-dev/$(shell echo $(OOSDKDIR) | sed -e s/lib/share/)/classes/win
  2026. endif
  2027. endif
  2028. chmod 644 $(PKGDIR)-dev/$(OOSDKDIR)/configure.pl
  2029. for i in csh csh.in; do \
  2030. perl -pi -e 's,/usr/bin/csh,/bin/csh,'\
  2031. $(PKGDIR)-dev/$(OOSDKDIR)/setsdkenv_unix.$$i; \
  2032. done
  2033. chmod 755 $(PKGDIR)-dev/$(OOSDKDIR)/setsdkenv_unix
  2034. # create wrapper scripts
  2035. cd $(PKGDIR)-dev/$(OOSDKDIR)/bin && \
  2036. for i in *; do \
  2037. mv $$i $$i.bin && \
  2038. ( \
  2039. echo "#!/bin/sh"; \
  2040. echo "# wrapper script for OOos SDK programs"; \
  2041. echo ""; \
  2042. echo 'LD_LIBRARY_PATH=/$(OOUREDIR)/lib /$(OOSDKDIR)/bin/`basename $$0`.bin "$$@"'; \
  2043. ) > $$i; \
  2044. chmod 755 $$i; \
  2045. done
  2046. # remove symlink, it should be in -dev-doc
  2047. cd $(PKGDIR)-dev/$(OOSDKDIR) && \
  2048. rm docs
  2049. # install gsicheck into -dev
  2050. mkdir -p $(PKGDIR)-dev/$(OODIR)/program
  2051. install -m755 $(SOURCE_TREE)/solver/$(shell . $(SOURCE_TREE)/Env.Host.sh; echo $$OUTPATH$$PROEXT)/bin/gsicheck \
  2052. $(PKGDIR)-dev/$(OODIR)/program/gsicheck.bin
  2053. ( \
  2054. echo '#! /bin/sh'; \
  2055. echo 'LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}/$(OODIR)/program'; \
  2056. echo 'export LD_LIBRARY_PATH'; \
  2057. echo 'exec /$(OODIR)/program/gsicheck.bin "$$@"'; \
  2058. ) > $(PKGDIR)-dev/$(OODIR)/program/gsicheck
  2059. chmod 755 $(PKGDIR)-dev/$(OODIR)/program/gsicheck
  2060. # fix permissions
  2061. find $(PKGDIR)-dev/usr/share/idl/$(OODIRNAME) -type f -exec chmod 644 {} \;
  2062. endif
  2063. ifeq "$(LINK_TO_STLPORT)" "y"
  2064. rm -f debian/ure/$(OOUREDIR)/lib/libstlport*
  2065. ln -s `readlink -f /usr/lib/libstlport_gcc.so` \
  2066. debian/ure/$(OOUREDIR)/lib/libstlport_gcc.so
  2067. endif
  2068. ifeq "$(ENABLE_JAVA)" "y"
  2069. ifeq "$(BUILD_JARS_NATIVE)" "y"
  2070. rm -rf $(PKGDIR)-gcj/usr/lib/gcj
  2071. mkdir -p $(PKGDIR)-gcj/usr/lib/gcj/$(OODIRNAME)
  2072. cp -p debian/tmp/native-jars/gcj/* $(PKGDIR)-gcj/usr/lib/gcj/$(OODIRNAME)
  2073. mkdir -p $(PKGDIR)-gcj/usr/share/gcj/classmap.d
  2074. cp -p debian/tmp/native-jars/tmp.db \
  2075. $(PKGDIR)-gcj/usr/share/gcj/classmap.d/libreoffice.db
  2076. endif
  2077. endif
  2078. ifeq "$(PACKAGE_SDK)" "y"
  2079. ifeq "$(ENABLE_JAVA)" "y"
  2080. # install the UNO Java sources for e.g. eclipse
  2081. mkdir -p $(CURDIR)/$(PKGDIR)-dev/usr/share/java
  2082. cd $(SOURCE_TREE)/solver/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/bin && \
  2083. for i in juh jurt jut ridl unoloader; do \
  2084. cp $${i}_src.zip \
  2085. $(CURDIR)/$(PKGDIR)-dev/usr/share/java; \
  2086. done
  2087. endif
  2088. endif
  2089. ifeq "$(ENABLE_JAVA)" "y"
  2090. # hrmpf, again something like that, we really need to find the root cause for that
  2091. ln -s libjava_uno.so \
  2092. debian/ure/$(OOUREDIR)/lib/libjava_uno
  2093. endif
  2094. # remove empty resource directories
  2095. for i in draw base writer impress calc math; do \
  2096. rm -rf $(PKGDIR)-$$i/$(OODIR)/program/resource; \
  2097. done
  2098. ifneq "$(ENABLE_REPORTDESIGN)" "y"
  2099. # unneeded. a no-Java arch, so the report-builder can't work anyway.
  2100. # (and we need to remove it here anyway as it otherwise would end up
  2101. # in -base)
  2102. rm -f $(PKGDIR)-base/$(OODIR)/program/librpt*
  2103. else
  2104. ifeq "$(PACKAGE_BASE)" "y"
  2105. # move rpt stuff into -report-builder-bin
  2106. rm -rf $(PKGDIR)-report-builder-bin
  2107. mkdir -p $(PKGDIR)-report-builder-bin/$(OODIR)/program
  2108. mv $(PKGDIR)-base/$(OODIR)/program/librpt* \
  2109. $(PKGDIR)-report-builder-bin/$(OODIR)/program
  2110. endif
  2111. endif
  2112. ifeq "$(ENABLE_MINIMIZER)" "y"
  2113. rm -f $(PKGDIR)-presentation-minimizer/$(OODIR)/share/extensions/presentation-minimizer/registration/LICENSE
  2114. endif
  2115. ifeq "$(ENABLE_MYSQLNATIVE)" "y"
  2116. rm -f $(PKGDIR)-mysql-connector/$(OODIR)/share/extensions/mysql-connector-ooo/registration/LICENSE
  2117. endif
  2118. ifeq "$(ENABLE_PDFIMPORT)" "y"
  2119. rm -f $(PKGDIR)-pdfimport/$(OODIR)/share/extensions/pdfimport/registration/LICENSE
  2120. endif
  2121. ifeq "$(ENABLE_MEDIAWIKI)" "y"
  2122. rm -f $(PKGDIR)-wiki-publisher/$(OODIR)/share/extensions/wiki-publisher/registration/LICENSE
  2123. endif
  2124. #ifeq "$(PACKAGE_SDK)" "y"
  2125. # # install gengal stuff into -dev
  2126. # mkdir -p $(PKGDIR)-dev/$(OODIR)/program
  2127. # install -m755 $(SOURCE_TREE)/svx/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/bin/gengal \
  2128. # $(PKGDIR)-dev/$(OODIR)/program/gengal
  2129. # install -m755 $(SOURCE_TREE)/svx/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/bin/gengal.bin \
  2130. # $(PKGDIR)-dev/$(OODIR)/program/gengal.bin
  2131. #endif
  2132. for i in $(ARCH_DEP_PACKAGES); do \
  2133. if [ -e debian/$$i.bug-script.in ]; then \
  2134. cat debian/$$i.bug-script.in \
  2135. | sed -e "s/@PLATFORMID@/$(PLATFORMID)/" \
  2136. > debian/$$i.bug-script; \
  2137. fi ;\
  2138. done
  2139. # generate .links files from *.in
  2140. for PKG in $(ARCH_DEP_PACKAGES); do \
  2141. LINKS=debian/$$PKG.links ; \
  2142. if [ -e $$LINKS.in ]; then \
  2143. sed -e "s#\@OODIR\@#$(OODIR)#g" \
  2144. < $$LINKS.in > $$LINKS ; \
  2145. fi; \
  2146. done
  2147. for PKG in $(ARCH_DEP_PACKAGES); do \
  2148. case $$PKG in \
  2149. python-uno|uno-libs*|ure*) \
  2150. ;; \
  2151. *) \
  2152. cat debian/changelog \
  2153. | sed -e '/^openoffice/,$$d' \
  2154. > debian/$$PKG.changelog; \
  2155. ;; \
  2156. esac; \
  2157. done
  2158. touch $@
  2159. # Install files generated by setup into arch-independent package directories
  2160. install-indep: $(STAMP_DIR)/install-indep
  2161. #$(STAMP_DIR)/install-indep: debian/libreoffice$(VER).install
  2162. #$(STAMP_DIR)/install-indep: debian/libreoffice$(VER)-mimelnk.install
  2163. #$(STAMP_DIR)/install-indep: debian/libreoffice$(VER).dirs
  2164. $(STAMP_DIR)/install-indep: $(STAMP_DIR)/install
  2165. dh_testdir
  2166. dh_testroot
  2167. # split out emailmerge stuff
  2168. mkdir -p $(PKGDIR)-emailmerge/$(OODIR)/program
  2169. for i in mailmerge msgbox officehelper; do \
  2170. mv $(PKGDIR)-common/$(OODIR)/program/$$i.py \
  2171. $(PKGDIR)-emailmerge/$(OODIR)/program; \
  2172. done
  2173. ifneq "$(USE_GSTREAMER)" "y"
  2174. # sound doesn't work anyway, remove the .wav files to save space
  2175. rm -rf $(PKGDIR)-common/$(OODIR)/share/gallery/sounds
  2176. rm -f $(PKGDIR)-common/$(OODIR)/share/gallery/sg9.*
  2177. endif
  2178. rm -f $(PKGDIR)-common/$(OODIR)/program/oo_product.bmp
  2179. # install openoffice-xlate-lang
  2180. install -d -m755 $(PKGDIR)-common/usr/share/$(OODIRNAME)/bin
  2181. install -m755 $(SOURCE_TREE)/bin/lo-xlate-lang \
  2182. $(PKGDIR)-common/usr/share/$(OODIRNAME)/bin
  2183. ifeq "$(HELPISOS)" ""
  2184. # when we don't build helpcontent2 here we are missing helpxsl.zip so
  2185. # this file doesn't get installed either. Do it manually..
  2186. mkdir -p -m755 $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/help && \
  2187. cp $(SOURCE_TREE)/helpcontent2/source/auxiliary/main_transform.xsl \
  2188. $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/help
  2189. cp $(SOURCE_TREE)/helpcontent2/source/auxiliary/idxcaption.xsl \
  2190. $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/help
  2191. cp $(SOURCE_TREE)/helpcontent2/source/auxiliary/idxcontent.xsl \
  2192. $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/help
  2193. endif
  2194. ifeq "$(PACKAGE_SDK)" "y"
  2195. rm -f $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev-doc/LICENSE
  2196. perl -pi -e 's,license.html,http://www.gnu.org/licenses/lgpl.html,' \
  2197. $(PKGDIR)-dev-doc/$(OOSDKDIR)/index.html
  2198. find $(PKGDIR)-dev-doc/$(OODIR)/sdk/examples -type f -exec chmod 644 {} \;
  2199. endif
  2200. ifeq "$(ENABLE_JAVA)" "y"
  2201. # move common Java stuff to -java-common
  2202. rm -rf $(PKGDIR)-java-common
  2203. mkdir -p $(PKGDIR)-java-common/$(OODIR)/program/classes
  2204. mkdir -p $(PKGDIR)-java-common/$(OODIR)/share/Scripts
  2205. mkdir -p $(PKGDIR)-java-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes
  2206. mv $(PKGDIR)-common/$(OODIR)/share/Scripts/java \
  2207. $(PKGDIR)-java-common/$(OODIR)/share/Scripts
  2208. mv $(PKGDIR)-common/$(OODIR)/program/classes/* \
  2209. $(PKGDIR)-java-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes
  2210. cd $(PKGDIR)-java-common/$(OODIR)/program/classes && \
  2211. for i in $(CURDIR)/$(PKGDIR)-java-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes/*; do \
  2212. case "`basename $$i`" in aportisdoc.jar|pexcel.jar|pocketword.jar) continue ;; \
  2213. *) ln -s `echo $$i | sed -e 's,$(CURDIR)/$(PKGDIR)-java-common,,'` `basename $$i` ;; esac; \
  2214. done
  2215. # move into extra package
  2216. rm -rf $(PKGDIR)-filter-mobiledev
  2217. mkdir -p $(PKGDIR)-filter-mobiledev/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes
  2218. mkdir -p $(PKGDIR)-filter-mobiledev/$(OODIR)/program/classes
  2219. for i in aportisdoc pexcel pocketword; do \
  2220. mv $(PKGDIR)-java-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes/$$i.jar \
  2221. $(PKGDIR)-filter-mobiledev/$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes; \
  2222. ln -s /$(shell echo $(OODIR) | sed -e s/lib/share/)/program/classes/$$i.jar \
  2223. $(PKGDIR)-filter-mobiledev/$(OODIR)/program/classes; \
  2224. done
  2225. for i in pocketexcel palm pocketword; do \
  2226. mkdir -p $(PKGDIR)-filter-mobiledev/$(OODIR)/share/registry && \
  2227. mv $(PKGDIR)-common/$(OODIR)/share/registry/$$i.xcd \
  2228. $(PKGDIR)-filter-mobiledev/$(OODIR)/share/registry; \
  2229. done
  2230. endif
  2231. # fix permissions
  2232. for i in editpic poll savepic show webcast; do \
  2233. chmod 755 $(PKGDIR)-common/$(OODIR)/share/config/webcast/$$i.pl; \
  2234. done
  2235. chmod 644 $(PKGDIR)-common/$(OODIR)/LICENSE.odt
  2236. chmod 644 $(PKGDIR)-common/$(OODIR)/CREDITS.odt
  2237. rm -rf $(PKGDIR)-common/$(OODIR)/LICENSE
  2238. # move uno_packages/cache to /var and create symlink for for
  2239. # documentation referencing it...
  2240. rm -rf $(PKGDIR)-common/$(OODIR)/share/uno_packages/cache
  2241. mkdir -p $(PKGDIR)-common/var/spool/$(OODIRNAME)/uno_packages/cache
  2242. ln -s /var/spool/$(OODIRNAME)/uno_packages/cache \
  2243. $(PKGDIR)-common/$(OODIR)/share/uno_packages/cache
  2244. perl -pi -e \
  2245. 's,\$$UNO_SHARED_PACKAGES/cache,file:///var/spool/$(OODIRNAME)/uno_packages/cache,g' \
  2246. $(PKGDIR)-common/$(OODIR)/program/unorc
  2247. # FIXME: What is this? unorc per default only mentiones
  2248. # share/uno_packages/cache...
  2249. rm -rf $(PKGDIR)-common/$(OODIR)/presets/uno_packages
  2250. # move javasettingsunopkginstall.xml to /var/lib
  2251. mkdir -p $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/usr/var/)/share/config
  2252. mv $(PKGDIR)-common/$(OODIR)/share/config/javasettingsunopkginstall.xml \
  2253. $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/usr/var/)/share/config/javasettingsunopkginstall.xml
  2254. ln -s /$(shell echo $(OODIR) | sed -e s/usr/var/)/share/config/javasettingsunopkginstall.xml \
  2255. $(PKGDIR)-common/$(OODIR)/share/config/javasettingsunopkginstall.xml
  2256. # set PYTHONPATH in unopkg
  2257. perl -pi -e 's,unset XENVIRONMENT,unset XENVIRONMENT\n\nexport PYTHONPATH=\"/$(OODIR)/program\"\n\n,' \
  2258. $(PKGDIR)-common/$(OODIR)/program/unopkg
  2259. ifeq "$(PACKAGE_TTF_OPENSYMBOL)" "y"
  2260. mkdir -p debian/fonts-opensymbol/usr/share/fonts/truetype/openoffice
  2261. mv $(PKGDIR)-common/$(OODIR)/share/fonts/truetype/opens___.ttf \
  2262. debian/fonts-opensymbol/usr/share/fonts/truetype/openoffice
  2263. rm -rf $(PKGDIR)-common/$(OODIR)/share/fonts/truetype
  2264. else
  2265. rm -f $(PKGDIR)-common/$(OODIR)/share/fonts/truetype/opens___.ttf
  2266. endif
  2267. # convert icons to xpm; we need them for the Debian menu policy...
  2268. cd $(PKGDIR)-common/usr/share/icons/hicolor/32x32/apps && \
  2269. for x in *.png; do convert $$x `basename $$x .png`.xpm; done
  2270. ifeq "$(ENABLE_JAVA)" "y"
  2271. ifneq (,$(filter saxon, $(SYSTEM_STUFF)))
  2272. ln -sf /usr/share/java/saxonb.jar \
  2273. $(PKGDIR)-java-common/$(OODIR)/program/classes/saxon9.jar
  2274. endif
  2275. endif
  2276. # remove extra license files
  2277. rm -rf $(PKGDIR)-common/$(OODIR)/licenses
  2278. rm -f $(PKGDIR)-common/$(OODIR)/share/readme/LICENSE*
  2279. rm -f $(PKGDIR)-common/$(OODIR)/THIRDPARTYLICENSEREADME.html
  2280. rm -f $(PKGDIR)-common/$(OODIR)/LICENSE.html
  2281. # remove extra readme files
  2282. rm -rf $(PKGDIR)-common/$(OODIR)/readmes
  2283. rm -f $(PKGDIR)-common/$(OODIR)/share/readme/README*
  2284. rm -f $(PKGDIR)-common/$(OODIR)/README.html
  2285. rm -f $(PKGDIR)-common/$(OODIR)/README
  2286. # URE got moved to /usr/lib, so this is obsolete
  2287. for i in ure/lib ure; do \
  2288. if [ -e $(PKGDIR)-common/$(OODIR)/$$i ]; then \
  2289. rmdir $(PKGDIR)-common/$(OODIR)/$$i; \
  2290. fi; \
  2291. done
  2292. # move psprint.conf into /etc
  2293. mkdir -p $(PKGDIR)-common/etc/$(OODIRNAME)
  2294. mv $(PKGDIR)-common/$(OODIR)/share/psprint/psprint.conf \
  2295. $(PKGDIR)-common/etc/$(OODIRNAME)
  2296. ln -s /etc/$(OODIRNAME)/psprint.conf \
  2297. $(PKGDIR)-common/$(OODIR)/share/psprint/psprint.conf
  2298. # prepare a fake sofficerc in the place where OOo expects it
  2299. # which does nothing except reference the "normal" one
  2300. # which we put into /etc
  2301. mv $(PKGDIR)-common/$(OODIR)/program/sofficerc \
  2302. $(PKGDIR)-common/etc/$(OODIRNAME)/sofficerc
  2303. ( \
  2304. echo "# *DO NOT* CHANGE THIS FILE. IT ONLY TAKES THE SETTINGS FROM"; \
  2305. echo "# /etc/$(OODIRNAME)/sofficerc. CHANGE THAT FILE IF YOU"; \
  2306. echo "# REALLY WANT TO CHANGE SOMETHING."; \
  2307. echo "FHS_CONFIG_FILE=file:///etc/$(OODIRNAME)/sofficerc"; \
  2308. echo "" >> $(PKGDIR)-common/$(OODIR)/program/sofficerc; \
  2309. ) > $(PKGDIR)-common/$(OODIR)/program/sofficerc
  2310. cat $(PKGDIR)-common/etc/$(OODIRNAME)/sofficerc \
  2311. | perl -p -e 's/(.*)=(.*)/$$1=\$${\$$FHS_CONFIG_FILE:Bootstrap:$$1}/' \
  2312. >> $(PKGDIR)-common/$(OODIR)/program/sofficerc
  2313. # except for URE_BOOTSTRAP...
  2314. TMP=`mktemp -q`; \
  2315. grep -v URE_BOOTSTRAP $(PKGDIR)-common/$(OODIR)/program/sofficerc > $$TMP && mv $$TMP $(PKGDIR)-common/$(OODIR)/program/sofficerc && \
  2316. grep URE_BOOTSTRAP $(PKGDIR)-common/etc/$(OODIRNAME)/sofficerc >> $(PKGDIR)-common/$(OODIR)/program/sofficerc && \
  2317. grep -v URE_BOOTSTRAP $(PKGDIR)-common/etc/$(OODIRNAME)/sofficerc > $$TMP && mv $$TMP $(PKGDIR)-common/etc/$(OODIRNAME)/sofficerc
  2318. install -m 644 debian/soffice.sh \
  2319. $(PKGDIR)-common/etc/$(OODIRNAME)/soffice.sh
  2320. ifeq "$(HELPISOS)" ""
  2321. # the helpimgs are not included when we don't build with help here.
  2322. # Add them now because libreoffice-help-* packaged in contrib or so
  2323. # will need them
  2324. set -e; \
  2325. for i in $(IMAGES); do \
  2326. s=_$$i.zip; \
  2327. case "$$i" in $(DEFAULT_IMAGE)) s=.zip; esac; \
  2328. z=images$$s; \
  2329. echo "adding helpimgs to $$z..."; \
  2330. rm -rf $$z; mkdir $$z; \
  2331. cd $$z; \
  2332. unzip -q $(CURDIR)/$(PKGDIR)-common/$(OODIR)/share/config/$$z && \
  2333. cp -r $(CURDIR)/$(SOURCE_TREE)/default_images/res/helpimg res && \
  2334. chmod +w $(CURDIR)/$(PKGDIR)-common/$(OODIR)/share/config/$$z && \
  2335. zip -q -r $(CURDIR)/$(PKGDIR)-common/$(OODIR)/share/config/$$z *; \
  2336. cd ..; \
  2337. rm -rf $$z; \
  2338. done
  2339. endif
  2340. set -e; \
  2341. for i in $(IMAGES); do \
  2342. z=images_$$i.zip; p=$$i; \
  2343. case "$$i" in $(DEFAULT_IMAGE)) z=images.zip; esac; \
  2344. mkdir -p $(PKGDIR)-style-$$p/$(shell echo $(OODIR) | sed -e s/lib/share/)/share/config; \
  2345. mv $(PKGDIR)-common/$(OODIR)/share/config/$$z \
  2346. $(PKGDIR)-style-$$p/$(shell echo $(OODIR) | sed -e s/lib/share/)/share/config/; \
  2347. done
  2348. rm -rf debian/openoffice.org-dtd-officedocument1.0
  2349. mkdir -p debian/openoffice.org-dtd-officedocument1.0/$(shell echo $(OODIR) | sed -e s/libreoffice/openoffice/)/share/dtd
  2350. mv $(PKGDIR)-common/$(OODIR)/share/dtd/officedocument \
  2351. debian/openoffice.org-dtd-officedocument1.0/$(shell echo $(OODIR) | sed -e s/libreoffice/openoffice/)/share/dtd
  2352. cat debian/catalog.xml.in \
  2353. | sed -e "s,\@OODIR\@,$(shell echo $(OODIR) | sed -e s/libreoffice/openoffice/)," \
  2354. > debian/openoffice.org-dtd-officedocument1.0/$(shell echo $(OODIR) | sed -e s/libreoffice/openoffice/)/share/dtd/officedocument/1_0/catalog.xml
  2355. cat debian/openoffice.org-dtd-officedocument1.0.xmlcatalogs.in \
  2356. | sed -e "s,\@OODIR\@,$(shell echo $(OODIR) | sed -e s/libreoffice/openoffice/)," \
  2357. > debian/openoffice.org-dtd-officedocument1.0.xmlcatalogs
  2358. # symlink, as it's in a openoffice.org-* package
  2359. cd debian/openoffice.org-dtd-officedocument1.0 && \
  2360. mkdir -p $(OODIR)/share/dtd && \
  2361. cd $(OODIR)/share/dtd && ln -s /$(shell echo $(OODIR) | sed -e s/libreoffice/openoffice/)/share/dtd/officedocument
  2362. ifeq "$(DEB_VENDOR)" "Debian"
  2363. # install Debian presentation template
  2364. mkdir -p $(PKGDIR)-common/$(OODIR)/share/template/en-US/presnt
  2365. install -m644 debian/templates/*.otp $(PKGDIR)-common/$(OODIR)/share/template/en-US/presnt/
  2366. endif
  2367. ifeq "$(PACKAGE_SDK)" "y"
  2368. # add symlinks for docs and examples
  2369. cd $(PKGDIR)-dev-doc/$(OOSDKDIR) && \
  2370. rm -rf docs && \
  2371. ln -sf /usr/share/doc/libreoffice-dev/docs docs
  2372. mkdir -p $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev
  2373. mkdir -p $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev-doc
  2374. cd $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev-doc && \
  2375. ln -s /usr/share/doc/libreoffice-dev/docs docs
  2376. cd $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev-doc && \
  2377. ln -s /$(OOSDKDIR)/examples examples
  2378. cd $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev && \
  2379. ln -s /$(OOSDKDIR)/examples examples
  2380. # and the index
  2381. cd $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev && \
  2382. ln -s /$(OOSDKDIR)/index.html index.html
  2383. endif
  2384. ifeq "$(ENABLE_JAVA)" "y"
  2385. ifeq "$(ENABLE_SCRIPT_PROVIDER_BSH)" "y"
  2386. mkdir -p $(PKGDIR)-script-provider-bsh/$(OODIR)/share/Scripts
  2387. mv $(PKGDIR)-common/$(OODIR)/share/Scripts/beanshell \
  2388. $(PKGDIR)-script-provider-bsh/$(OODIR)/share/Scripts
  2389. endif
  2390. ifeq "$(ENABLE_SCRIPT_PROVIDER_JS)" "y"
  2391. mkdir -p $(PKGDIR)-script-provider-js/$(OODIR)/share/Scripts
  2392. mv $(PKGDIR)-common/$(OODIR)/share/Scripts/javascript \
  2393. $(PKGDIR)-script-provider-js/$(OODIR)/share/Scripts
  2394. endif
  2395. endif
  2396. ifeq "$(ENABLE_REPORTDESIGN)" "y"
  2397. ifeq "$(ENABLE_JAVA)" "y"
  2398. for i in THIRDPARTYREADMELICENSE.html readme_en-US.html readme_en-US.txt \
  2399. registration/LICENSE; do \
  2400. rm -f $(PKGDIR)-report-builder/$(OODIR)/share/extensions/report-builder/$$i; \
  2401. done
  2402. endif
  2403. endif
  2404. ifeq "$(ENABLE_MEDIAWIKI)" "y"
  2405. rm -f $(PKGDIR)-wiki-publisher/$(OODIR)/share/extensions/wiki-publisher/license/THIRDPARTYLICENSEREADME.html
  2406. endif
  2407. # unopkg creates stuff in there.
  2408. mkdir -p $(PKGDIR)-common/$(OODIR)/share/prereg
  2409. mkdir -p $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/usr/var/)/share/prereg/bundled
  2410. ln -s /$(shell echo $(OODIR) | sed -e s/usr/var/)/share/prereg/bundled \
  2411. $(PKGDIR)-common/$(OODIR)/share/prereg/bundled
  2412. for i in $(ARCH_INDEP_PACKAGES); do \
  2413. if [ -e debian/$$i.bug-script.in ]; then \
  2414. cat debian/$$i.bug-script.in \
  2415. | sed -e "s/@PLATFORMID@/$(PLATFORMID)/" \
  2416. > debian/$$i.bug-script; \
  2417. fi ;\
  2418. done
  2419. # generate .links files from *.in
  2420. for PKG in $(ARCH_INDEP_PACKAGES); do \
  2421. LINKS=debian/$$PKG.links ; \
  2422. if [ -e $$LINKS.in ]; then \
  2423. sed -e "s#\@OODIR\@#$(OODIR)#g" \
  2424. < $$LINKS.in > $$LINKS ; \
  2425. fi; \
  2426. done
  2427. for PKG in $(ARCH_INDEP_PACKAGES); do \
  2428. case $$PKG in \
  2429. ttf-opensymbol|openoffice.org-dtd-officedocument1.0) \
  2430. ;; \
  2431. *) \
  2432. cat debian/changelog \
  2433. | sed -e '/^openoffice/,$$d' \
  2434. > debian/$$PKG.changelog; \
  2435. ;; \
  2436. esac; \
  2437. done
  2438. # install extension shell lib for use by extensions not from here
  2439. install -D -m644 debian/shell-lib-extensions.sh \
  2440. $(PKGDIR)-common/usr/share/$(OODIRNAME)/shell-lib-extensions.sh
  2441. # those are needed in /usr/share, too
  2442. mkdir -p $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)
  2443. mv $(PKGDIR)-common/$(OODIR)/help \
  2444. $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)
  2445. # help is in /usr/share
  2446. sed -i 's,$$(instpath)/help,/$(shell echo $(OODIR) | sed -e s/lib/share/)/help,' \
  2447. $(PKGDIR)-common/$(OODIR)/share/registry/main.xcd
  2448. # compat dirs, the split icons thing need it
  2449. mkdir -p $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/program
  2450. mkdir -p $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/program
  2451. # three-layer symlinks also for /usr/share
  2452. ln -s /$(OOUREDIR) \
  2453. $(PKGDIR)-common/$(shell echo $(OODIR) | sed -e s/lib/share/)/ure-link
  2454. # enable session handling and recovery
  2455. 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
  2456. # examples. move where they belong
  2457. mkdir -p $(PKGDIR)-common/usr/share/doc/libreoffice-common/examples
  2458. for i in oo-ldap.xcd.sample oo-ad-ldap.xcd.sample; do \
  2459. mv $(PKGDIR)-common/$(OODIR)/share/registry/$$i \
  2460. $(PKGDIR)-common/usr/share/doc/libreoffice-common/examples; \
  2461. ln -s /usr/share/doc/libreoffice-common/examples/$$i $(PKGDIR)-common/$(OODIR)/share/registry/$$i; \
  2462. done
  2463. # install font config. Doesn't get installed with
  2464. # --without-fonts.
  2465. # FIXME: Shouldn't this be in /etc/fonts/conf.d with a symlink here?
  2466. install -m644 -D $(SOURCE_TREE)/more_fonts/fonts/fc_local.conf \
  2467. $(PKGDIR)-common/$(OODIR)/share/fonts/truetype/fc_local.conf
  2468. # register technical.dic
  2469. perl -pi -e 's/standard.dic;/standard.dic;technical.dic;/' $(PKGDIR)-common/$(OODIR)/share/registry/main.xcd
  2470. #ifeq "$(PACKAGE_SDK)" "y"
  2471. # # install gengal stuff into -dev
  2472. # mkdir -p $(PKGDIR)-dev/$(OODIR)/program
  2473. # install -m644 $(SOURCE_TREE)/svx/$(shell . $(SOURCE_TREE)/*Env*.sh; echo $$OUTPATH$$PROEXT)/bin/gengalrc \
  2474. # $(PKGDIR)-common/$(OODIR)/program/gengalrc
  2475. #endif
  2476. touch $@
  2477. binary-arch: $(STAMP_DIR)/binary-arch
  2478. $(STAMP_DIR)/binary-arch: $(STAMP_DIR)/install-arch debian/control $(STAMP_DIR)/maintscripts
  2479. dh_testdir
  2480. dh_testroot
  2481. for pkg in $(ARCH_DEP_PACKAGES) ; do \
  2482. rm -f debian/$$pkg.*.debhelper;\
  2483. rm -rf debian/$$pkg/DEBIAN;\
  2484. done
  2485. dh_installdocs -s -A debian/README.Debian
  2486. dh_installdebconf -s
  2487. dh_installman -s
  2488. for i in writer calc draw base math impress; do \
  2489. for i in `find $(PKGDIR)-$$i -type l -name "lo*.1"`; do \
  2490. mv $$i $$i.gz; \
  2491. if [ "`readlink $$i`" != "libreoffice.1.gz" ]; then \
  2492. ln -sf libreoffice.1.gz $$i.gz; \
  2493. fi; \
  2494. done; \
  2495. done
  2496. dh_installchangelogs -s -k
  2497. dh_installmime -s
  2498. dh_installmenu -s
  2499. ifeq "$(ENABLE_JAVA)" "y"
  2500. ifeq "$(BUILD_JARS_NATIVE)" "y"
  2501. dh_nativejava -plibreoffice$(VER)-gcj -o
  2502. endif
  2503. endif
  2504. dh_python2 -ppython-uno --no-guessing-versions --no-guessing-deps
  2505. ifeq "$(ENABLE_PYTHON3)" "y"
  2506. dh_python3 -ppython3-uno --no-guessing-deps
  2507. endif
  2508. dh_lintian -s
  2509. dh_bugfiles -s -A
  2510. dh_link -s -X.desktop
  2511. dh_fixperms -s
  2512. ifeq "$(BUILD_DBG_PACKAGE)" "y"
  2513. dh_strip -s -Nure -Nuno-libs3 --dbg-package=libreoffice$(VER)-dbg
  2514. dh_strip -pure --dbg-package=ure-dbg
  2515. dh_strip -puno-libs3 --dbg-package=uno-libs3-dbg
  2516. # dh_strip --dbg-package= is not idempotent, force copying of the binaries
  2517. # again...
  2518. rm -f $(STAMP_DIR)/install-arch
  2519. # install .gdb-py
  2520. for i in `find $(SOURCE_TREE)/solver/ -name "*-gdb.py"`; do \
  2521. if echo $$i | grep -q uno_; then pkg=uno-libs3; path=usr/lib/ure/lib; \
  2522. else pkg=libreoffice; path=usr/lib/libreoffice/program; fi; \
  2523. mkdir -p debian/$$pkg-dbg/usr/lib/debug/$$path && \
  2524. install -m644 $$i debian/$$pkg-dbg/usr/lib/debug/$$path/`basename $$i`; \
  2525. done
  2526. else
  2527. dh_strip -s
  2528. endif
  2529. dh_icons -s
  2530. dh_compress -s -X.py -X.mk -X.sxd
  2531. dh_makeshlibs -puno-libs3 -V"uno-libs3 (>= $(shell grep UREPACKAGEVERSION $(SOURCE_TREE)/instsetoo_native/util/openoffice.lst | awk '{ print $$2 }')~), ure" -- -c0 -v`echo $(BINARY_VERSION) | cut -d: -f2`
  2532. 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`
  2533. # ugly hack, but why does that happen? It's not in .symbols...
  2534. TMP=`mktemp -q`; \
  2535. grep -v PRIVATE debian/uno-libs3/DEBIAN/symbols > $$TMP && \
  2536. mv $$TMP debian/uno-libs3/DEBIAN/symbols && \
  2537. chmod 644 debian/uno-libs3/DEBIAN/symbols
  2538. dh_installdeb -s
  2539. ifeq "$(BUILD_KFREEBSD)" "y"
  2540. cat debian/shlibs.override.libc >> debian/shlibs.local
  2541. endif
  2542. ifeq (,$(filter icu, $(SYSTEM_STUFF)))
  2543. cat debian/shlibs.override.icu >> debian/shlibs.local
  2544. endif
  2545. ifeq (,$(filter stdlibs, $(SYSTEM_STUFF)))
  2546. cat debian/shlibs.override.stdlibs >> debian/shlibs.local
  2547. endif
  2548. # we need to do it in two steps. The new dpkg-shlibdeps doesn't find
  2549. # /usr/lib/libgcj-bc.so when specifying -l$(GCJ_JAWT_DIR)
  2550. # and therefore we must not use it for -gcj. But we *do* need it
  2551. # for -officebean (libjawt.so is referenced there)
  2552. LD_LIBRARY_PATH="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" \
  2553. dh_shlibdeps -s -Nlibreoffice$(VER)-officebean \
  2554. -Lure -Luno-libs3 \
  2555. -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)) \
  2556. $(SHLIBS_OVERRIDE)
  2557. ifneq (,$(filter redland, $(SYSTEM_STUFF)))
  2558. # dpkg-shlibdeps "in practice" always will look for this in
  2559. # /usr/lib/openoffice/basisX.Y/program due to the RPATH and the
  2560. # dh_shlibdeps would fail. It's excluded, and we now need to do it
  2561. # manually. Saves us a versioned build-conflict with ourselves
  2562. # which quickly can get outdated
  2563. perl -pi -e 's/(shlibs.*$$)/$$1, $(shell cat /var/lib/dpkg/info/$(shell dpkg -S /usr/lib/`objdump -p $(PKGDIR)-core/$(OODIR)/program/libunordf*.so | grep NEEDED | grep librdf | awk '{ print $$2 }'` | cut -d: -f1).shlibs | awk '{ print $$3,$$4,$$5 }')/' $(PKGDIR)-core.substvars
  2564. endif
  2565. ifeq "$(ENABLE_LIBRSVG)" "y"
  2566. ifeq "$(SYSTEM_LIBRSVG)" "y"
  2567. # dlopen()'ed only for some weird reason (even when --with-librsvg=internal!)
  2568. perl -pi -e 's/(shlibs.*$$)/$$1, $(shell cat /var/lib/dpkg/info/librsvg*.shlibs | awk '{ print $$3,$$4,$$5 }')/' $(PKGDIR)-core.substvars
  2569. endif
  2570. endif
  2571. # don't make uno-libs3 depend on ure...
  2572. perl -pi -e 's/, ure$$//' debian/uno-libs3.substvars
  2573. # .. and prevent ure to depend on itself..
  2574. perl -pi -e 's/, ure \(.*\)$$//' debian/ure.substvars
  2575. ifeq "$(ENABLE_JAVA)" "y"
  2576. LD_LIBRARY_PATH="debian/uno-libs3/$(OOUREDIR)/lib:debian/ure/$(OOUREDIR)/lib:$(PKGDIR)-core/$(OODIR)/program" \
  2577. dh_shlibdeps -plibreoffice$(VER)-officebean \
  2578. -Lure -Luno-libs3 \
  2579. -ldebian/uno-libs3/$(OOUREDIR)/lib:debian/ure/$(OOUREDIR)/lib:$(PKGDIR)-core/$(OODIR)/program:$(GCJ_JAWT_DIR) \
  2580. $(SHLIBS_OVERRIDE)
  2581. endif
  2582. ifeq "$(LINK_TO_STLPORT)" "y"
  2583. perl -pi -e 's/(shlibs.*$$)/$$1, $(shell cat /var/lib/dpkg/info/libstlport4.6*.shlibs | awk '{ print $$3,$$4,$$5 }')/' debian/ure.substvars
  2584. endif
  2585. ifeq "$(ENABLE_JAVA)" "y"
  2586. jh_depends -s -Xlibreoffice$(VER)-gcj -Xlibreoffice$(VER)-dbg -Xure
  2587. ifeq "$(PACKAGE_BASE)" "y"
  2588. perl -pi -e "s/libhsqldb-java/$(BASE_HSQLDB_DEPENDS)/" \
  2589. debian/libreoffice$(VER)-base.substvars
  2590. perl -pi -e "s/base-files,//" \
  2591. debian/libreoffice$(VER)-base.substvars
  2592. endif
  2593. # jh_depends adds ure (${source:Version}) entries. They are overly strict
  2594. # and do not fit anyway given ure has a different versioning scheme. Excluded
  2595. # above, readd here unversioned
  2596. perl -pi -e 's/^(java:Depends.*$$)/\1, ure/' \
  2597. debian/libreoffice$(VER)-officebean.substvars
  2598. endif
  2599. # This switch to dh_shlibdeps reduces the 'libXXX not found' warnings but
  2600. # causes ldd crashes sometimes when used with fakeroot:
  2601. # -l $(PKGDIR)-core/$(OPENOFFICEDIR)/program
  2602. dh_gencontrol -s $(DEBHELPER_OPTIONS) -Nure -Nure-dbg -Nuno-libs3 -Nuno-libs3-dbg \
  2603. -Nlibreoffice$(VER)-presentation-minimizer \
  2604. -Nlibreoffice$(VER)-presenter-console \
  2605. -Nlibreoffice$(VER)-pdfimport \
  2606. -Nlibreoffice$(VER)-mysql-connector -- \
  2607. -V"ure:Version=$(shell grep UREPACKAGEVERSION $(SOURCE_TREE)/instsetoo_native/util/openoffice.lst | awk '{ print $$2 }')" \
  2608. -V'base-version=$(BASE_VERSION)' \
  2609. -V'oover=$(OOVER)' \
  2610. -V'next-oover=$(NEXT_OOVER)' \
  2611. -V'help-l10n-virtual-version=$(HELP_L10N_VIRTUAL_VERSION)' \
  2612. -V'base-hsqldb-depends=$(BASE_HSQLDB_DEPENDS)' \
  2613. -V'java-common-depends=$(JAVA_COMMON_DEPENDS) $(JAVA_COMMON_DEPENDS_VERSION)' \
  2614. -V'java-runtime-depends=$(JAVA_RUNTIME_DEPENDS)' \
  2615. -V'java-gcj-depends=$(JAVA_GCJ_DEPENDS)' \
  2616. -V'lucene-depends=$(LUCENE_DEPENDS)' \
  2617. -V'Binary-Version=$(BINARY_VERSION)' \
  2618. -V'ooo-binfilter-dep=$(OOO_BINFILTER_DEP)' \
  2619. -V'ooo-officebean-dep=$(OOO_OFFICEBEAN_DEP)' \
  2620. -V'kde-iconset-dep=$(KDE_ICONSET_DEP)' \
  2621. -V'lpsolve-dep=$(LPSOLVE_DEP)' \
  2622. -V'gstreamer-plugins-suggests=$(GSTREAMER_PLUGINS_SUGGESTS)' \
  2623. -V'libebook-dep=$(shell debian/scripts/get_libebook_dep.sh)' \
  2624. -V'libldap-suggests=$(LDAP_LIB)' \
  2625. -V'dbg-dbg-suggests=$(DBG_DBG_SUGGESTS)' \
  2626. -v$(BINARY_VERSION)
  2627. ifeq "$(ENABLE_JAVA)" "y"
  2628. perl -pi -e "s/java-gcj-compat/java-gcj-compat (>= 1.0.77-4)/" \
  2629. debian/libreoffice$(VER)-officebean/DEBIAN/control
  2630. endif
  2631. ifneq (,$(findstring $(DEB_HOST_ARCH),$(OOO_ARCH_DEP_EXTENSIONS_ARCHS)))
  2632. ifeq "$(ENABLE_PDFIMPORT)" "y"
  2633. dh_gencontrol -plibreoffice$(VER)-pdfimport -- \
  2634. -v$(shell grep "<version" $(SOURCE_TREE)/sdext/source/pdfimport/description.xml | perl -pi -e 's,<version.*value=\"(.*)\" />,\1,; s/^\s+//')+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
  2635. endif
  2636. ifeq "$(ENABLE_MINIMIZER)" "y"
  2637. dh_gencontrol -plibreoffice$(VER)-presentation-minimizer -- \
  2638. -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`
  2639. endif
  2640. ifeq "$(ENABLE_PRESENTER_CONSOLE)" "y"
  2641. dh_gencontrol -plibreoffice$(VER)-presenter-console -- \
  2642. -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`
  2643. endif
  2644. ifeq "$(PACKAGE_BASE)" "y"
  2645. ifeq "$(ENABLE_MYSQLNATIVE)" "y"
  2646. dh_gencontrol -plibreoffice$(VER)-mysql-connector -- \
  2647. -v$(shell grep "<version" $(SOURCE_TREE)/mysqlc/$(shell . $(SOURCE_TREE)/Env.Host.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`
  2648. endif
  2649. endif
  2650. endif
  2651. dh_gencontrol -pure -pure-dbg -puno-libs3 -puno-libs3-dbg -- \
  2652. -V"ure:Version=`echo $(BINARY_VERSION) | cut -d: -f2`" \
  2653. -v"`echo $(BINARY_VERSION) | cut -d: -f2`"
  2654. dh_md5sums -s
  2655. dh_builddeb -s $(DEBHELPER_OPTIONS) $(BUILDDEB_OPTIONS)
  2656. touch $@
  2657. binary-indep: $(GSI_EXPORT_STAMP) $(STAMP_DIR)/binary-indep
  2658. $(STAMP_DIR)/binary-indep: $(STAMP_DIR)/install-indep debian/control $(STAMP_DIR)/maintscripts $(STAMP_DIR)/langpacks
  2659. ifneq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH),$(OOO_JAVA_ARCHS)))
  2660. echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
  2661. echo "For uploads with binary-all packages, please use arches where Java is enabled!!!!!"
  2662. echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
  2663. endif
  2664. dh_testdir
  2665. dh_testroot
  2666. for pkg in $(ARCH_INDEP_PACKAGES) ; do \
  2667. rm -f debian/$$pkg.*.debhelper;\
  2668. rm -rf debian/$$pkg/DEBIAN;\
  2669. done
  2670. ifeq "$(PACKAGE_SDK)" "y"
  2671. . $(SOURCE_TREE)/solenv/inc/udkversion.mk && \
  2672. for i in common cpp java; do \
  2673. cat debian/udk-$$i-ref.in \
  2674. | sed -e "s/@UDK_MAJOR@/$$UDK_MAJOR/" \
  2675. -e "s/@UDK_MINOR@/$$UDK_MINOR/" \
  2676. -e "s/@UDK_MICRO@/$$UDK_MICRO/" \
  2677. -e "s/@VER@/$(VER)/" \
  2678. > debian/libreoffice-dev-doc.doc-base.udk-$$i-ref; \
  2679. done
  2680. # remove Autodoc_DiagnosticMessages.txt
  2681. find $(PKGDIR)-dev-doc/usr/share/doc/libreoffice-dev \
  2682. -name "Autodoc_DiagnosticMessages.txt" -exec rm {} \;
  2683. 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`; \
  2684. echo "Files: $$UDK_CPP_FILES" >> debian/libreoffice-dev-doc.doc-base.udk-cpp-ref
  2685. ifeq "$(ENABLE_JAVA)" "y"
  2686. 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`; \
  2687. echo "Files: $$UDK_JAVA_FILES" >> debian/libreoffice-dev-doc.doc-base.udk-java-ref
  2688. endif
  2689. # xargs strips the many files here so we need to post-process it.
  2690. 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`; \
  2691. TMP=`mktemp -q`; \
  2692. cp debian/libreoffice-dev-doc.doc-base.udk-common-ref $$TMP; \
  2693. echo "Files: $$UDK_COMMON_FILES" >> $$TMP; \
  2694. cat $$TMP | perl -e 'while(<>) { if (/^Files/) {$$f=1;} if ($$f eq "1") { chomp(); } print $$_; }' > debian/libreoffice-dev-doc.doc-base.udk-common-ref; \
  2695. rm -f $$TMP
  2696. # no idea why this happens; afais this can't come from above
  2697. # since it doesn't affect the files at the end of the lines...
  2698. # But fix it..
  2699. perl -pi -e 's,html/,html /,g' debian/libreoffice-dev-doc.doc-base.udk-common-ref
  2700. endif
  2701. dh_installdocs -i -A debian/README.Debian
  2702. dh_installman -i
  2703. for i in `find $(PKGDIR)-common -type l -name "lo*.1"`; do \
  2704. mv $$i $$i.gz; \
  2705. if [ "`readlink $$i`" != "libreoffice.1.gz" ]; then \
  2706. ln -sf libreoffice.1.gz $$i.gz; \
  2707. fi; \
  2708. done
  2709. dh_installchangelogs -i -k
  2710. dh_installmime -i
  2711. dh_lintian -i
  2712. dh_bugfiles -i -A
  2713. dh_link -i -X.desktop
  2714. # dh_link -X does not work for .links stuff. And adding it there and
  2715. # fixing it up later because it's relative doesn't make that much sense.
  2716. # So do it here.
  2717. cd $(PKGDIR)-common/usr/share/applications && \
  2718. ln -sf /$(OODIR)/share/xdg/startcenter.desktop libreoffice-startcenter.desktop
  2719. dh_fixperms -i
  2720. dh_icons -i
  2721. dh_installxmlcatalogs -i
  2722. dh_compress -i -X.py -X.mk -X.sxd -X.xcd.sample
  2723. dh_installdeb -i
  2724. ifeq "$(ENABLE_JAVA)" "y"
  2725. # the help recommends lucene. this is enough. no need for a hard depend in
  2726. # -common, IMHO
  2727. jh_depends -i -Xlibreoffice$(VER)-gcj -Xlibreoffice$(VER)-dbg -Xliblucene2-java
  2728. endif
  2729. dh_gencontrol -i $(DEBHELPER_OPTIONS) \
  2730. -Nlibreoffice$(VER)-report-builder \
  2731. -Nlibreoffice$(VER)-wiki-publisher \
  2732. -Nttf-opensymbol \
  2733. -Nfonts-opensymbol \
  2734. -Nopenoffice.org-dtd-officedocument1.0 -- \
  2735. -V'base-version=$(BASE_VERSION)' \
  2736. -V'oover=$(OOVER)' \
  2737. -V'next-oover=$(NEXT_OOVER)' \
  2738. -V'help-l10n-virtual-version=$(HELP_L10N_VIRTUAL_VERSION)' \
  2739. -V'bsh-depends=$(BSH_DEPENDS)' \
  2740. -V'java-common-depends=$(JAVA_COMMON_DEPENDS)' \
  2741. -V'java-runtime-depends=$(JAVA_RUNTIME_DEPENDS)' \
  2742. -V'lucene-depends=$(LUCENE_DEPENDS)' \
  2743. -V'lucene-conflicts=$(LUCENE_CONFLICTS)' \
  2744. -V'textcat-data-recommends=$(TEXTCAT_DATA_RECOMMENDS)' \
  2745. -V'Binary-Version=$(BINARY_VERSION)' \
  2746. -V'ooo-binfilter-dep=$(OOO_BINFILTER_DEP)' \
  2747. -V'dbg-dbg-suggests=$(DBG_DBG_SUGGESTS)' \
  2748. -v$(BINARY_VERSION)
  2749. ifeq "$(PACKAGE_TTF_OPENSYMBOL)" "y"
  2750. dh_gencontrol -pttf-opensymbol -pfonts-opensymbol -- \
  2751. -v$(shell echo `echo $(BINARY_VERSION) | cut -d: -f1` + 1 | bc):$(shell fontforge -lang=ff -c 'Open($$1); Print ($$fontversion); Quit(0);' debian/fonts-opensymbol/usr/share/fonts/truetype/openoffice/opens___.ttf)+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
  2752. endif
  2753. ifeq "$(ENABLE_MEDIAWIKI)" "y"
  2754. dh_gencontrol -plibreoffice$(VER)-wiki-publisher -- \
  2755. -V'mediawiki-jar-depends=$(MEDIAWIKI_JAR_DEPENDS)' \
  2756. -V'lucene-depends=$(LUCENE_DEPENDS)' \
  2757. -V'java-runtime-depends=$(JAVA_RUNTIME_DEPENDS)' \
  2758. -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`
  2759. endif
  2760. ifeq "$(ENABLE_REPORTDESIGN)" "y"
  2761. dh_gencontrol -plibreoffice$(VER)-report-builder -- \
  2762. -V'base-version=$(BASE_VERSION)' \
  2763. -V'report-builder-jar-depends=$(REPORT_BUILDER_JAR_DEPENDS)' \
  2764. -V'java-runtime-depends=$(JAVA_RUNTIME_DEPENDS)' \
  2765. -v`echo $(BINARY_VERSION) | cut -d: -f1`:$(shell grep "<version" $(SOURCE_TREE)/reportbuilder/$(shell . $(SOURCE_TREE)/Env.Host.sh; echo $$OUTPATH$$PROEXT)/misc/description.xml | perl -pi -e 's,<version value=\"(.*)\"/>,\1,; s/^\s+//')+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
  2766. endif
  2767. dh_gencontrol -popenoffice.org-dtd-officedocument1.0 -- \
  2768. -v$(shell echo `echo $(BINARY_VERSION) | cut -d: -f1` + 1 | bc):1.0+LibO`echo $(BINARY_VERSION) | cut -d: -f2`
  2769. dh_md5sums -i -Xjavasettingsunopkginstall.xml
  2770. dh_builddeb -i $(DEBHELPER_OPTIONS) $(BUILDDEB_OPTIONS)
  2771. touch $@
  2772. binary: binary-arch binary-indep
  2773. ifeq "$(USE_GIT_TARBALLS)" "y"
  2774. # $(1) is the upstream name of the repo
  2775. # $(2) is the name of the tarball
  2776. # $(3) is the path to archive (empty for everything)
  2777. #
  2778. # according to policy get-orig-source has to download to the current dir, thus
  2779. # should not require a dh_testdir. However, like this we can have clean deps
  2780. # from build and download the source, configure, build, pack in on piece. As
  2781. # get-orig-source is an optional target anyway, we stick to support only this
  2782. # case and not random dirs. see also: debian bug 494141
  2783. # also, we need to run configure to create the src tarball anyway
  2784. GIT_INSTALLED:=$(shell which git >/dev/null 2>/dev/null && echo "y")
  2785. get_orig_tarball=$(CURDIR)/../libreoffice_$(DEB_VERSION_UPSTREAM).orig$(1).tar.xz
  2786. define pack_gittarball
  2787. $(if $(GIT_INSTALLED),,$(error You need git.))
  2788. dh_testdir
  2789. TMPD=`mktemp -d $(if $(TMP),-p $(TMP))` && \
  2790. mkdir $${TMPD}/archive && \
  2791. git clone --bare $(GIT_BASEURL)/$(1) $${TMPD}/repo -b $(GIT_BRANCH) && \
  2792. git archive --remote $${TMPD}/repo --format=tar --prefix libreoffice-$(DEB_VERSION_UPSTREAM)/ $(GIT_TAG) |tar x -C $${TMPD}/archive && \
  2793. tar cvJf $(2) -C $${TMPD}/archive/$(3) --transform 's,./,,' . && \
  2794. rm -rf $${TMPD}
  2795. endef
  2796. define unpack_gittarball
  2797. dh_testdir
  2798. mkdir -p $(CURDIR)/$(1)
  2799. test -f $(CURDIR)/$(1)/.gitignore || tar xvJf $(2) -C $(CURDIR)/$(1) $(3)
  2800. endef
  2801. ifneq ($(filter get-orig-source unpack,$(MAKECMDGOALS)),)
  2802. $(call get_orig_tarball):
  2803. $(call pack_gittarball,core,$@,)
  2804. $(call get_orig_tarball,-helpcontent2):
  2805. $(call pack_gittarball,help,$@,libreoffice-$(DEB_VERSION_UPSTREAM)/helpcontent2)
  2806. $(call get_orig_tarball,-%):
  2807. $(call pack_gittarball,$*,$@,libreoffice-$(DEB_VERSION_UPSTREAM)/$*)
  2808. # Get upstream external sources
  2809. $(call get_orig_tarball,-src): binfilter/no_localization dictionaries/en/README.txt helpcontent2/makefile.pmk translations/makefile.mk .gitignore
  2810. dh_testdir
  2811. rm -rf $(TARFIILE_LOCATION)
  2812. mkdir -p $(TARFILE_LOCATION)
  2813. ./autogen.sh
  2814. ./download
  2815. tar cvJf $@ -C $(TARFILE_LOCATION) --transform 's,./,,' .
  2816. # using flag files for unpacking
  2817. .gitignore: $(call get_orig_tarball)
  2818. $(call unpack_gittarball,,$<,--strip-components=1)
  2819. binfilter/no_localization: $(call get_orig_tarball,-binfilter)
  2820. $(call unpack_gittarball,binfilter,$<,)
  2821. dictionaries/en/README.txt: $(call get_orig_tarball,-dictionaries)
  2822. $(call unpack_gittarball,dictionaries,$<,)
  2823. translations/makefile.mk: $(call get_orig_tarball,-translations)
  2824. $(call unpack_gittarball,translations,$<,)
  2825. helpcontent2/makefile.pmk: $(call get_orig_tarball,-helpcontent2)
  2826. $(call unpack_gittarball,helpcontent2,$<,)
  2827. src/fetch.log: $(call get_orig_tarball,-src) patched
  2828. $(call unpack_gittarball,src,$<,)
  2829. get-orig-source: $(call get_orig_tarball,-src) src/fetch.log
  2830. dh_testdir
  2831. unpack: src/fetch.log
  2832. dh_testdir
  2833. endif
  2834. endif
  2835. .PHONY: control
  2836. .PHONY: clean-debdir clean-instsetoo clean-objectdirs clean default configure
  2837. .PHONY: build build-indep build-arch install-arch install-indep
  2838. .PHONY: get-orig-source unpack patched
  2839. .PHONY: $(stampdir_targets)
  2840. # vim:set noet ai sts=8 sw=8 tw=0: