afb24cdd1de7cf9b74613a0d6db25ab168d3382a
[maemo-efl] / trunk / python-edje / debian / rules
1 #!/usr/bin/make -f
2
3 PYVER=2.5
4 PYTHON=python$(PYVER)
5
6 p_base=$(PYTHON)-edje
7 d_base=debian/$(p_base)
8
9 DEB_BUILD_ARCH  ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
10
11 ifneq (,$(findstring armel,$(DEB_BUILD_ARCH)))
12     CFLAGS += -DNDEBUG=1 -fomit-frame-pointer -O2 -ffast-math -funsafe-math-optimizations -fno-math-errno -fsingle-precision-constant
13     ifneq (,$(findstring n8x0,$(DEB_BUILD_OPTIONS)))
14         CFLAGS += -mfpu=vfp -mfloat-abi=softfp -mcpu=arm1136jf-s
15     endif
16     ifneq (,$(findstring n770,$(DEB_BUILD_OPTIONS)))
17          CFLAGS += -mcpu=arm926ej-s
18     endif
19 endif
20
21 build: build-stamp
22 build-stamp:
23         dh_testdir
24         touch edje/edje.*.pyx
25         CFLAGS="$(CFLAGS)" $(PYTHON) setup.py build_ext build install --prefix /usr install_headers
26         touch build-stamp
27         cd $(CURDIR)/examples/evas-demo/01-app_launcher && \
28                 edje_cc 01-app_launcher.edc $(CURDIR)/debian/01-app_launcher.edj
29         cd $(CURDIR)/examples/evas-demo/02-vkbd && \
30                         edje_cc 02-vkbd.edc $(CURDIR)/debian/02-vkbd.edj
31
32 clean:
33         dh_testdir
34         dh_testroot
35         CFLAGS="$(CFLAGS)" $(PYTHON) setup.py clean
36         -rm -f build-stamp
37         -rm -rf build dist python_edje.egg-info
38         -rm -f edje/*.py[co]
39         -rm -f *.py[co]
40         -rm -f debian/*.edj
41         dh_clean
42
43 install: build
44         dh_testdir
45         dh_testroot
46         dh_installdirs
47         CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install --root=$(d_base)
48         if [ "x$(DEB_BUILD_ARCH)" = "xarmel" ]; then \
49                 rm -rf $(d_base)/usr/lib/$(PYTHON)/site-packages/edje/*.py; \
50                 rm -rf $(d_base)/usr/lib/$(PYTHON)/site-packages/edje/*.pyc; \
51         fi
52
53 binary: binary-indep binary-arch
54 binary-indep: install
55 binary-arch: install
56         dh_testdir
57         dh_testroot
58         dh_install
59         dh_strip
60         dh_fixperms
61         dh_makeshlibs
62         dh_installdeb
63         dh_shlibdeps
64         dh_gencontrol
65         dh_md5sums
66         dh_builddeb
67
68 .PHONY: build install clean binary binary-indep binary-arch