~ubuntu-branches/ubuntu/dapper/enigmail/dapper

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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/usr/bin/make -f

export MOZ_MAILNEWS=1

DESTDIR=$(CURDIR)/debian/tmp-enigmail-mn
MOZ_APP_NAME=mozilla
MOZ_APP_POSTFIX=

ENIG_EXT_ID={847b3a00-7ab1-11d4-8f02-006008948af5}

all_patches=$(patsubst \#%,,$(shell cat $(wildcard $(CURDIR)/debian/patches/00list.$(MOZ_APP_NAME))))

MOZ_VERS = $(shell mozilla-config --version)

export XPIDL_TOOLS_DIR=/usr/lib/mozilla-thunderbird/
export MOZSDK_EXTENSIONS_DIR=extensions/
export MOZSDK_EXTENSIONS_DEPTH=..
export PATCH_DEPTH=1

#set the correct VERSION

ifeq ($(MOZ_VERS),1.6)
MOZSDK_VERS=MOZILLA_1_6_RELEASE
IPC_VERS=1.0.5
ENIG_VERS=0.86.1
endif

ifeq ($(MOZ_VERS),1.7.3) # it's still the same sdk
MOZSDK_VERS=MOZILLA_1_7_3_RELEASE
IPC_VERS=1.1.2
ENIG_VERS=0.91.0
endif

ifeq ($(MOZ_VERS),1.7.5) # it's still the same sdk
MOZSDK_VERS=MOZILLA_1_7_5_RELEASE
IPC_VERS=1.1.2
ENIG_VERS=0.91.0
endif

ifeq ($(MOZ_VERS),1.7.6) # it's still the same sdk
MOZSDK_VERS=MOZILLA_1_7_6_RELEASE
IPC_VERS=1.1.2
ENIG_VERS=0.91.0
endif

ifeq ($(MOZ_VERS),1.7.8) # it's still the same sdk
MOZSDK_VERS=MOZILLA_1_7_8_RELEASE
#IPC_VERS=1.1.2
#ENIG_VERS=0.91.0
IPC_VERS=1.1.3
ENIG_VERS=0.92.0
endif

ifeq ($(MOZ_VERS),1.7.7) # it's still the same sdk
MOZSDK_VERS=MOZILLA_1_7_6_RELEASE
IPC_VERS=1.1.2
ENIG_VERS=0.91.0
endif

ifeq ($(MOZ_VERS),1.7.10) # it's still the same sdk
MOZSDK_VERS=MOZILLA_1_7_10_RELEASE
IPC_VERS=1.1.3
ENIG_VERS=0.92.0
endif

ifeq ($(MOZ_VERS),1.7.11) # it's still the same sdk
MOZSDK_VERS=MOZILLA_1_7_10_RELEASE
IPC_VERS=1.1.3
ENIG_VERS=0.92.0
endif

ifeq ($(MOZ_VERS),1.7.12) # it's still the same sdk
MOZSDK_VERS=MOZILLA_1_7_10_RELEASE
IPC_VERS=1.1.3
ENIG_VERS=0.93.0
endif

# TODO this could be generic matching algo
# cat ./extensions/enigmail/package/install.rdf | \
# grep \<em:id\> | head -n 1 | sed -e 's/^.*<em:id>\(.*\)<\/em:id>.*$/\1/'

patch-stamp.$(MOZ_APP_NAME):
	-dpatch apply $(all_patches)
	touch patch-stamp.$(MOZ_APP_NAME)

patch: setup-source patch-stamp.$(MOZ_APP_NAME)

dounpatch:
	-dpatch deapply $(all_patches)

clean: dounpatch
	rm -rf $(CURDIR)/build-dir
	rm -f $(CURDIR)/setup-source.stamp
	rm -rf $(CURDIR)/debian/patched

setup-source: setup-source.stamp

setup-source.stamp:
	mkdir -p $(CURDIR)/build-dir/
	tar -C $(CURDIR)/build-dir/ -xzvf archives/mozsdk-$(MOZSDK_VERS).tar.gz
	tar -C $(CURDIR)/build-dir/mozilla/extensions -xvzf \
		archives/enigmail-$(ENIG_VERS).tar.gz
	tar -C $(CURDIR)/build-dir/mozilla/extensions -xvzf archives/ipc-$(IPC_VERS).tar.gz
	touch setup-source.stamp

build: setup-source patch $(CURDIR)/build-dir/mozilla/build-stamp

$(CURDIR)/build-dir/mozilla/build-stamp:
	cp $(CURDIR)/debian/configure.sh.$(MOZSDK_VERS) $(CURDIR)/build-dir/mozilla/configure.sh
	sh -c "cd build-dir/mozilla && autoconf && sh configure.sh"
	sh -c "LD_LIBRARY_PATH=/usr/lib/mozilla/ && export LD_LIBRARY_PATH && make -C build-dir/mozilla"
	touch $(CURDIR)/build-dir/mozilla/build-stamp

install: build
	make -C build-dir/mozilla install DESTDIR=$(DESTDIR)
#	cp -f $(CURDIR)/build-dir/mozilla/extensions/enigmail/package/install.rdf debian/tmp-enigmail-mn

.PHONY: clean install build patch