5
DESTDIR=$(CURDIR)/debian/tmp-enigmail-mn
9
ENIG_EXT_ID={847b3a00-7ab1-11d4-8f02-006008948af5}
11
all_patches=$(patsubst \#%,,$(shell cat $(wildcard $(CURDIR)/debian/patches/00list.$(MOZ_APP_NAME))))
13
MOZ_VERS = $(shell mozilla-config --version)
15
#set the correct VERSION
17
ifeq ($(MOZ_VERS),1.6)
18
MOZSDK_VERS=MOZILLA_1_6_RELEASE
23
ifeq ($(MOZ_VERS),1.7.3) # it's still the same sdk
24
MOZSDK_VERS=MOZILLA_1_7_3_RELEASE
29
ifeq ($(MOZ_VERS),1.7.5) # it's still the same sdk
30
MOZSDK_VERS=MOZILLA_1_7_5_RELEASE
35
ifeq ($(MOZ_VERS),1.7.6) # it's still the same sdk
36
MOZSDK_VERS=MOZILLA_1_7_6_RELEASE
42
# TODO this could be generic matching algo
43
# cat ./extensions/enigmail/package/install.rdf | \
44
# grep \<em:id\> | head -n 1 | sed -e 's/^.*<em:id>\(.*\)<\/em:id>.*$/\1/'
46
patch-stamp.$(MOZ_APP_NAME):
47
-dpatch apply $(all_patches)
48
touch patch-stamp.$(MOZ_APP_NAME)
50
patch: setup-source patch-stamp.$(MOZ_APP_NAME)
53
-dpatch deapply $(all_patches)
56
rm -rf $(CURDIR)/build-dir
57
rm -f $(CURDIR)/setup-source.stamp
58
rm -rf $(CURDIR)/debian/patched
60
setup-source: setup-source.stamp
63
mkdir -p $(CURDIR)/build-dir/
64
tar -C $(CURDIR)/build-dir/ -xzvf archives/mozsdk-$(MOZSDK_VERS).tar.gz
65
tar -C $(CURDIR)/build-dir/mozilla/extensions -xvzf \
66
archives/enigmail-$(ENIG_VERS).tar.gz
67
tar -C $(CURDIR)/build-dir/mozilla/extensions -xvzf archives/ipc-$(IPC_VERS).tar.gz
68
touch setup-source.stamp
70
build: setup-source patch $(CURDIR)/build-dir/mozilla/build-stamp
72
$(CURDIR)/build-dir/mozilla/build-stamp:
73
cp $(CURDIR)/debian/configure.sh.$(MOZSDK_VERS) $(CURDIR)/build-dir/mozilla/configure.sh
74
sh -c "cd build-dir/mozilla && autoconf && sh configure.sh"
75
sh -c "LD_LIBRARY_PATH=/usr/lib/mozilla/ && export LD_LIBRARY_PATH && make -C build-dir/mozilla"
76
touch $(CURDIR)/build-dir/mozilla/build-stamp
79
make -C build-dir/mozilla install DESTDIR=$(DESTDIR)
81
.PHONY: clean install build patch