2.0 init
[external/libsndfile.git] / debian / rules
1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
4
5 # Uncomment this to turn on verbose mode.
6 #export DH_VERBOSE=1
7
8 # These are used for cross-compiling and for saving the configure script
9 # from having to guess our platform (since we know it already)
10 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
11 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
12
13
14 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
15         CFLAGS += -g
16 endif
17 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
18         INSTALL_PROGRAM += -s
19 endif
20
21 config.status: configure
22         dh_testdir
23         #autoreconf -f
24         #./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
25         ./configure --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
26
27
28 build: build-stamp
29 build-stamp: config.status
30         dh_testdir
31
32         $(MAKE)
33
34         # Failure in test suite must cause a build failure.
35         $(MAKE) check
36
37         touch build-stamp
38
39 clean:
40         dh_testdir
41         dh_testroot
42         rm -f build-stamp
43
44         [ ! -f Makefile ] || $(MAKE) distclean
45
46         dh_clean -a
47
48 install: build
49         dh_testdir
50         dh_testroot
51         #dh_prep -a
52         dh_installdirs
53
54         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
55
56         set -e; for FILE in debian/tmp/usr/lib/*.la; \
57         do \
58                 sed -i "/dependency_libs/ s/'.*'/''/" $$FILE; \
59         done
60
61 binary-indep: build install
62
63 binary-arch: build install
64         dh_testdir
65         dh_testroot
66         dh_install -a --sourcedir=debian/tmp --list-missing
67
68         # This line can be removed when these man pages get pushed upstream.
69         dh_installman -psndfile-programs debian/sndfile-interleave.1
70         dh_link -psndfile-programs usr/share/man/man1/sndfile-interleave.1 usr/share/man/man1/sndfile-deinterleave.1
71
72         dh_installdocs -a
73         dh_installexamples -a
74         dh_installchangelogs -a ChangeLog
75         dh_strip -a
76         dh_compress -a
77         dh_fixperms -a
78         dh_makeshlibs -plibsndfile1
79         dh_installdeb -a
80         dh_shlibdeps -plibsndfile1
81         dh_shlibdeps -psndfile-programs -ldebian/tmp/usr/lib
82         dh_gencontrol -a
83         dh_md5sums -a
84         dh_builddeb -a
85
86 binary: binary-indep binary-arch
87 .PHONY: build clean binary-indep binary-arch binary install