#!/usr/bin/make -f # # Build (debuggable) Evo from GIT # Run "make help" for some help, or see the comments below. # # Requires GNU make 3.80 or better. # # Author: Paul Smith # Version: 3.3 # Date: 26 Apr 2010 # # -------------------------------------------------- # Copyright (C) 2007, 2008, 2009, 2010 Paul Smith # This Makefile is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 3 of the License, or (at your option) # any later version. # # You should have a copy of the GNU General Public License on your system. # If not, see . # -------------------------------------------------- # # You can look here for more/alternate information: # http://www.go-evolution.org/Compiling_Evolution_from_SVN # # Enhancements/suggestions provided by: # Holger Goetz # Brian J. Murrell # Patrick Ohly # Bastiaan Wakkie all: .SUFFIXES: %:: RCS/%,v %:: RCS/% %:: %,v %:: s.% %:: SCCS/s.% # ====================================================================== # By default we build for Ubuntu (I'm testing on Ubuntu 8.04). # # If you want to build for another distro, see if it's listed in the DISTROS # variable (currently only Debian & Ubuntu releases are listed) and, if so, # change "DISTRO" to your distro. You can do this in local.mk to avoid # changing this makefile. # # If your distro is not supported, you can set "distro" to empty and the check # for prerequisite packages will be skipped. Of course, if you don't have all # the proper development packages installed the build will fail. # ====================================================================== # vvvvvvvvvvvvvvvvvvvvvvvvv User Customization vvvvvvvvvvvvvvvvvvvvvvvvv # Feel free to change these if you like # What branch to work with. If not set, we use the trunk. Close to a # release, however, you might prefer to use the pending release. # E.g.: # BRANCH := gnome-2.30 # Default, for anything that's not explicitly stated below. BRANCH := master # These follow the Gnome branching structure and release numbering: #BRANCH_evolution := #BRANCH_evolution-data-server := #BRANCH_evolution-mapi := #BRANCH_evolution-exchange := #BRANCH_evolution-webcal := #BRANCH_gtkhtml := #BRANCH_gnome-desktop := #BRANCH_gnome-common := #BRANCH_gnome-vfs := #BRANCH_libgnomeui := # These follow Gnome branching structure but don't always have # branches created for each release BRANCH_libgweather := master # These follow a different branch structure BRANCH_libxml2 := master BRANCH_libsoup := master BRANCH_gtk+ := master BRANCH_glib := master BRANCH_atk := master BRANCH_libgdata := libgdata-0.6 BRANCH_gobject-introspection := master # These packages use SVN, not git REPOTYPE_openchange := svn BRANCH_openchange := trunk REPOTYPE_libical := svn BRANCH_libical := trunk # These packages use tarballs REPOTYPE_sqlite := tarball VERSION_sqlite := 3.6.18 TARBALL_sqlite := sqlite-amalgamation-$(VERSION_sqlite).tar.gz ROOTURL_sqlite := http://www.sqlite.org SRCDIR_sqlite := sqlite-$(VERSION_sqlite) REPOTYPE_intltool := tarball VERSION_intltool := 0.40.6 TARBALL_intltool := intltool-$(VERSION_intltool).tar.bz2 ROOTURL_intltool := http://ftp.gnome.org/pub/gnome/sources/intltool/0.40/ SRCDIR_intltool := intltool-$(VERSION_intltool) REPOTYPE_libproxy := tarball VERSION_libproxy := 0.3.1 TARBALL_libproxy := libproxy-$(VERSION_libproxy).tar.bz2 ROOTURL_libproxy := http://libproxy.googlecode.com/files SRCDIR_libproxy := libproxy-$(VERSION_libproxy) REPOTYPE_gnutls := tarball VERSION_gnutls := 2.8.4 TARBALL_gnutls := gnutls-$(VERSION_gnutls).tar.bz2 ROOTURL_gnutls := ftp://ftp.gnu.org/pub/gnu/gnutls SRCDIR_gnutls := gnutls-$(VERSION_gnutls) REPOTYPE_libgcrypt := tarball VERSION_libgcrypt := 1.4.4 TARBALL_libgcrypt := libgcrypt-$(VERSION_libgcrypt).tar.bz2 ROOTURL_libgcrypt := ftp://ftp.gnupg.org/gcrypt/libgcrypt SRCDIR_libgcrypt := libgcrypt-$(VERSION_libgcrypt) # We build samba4 using scripts from openchange REPOTYPE_samba4 := other VERSION_samba4 := 4.0.0alpha8 samba4_VARS = SAMBA4_RELEASE='$(VERSION_samba4)' PREFIX='$(PREFIX)' SUDO= \ EVOCONFIG_OPTS='$(CONFIG_OPTS) CPPFLAGS=-I$(PREFIX)/include LDFLAGS=-L$(PREFIX)/lib CFLAGS=-g $($*_CONFIG_OPTS) $($(DISTRO)-CONFIG_OPTS)' # Where to install Evo. DO NOT use /usr here for any system controlled by a # package manager (rpm, dpkg) PREFIX := /opt/evo # Where to build objects. OBJDIR := obj # What distro you use, for checking that all prerequisite packages for a # successful build are installed. The currently supported distros are # listed in the DISTROS variable below. # If yours is not one of these, set this to empty and take your chances! DISTRO := karmic # Comment this out if you don't want to use ccache CCACHE := ccache CCACHE_DIR := $(CURDIR)/ccache export CCACHE_DIR # Set this to empty if you want to see the rules being run Q := @ ifneq (0,$(firstword $V 0)) Q := endif # Enable/disable optional packages ENABLE_libgweather := y ENABLE_exchange := y ENABLE_mapi := y ENABLE_webcal := y ENABLE_openchange := y # You can override the above by creating local.mk setting these vars # if you don't want to modify this makefile. -include local.mk # ^^^^^^^^^^^^^^^^^^^^^^^^^ User Customization ^^^^^^^^^^^^^^^^^^^^^^^^^ # ====================================================================== # ----- << You don't need to touch anything below here!! >> ----- # ----- << (unless you really know what you're doing...) >> ----- # These are the prerequisite packages needed on the system before we can build # Evo. There are different ways to check for them, based on distro. DISTROS := feisty gutsy hardy intrepid jaunty karmic \ etch gnome-vfs-REQUIRED := libbz2-dev evolution-mapi-REQUIRED := libmapi-dev libtalloc-dev libdcerpc-dev \ libsamba-hostconfig-dev tdb-dev # libldb-samba4-dev samba4-dev openchange-REQUIRED := libparse-pidl-perl libdcerpc-dev \ libtorture-dev python-dev subversion # Distro-required packages # ----- UBUNTU feisty-REQUIRED = \ gtk-doc-tools subversion git-core flex bison build-essential \ libldap2-dev libnss-dev libnspr-dev libgail-dev evolution-dev \ icon-naming-utils $(CCACHE) gutsy-REQUIRED = \ gtk-doc-tools subversion git-core flex bison build-essential \ libssl-dev libldap2-dev libnss3-dev libnspr4-dev libgail-dev \ evolution-dev icon-naming-utils libdbus-glib-1-dev \ $(CCACHE) hardy-REQUIRED = \ gtk-doc-tools subversion git-core flex bison build-essential \ libldap2-dev libnss3-dev libenchant-dev libdb-dev \ $(foreach P,$(PACKAGES),$($P-REQUIRED)) \ $(CCACHE) hardy-MUSTBUILD := libgcrypt gnutls intltool sqlite libical libproxy \ glib libsoup libxml2 gtk+ \ libgnomeui gnome-common gnome-desktop gnome-vfs # Hardy contains a too-old NetworkManager and I sure don't want to # rebuild THAT! hardy-CONFIG_OPTS := --disable-nm intrepid-REQUIRED = \ gtk-doc-tools subversion git-core flex bison build-essential intltool \ libldap2-dev libnss3-dev libsoup2.4-dev libenchant-dev \ gnome-common evolution-dev libgweather-dev libdb-dev \ $(foreach P,$(PACKAGES),$($P-REQUIRED)) \ $(CCACHE) jaunty-REQUIRED = \ gtk-doc-tools subversion git-core gperf flex bison \ build-essential intltool \ libldap2-dev libnss3-dev libsoup2.4-dev libenchant-dev \ gnome-common libgweather-dev evolution-dev libglade2-dev \ libical-dev libgnome-desktop-dev libdbus-glib-1-dev \ network-manager-dev libdb-dev \ $(foreach P,$(PACKAGES),$($P-REQUIRED)) \ $(CCACHE) jaunty-MUSTBUILD := libxml2 $(if $(filter y,$(ENABLE_openchange)),samba4) master-extras := libdb-dev libcanberra-gtk-dev libunique-dev libhal-dev \ libgstreamer0.10-dev libgtkimageview-dev libpst-dev karmic-REQUIRED = \ gtk-doc-tools subversion git-core gperf flex bison \ build-essential \ evolution-dev libldap2-dev libkrb5-dev libical-dev \ libnspr4-dev libnss3-dev libgnome-desktop-dev \ libdbus-glib-1-dev network-manager-dev libgtkhtml-editor-dev \ libproxy-dev libtiff4-dev libffi-dev libglib2.0-dev \ $(master-extras) \ $(foreach P,$(PACKAGES),$($P-REQUIRED)) \ $(CCACHE) karmic-MUSTBUILD := $(if $(filter y,$(ENABLE_openchange)),samba4) \ # glib atk gtk+ libgdata # libxml2 libsoup # gobject-introspection # ----- DEBIAN etch-REQUIRED = \ gtk-doc-tools subversion gperf flex bison build-essential \ libssl-dev libldap2-dev libnss3-dev libnspr4-dev \ libgail-dev evolution-dev icon-naming-utils gnome-doc-utils \ $(CCACHE) # By default we will try to get source from the Gnome GIT repo. # If packages need a different method, encode that here SCM := git ROOTURL := git://git.gnome.org SCM_openchange := svn #ROOTURL_openchange := https://svn.openchange.org/openchange/trunk ROOTURL_openchange := svn://websvn.openchange.org/openchange/trunk SCM_libical := svn ROOTURL_libical := https://freeassociation.svn.sourceforge.net/svnroot/freeassociation/$(BRANCH_libical)/libical # These are the packages we need to build from source, and any config/make/etc. # customized options we need to provide. PACKAGE_libgweather-y := libgweather PACKAGE_exchange-y := evolution-exchange PACKAGE_mapi-y := evolution-mapi PACKAGE_webcal-y := evolution-webcal PACKAGE_openchange-y := openchange set_package = PACKAGE_$1 := $$(PACKAGE_$1-$$(ENABLE_$1)) $(eval $(call set_package,libgweather)) $(eval $(call set_package,exchange)) $(eval $(call set_package,mapi)) $(eval $(call set_package,webcal)) $(eval $(call set_package,openchange)) PACKAGES := evolution-data-server evolution gtkhtml \ $(PACKAGE_libgweather) \ $(PACKAGE_exchange) \ $(PACKAGE_mapi) \ $(PACKAGE_webcal) \ $(PACKAGE_openchange) \ $(local_PACKAGES) \ $($(DISTRO)-MUSTBUILD) src_gettype = $(sort $(foreach P,$(PACKAGES),$(if $(filter $1,$(REPOTYPE_$P)),$P))) PACKAGES_svn := $(call src_gettype,svn) PACKAGES_tarball := $(call src_gettype,tarball) PACKAGES_other := $(call src_gettype,other) $(info Building packages: $(PACKAGES)) CONFIG_VARS = CC='$(CC)' CFLAGS=-g CONFIG_OPTS = --prefix=$(PREFIX) --enable-maintainer-mode BUILD_VARS = BUILD_OPTS = INSTALL_VARS = INSTALL_OPTS = PKG_CONFIG_PATH := $(PREFIX)/lib/pkgconfig:$(PREFIX)/share/pkgconfig:$(PKG_CONFIG_PATH) export PKG_CONFIG_PATH $(info PKG_CONFIG_PATH=$(PKG_CONFIG_PATH)) ACLOCAL_FLAGS := -I $(PREFIX)/share/aclocal $(ACLOCAL_FLAGS) export ACLOCAL_FLAGS $(info ACLOCAL_FLAGS=$(ACLOCAL_FLAGS)) LD_LIBRARY_PATH := $(PREFIX)/lib:$(LD_LIBRARY_PATH) export LD_LIBRARY_PATH $(info LD_LIBRARY_PATH=$(LD_LIBRARY_PATH)) ifneq ($(LINGUAS),) export LINGUAS endif # ----- Per-package configuration and build options # # Each package can have any or all of these variables set: # # _PREREQS # _CONFIG_VARS # _CONFIG_OPTS # _BUILD_VARS # _BUILD_OPTS # _INSTALL_VARS # _INSTALL_OPTS # # The _PREREQS value lists packages that are (make) prerequisites. # The _*_VARS values are environment variable settings for that stage. # The _*_OPTS values are command line options for that stage. # # Only the variables with any values are listed here. CONFIG_libgweather-y := --with-weather CONFIG_libgweather-n := --without-weather CONFIG_exchange-y := --enable-exchange=yes CONFIG_exchange-n := --enable-exchange=no set_config = CONFIG_$1 := $$(CONFIG_$1-$$(ENABLE_$1)) $(eval $(call set_config,libgweather)) $(eval $(call set_config,exchange)) # Compile of gnutlsxx.cpp fails: # In file included from ../gnutls/lib/gnutlsxx.cpp:1: # ../gnutls/lib/includes/gnutls/gnutlsxx.h:146: error: 'gnutls_priority_t' has not been declared # ../gnutls/lib/includes/gnutls/gnutlsxx.h:177: error: 'gnutls_openpgp_crt_status_t' has not been declared # ../gnutls/lib/gnutlsxx.cpp: In member function 'void gnutls::session::set_priority(const char*, const char**)': # ../gnutls/lib/gnutlsxx.cpp:192: error: 'gnutls_priority_set_direct' was not declared in this scope # ../gnutls/lib/gnutlsxx.cpp: At global scope: # ../gnutls/lib/gnutlsxx.cpp:195: error: variable or field 'set_priority' declared void # ../gnutls/lib/gnutlsxx.cpp:195: error: 'gnutls_priority_t' was not declared in this scope # ../gnutls/lib/gnutlsxx.cpp:461: error: variable or field 'send_openpgp_cert' declared void # ../gnutls/lib/gnutlsxx.cpp:461: error: 'gnutls_openpgp_crt_status_t' was not declared in this scope gnutls_PREREQS := libgcrypt gnutls_CONFIG_OPTS := --with-libgcrypt-prefix="$(PREFIX)" --disable-cxx glib_PREREQS := libgdata_PREREQS := gobject-introspection gtk+_PREREQS := glib atk libsoup_PREREQS := glib gtk+ libproxy gnutls gtkhtml_PREREQS := glib gtk+ libsoup libgweather_PREREQS := glib libgnomeui_PREREQS := libxml2 gnome-vfs_PREREQS := gnutls gnome-desktop_PREREQS := intltool gnome-common gnome-desktop_CONFIG_OPTS = --disable-scrollkeeper evolution-data-server_PREREQS := glib libxml2 libglade libical sqlite libsoup gtk+ libgweather libgdata evolution-data-server_CONFIG_OPTS = \ --with-openldap=yes --enable-gnome-keyring=yes --with-e2k-debug \ --with-krb5=/usr \ $(CONFIG_libgweather) \ --with-gconf-source="xml:merged:$(PREFIX)/etc/gconf/gconf.xml.defaults" # --with-krb5=/usr --enable-nspr --enable-nss --enable-smime \ # --with-krb5=/usr --with-nspr-includes=/usr/include/nspr \ # --with-nss-includes=/usr/include/nss \ # I decided to disable scrollkeeper since otherwise Evolution will try # to register it, and this requires root privileges. evolution_PREREQS := glib libxml2 libsoup gtk+ libxml2 gtkhtml libgweather gnome-desktop evolution-data-server gnome-vfs libgnomeui evolution_CONFIG_OPTS = \ --with-openldap=yes --enable-nntp=yes \ --enable-nss=yes --enable-smime=yes --enable-plugins=all \ --enable-cairo-calendar=yes --enable-imap4=yes --with-e2k-debug \ --disable-scrollkeeper $(CONFIG_libgweather) $(CONFIG_exchange) \ --with-gconf-source="xml:merged:$(PREFIX)/etc/gconf/gconf.xml.defaults" evolution-exchange_PREREQS := glib libsoup evolution-data-server evolution evolution-exchange_CONFIG_OPTS = \ --with-openldap=yes --with-e2k-debug \ --with-gconf-source="xml:merged:$(PREFIX)/etc/gconf/gconf.xml.defaults" evolution-mapi_PREREQS := evolution-data-server evolution openchange evolution-mapi_CONFIG_OPTS = \ --with-openldap=yes --with-e2k-debug \ --with-gconf-source="xml:merged:$(PREFIX)/etc/gconf/gconf.xml.defaults" evolution-webcal_PREREQS := glib libsoup evolution-data-server evolution evolution-webcal_CONFIG_OPTS = \ --with-gconf-source="xml:merged:$(PREFIX)/etc/gconf/gconf.xml.defaults" openchange_PREREQS := samba4 openchange_CONFIG_OPTS = --with-samba=$(PREFIX) openchange_BUILD_VARS = CC='$(CC)' CFLAGS=-g # ----- STAMPDIR := .stamp STAMPFILE = $(CURDIR)/$@ ifeq ($(OBJDIR),.) OBJPATH = $* SRCPATH = . else OBJPATH = $(OBJDIR)/$* SRCPATH = ../../$* endif # Commands CC := $(strip $(CCACHE) gcc) CP := cp -p CPDIR := cp -a DPKG := dpkg ECHO := echo GIT := git LINK := ln -s MKDIR := mkdir -p MV := mv -f RM := rm -f RMDIR := rm -rf SED := sed SUDO := sudo SVN := svn TAR := tar TOUCH := touch WGET := wget -nv MKSTAMP = $(TOUCH) '$(STAMPFILE)' NOTIFY = $(ECHO) '' && $(ECHO) '>>>>> Running $1 for $*' # Make sure we look in the new location for apps PATH := $(PREFIX)/bin:$(PATH) export PATH $(info PATH=$(PATH)) # Default branches for various distros; older distros can't always build # newer branches BRANCH_feisty := 2.20 ifeq ($(BRANCH),) BRANCH = $(BRANCH_$(DISTRO)) endif # Create the prefix directory if needed. # This could be done as an order-only prereq or something, but if we do it # here then the user is asked for a password up-front, rather than halfway # through the build when they've gone off for more tea. $(shell if [ -d '$(PREFIX)' ] || $(MKDIR) '$(PREFIX)' 2>/dev/null; then \ :; \ else \ $(ECHO) "Need root to create directory $(PREFIX)." 1>&2; \ $(ECHO) "Please enter YOUR password when asked (for sudo)." 1>&2; \ $(SUDO) $(MKDIR) '$(PREFIX)' && $(SUDO) chown '$(USER)' '$(PREFIX)';\ fi) # aclocal throws up if this doesn't exist... bogus! $(shell [ -d '$(PREFIX)/share/aclocal' ] || $(MKDIR) '$(PREFIX)/share/aclocal') # Make stamp and obj directories early, so make doesn't throw out patterns # for them. $(shell $(MKDIR) '$(CURDIR)/$(STAMPDIR)' '$(CURDIR)/obj') STAMPTYPES := wget scm patch config build install # ----- all target # All means everything is installed .PHONY: all install update help all: install $(PREFIX)/bin/evolution-src $(PREFIX)/bin/evolution-env install: $(patsubst %,$(STAMPDIR)/%.install,$(PACKAGES)) help: $(SED) -n 's/^#h://p' < $(firstword $(MAKEFILE_LIST)) # Make sure none of the targets are considered intermediate .PRECIOUS: $(foreach X,$(STAMPTYPES),$(STAMPDIR)/%.$X) # ----- install script wrappers $(PREFIX)/bin/evolution-%: $(firstword $(MAKEFILE_LIST)) $Q $(MKDIR) -p '$(@D)' \ && $(SED) -n -e 's|^#$*:||p' < '$<' \ | $(SED) -e 's|@PREFIX@|$(PREFIX)|' \ -e 's|@PKG_CONFIG_PATH@|$(PKG_CONFIG_PATH)|' \ -e 's|@LD_LIBRARY_PATH@|$(LD_LIBRARY_PATH)|' \ > '$@' \ && chmod 0755 '$@' \ && echo "Installed $@" # ----- final setup operations _dbus_cfile := /etc/dbus-1/session.d/$(notdir $(PREFIX)).conf _dbus_conf := $(PREFIX)/share/dbus-1/services/ _ld_cfile := /etc/ld.so.conf.d/$(notdir $(PREFIX)).conf # Make sure camel-lock-helper has the right privs for handling email install: $Q $(ECHO) "Setting mail helper privileges (may require $(SUDO)!)"; \ ls -1 $(PREFIX)/libexec/camel-lock-helper-* \ | while read helper; do \ [ -f "$$helper" ] || continue; \ case `stat --format="%G:%A" "$$helper"` in \ mail:??????s???) : all set ;; \ *) $(SUDO) chgrp mail "$$helper" \ && $(SUDO) chmod g+s "$$helper" ;; \ esac; \ done $Q if [ ! -f '$(_dbus_cfile)' ]; then \ $(ECHO) "Configuring D-BUS Evolution settings (requires $(SUDO))"; \ $(ECHO) '$(_dbus_conf)' | $(SUDO) -s 'cat > $(_dbus_cfile)'; \ $(ECHO) 'You *must* log out and log back in before starting Evolution'; \ fi $Q if [ ! -f '$(_ld_cfile)' ]; then \ $(ECHO) "Configuring ldconfig settings (requires $(SUDO))"; \ $(ECHO) '$(PREFIX)/lib' | $(SUDO) -s 'cat > $(_ld_cfile)'; \ $(SUDO) ldconfig; \ $(ECHO) 'You *must* log out and log back in before starting Evolution'; \ fi # ----- install source workspaces $(STAMPDIR)/%.install: $(STAMPDIR)/%.build | $(PREFIX) @ $(call NOTIFY,install) $Q [ -d '$(PREFIX)/etc/gconf' ] || $(MKDIR) '$(PREFIX)/etc/gconf' $Q cd '$(OBJPATH)' \ && $(INSTALL_VARS) $($*_INSTALL_VARS) \ $(MAKE) install $(INSTALL_OPTS) $($*_INSTALL_OPTS) @ $(MKSTAMP) # ----- build source workspaces $(STAMPDIR)/%.build: $(STAMPDIR)/%.config @ $(call NOTIFY,build) $Q cd '$(OBJPATH)' \ && $(BUILD_VARS) $($*_BUILD_VARS) \ $(MAKE) $(BUILD_OPTS) $($*_BUILD_OPTS) @ $(MKSTAMP) # ----- configure source workspaces _CONFIG = $(MKDIR) '$(OBJPATH)/' && cd '$(OBJPATH)' \ && $(MKDIR) $(SRCPATH)/m4 m4 \ && $(CONFIG_VARS) $($*_CONFIG_VARS) \ '$(SRCPATH)/autogen.sh' $(CONFIG_OPTS) $($*_CONFIG_OPTS) $($(DISTRO)-CONFIG_OPTS) # We don't use the stamp files here because if we do, it will cause all the # prerequisite information at the end to come into play. config.%: @ $(call NOTIFY,config) $(_CONFIG) $(STAMPDIR)/%.config: $(STAMPDIR)/%.patch @ $(call NOTIFY,config) $Q $(_CONFIG) @ $(MKSTAMP) # Openchange can't run at all from the obj dir $(STAMPDIR)/openchange.config: $(STAMPDIR)/%.config: $(STAMPDIR)/%.patch @ $(call NOTIFY,config) $Q $(TAR) cf - --exclude=.svn openchange \ | (cd '$(OBJDIR)' && $(TAR) xf -) $Q cd '$*' $Q $(MKDIR) '$(OBJPATH)/' && cd '$(OBJPATH)' \ && $(CONFIG_VARS) $($*_CONFIG_VARS) './autogen.sh' \ && $(CONFIG_VARS) $($*_CONFIG_VARS) \ './configure' $(CONFIG_OPTS) $($*_CONFIG_OPTS) @ $(MKSTAMP) # We build samba4 using scripts in openchange samba4_SCRIPT := $(CURDIR)/openchange/script/installsamba4.sh # Openchange does not provide a configurable location for the Samba install # so hack the script :-/ $(STAMPDIR)/samba4.scm: $(STAMPDIR)/%.scm: $(STAMPDIR)/openchange.patch @ $(call NOTIFY,download) $Q [ ! -f '$(samba4_SCRIPT).orig' ] || $(MV) '$(samba4_SCRIPT).orig' '$(samba4_SCRIPT)' $Q perl -pi.orig -e \ 's,/usr/local/samba,\$${PREFIX:-/usr/local/samba},g; s,sudo,\$${SUDO-sudo},g; s,\./configure(\S*),./configure$$1 \$$EVOCONFIG_OPTS,g' \ '$(samba4_SCRIPT)' $Q $(MKDIR) '$(OBJDIR)/' && cd '$(OBJDIR)' \ && echo 'y' | $(samba4_VARS) '$(samba4_SCRIPT)' download @ $(MKSTAMP) $(STAMPDIR)/samba4.patch: $(STAMPDIR)/%.patch: $(STAMPDIR)/%.scm @ $(call NOTIFY,patch) $Q cd '$(OBJDIR)' && $(samba4_VARS) '$(samba4_SCRIPT)' patch @ $(MKSTAMP) # The config is done as part of the build ("packages") $(STAMPDIR)/samba4.config: $(STAMPDIR)/%.config: $(STAMPDIR)/%.patch @ $(MKSTAMP) $(STAMPDIR)/samba4.build: $(STAMPDIR)/%.build: $(STAMPDIR)/%.config @ $(call NOTIFY,build) $Q cd '$(OBJDIR)' \ && echo 'n' | $(samba4_VARS) '$(samba4_SCRIPT)' packages \ && $(samba4_VARS) '$(samba4_SCRIPT)' compile @ $(MKSTAMP) # The install is done as part of the build ("packages") $(STAMPDIR)/samba4.install: $(STAMPDIR)/%.install: $(STAMPDIR)/%.build @ $(call NOTIFY,install) $Q cd '$(OBJDIR)' \ && $(samba4_VARS) '$(samba4_SCRIPT)' install \ && $(samba4_VARS) '$(samba4_SCRIPT)' post_install @ $(MKSTAMP) # libical can't run autogen from the obj dir $(STAMPDIR)/libical.config: $(STAMPDIR)/%.config: $(STAMPDIR)/%.patch @ $(call NOTIFY,config) $Q cd '$*' && './bootstrap' $Q $(MKDIR) '$(OBJPATH)/' && cd '$(OBJPATH)' \ && $(CONFIG_VARS) $($*_CONFIG_VARS) \ '$(SRCPATH)/configure' $(CONFIG_OPTS) $($*_CONFIG_OPTS) @ $(MKSTAMP) # tarball packages already have configure scripts, generally $(patsubst %,$(STAMPDIR)/%.config,$(PACKAGES_tarball)): $(STAMPDIR)/%.config: $(STAMPDIR)/%.patch @ $(call NOTIFY,config) $Q $(MKDIR) '$(OBJPATH)/' && cd '$(OBJPATH)' \ && $(CONFIG_VARS) $($*_CONFIG_VARS) \ '$(SRCPATH)/configure' $(CONFIG_OPTS) $($*_CONFIG_OPTS) @ $(MKSTAMP) # ----- patch source workspaces $(STAMPDIR)/%.patch: $(STAMPDIR)/%.scm @ $(call NOTIFY,patch) @ $(MKSTAMP) # ----- create GIT source workspaces # Compute the GIT branch, for a given package name in $$pkg # If it's empty, assume the head setup_git = pkg='$1'; \ branch='$(subst .,-,$(firstword $(BRANCH_$1) $(BRANCH) master))'; \ rooturl='$(firstword $(ROOTURL_$1) $(ROOTURL))/$1' $(STAMPDIR)/%.scm: %/.git FORCE | check-prereqs-$(DISTRO) @ $(call NOTIFY,git check) $Q $(call setup_git,$*); set -e; cd "$$pkg"; \ if $(git_samebranch_p); then \ [ -f '$(STAMPFILE)' ] || $(MKSTAMP); \ else \ if $(GIT) branch | grep -q "$$branch"; then \ $(GIT) checkout "$$branch" \ && $(GIT) merge "origin/$$branch"; \ elif $(GIT) branch -a | grep -q "origin/$$branch"; then \ $(GIT) checkout -b "$$branch" "origin/$$branch"; \ else \ echo "*** No branch $$branch for $$pkg!"; \ exit 1; \ fi; \ $(MKSTAMP); \ fi .PRECIOUS: %/.git %/.git: @ $(call NOTIFY,git checkout) $Q $(call setup_git,$*); $(GIT) clone "$$rooturl" "$$pkg" \ && cd "$$pkg" \ && ( [ "$$branch" = "master" ] \ || $(GIT) checkout -b "$$branch" "origin/$$branch" ) @$(TOUCH) '$(CURDIR)/$(STAMPDIR)/$*.scm' # ----- create SVN source workspaces # Compute the SVN branch, for a given package name in $$pkg # If it's empty, assume the trunk svn_setup = pkg='$1'; \ branch='$(subst .,-,$(firstword $(BRANCH_$1) trunk))'; \ rooturl="$(firstword $(ROOTURL_$1) $(ROOTURL)/$1/$$branch)" svn_getrev = `$(SVN) info $(1) | $(SED) -n 's/^Revision: \([0-9][0-9]*\).*/\1/p'` svn_getinfo = eval `$(SVN) info $(2) | $(SED) -n -e 's/^Revision: *\([0-9][0-9]*\).*/$(1)rev="\1"/p' -e 's/^URL: *\(http.*\)/$(1)url="\1"/p'` # There's nothing to do here: since SVN doesn't have a local repository. # Ideally this would check to see if the branch asked for in the makefile is # the one we have checked out and handle it if not... I'm tired! $(patsubst %,$(STAMPDIR)/%.scm,$(PACKAGES_svn)) : $(STAMPDIR)/%.scm: %/.svn | check-prereqs-$(DISTRO) $Q [ -f '$@' ] || $(MKSTAMP) # $Q $(call svn_setup,$*); set -e; cd "$$pkg"; \ # $(call svn_getinfo,repo,"$$rooturl"); \ # $(call svn_getinfo,work,); \ # if [ "$$workrev:$$workurl" = "$$reporev:$$repourl" ]; then \ # $(ECHO) "No SVN update needed for $$pkg."; \ # [ -f '$(STAMPFILE)' ] || $(MKSTAMP); \ # else \ # $(ECHO) ">>>> Updating package $$pkg from SVN:"; \ # $(SVN) switch $$rooturl \ # && $(SVN) update \ # && $(MKSTAMP); \ # fi .PRECIOUS: %/.svn %/.svn: @ $(call NOTIFY,svn checkout) $Q $(call svn_setup,$*); $(SVN) co "$$rooturl" "$$pkg" @ $(TOUCH) '$(CURDIR)/$(STAMPDIR)/$*.scm' # ----- create tarball source workspaces $(patsubst %,$(STAMPDIR)/%.scm,$(PACKAGES_tarball)) : $(STAMPDIR)/%.scm: $(STAMPDIR)/%.wget | check-prereqs-$(DISTRO) @ $(call NOTIFY,tarball unpack) $Q $(RMDIR) '$*' \ && case '$(TARBALL_$*)' in \ *.tar.gz|*.tgz) tar xzf 'pkg/$(TARBALL_$*)' ;; \ *.tar.bz2) tar xjf 'pkg/$(TARBALL_$*)' ;; \ esac \ && $(MV) '$(SRCDIR_$*)' '$*' @ $(MKSTAMP) $(STAMPDIR)/%.wget :: @ $(call NOTIFY,wget download) $Q $(MKDIR) pkg && cd pkg && $(RM) '$(TARBALL_$*)' \ && $(WGET) '$(ROOTURL_$*)/$(TARBALL_$*)' @ $(MKSTAMP) # ----- update source workspaces .PHONY: update check-update check-changelog update: $(addprefix update.,$(PACKAGES)) check-update: $(addprefix check-update.,$(PACKAGES)) check-changelog: $(addprefix check-changelog.,$(PACKAGES)) # ----- update GIT workspaces git_samebranch_p = `$(GIT) branch | grep -q "^\* $$branch\$$"` # Non-empty rev list between local ref and remote ref implies # that there are unmerged revisions on the remote branch => not up-to-date. git_uptodate_p = ( localref=`$(GIT) show-ref --hash heads/$$branch`; \ remoteref=`$(GIT) show-ref --hash origin/$$branch`; \ ( [ "$$localref" = "$$remoteref" ] \ || [ `$(GIT) rev-list "$$localref..$$remoteref" | wc -l` -eq 0 ] ) \ && $(git_samebranch_p) ) git_updaterange = "`$(GIT) show-ref --hash heads/$$branch`..`$(GIT) show-ref --hash origin/$$branch`" update.%: %/.git @ $(call NOTIFY,GIT update) $Q $(call setup_git,$*); cd "$$pkg" \ && $(GIT) fetch \ && if $(git_uptodate_p); then \ $(ECHO) "No update needed for $$pkg."; \ else \ $(ECHO) ">>>> Updating package $$pkg from GIT:"; \ if $(git_samebranch_p); then \ $(GIT) merge "origin/$$branch"; \ elif $(GIT) branch | grep -q "$$branch"; then \ $(GIT) checkout "$$branch" \ && $(GIT) merge "origin/$$branch"; \ elif $(GIT) branch -a | grep -q "origin/$$branch"; then \ $(GIT) checkout -b "$$branch" "origin/$$branch"; \ else \ echo "*** No branch $$branch for $$pkg!"; \ exit 1; \ fi; \ $(TOUCH) '$(CURDIR)/$(STAMPDIR)/$*.scm'; \ fi check-update.%: @ $(call NOTIFY,GIT update check) $Q $(call setup_git,$*); cd "$$pkg" && $(GIT) fetch; \ if $(git_uptodate_p); then \ $(ECHO) ">>>> No GIT update needed for $$pkg."; \ else \ $(ECHO) ">>>> $$pkg has GIT updates available"; \ fi check-changelog.%: @ $(call NOTIFY,GIT changelog check) $Q $(call setup_git,$*); cd "$$pkg" && $(GIT) fetch; \ if $(git_uptodate_p); then \ $(ECHO) ">>>> No new GIT updates available for $$pkg."; \ else \ $(ECHO) ">>>> $$pkg has GIT updates available:"; \ PAGER= $(GIT) log $(git_updaterange); \ fi # ----- update SVN workspaces $(addprefix update.,$(PACKAGES_svn)) : update.%: %/.svn @ $(call NOTIFY,SVN update) $Q $(call svn_setup,$*); cd "$$pkg"; \ $(call svn_getinfo,repo,$$rooturl); \ $(call svn_getinfo,work,); \ if [ "$$workrev:$$workurl" = "$$reporev:$$repourl" ]; then \ $(ECHO) "No SVN update needed for $$pkg."; \ else \ $(ECHO) ">>>> Updating package $$pkg from SVN:"; \ $(SVN) switch $$rooturl && $(SVN) update; \ $(TOUCH) '$(CURDIR)/$(STAMPDIR)/$*.scm'; \ fi $(addprefix check-update.,$(PACKAGES_svn)) : check-update.%: @ $(call NOTIFY,SVN update check) $Q $(call svn_setup,$*); cd "$$pkg"; \ $(call svn_getinfo,repo,$$rooturl); \ $(call svn_getinfo,work,); \ if [ "$$workrev" = "$$reporev" ]; then \ $(ECHO) ">>>> No SVN update needed for $$pkg."; \ else \ $(ECHO) ">>>> $$pkg has SVN updates available:"; \ if [ "$$workurl" = "$$repourl" ]; then \ $(SVN) status -q -u; \ else \ $(ECHO) "-> On $(BRANCH). Use 'make update'."; \ fi; \ fi $(addprefix check-changelog.,$(PACKAGES_svn)) : check-changelog.%: @ $(call NOTIFY,SVN changelog check) $Q $(call svn_setup,$*); cd "$$pkg"; \ $(call svn_getinfo,repo,$$rooturl); \ $(call svn_getinfo,work,); \ if [ "$$workrev" = "$$reporev" ]; then \ $(ECHO) ">>>> No SVN update needed for $$pkg."; \ else \ $(ECHO) ">>>> $$pkg has SVN updates available:"; \ if [ "$$workurl" != "$$repourl" ]; then \ $(ECHO) "-> On $(BRANCH). Use 'make update'."; \ else \ log="/tmp/svnstatus.log.$$$$"; \ $(SVN) status -q -u 2>&1 | tee "$$log"; \ sort "$$log" \ | while read stat rev fn; do \ case $$fn in \ ChangeLog|*/ChangeLog) \ $(ECHO) ">>>> $$pkg: $(SVN) diff -r $$rev:HEAD $$fn"; \ $(SVN) diff -r "$$rev:HEAD" "$$fn" ;; \ esac; \ done; \ $(RM) "$$log"; \ fi; \ fi # ----- update tarball workspaces $(addprefix update.,$(PACKAGES_tarball) $(PACKAGES_other)) : update.%: $Q : nothing to do here $(addprefix check-update.,$(PACKAGES_tarball) $(PACKAGES_other)) : check-update.%: $Q : nothing to do here $(addprefix check-changelog.,$(PACKAGES_tarball) $(PACKAGES_other)) : check-changelog.%: $Q : nothing to do here # ----- check packages # This is for DPKG systems. Someone else will have to write the # equivalent RPM code. .PHONY: check-prereqs check-prereqs- check-prereqs-ubuntu check-prereqs: check-prereqs-$(DISTRO) check-prereqs-: @$(ECHO) "Cannot verify system package prerequisites."; \ $(ECHO) "I'm trying to build anyway..."; \ $(ECHO) " Good luck!!" check-prereqs-%: @$(ECHO) "Unsupported distro: '$*'. Choose one of:"; \ for d in $(DISTROS); do $(ECHO) " $$d"; done; \ $(ECHO) "Or to force a build, set 'distro' empty in the makefile."; \ exit 1 $(addprefix check-prereqs-,$(DISTROS)): check-prereqs-%: @log="/tmp/evo-chk-prereqs.$$$$" \ && $(RM) "$$log" \ && $(TOUCH) "$$log" \ && $(DPKG) -l $(sort $($*-REQUIRED)) \ | while read s n rest; do \ case $$s in \ ii) echo "$$n" >> "$$log" ;; \ [a-z][a-z]) \ echo "Package $$n not installed (state $$s)" ;; \ esac; \ done; \ num=`wc -l < "$$log"`; \ $(RM) "$$log"; \ if [ "$$num" != "$(words $(sort $($*-REQUIRED)))" ]; then \ $(ECHO); \ $(ECHO) "Not all prerequisites are installed!"; \ $(ECHO) "Use 'aptitude install ...' on the above missing packages."; \ $(ECHO); \ exit 1; \ fi # ----- install schemas .PHONY: install-schemas install-schemas: @for s in $(PREFIX)/etc/gconf/schemas/*.schemas; do \ echo "Installing $$s ..."; \ gconftool-2 --install-schema-file $$s >/dev/null; \ done # ----- cleanup .PHONY: clean shinyclean superclean clean: $(RMDIR) $(STAMPDIR) ifneq ($(OBJDIR),.) $(RMDIR) $(OBJDIR) endif shinyclean: clean $(RMDIR) $(PREFIX)/* superclean: shinyclean $(RMDIR) $(PACKAGES) pkg ccacheclean: @if [ -n " $(CCACHE)" ]; then \ $(CCACHE) -C; \ else echo "ccache not enabled"; fi # ----- ordering # These ensure that packages are built in the correct order. In general, # we can't do the config until after we've installed the previous packages. # # Technically, we don't really need to reconfig after every install: most of # the time it would be enough to rebuild after the install; however, there's # no good way to make that work all the time, unless we had perfect # prerequisite declarations (knowing which installed files actually would # require a reconfig vs. a rebuild for example). # Generate prerequisites, but don't depend on packages we don't build prereqs = $(STAMPDIR)/$(1).config : $(patsubst %,$(STAMPDIR)/%.install,$(filter $($(1)_PREREQS),$(PACKAGES))) $(foreach P,$(PACKAGES),$(eval $(call prereqs,$P))) # ---- Help FORCE: # ---- disable builtin stuff .SUFFIXES: # ---- END OF MAKEFILE ---- # ----------------------------------------------------------------------------- # This is the content of evolution-env. It's extracted by sed. #env:#!/bin/sh #env:# #env:# Put this file in your PATH and/or invoke it directly. #env:# #env:# - Sets up the environment for running the compiled version of #env:# Evolution and compiling programs against it. #env:# - Runs the program on the command line (if one given) or a bash #env:# shell. #env: #env:prefix='@PREFIX@' #env:pkgconfig='@PKG_CONFIG_PATH@' #env:ldlibrary='@LD_LIBRARY_PATH@' #env: #env:BONOBO_ACTIVATION_PATH=$prefix/lib/bonobo/servers #env:export BONOBO_ACTIVATION_PATH #env: #env:case ":$PKG_CONFIG_PATH:" in #env: *":$pkgconfig:"*) : ok ;; #env: *) PKG_CONFIG_PATH="$pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" #env: export PKG_CONFIG_PATH ;; #env:esac #env: #env:case ":$LD_LIBRARY_PATH:" in #env: *":$ldlibrary:"*) : ok ;; #env: *) LD_LIBRARY_PATH="$ldlibrary${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" #env: export LD_LIBRARY_PATH ;; #env:esac #env: #env:case ":$PATH:" in #env: *":$prefix/bin:$prefix/libexec:"*) : ok ;; #env: *) PATH="$prefix/bin:$prefix/libexec:$PATH" #env: export PATH ;; #env:esac #env: #env:exec "${@:-${SHELL:-/bin/bash}}" # ----------------------------------------------------------------------------- # This is the content of evolution-src. It's extracted by sed. #src:#!/bin/sh #src:# #src:# Put this file in your PATH and/or invoke it directly. #src:# #src:# - Enables full debugging (note! Privacy concerns!) #src:# - Enables core dumps (ulimit) #src:# - Creates a new log directory for this instance of Evo #src:# - Cd's there to keep everything related to this run together #src:# - Force-shutdown of any existing Evolution applications #src:# #src:# You should clean out those log directories occasionally. #src: #src:prefix='@PREFIX@' #src: #src:# Set up debugging. Remember EVERYTHING! #src:E2K_DEBUG=5 #src:CAMEL_DEBUG=all #src:export E2K_DEBUG CAMEL_DEBUG #src: #src:# Allow for core dumps. #src:ulimit -c unlimited #src: #src:# All our email is dumped with debugging, so set restrictive permissions #src:umask 0077 #src: #src:# Create a directory just for this run #src:logdir="$HOME/evo/log/`date '+%Y%m%d.%H%M%S'`" #src:mkdir -p "$logdir" #src:cd "$logdir" || exit 1 #src: #src:# Kill any existing Evolution programs #src:"$prefix/bin/evolution-env" "$prefix/bin/evolution" --force-shutdown #src: #src:# Kill the bonobo-activation-server to be sure we get the new servers #src:killall -q -u "$USER" bonobo-activation-server #src: #src:# Run it #src:i=0 #src:while [ -e "$logdir/evo.log.$i" ]; do #src: i=`expr $i + 1` #src:done #src: #src:"$prefix/bin/evolution-env" "$prefix/bin/evolution" "$@" >"$logdir/evo.log.$i" 2>&1 #src:r=$? #src: #src:# Kill the bonobo-activation-server in case the user starts the "old" Evo #src:killall -q -u "$USER" bonobo-activation-server #src: #src:# Check for cores and get a traceback on any we find #src:for f in "$logdir"/core*; do #src: [ -f "$f" ] || continue #src: echo #src: echo "----- Core file: $f -----" #src: file "$f" #src: proc=`file "$f" | sed -n "s/^.* from .\\([^']*\\)'\$/\\1/p"` #src: if [ -x "$proc" ]; then #src: echo "gdb -batch -ex 'info shared' -ex 'thread apply all bt full' -ex 'bt' -core $f $proc" #src: gdb -batch -ex 'set pagination off' -ex 'info shared' \ #src: -ex 'thread apply all bt full' -ex 'bt' \ #src: -core "$f" "$proc" #src: else #src: echo "Cannot locate program ($proc) for this core" #src: fi #src:done >>"$logdir/evo.log.$i" 2>&1 #src: #src:exit $r # ----------------------------------------------------------------------------- # This is some help. Run "make help" to read it most easily. #h:Makefile for building Evolution from GIT #h:---------------------------------------- #h: #h:Post-install you should run: #h: #h: make install-schemas #h: #h:in any user account that wants to run Evolution. #h: #h: #h:MAKE TARGETS: #h: #h:all [Default] Check out, configure, compile, install the various #h: components necessary to build Evolution from GIT. #h: #h:update Perform GIT updates of all the checked out components. #h: #h:check-update Check whether there are new updates in the GIT repository. #h: Doesn't check anything out. #h: #h:check-changelog Check whether there are new updates, AND show the ChangeLog #h: diffs. #h: #h:check-prereqs Verify that the packages needed for the build are installed. #h: #h:clean For each source package, "make clean" #h: #h:shinyclean Remove the built package files and the installed Evolution #h: #h:superclean Run "shinyclean", plus remove the source directories #h: #h: #h:CUSTOMIZATION: #h: #h:You can create a makefile "local.mk" in the same directory that contains the #h:Makefile. This file, if it exists, can contain one or more of the following #h:variables: #h: #h:PREFIX The directory in which to install Evolution. #h: Must NOT be /usr! #h: #h:DISTRO The GNU/Linux distribution you're running. This helps the #h: Makefile check for the right packages before starting the #h: build. Currently supported are "feisty", "gutsy", "hardy", and #h: "etch" (Debian). You can also set it to empty and hope for the best. #h: #h:BRANCH The GIT label or branch to build. If you don't set this then #h: a default value is used: this is the current release. #h: #h:CCACHE Enable ccache (on by default). If you don't want to use it, #h: set this to empty. #h: #h:ENABLE_exchange Turn on Evolution Exchange support (on by default). If you #h: don't want to build it, set this to "n" (or any non-"y" #h: value). #h: #h:ENABLE_mapi Turn on Evolution MAPI support (on by default). If you #h: don't want to build it, set this to "n" (or any non-"y" #h: value). #h: #h:ENABLE_webcal Turn on Evolution Webcall support (on by default). If you #h: don't want to build it, set this to "n" (or any non-"y" #h: value). #h: #h:ENABLE_openchange #h: Enable building the OpenChange library (on by default). If you #h: don't want to build it, set this to "n" (or any non-"y" #h: value). #h: #h:LINGUAS Restrict the number of translations built and installed to #h: those listed in this variable. #h: #h:local_PACKAGES A list of extra packages you want to build. These must be #h: "standard" Gnome packages kept on the Gnome GIT server and #h: using the normal build operations. Common packages you might #h: want to list here are glib, libbonobo, and libsoup. #h: