Update the trunk to the OpenCV's CVS (2008-07-14)
[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
25 config.status: configure
26         dh_testdir
27         touch configure.in
28         touch aclocal.m4
29         touch configure
30         touch cvconfig.h.in
31         touch `find . -name Makefile.in`
32         touch stamp-h.in
33         CFLAGS="$(CFLAGS)" ./configure $(confflags) --enable-static --without-python --with-apps
34
35 build: build-stamp
36 build-stamp: config.status
37         dh_testdir
38         $(MAKE) CFLAGS="$(CFLAGS)" CXXFLAGS="$(CFLAGS)"
39         touch build-stamp
40
41 clean:
42         dh_testdir
43         dh_testroot
44         rm -f build-stamp 
45         -$(MAKE) distclean
46         rm -f tests/cv/src/lt-cvtest.lst tests/cv/src/lt-cvtest.sum
47         dh_clean 
48
49 install: build
50         dh_testdir
51         dh_testroot
52         dh_clean -k 
53         dh_installdirs
54         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
55         # Move files around
56         mkdir -p debian/tmp/usr/share/doc/opencv-doc
57         mv debian/tmp/usr/share/opencv/doc/* debian/tmp/usr/share/doc/opencv-doc/
58         mv debian/tmp/usr/share/opencv/readme.txt debian/tmp/usr/share/doc/opencv-doc/
59         mv debian/tmp/usr/share/opencv/samples debian/tmp/usr/share/doc/opencv-doc/examples
60         # Remove useless files
61         rm -f `find debian/tmp -name license.txt`
62         rm -f `find debian/tmp -name '*.py[co]'`
63         # Install files in their required packages
64         dh_install --sourcedir=debian/tmp --list-missing
65
66 binary-indep: build install
67         dh_testdir
68         dh_testroot
69         dh_installchangelogs -i ChangeLog
70         dh_installdocs -i AUTHORS THANKS TODO
71         dh_installexamples -p opencv-doc samples/c/*.c samples/c/*.png samples/c/*.jpg
72         #dh_install -p opencv-doc docs/*.rtf usr/share/doc/opencv-doc
73         #dh_install -p opencv-doc docs/*.pdf usr/share/doc/opencv-doc
74         #dh_install -p opencv-doc docs/*.htm usr/share/doc/opencv-doc/html
75         #dh_install -p opencv-doc docs/*.jpg usr/share/doc/opencv-doc/html
76         #dh_install -p opencv-doc docs/ref usr/share/doc/opencv-doc/html
77 #       dh_install
78 #       dh_installmenu
79 #       dh_installdebconf       
80 #       dh_installlogrotate
81 #       dh_installemacsen
82 #       dh_installpam
83 #       dh_installmime
84 #       dh_installinit
85 #       dh_installcron
86 #       dh_installinfo
87         dh_installman -i
88         dh_link -i
89         dh_strip -i
90         dh_compress -i -Xexamples
91         dh_fixperms -i
92 #       dh_perl
93 #       dh_python
94 #       dh_makeshlibs
95         dh_installdeb -i
96 #       dh_shlibdeps -i
97         dh_gencontrol -i
98         dh_md5sums -i
99         dh_builddeb -i
100
101 binary-arch: build install
102         dh_testdir
103         dh_testroot
104         dh_installchangelogs -a ChangeLog
105         dh_installdocs -a AUTHORS THANKS TODO
106         dh_installexamples -a
107 #       dh_install
108 #       dh_installmenu
109 #       dh_installdebconf       
110 #       dh_installlogrotate
111 #       dh_installemacsen
112 #       dh_installpam
113 #       dh_installmime
114 #       dh_installinit
115 #       dh_installcron
116 #       dh_installinfo
117         dh_installman -p libcv-dev debian/opencv-config.1
118         dh_link -a
119         dh_strip -a
120         dh_compress -a
121         dh_fixperms -a
122 #       dh_perl
123         dh_makeshlibs
124         dh_installdeb -a
125         dh_shlibdeps -a
126         dh_gencontrol -a
127         dh_md5sums -a
128         dh_builddeb -a
129
130 binary: binary-indep binary-arch
131 .PHONY: build clean binary-indep binary-arch binary install