Switch to dh_python2.
[abartlet/talloc-debian.git] / debian / rules
1 #!/usr/bin/make -f
2
3 CFLAGS = -g -Wall
4
5 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
6 CFLAGS += -O0
7 else
8 CFLAGS += -O2
9 endif
10
11 LDFLAGS += -Wl,--as-needed
12
13 DESTDIR=$(CURDIR)/debian/tmp
14
15 conf_args = --prefix=/usr --disable-rpath-install --disable-rpath --bundled-libraries=NONE
16 conf_args += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
17
18 configure: configure-stamp
19 configure-stamp:
20         dh_testdir
21         CFLAGS="$(CFLAGS)" ./configure $(conf_args)
22         touch configure-stamp
23
24 build: configure build-stamp
25 build-stamp:
26         dh_testdir
27         $(MAKE) all
28 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
29         LD_LIBRARY_PATH=bin/shared ./bin/talloc_testsuite
30 endif
31         touch build-stamp
32
33 get-orig-source:
34         ./debian/build-orig.sh
35
36 clean:
37         dh_testdir
38         dh_testroot
39         rm -f build-stamp configure-stamp
40         [ ! -f Makefile ] || $(MAKE) distclean
41         rm -f buildtools/wafsamba/*.pyc
42         rm -rf buildtools/bin/.waf*
43         dh_clean
44
45 install: build
46         dh_testdir
47         dh_testroot
48         dh_prep
49         dh_installdirs
50         mkdir -p $(DESTDIR)`swig -swiglib`
51         $(MAKE) install DESTDIR=$(DESTDIR)
52         # Waf really should be doing this:
53         ar -rc libtalloc.a bin/default/talloc_*.o
54         cp libtalloc.a $(DESTDIR)/usr/lib
55         dh_install --list-missing --fail-missing --sourcedir=$(DESTDIR)
56
57 # Build architecture-dependent files here.
58 # Pass -a to all debhelper commands in this target to reduce clutter.
59 binary-arch: DH_OPTIONS=-a
60 binary-arch: build install
61         dh_testdir
62         dh_testroot
63         dh_installdocs
64         dh_installchangelogs 
65         dh_strip
66         dh_link
67         dh_compress
68         dh_fixperms
69         dh_makeshlibs -- -c4
70         dh_python2
71         dh_installdeb
72         dh_shlibdeps
73         dh_gencontrol
74         dh_md5sums
75         dh_builddeb
76
77 binary-indep:
78
79 binary: binary-arch binary-indep
80 .PHONY: build clean binary-arch binary install configure