summaryrefslogtreecommitdiff
path: root/Makefile.am
blob: 23f1e488c526a504bfa368df2b618afc909b55e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
## Process this file with automake to produce Makefile.in

SUBDIRS = src etc test

EXTRA_DIST = HACKING
MAINTAINERCLEANFILES = Makefile.in config.h.in config.guess config.sub configure depcomp install-sh ltmain.sh missing mkinstalldirs
DISTCHECK_CONFIGURE_FLAGS = --with-sync4j=@SYNC4J@

# binary distribution
distbin : README all
	@ [ "$(BINSUFFIX)" ] || (echo "please invoke with e.g. 'make distbin BINSUFFIX=debian-3.1'"; exit 1 ) 
	rm -rf $(distdir)
	$(MAKE) prefix=`pwd`/$(distdir) install
	cp $(srcdir)/README $(srcdir)/NEWS $(srcdir)/COPYING $(distdir)
	tar zcf $(distdir)-$(BINSUFFIX).tar.gz $(distdir)
	rm -rf $(distdir)

iphone : SyncEvolution.plist

IPHONE_FILENAME = syncevolution-$(VERSION)-iphone.zip

SyncEvolution.plist : SyncEvolution.plist.in $(IPHONE_FILENAME)
	sed -e 's/__FILENAME__/$(IPHONE_FILENAME)/' \
	    -e 's/__VERSION__/$(VERSION)/' \
	    -e 's/__SIZE__/$(shell ls -l $(IPHONE_FILENAME) | sed -e 's/  */ /g' | cut -d ' ' -f 5)/' \
	    $< >$@

$(IPHONE_FILENAME) : all
	rm -rf syncevolution-iphone $@
	$(MAKE) DESTDIR=`pwd`/syncevolution-iphone install
	rm -rf `ls -1 -d syncevolution-iphone/usr/share/doc/syncevolution/*/spds/sources/* | grep -v addressbook`
	perl -pi -e 's;SyncEvolution test #1;;;' \
	         -e 's;^type = text/(x-)?vcard;type = addressbook;m;' \
                 syncevolution-iphone/usr/share/doc/syncevolution/*/spds/sources/addressbook/config.txt
	cd syncevolution-iphone && zip -r ../$(IPHONE_FILENAME) .

TYPE_deb = -D
TYPE_rpm = -R
REQUIRES_deb = --requires="`dpkg-shlibdeps -O src/syncevolution | sed -e 's/[^=]*=//'`"
VERSION_deb = $(VERSION)
VERSION_rpm = `echo $(VERSION) | sed -e s/-/_/g`

# The package name: BINSUFFIX is used to distinguish binaries
# for different Evolution releases.
PKGNAME=syncevolution$(patsubst %,-%,$(BINSUFFIX))

# This is a list of packages (potentially) provided on estamos.de.
# The current package conflicts with any of them, but not itself.
PKGS = $(addprefix syncevolution-evolution-, 2.0 2.2 2.4 2.6 2.8 2.10 2.12 2.14 2.16)

# When calling checkinstall we cannot install into /tmp
# because any file created there will be excluded: that makes
# sense, because "make install" might create temporary files
# there. The current directory might be in /tmp, so use $HOME.
deb rpm : all doc-pak
	tmpdir=`mktemp -d $$HOME/syncevolution.XXXXXXXXXX` && \
	trap "rm -rf $$tmpdir" EXIT && \
	docdir="$(docdir)" && \
        if [ ! "$$docdir" ]; then docdir="$(datadir)/doc/$(PACKAGE)"; fi && \
	fakeroot checkinstall \
		$(TYPE_$@) \
		$(REQUIRES_$@) \
		--fstrans=yes \
		--pkgversion=$(VERSION_$@) \
		--pkgname=$(PKGNAME) \
		--provides=syncevolution \
		--conflicts="`echo $(filter-out $(PKGNAME), $(PKGS)) | sed -e 's/  */, /g'`" \
		--maintainer='Patrick Ohly <patrick.ohly@gmx.de>' \
		--pkgsource='http://sourceforge.net/project/showfiles.php?group_id=146288' \
		--pkgaltsource='http://www.estamos.de/projects/SyncML/' \
		--pkggroup='gnome' \
		--docdir=$$docdir $(MAKE) install

doc-pak : README NEWS COPYING
	mkdir $@
	cp $+ $@

description-pak : description
	cp $< $@