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