b8c607b3428d71f9ff7eea906821d5a5199d8a0c
[maemo-efl] / trunk / python-evas / debian / rules
1 #!/usr/bin/make -f
2
3 DEB_DESTDIR=$(CURDIR)/debian/tmp
4
5 PYVER=2.5
6 PYTHON=python$(PYVER)
7
8 DEB_BUILD_ARCH?=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
9
10 ifeq ($(DEB_BUILD_ARCH),armel)
11         COMMON_CFLAGS=-DNDEBUG=1 -fomit-frame-pointer -O2 -ffast-math -funsafe-math-optimizations -fno-math-errno -fsingle-precision-constant
12         N770_CFLAGS=-mcpu=arm926ej-s
13         N8x0_CFLAGS=-mfpu=vfp -mfloat-abi=softfp -mcpu=arm1136jf-s
14         ifneq ($(DEB_BUILD_OPTIONS),)
15                 ifneq (,$(findstring n8x0,$(DEB_BUILD_OPTIONS)))
16                         SPECIFIC_CFLAGS=$(N8x0_CFLAGS)
17                 else
18                         ifneq (,$(findstring n770,$(DEB_BUILD_OPTIONS)))
19                                 SPECIFIC_CFLAGS=$(N770_CFLAGS)
20                         endif
21                 endif
22         endif
23     ifeq ($(SPECIFIC_CFLAGS),)
24         ifeq (0,$(shell test -e /etc/osso_software_version; echo $$?))
25             SW_VERSION?=$(shell cat /etc/osso_software_version|cut -d_ -f2)
26                         ifneq (,$(findstring $(SW_VERSION),OSSO1.1 2008SE DIABLO))
27                                 SPECIFIC_CFLAGS=$(N8x0_CFLAGS)
28             endif
29                 endif
30         ifeq ($(SPECIFIC_CFLAGS),)
31             # Our last hope is to look at the value returned by `sb-conf current`
32             SB_CURRENT?=$(shell sb-conf current|cut -d_ -f1)
33                         ifneq (,$(findstring $(SB_CURRENT),GREGALE BORA CHINOOK DIABLO))
34                                 ifeq ($(SB_CURRENT),GREGALE)
35                                         SPECIFIC_CFLAGS=$(N770_CFLAGS)
36                                 else
37                                         SPECIFIC_CFLAGS=$(N8x0_CFLAGS)
38                                 endif
39                         else
40                                 COMMON_CFLAGS=
41                         endif
42         endif
43     endif
44 endif
45
46 CFLAGS+=$(COMMON_CFLAGS) $(SPECIFIC_CFLAGS)
47
48 build: build-stamp
49 build-stamp:
50         dh_testdir
51         touch evas/evas.*.pyx
52         CFLAGS="$(CFLAGS)" $(PYTHON) setup.py build_ext build
53         touch build-stamp
54 clean:
55         dh_testdir
56         dh_testroot
57         CFLAGS="$(CFLAGS)" $(PYTHON) setup.py clean
58         -rm -f build-stamp
59         -rm -rf build dist python_evas.egg-info
60         -rm -f evas/*.py[co]
61         -rm -f *.py[co]
62         dh_clean
63
64 install: build
65         dh_testdir
66         dh_testroot
67         dh_installdirs
68         CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install --root=$(DEB_DESTDIR) install_headers -d $(DEB_DESTDIR)/usr/include/$(PYTHON)
69         if [ "x$(DEB_BUILD_ARCH)" = "xarmel" ]; then \
70                 rm -rf $(DEB_DESTDIR)/usr/lib/$(PYTHON)/site-packages/evas/*.py; \
71                 rm -rf $(DEB_DESTDIR)/usr/lib/$(PYTHON)/site-packages/evas/*.pyc; \
72         fi
73         dh_install --sourcedir=$(DEB_DESTDIR) --fail-missing
74
75 binary: binary-arch
76 binary-arch: build install
77         dh_testdir
78         dh_testroot
79         dh_installdocs
80         dh_installdebconf
81         dh_installchangelogs
82         dh_strip
83         dh_compress
84         dh_fixperms
85         dh_makeshlibs
86         dh_installdeb
87         dh_shlibdeps
88         dh_gencontrol
89         dh_md5sums
90         dh_builddeb
91
92 .PHONY: build install clean binary binary-arch