Update to 2.0.0 tree from current Fremantle build
[opencv] / debian / rules
1 #!/usr/bin/make -f
2
3 #export DH_VERBOSE=1
4
5 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
6 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
7
8 confflags = --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
9 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
10   confflags += --build $(DEB_HOST_GNU_TYPE)
11 else
12   confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
13 endif
14
15 CFLAGS = -Wall -g
16 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
17         CFLAGS += -O0
18 else
19         CFLAGS += -O2 -g
20 endif
21 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
22         INSTALL_PROGRAM += -s
23 endif
24 ifneq (,$(CONCURRENCY_LEVEL))
25         MAKE_FLAGS += -j $(CONCURRENCY_LEVEL)
26 endif
27
28 PYTHON_CSPEC = /usr/include/python2.5/
29 PYTHON = /usr/bin/python2.5
30
31 config.status: configure
32         dh_testdir
33         QUILT_PATCHES=debian/patches quilt push -a || test $$? = 2
34         touch configure.in
35         touch aclocal.m4
36         touch configure
37         touch cvconfig.h.in
38         touch `find . -name Makefile.in`
39         touch stamp-h.in
40         CFLAGS="$(CFLAGS)" PYTHON_CSPEC="$(PYTHON_CSPEC)" PYTHON="$(PYTHON)" \
41                  ./configure $(confflags) --enable-static \
42                 --disable-optimization --disable-sse --without-1394libs \
43                 --disable-openmp --with-python
44
45 build: build-stamp
46 build-stamp: config.status
47         dh_testdir
48         $(MAKE) $(MAKE_FLAGS) CFLAGS="$(CFLAGS)" CXXFLAGS="$(CFLAGS)"
49         touch build-stamp
50
51 clean:
52         dh_testdir
53         dh_testroot
54         rm -f build-stamp 
55         [ ! -f Makefile ] || $(MAKE) distclean
56         rm -f tests/cv/src/lt-cvtest.lst tests/cv/src/lt-cvtest.sum
57         QUILT_PATCHES=debian/patches quilt pop -a -R || test $$? = 2
58         dh_clean
59         rm -rf stamp-h.in .pc
60
61 install: build
62         dh_testdir
63         dh_testroot
64         dh_clean -k 
65         dh_installdirs
66         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
67         # Move files around
68         mkdir -p debian/tmp/usr/share/doc/opencv-doc
69         # mv debian/tmp/usr/share/opencv/doc/* debian/tmp/usr/share/doc/opencv-doc/
70         mv debian/tmp/usr/share/opencv/readme.txt debian/tmp/usr/share/doc/opencv-doc/
71         mv debian/tmp/usr/share/opencv/samples debian/tmp/usr/share/doc/opencv-doc/examples
72         # Install files in their required packages
73         dh_install --sourcedir=debian/tmp --list-missing -Xlicense.txt -X.pyc -X.pyo
74
75 binary-indep: build install
76         dh_testdir
77         dh_testroot
78         dh_installchangelogs -i ChangeLog
79         dh_installdocs -i AUTHORS THANKS TODO debian/README.Debian
80         dh_installexamples -i
81         mv debian/opencv-doc/usr/share/doc/opencv-doc/examples/c/Makefile.debian debian/opencv-doc/usr/share/doc/opencv-doc/examples/c/Makefile
82         (cd debian/opencv-doc/usr/share/doc/opencv-doc/examples/python/; cp minidemo.py tmp ; echo '#!/usr/bin/python' >| minidemo.py ; cat tmp >> minidemo.py ; rm -f tmp)
83         #dh_install -p opencv-doc docs/*.rtf usr/share/doc/opencv-doc
84         #dh_install -p opencv-doc docs/*.pdf usr/share/doc/opencv-doc
85         #dh_install -p opencv-doc docs/*.htm usr/share/doc/opencv-doc/html
86         #dh_install -p opencv-doc docs/*.jpg usr/share/doc/opencv-doc/html
87         #dh_install -p opencv-doc docs/ref usr/share/doc/opencv-doc/html
88         dh_installman -i
89         dh_link -i
90         dh_strip -i
91         dh_compress -i -Xexamples
92         dh_fixperms -i
93         dh_installdeb -i
94         dh_gencontrol -i
95         dh_md5sums -i
96         dh_builddeb -i
97
98 binary-arch: build install
99         dh_testdir
100         dh_testroot
101         dh_installchangelogs -a ChangeLog
102         dh_installdocs -a AUTHORS THANKS TODO debian/README.Debian
103         dh_installexamples -a
104         dh_installman -a 
105         dh_link -a
106         dh_strip -a
107         dh_compress -a
108         dh_fixperms -a
109         dh_pysupport -a
110         dh_makeshlibs
111         dh_installdeb -a
112         dh_shlibdeps -a
113         dh_gencontrol -a
114         dh_md5sums -a
115         dh_builddeb -a
116
117 binary: binary-indep binary-arch
118 .PHONY: build clean binary-indep binary-arch binary install