~ubuntu-branches/ubuntu/wily/lightning-sunbird/wily

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
119
#!/usr/bin/make -f

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_BUILD_ARCH  ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)

DEBIAN_VERSION := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\(.*\)$$/\1/ p')
DEBIAN_REV_CODE := $(shell echo $(DEBIAN_VERSION) | sed 's/^.*-\([0-9]*\)[^-]*$$/0\1/ ; s/^.*\(..\)$$/\1/')
DEBIAN_DATE := $(shell echo $(DEBIAN_VERSION) | sed 's/^.*cvs\([0-9]*\).*$$/\1/')

DEBIAN_MOZ_UPSTREAM_VERSION := $(shell dpkg-parsechangelog | sed -n 's/^Version: \([0-9.]*\).*$$/\1/ p')

DEBIAN_MOZ_SOURCE_VERSION := $(shell echo $(DEBIAN_VERSION) | sed 's/^\(.*\)-[^-]*$$/\1/')
DEBIAN_MOZ_APPLICATION := $(shell dpkg-parsechangelog | sed -n 's/Source: \(.*\)$$/\1/ p')
DEBIAN_MOZ_UPSTREAM_APPLICATION ?= lightning-sunbird

DEB_TAR_SRCDIR		:= mozilla

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
        OPTFLAGS = -O0
else
        OPTFLAGS = -O2 -fno-strict-aliasing
endif

# we are modern and build with 4.2 everywhere
CXX=g++-4.2
CC=gcc-4.2
export CXX CC

OPTFLAGS += -g

#DEB_AUTO_UPDATE_DEBIAN_CONTROL=1
#DEB_AUTO_UPDATE_AUTOCONF=2.13

DEB_DH_INSTALL_ARGS_sunbird := -Xgnome -Ximgicon -Xmozlibthai
DEB_DH_INSTALL_ARGS_sunbird-dev :=

include /usr/share/cdbs/1/rules/tarball.mk
include $(CURDIR)/debian/cdbs-rules/debhelper.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
include /usr/share/cdbs/1/class/autotools.mk

export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1


DEB_CONFIGURE_USER_FLAGS= \
	--enable-application=calendar \
	--disable-strip \
	--disable-strip-libs \
        --enable-default-toolkit=gtk2 \
	--with-default-mozilla-five-home=/usr/lib/sunbird \
	--with-system-mng=/usr \
	--with-system-png=/usr \
	--with-system-jpeg=/usr \
	--with-system-zlib=/usr \
	--enable-optimize="-pipe -w $(OPTFLAGS)" \
	--enable-extensions=default,lightning,pref \
	--with-system-nspr \
	--with-system-nss \
	--enable-postscript \
	--enable-gnomevfs \
	--enable-libthai \
	--enable-system-cairo \
	--disable-debug \
	--with-distribution-id=com.ubuntu \
	--enable-official-branding

UUDECODE = \
	debsearch.gif \
	wikipedia.gif \
	$(NULL)

common-install-arch::
	set -e; mkdir -p debian/lightning-extension/usr/lib/lightning-extension \
		debian/calendar-google-provider/usr/lib/calendar-google-provider \
		debian/calendar-timezones/usr/lib/calendar-timezones; \
		sh -c "set -e; cd debian/lightning-extension/usr/lib/lightning-extension/; unzip $(CURDIR)/build-tree/mozilla/dist/xpi-stage/lightning.xpi"; \
		sh -c "set -e; cd debian/calendar-google-provider/usr/lib/calendar-google-provider/; unzip $(CURDIR)/build-tree/mozilla/dist/xpi-stage/gdata-provider.xpi"; \
		sh -c "set -e; cd debian/calendar-timezones/usr/lib/calendar-timezones/; unzip $(CURDIR)/build-tree/mozilla/dist/xpi-stage/calendar-timezones.xpi"

pre-build::
	set -e; for i in $(UUDECODE); do \
		uudecode -o debian/$$i debian/$$i.uu; \
		done; gcc -o debian/build-tools/obscure-tool debian/build-tools/obscure.c; \
		debian/build-tools/obscure-tool debian/sunbird.cfg.source debian/sunbird.cfg

clean::
	set -e; for i in $(UUDECODE); do \
		rm -f debian/$$i; \
		done; rm -f debian/build-tools/obscure-tool;
		rm -f debian/sunbird.cfg

common-install-arch:: common-install-impl
	set -e; . /etc/lsb-release; export DISTRIB_ID DISTRIB_RELEASE DISTRIB_CODENAME; $(CURDIR)/build-tree/mozilla/config/preprocessor.pl -E < $(CURDIR)/debian/vendor.js.in > $(CURDIR)/debian/tmp/usr/lib/sunbird/defaults/pref/vendor.js
	set -e; /usr/bin/convert -resize 48x48 $(CURDIR)/debian/tmp/usr/lib/sunbird/icons/mozicon128.png $(CURDIR)/debian/tmp/usr/lib/sunbird/icons/mozicon50.png

$(DEBIAN_MOZ_UPSTREAM_APPLICATION)-$(DEBIAN_MOZ_UPSTREAM_VERSION)+nobinonly-source.tar.bz2: $(DEBIAN_MOZ_UPSTREAM_APPLICATION)-$(DEBIAN_MOZ_UPSTREAM_VERSION)-source.tar.bz2
	set -e; rm -rf tmp1/; mkdir tmp1/; tar -C tmp1/ -xjf $<; cd tmp1/mozilla/; \
		sh ../../debian/remove.binonly.sh; cd ../../; \
		tar -C tmp1/ -cjf $@ mozilla/

$(CURDIR)/../$(DEBIAN_MOZ_APPLICATION)_$(DEBIAN_MOZ_SOURCE_VERSION).orig.tar.gz: $(DEBIAN_MOZ_UPSTREAM_APPLICATION)-$(DEBIAN_MOZ_UPSTREAM_VERSION)+nobinonly-source.tar.bz2
	set -e; rm -rf $(DEBIAN_MOZ_APPLICATION)-$(DEBIAN_MOZ_SOURCE_VERSION); \
		mkdir $(DEBIAN_MOZ_APPLICATION)-$(DEBIAN_MOZ_SOURCE_VERSION); \
		cp $^ $(DEBIAN_MOZ_APPLICATION)-$(DEBIAN_MOZ_SOURCE_VERSION)/; \
		tar cvzf $@ $(DEBIAN_MOZ_APPLICATION)-$(DEBIAN_MOZ_SOURCE_VERSION)/$^ ; \
		rm -rf $(DEBIAN_MOZ_APPLICATION)-$(DEBIAN_MOZ_SOURCE_VERSION)

update-orig: $(CURDIR)/../$(DEBIAN_MOZ_APPLICATION)_$(DEBIAN_MOZ_SOURCE_VERSION).orig.tar.gz

echox:
	set -e; echo DEBIAN_MOZ_APPLICATION = $(DEBIAN_MOZ_APPLICATION); \
		echo DEBIAN_MOZ_SOURCE_VERSION = $(DEBIAN_MOZ_SOURCE_VERSION)

CFLAGS =
CXXFLAGS =