17dd01c6e40795e392edcd7ab03067f77f80b416
[maemo-efl] / trunk / python-efl_utils / debian / rules
1 #!/usr/bin/make -f
2
3 PYVER=2.5
4 PYTHON=python$(PYVER)
5
6 p_base=$(PYTHON)-efl-utils
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         CFLAGS="$(CFLAGS)" $(PYTHON) setup.py build_ext build install --prefix /usr install_headers
25         touch build-stamp
26 clean:
27         dh_testdir
28         dh_testroot
29         CFLAGS="$(CFLAGS)" $(PYTHON) setup.py clean
30         -rm -f build-stamp
31         -rm -rf build dist python_efl_utils.egg-info
32         -rm -f efl_utils/*.py[co]
33         -rm -f *.py[co]
34         dh_clean
35
36 install: build
37         dh_testdir
38         dh_testroot
39         dh_installdirs
40         CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install --root=$(d_base)
41         if [ "x$(DEB_BUILD_ARCH)" = "xarmel" ]; then \
42                 rm -rf $(d_base)/usr/lib/$(PYTHON)/site-packages/efl_utils/*.py; \
43                 rm -rf $(d_base)/usr/lib/$(PYTHON)/site-packages/efl_utils/*.pyc; \
44         fi
45
46 binary: binary-arch binary-indep
47 binary-arch: build install
48 binary-indep: build install
49         dh_testdir
50         dh_testroot
51         dh_strip
52         dh_fixperms
53         dh_makeshlibs
54         dh_installdeb
55         dh_shlibdeps
56         dh_gencontrol
57         dh_md5sums
58         dh_builddeb
59
60 .PHONY: build install clean binary binary-arch binary-indep