1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 fetch_LOGFILE := $(TARFILE_LOCATION)/fetch.log
13 define fetch_Download__wget_command
14 && $(WGET) --progress=dot:mega -Q 0 -P "." -l 0 -nd -nH -N $1/$2 2>&1 | tee -a $(fetch_LOGFILE) && [ $$PIPESTATUS -eq 0 ]
18 define fetch_Download__wget_command
19 && echo fetching $2 && $(CURL) -O $1/$2 2>&1 | tee -a $(fetch_LOGFILE) && [ $$PIPESTATUS -eq 0 ]
25 define fetch_Download__checksum_command
26 && SUM=`$(MD5SUM) $1 | sed "s/ .*//"` \
27 && if test "$$SUM" != "$2"; then \
28 echo ERROR: expected checksum for $1 is $2 2>&1 | tee -a $(fetch_LOGFILE); \
34 fetch_Download__checksum_command :=
38 # fetch__Download_item url tarball-name md5sum
39 define fetch__Download_item
40 $(if $(wildcard $(TARFILE_LOCATION)/$2),, \
41 cd $(TARFILE_LOCATION)/tmp \
42 $(call fetch_Download__wget_command,$1,$2) \
43 $(if $3,$(call fetch_Download__checksum_command,$2,$3)) \
49 # fetch_Download_item url tarball-name no-sum?
50 define fetch_Download_item
51 $(call fetch__Download_item,$1,$2,$(if $3,,$(firstword $(subst -, ,$2))))
55 # fetch_Download_item_special url variable-name
56 define fetch_Download_item_special
57 $(if $($(subst _TARBALL,_MD5SUM,$(2))),,$(error "fetch_Download_item_special: $2_MD5SUM can't be empty"))
58 $(call fetch__Download_item,$1,$($2),$($(subst _TARBALL,_MD5SUM,$(2))))
62 fetch_BUILD_TYPE := $(sort $(BUILD_TYPE))
63 ifeq ($(CROSS_COMPILING),YES)
64 fetch_BUILD_TYPE := $(sort $(fetch_BUILD_TYPE) $(shell . $(SRCDIR)/bin/get_config_variables --build BUILD_TYPE && echo $$BUILD_TYPE))
68 $(if $(filter ALL,$(DO_FETCH_TARBALLS))$(filter $1,$(fetch_BUILD_TYPE)),$2)
71 download: $(WORKDIR)/download
73 $(WORKDIR)/download: $(BUILDDIR)/config_host.mk $(SRCDIR)/download.lst $(SRCDIR)/Makefile.fetch
74 @mkdir -p $(TARFILE_LOCATION)/tmp
75 @date >> $(fetch_LOGFILE)
77 $(call fetch_Optional,CDR,CDR_TARBALL) \
78 $(call fetch_Optional,MSPUB,MSPUB_TARBALL) \
79 $(call fetch_Optional,MWAW,MWAW_TARBALL) \
80 $(call fetch_Optional,VISIO,VISIO_TARBALL) \
81 ,$(call fetch_Download_item_special,http://dev-www.libreoffice.org/src,$(item)))
83 $(call fetch_Optional,AFMS,$(AFMS_TARBALL)) \
84 $(call fetch_Optional,APACHE_COMMONS,$(APACHE_COMMONS_CODEC_TARBALL)) \
85 $(call fetch_Optional,APACHE_COMMONS,$(APACHE_COMMONS_HTTPCLIENT_TARBALL)) \
86 $(call fetch_Optional,APACHE_COMMONS,$(APACHE_COMMONS_LANG_TARBALL)) \
87 $(call fetch_Optional,APACHE_COMMONS,$(APACHE_COMMONS_LOGGING_TARBALL)) \
88 $(call fetch_Optional,BOOST,$(BOOST_TARBALL)) \
89 $(call fetch_Optional,BSH,$(BSH_TARBALL)) \
90 $(call fetch_Optional,CAIRO,$(CAIRO_TARBALL)) \
91 $(call fetch_Optional,CLUCENE,$(CLUCENE_TARBALL)) \
92 $(call fetch_Optional,CMIS,$(CMIS_TARBALL)) \
93 $(call fetch_Optional,CPPUNIT,$(CPPUNIT_TARBALL)) \
94 $(call fetch_Optional,CT2N,$(CT2N_TARBALL)) \
95 $(call fetch_Optional,CURL,$(CURL_TARBALL)) \
96 $(call fetch_Optional,EPM,$(EPM_TARBALL)) \
97 $(call fetch_Optional,EXPAT,$(EXPAT_TARBALL)) \
98 $(call fetch_Optional,MARIADB,$(MARIADB_TARBALL)) \
99 $(call fetch_Optional,MORE_FONTS,$(FONT_DEJAVU_TARBALL)) \
100 $(call fetch_Optional,MORE_FONTS,$(FONT_GENTIUM_TARBALL)) \
101 $(call fetch_Optional,MORE_FONTS,$(FONT_LIBERATION_NARROW_TARBALL)) \
102 $(call fetch_Optional,MORE_FONTS,$(FONT_LIBERATION_TARBALL)) \
103 $(call fetch_Optional,MORE_FONTS,$(FONT_LINLIBERTINEG_TARBALL)) \
104 $(call fetch_Optional,MORE_FONTS,$(FONT_PTSERIF_TARBALL)) \
105 $(call fetch_Optional,MORE_FONTS,$(FONT_OPENSANS_TARBALL)) \
106 $(call fetch_Optional,MORE_FONTS,$(FONT_SOURCESANS_TARBALL)) \
107 $(call fetch_Optional,MORE_FONTS,$(FONT_SOURCECODE_TARBALL)) \
108 $(call fetch_Optional,FONTCONFIG,$(FONTCONFIG_TARBALL)) \
109 $(call fetch_Optional,FREETYPE,$(FREETYPE_TARBALL)) \
110 $(GOOGLE_DOCS_EXTENSION_PACK) \
111 $(call fetch_Optional,GRAPHITE,$(GRAPHITE_TARBALL)) \
112 $(call fetch_Optional,GLIBC,$(GLIBC_TARBALL)) \
113 $(call fetch_Optional,HSQLDB,$(HSQLDB_TARBALL)) \
114 $(call fetch_Optional,HUNSPELL,$(HUNSPELL_TARBALL)) \
115 $(call fetch_Optional,HARFBUZZ,$(HARFBUZZ_TARBALL)) \
116 $(call fetch_Optional,HYPHEN,$(HYPHEN_TARBALL)) \
117 $(call fetch_Optional,ICU,$(ICU_TARBALL)) \
118 $(call fetch_Optional,JFREEREPORT,$(JFREEREPORT_FLOW_ENGINE_TARBALL)) \
119 $(call fetch_Optional,JFREEREPORT,$(JFREEREPORT_FLUTE_TARBALL)) \
120 $(call fetch_Optional,JFREEREPORT,$(JFREEREPORT_LIBBASE_TARBALL)) \
121 $(call fetch_Optional,JFREEREPORT,$(JFREEREPORT_LIBFONTS_TARBALL)) \
122 $(call fetch_Optional,JFREEREPORT,$(JFREEREPORT_LIBFORMULA_TARBALL)) \
123 $(call fetch_Optional,JFREEREPORT,$(JFREEREPORT_LIBLAYOUT_TARBALL)) \
124 $(call fetch_Optional,JFREEREPORT,$(JFREEREPORT_LIBLOADER_TARBALL)) \
125 $(call fetch_Optional,JFREEREPORT,$(JFREEREPORT_LIBREPOSITORY_TARBALL)) \
126 $(call fetch_Optional,JFREEREPORT,$(JFREEREPORT_LIBSERIALIZER_TARBALL)) \
127 $(call fetch_Optional,JFREEREPORT,$(JFREEREPORT_LIBXML_TARBALL)) \
128 $(call fetch_Optional,JFREEREPORT,$(JFREEREPORT_SAC_TARBALL)) \
129 $(call fetch_Optional,JPEG,$(JPEG_TARBALL)) \
130 $(call fetch_Optional,LANGUAGETOOL,$(LANGUAGETOOL_TARBALL)) \
131 $(call fetch_Optional,LCMS2,$(LCMS2_TARBALL)) \
132 $(call fetch_Optional,LIBEXTTEXTCAT,$(LIBEXTTEXTCAT_TARBALL)) \
133 $(call fetch_Optional,LIBLANGTAG,$(LIBLANGTAG_TARBALL)) \
134 $(call fetch_Optional,LIBXML2,$(LIBXML_TARBALL)) \
135 $(LIBXMLSEC_TARBALL) \
136 $(call fetch_Optional,LIBXSLT,$(LIBXSLT_TARBALL)) \
137 $(call fetch_Optional,LPSOLVE,$(LPSOLVE_TARBALL)) \
138 $(call fetch_Optional,MDDS,$(MDDS_TARBALL)) \
139 $(call fetch_Optional,MYSQLCPPCONN,$(MYSQLCPPCONN_TARBALL)) \
140 $(call fetch_Optional,MYTHES,$(MYTHES_TARBALL)) \
141 $(call fetch_Optional,NEON,$(NEON_TARBALL)) \
142 $(call fetch_Optional,NSS,$(NSS_TARBALL)) \
143 $(NUMBERTEXT_EXTENSION_PACK) \
144 $(call fetch_Optional,OPENLDAP,$(OPENLDAP_TARBALL)) \
145 $(call fetch_Optional,OPENSSL,$(OPENSSL_TARBALL)) \
146 $(call fetch_Optional,ORCUS,$(ORCUS_TARBALL)) \
147 $(call fetch_Optional,CAIRO,$(PIXMAN_TARBALL)) \
148 $(call fetch_Optional,LIBPNG,$(PNG_TARBALL)) \
149 $(call fetch_Optional,POSTGRESQL,$(POSTGRESQL_TARBALL)) \
150 $(call fetch_Optional,PYTHON,$(PYTHON_TARBALL)) \
151 $(call fetch_Optional,REDLAND,$(RAPTOR_TARBALL)) \
152 $(call fetch_Optional,REDLAND,$(RASQAL_TARBALL)) \
153 $(call fetch_Optional,REDLAND,$(REDLAND_TARBALL)) \
154 $(call fetch_Optional,RHINO,$(RHINO_TARBALL)) \
155 $(call fetch_Optional,RHINO,$(SWING_TARBALL)) \
156 $(call fetch_Optional,TOMCAT,$(TOMCAT_TARBALL)) \
157 $(call fetch_Optional,UCPP,$(UCPP_TARBALL)) \
158 $(call fetch_Optional,VIGRA,$(VIGRA_TARBALL)) \
159 $(call fetch_Optional,WPD,$(WPD_TARBALL)) \
160 $(call fetch_Optional,WPG,$(WPG_TARBALL)) \
161 $(call fetch_Optional,WPS,$(WPS_TARBALL)) \
162 $(call fetch_Optional,XPDF,$(XPDF_TARBALL)) \
163 $(call fetch_Optional,XSLTML,$(XSLTML_TARBALL)) \
164 $(call fetch_Optional,ZLIB,$(ZLIB_TARBALL)) \
165 ,$(call fetch_Download_item,http://dev-www.libreoffice.org/src,$(item)))
167 $(call fetch_Optional,DBGHELP,$(DBGHELP_DLL)) \
168 $(call fetch_Optional,ODK,$(UNOWINREG_DLL)) \
169 ,$(call fetch_Download_item,http://dev-www.libreoffice.org/extern,$(item)))
171 $(BARCODE_EXTENSION_PACK) \
172 $(DIAGRAM_EXTENSION_PACK) \
173 $(HUNART_EXTENSION_PACK) \
175 $(OOOP_GALLERY_PACK) \
176 $(OOOP_SAMPLES_PACK) \
177 $(OOOP_TEMPLATES_PACK) \
178 $(SUNTEMPLATES_DE_PACK) \
179 $(SUNTEMPLATES_EN_US_PACK) \
180 $(SUNTEMPLATES_ES_PACK) \
181 $(SUNTEMPLATES_FR_PACK) \
182 $(SUNTEMPLATES_HU_PACK) \
183 $(SUNTEMPLATES_IT_PACK) \
184 $(TYPO_EXTENSION_PACK) \
185 $(VALIDATOR_EXTENSION_PACK) \
186 $(WATCH_WINDOW_EXTENSION_PACK) \
187 ,$(call fetch_Download_item,http://ooo.itc.hu/oxygenoffice/download/libreoffice,$(item)))
189 $(call fetch_Optional,MOZ,$(MOZ_ZIP_INC)) \
190 $(call fetch_Optional,MOZ,$(MOZ_ZIP_LIB)) \
191 $(call fetch_Optional,MOZ,$(MOZ_ZIP_RUNTIME)) \
192 ,$(call fetch_Download_item,http://dev-www.libreoffice.org/mozilla,$(item),no-sum))
193 @mkdir -p $(dir $@) && touch $@
195 # vim: set noet sw=4 ts=4: