1 include $(top_srcdir)/setup-variables.am
2 include $(top_srcdir)/autotroll.am
3 include $(top_srcdir)/build/build.am
5 AUTOMAKE_OPTIONS = subdir-objects
7 ## Process this file with automake to produce Makefile.in
9 ACLOCAL_AMFLAGS = -I m4 -I m4-repo ${ACLOCAL_FLAGS}
12 SUBDIRS += $(SYNTHESIS_SUBDIR)
14 SUBDIRS += $(SYNTHESIS_SUBDIR_INCLUDES)
19 # choose D-Bus implementation
21 gdbus_dir = $(top_srcdir)/src/gdbusxx
22 gdbus_build_dir = src/gdbusxx
24 gdbus_dir = $(top_srcdir)/src/gdbus
25 gdbus_build_dir = src/gdbus
36 disted_docs += README NEWS COPYING $(TEST_README_FILES) test/syncevo-http-server-logging.conf
37 distbin_docs += $(disted_docs)
38 dist_doc_DATA += $(disted_docs)
40 distbin_docs += README.html
41 # do not distribute in tarball.
42 doc_DATA += README.html
45 man_MANS += syncevolution.1
60 MAINTAINERCLEANFILES += Makefile.in config.h.in config.guess config.sub configure depcomp install-sh ltmain.sh missing mkinstalldirs
62 TEST_README_FILES = $(wildcard $(top_srcdir)/test/README.*)
64 DEV_FILE_PATTERN = $(1)$(2)/include $(1)$(2)/lib/*.so $(1)$(2)/lib/*.a $(1)$(2)/lib/*.la $(1)$(2)/lib/*/*.la $(1)$(2)/lib/pkgconfig
66 # binary distribution as .tar.gz
68 # when building with D-Bus, we have no choice: the service has to go into /usr
69 # in order to be found
70 distbin : $(distbin_docs) INSTALL-tar-gz all
71 @ [ "$(BINSUFFIX)" ] || (echo "please invoke with e.g. 'make distbin BINSUFFIX=debian-3.1'"; exit 1 )
72 @ [ "$(prefix)" = "/usr" ] || (echo "please reconfigure with --prefix=/usr"; exit 1 )
74 $(MAKE) DESTDIR=`pwd`/$(distdir) install
75 $(MAKE) DESTDIR=`pwd`/$(distdir) installcheck
76 rm -rf $(call DEV_FILE_PATTERN,$(distdir),/usr)
77 for i in `find $(distdir) -type d | sort -r`; do rmdir $$i 2>/dev/null || true; done
78 mkdir -p $(distdir)/usr/share/doc/syncevolution
79 cp $(srcdir)/INSTALL-tar-gz $(distdir)/INSTALL
80 cp $(filter-out all, $+) $(distdir)/usr/share/doc/syncevolution
81 tar zcf $(distdir)-$(BINSUFFIX).tar.gz $(distdir)
84 # without D-Bus, we can simply create an archive with a bin directory
85 # and everything works
86 distbin : $(distbin_docs) all
87 @ [ "$(BINSUFFIX)" ] || (echo "please invoke with e.g. 'make distbin BINSUFFIX=debian-3.1'"; exit 1 )
89 $(MAKE) prefix=`pwd`/$(distdir) install
90 @echo removing developer files and empty directories
91 rm -rf $(call DEV_FILE_PATTERN,$(distdir),/)
92 for i in `find $(distdir) -type d | sort -r`; do rmdir $$i 2>/dev/null || true; done
93 cp $(filter-out all, $+) $(distdir)
94 tar zcf $(distdir)-$(BINSUFFIX).tar.gz $(distdir)
98 iphone : SyncEvolution.plist
100 IPHONE_FILENAME = syncevolution-$(VERSION)-iphone.zip
102 SyncEvolution.plist : SyncEvolution.plist.in $(IPHONE_FILENAME)
103 $(AM_V_GEN)sed -e 's/__FILENAME__/$(IPHONE_FILENAME)/' \
104 -e 's/__VERSION__/$(VERSION)/' \
105 -e 's/__SIZE__/$(shell ls -l $(IPHONE_FILENAME) | sed -e 's/ */ /g' | cut -d ' ' -f 5)/' \
108 $(IPHONE_FILENAME) : all
109 rm -rf syncevolution-iphone $@
110 $(MAKE) DESTDIR=`pwd`/syncevolution-iphone install
111 rm -rf `ls -1 -d syncevolution-iphone/usr/share/doc/syncevolution/*/spds/sources/* | grep -v addressbook`
112 perl -pi -e 's;SyncEvolution test #1;;;' \
113 -e 's;^type = text/(x-)?vcard;type = addressbook;m;' \
114 syncevolution-iphone/usr/share/doc/syncevolution/*/spds/sources/addressbook/config.txt
115 cd syncevolution-iphone && zip -r ../$(IPHONE_FILENAME) .
119 # Dependency calculation is intentionally incomplete:
120 # - don't force dependency on specific EDS libs via backends, their versions change too much (handled via --enable-evolution-compatibility and dynamic loading of the backends)
121 # - ignore client-test dependencies (because users typically don't run it)
122 # - ignore backend dependencies (should never prevent installing the bundle)
123 # - be more flexible about kdelibs5 than dpkg-shlibdeps: it is found as package
124 # for libkdeui.so.5 and libkdecore.so.5 on Ubuntu Lucid, but after Debian
125 # Squeeze the package was replaced by individual library packages. On such
126 # distros, libkdeui5 is what we need.
127 # - same for kdepimlibs5 -> libakonadi-kde4
128 REQUIRES_SED_KDE = -e 's/kdelibs5 ([^,]*),/kdelibs5 | libkdeui5,/g' -e 's/kdepimlibs5 ([^,]*),/kdepimlibs5 | libakonadi-kde4,/g'
129 REQUIRES_deb = --requires="'$(shell set -x; cd dist; LD_LIBRARY_PATH=$(distdir)/usr/lib:$(distdir)/usr/lib/syncevolution dpkg-shlibdeps -L$(srcdir)/src/shlibs.local --ignore-missing-info -O $$(for i in $$(find $(distdir) -type f -perm /u+x | grep -v -e client-test -e lib/syncevolution/backends/); do if file $$i | grep ELF >/dev/null; then echo $$i; fi; done) | sed $(REQUIRES_SED_KDE) -e 's/[^=]*=//')$(REQUIRES_deb_neon)'"
130 if NEON_COMPATIBILITY
131 # --enable-neon-compatibility in src/backends/webdav:
132 # replace dependencies from linking with hard-coded dlopen() dependencies
133 REQUIRES_deb_neon = , libneon27 (>= 0.29.0) | libneon27-gnutls (>= 0.29.0)
137 VERSION_deb = 1:$(STABLE_VERSION)$(VERSION)
138 VERSION_rpm = `echo $(VERSION) | sed -e s/-/_/g`
141 # The package name: BINSUFFIX is used to distinguish binaries
142 # for different Evolution releases.
143 PKGNAME=syncevolution$(patsubst %,-%,$(BINSUFFIX))
145 # This is a list of packages (potentially) provided on estamos.de.
146 # The current package conflicts with any of them, but not itself.
147 PKGS = $(addprefix syncevolution-evolution-, 2.6 2.8 2.12)
149 # When calling checkinstall we cannot install into /tmp
150 # because any file created there will be excluded: that makes
151 # sense, because "make install" might create temporary files
152 # there. The current directory might be in /tmp, so use $HOME.
154 # --replaces is necessary for migrating from syncevolution-evolution-<evover>
155 # to syncevolution-evolution (as per http://wiki.debian.org/Renaming_a_Package)
157 # When we build shared objects, then conflict with the corresponding
158 # system libs. The assumption is that the system library is named
159 # after the lib and its major version, which holds for libsmltk and
160 # libsynthesis in Debian.
161 deb rpm : dist/$(distdir) dist/debian/control
162 (echo "SyncEvolution - synchronizing personal information management data" && cat $(srcdir)/description) >description-pak
163 conflicts=`ls -1 dist/$(distdir)/usr/lib/*.so.[0123456789] | sed -e 's;.*/;;' -e 's/\.so\.//' -e 's/$$/, /'` && \
164 tmpdir=`mktemp -d $$HOME/syncevolution.XXXXXXXXXX` && \
165 trap "rm -rf $$tmpdir" EXIT && \
166 fakeroot checkinstall </dev/null \
171 --pkgversion=$(VERSION_$@) \
172 --pkgrelease=$(RELEASE) \
173 --pkgname=$(PKGNAME) \
174 --pkgarch=$(PKGARCH) \
175 --provides=syncevolution \
176 --replaces="'syncevolution, `echo $(filter-out $(PKGNAME), $(PKGS)) | sed -e 's/ */ (<< 1:0.8.1-2), /g'` (<< 1:0.8.1-2)'" \
177 --conflicts="'$${conflicts}syncevolution, `echo $(filter-out $(PKGNAME), $(PKGS)) | sed -e 's/ */ (<< 1:0.8.1-2), /g'` (<< 1:0.8.1-2)', libsmltk0, libsyncevolution0, libsynthesis0, syncevolution-common, syncevolution-libs" \
178 --maintainer="'Patrick Ohly <patrick.ohly@gmx.de>'" \
179 --pkgsource='http://syncevolution.org' \
183 if [ $@ = "rpm" ]; then cp /usr/src/rpm/RPMS/*/${PKGNAME}-${VERSION}-2.*.rpm .; fi
185 # Pseudo platform .deb packages:
186 # only depend on PKGNAME = syncevolution-$(BINSUFFIX) (usually syncevolution-bundle).
187 # Version number is only bumped when changing the packaging rules here.
188 PLATFORM_DEB_VERSION = $(VERSION_deb)
189 PLATFORM_DEB_RELEASE = 1
191 deb : syncevolution-kde-deb
192 deb : syncevolution-evolution-deb
195 # define which files are relevant for each platform
196 PLATFORM_FILES_evolution = platformgnome syncecal syncebook
197 PLATFORM_FILES_kde = platformkde syncakonadi
199 # Fake conflicts/replaces works around a bug in CheckInstall,
200 # which creates empty, invalid entries for those unless
201 # something is given.
202 syncevolution-%-deb: dist/$(distdir) dist/debian/control
203 (echo "SyncEvolution - meta package for $*" && cat $(srcdir)/description) >description-pak
204 tmpdir=`mktemp -d $$HOME/syncevolution.XXXXXXXXXX` && \
205 trap "rm -rf $$tmpdir" EXIT && \
206 fakeroot checkinstall </dev/null \
211 --pkgversion=$(PLATFORM_DEB_VERSION) \
212 --pkgrelease=$(PLATFORM_DEB_RELEASE) \
213 --pkgname=syncevolution-$* \
215 --requires="'$(shell set -x; cd dist; LD_LIBRARY_PATH=$(distdir)/usr/lib:$(distdir)/usr/lib/syncevolution dpkg-shlibdeps -L$(srcdir)/src/shlibs.local --ignore-missing-info -O $$(for i in $(patsubst %,$(distdir)/usr/lib/syncevolution/backends/%.so,$(PLATFORM_FILES_$*)); do if file $$i | grep ELF >/dev/null; then echo $$i; fi; done) | sed $(REQUIRES_SED_KDE) -e 's/[^=]*=//'), $(PKGNAME) (= $(VERSION_deb)-$(RELEASE))'" \
216 --conflicts=syncevolution-foobar \
217 --replaces=syncevolution-foobar \
218 --maintainer="'Patrick Ohly <patrick.ohly@gmx.de>'" \
219 --pkgsource='http://syncevolution.org' \
221 sh -c 'mkdir -p touch /usr/share/doc/syncevolution-$* && echo "SyncEvolution platform pseudo-package for $*" >/usr/share/doc/syncevolution-$*/README'
223 all_phonies += dist/$(distdir) clean_dist
226 $(MAKE) install DESTDIR=`pwd`/$@
227 $(MAKE) installcheck DESTDIR=`pwd`/$@
228 rm -rf $(call DEV_FILE_PATTERN,$@,/usr)
229 clean-local: clean_dist
231 rm -rf dist description-pak
233 # required by dpkg-shlibdeps
238 # Build "html" inside the build dir, using source files
239 # from the SyncEvolution source directory and (if built)
240 # the installed client-api.build directory.
241 all_phonies += doc clean-html
244 export VERSION="SyncEvolution $(VERSION)"; \
245 export OUTPUT_DIRECTORY="`pwd`"; \
246 export PREDEFINED="@BACKEND_DEFINES@ ENABLE_UNIT_TESTS ENABLE_INTEGRATION_TESTS"; \
247 export CLIENT_LIBRARY="@FUNAMBOL_SUBDIR@/test @FUNAMBOL_SUBDIR@/include "; \
248 export STRIP_FROM_PATH="$(srcdir) `dirname @FUNAMBOL_SUBDIR@`"; \
249 cd $(srcdir); doxygen
250 clean-local: clean-html
254 all_dist_hooks += dot_dist_hook
256 @if test -d "$(srcdir)/.git"; \
258 printf '%s' 'Creating ChangeLog...' && \
259 ( cd "$(top_srcdir)" && \
260 printf '%s\n\n' '# Generated by configure. Do not edit.'; \
261 $(top_srcdir)/missing --run perl $(top_srcdir)/build/gen-changelog.pl ) > ChangeLog.tmp && \
262 ( mv -f ChangeLog.tmp $(top_distdir)/ChangeLog && \
263 printf '%s\n' ' done.' ) || \
264 ( rm -f ChangeLog.tmp ; \
265 printf '%s\n' ' failed.'; \
266 echo Failed to generate ChangeLog >&2 ); \
268 echo 'A git checkout is required to generate a ChangeLog.' >&2; \
271 if ENABLE_EVOLUTION_COMPATIBILITY
272 # check .so (relevant for modular builds) and main syncevolution binary
273 # (relevant in that case and for static builds) for dependencies on
274 # problematic libraries and symbols
276 # ical_strdup is an exception because it is in SyncEvolution.
277 all_local_installchecks += toplevel_so_check
279 for i in `find $(DESTDIR)/$(libdir)/syncevolution $(DESTDIR)/$(libdir)/libsyncevo* $(DESTDIR)/$(libdir)/libsynthesis* -name *.so` $(DESTDIR)/$(bindir)/syncevolution; \
281 if objdump -T -C $$i | grep -v :: | grep '\*UND\*' | sort | grep -v -w ical_strdup | grep -e ical -e " e_"; then \
282 echo "$$i should not depend on EDS, libical or libbluetooth"; \
285 if ldd $$i | grep -e libecal -e libebook -e libedata -e libical -e libbluetooth; then \
286 echo "$$i should not be linked against EDS, libical or libbluetooth"; \
292 # Be strict about running 'syncevolution' only when not doing
293 # cross-compilation: in that case, if running 'syncevolution' fails,
294 # abort the build process. Otherwise proceed with the fallback below,
295 # which is to keep the "see --sync/source-property ?" placeholders in
297 if COND_CROSS_COMPILING
298 RUN_SYNCEVOLUTION_CHECK=if ($$?) { return ""; } else { return $$buffer; }
300 RUN_SYNCEVOLUTION_CHECK=die if $$?; return $$buffer;
303 # patch README.rst properties on-the-fly
304 README.patched.rst: README.rst src/syncevolution
305 $(AM_V_GEN)perl -e '$$syncfound=0; $$sourcefound=0; $$res=0;' \
306 -e 'sub run { $$cmd = shift; $$buffer = `env LD_LIBRARY_PATH=src/syncevo/.libs:src/gdbus/.libs:src/gdbusxx/.libs:src/build-synthesis/src/.libs:$$ENV{LD_LIBRARY_PATH} $$cmd`; $(RUN_SYNCEVOLUTION_CHECK) }' \
308 -e 's/^:Version: .*/:Version: $(VERSION)/;' \
309 -e 's/:Date: .*/":Date: " . `date +%Y-%m-%d`/e;' \
310 -e 'if (s;(<< see "syncevolution --sync-property ." >>\n);run("src/syncevolution --daemon=no --sync-property ?") || $$1;e) { $$syncfound=1; }' \
311 -e 'if (s;(<< see "syncevolution --source-property ." >>\n);run("src/syncevolution --daemon=no --source-property ?") || $$1;e) { $$sourcefound=1; }' \
314 -e 'die "<<sync-property>> tag not in README.rst?!" unless $$syncfound;' \
315 -e 'die "<<source-property>> tag not in README.rst?!" unless $$sourcefound;' \
318 CLEANFILES += README.patched.rst
321 syncevolution.1: README.patched.rst
322 $(AM_V_GEN)$(RST2MAN) --exit-status=3 $< >$@
323 CLEANFILES += syncevolution.1
325 # README is the traditional name in the distribution,
326 # continue using it instead of README.rst.
327 # TODO: replace some of the RST syntax
328 README: README.patched.rst
332 # The README.html is also used on syncevolution.org as "Usage" page,
333 # therefore we must use <h3> headers and lower to fit into the page.
334 README.html: README.patched.rst
335 $(AM_V_GEN)$(RST2HTML) --initial-header-level=3 --exit-status=3 $< >$@
336 CLEANFILES += README.html
338 .PHONY: $(all_phonies) ;
340 installcheck-local: $(all_local_installchecks) ;
342 dist-hook: $(all_dist_hooks)
344 # Force sequential installation. This is a workaround for relinking failures
345 # during concurrent distcheck (a backend was relinked against not yet installed
346 # libsyncevolution.la).
348 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am
349 @$(MAKE) $(AM_MAKEFLAGS) install-data-am