1 #! /usr/bin/make -f
2 # debian/rules for libmpdclient
3 #
4 # Written by Sebastian Harl <tokkee@debian.org>
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
9 # These are used for cross-compiling and for saving the configure script
10 # from having to guess our platform (since we know it already)
11 include /usr/share/dpkg/architecture.mk
13 CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
14 CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
15 CFLAGS += -Wall -g
17 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
18 CFLAGS += -O0
19 else
20 CFLAGS += -O2
21 endif
23 CHECK = check
25 ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
26 CHECK =
27 endif
29 config.status: configure
30 dh_testdir
31 dh_autotools-dev_updateconfig
33 ./configure \
34 --host=$(DEB_HOST_GNU_TYPE) \
35 --build=$(DEB_BUILD_GNU_TYPE) \
36 --prefix=/usr \
37 --mandir=\$${prefix}/share/man \
38 --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
39 CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)"
41 build: build-arch build-indep
43 build-arch: build-stamp
44 build-indep: build-stamp
46 build-stamp: config.status
47 dh_testdir
49 $(MAKE)
50 test -z '$(CHECK)' || make $(CHECK)
52 touch build-stamp
54 clean:
55 dh_testdir
56 dh_testroot
57 rm -f build-stamp
59 [ ! -f Makefile ] || $(MAKE) distclean
61 dh_autotools-dev_restoreconfig
62 dh_clean
64 install: build
65 dh_testdir
66 dh_testroot
67 dh_prep
68 dh_installdirs
70 $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
72 # we do not want .la files in Debian
73 rm -f debian/tmp/usr/lib/*/libmpdclient.la
75 # these files do not include any useful content
76 rm -f debian/tmp/usr/share/doc/libmpdclient/README
77 rm -f debian/tmp/usr/share/doc/libmpdclient/COPYING
79 # install that file as changelog instead
80 rm -f debian/tmp/usr/share/doc/libmpdclient/NEWS
82 dh_install --sourcedir=debian/tmp --fail-missing
83 dh_lintian
85 binary-indep: build install
86 dh_testdir
87 dh_testroot
88 dh_installchangelogs -i NEWS
89 dh_installdocs -i -A AUTHORS
90 dh_compress -i
91 dh_fixperms -i
92 dh_installdeb -i
93 dh_gencontrol -i
94 dh_md5sums -i
95 dh_builddeb -i
97 binary-arch: build install
98 dh_testdir
99 dh_testroot
100 dh_installchangelogs -a NEWS
101 dh_installdocs -a -A AUTHORS
102 dh_link -a
103 dh_strip -a --dbg-package=libmpdclient2-dbg
104 dh_compress -a
105 dh_fixperms -a
106 dh_makeshlibs -a -V 'libmpdclient2 (>= 2.2)'
107 dh_installdeb -a
108 dh_shlibdeps -a
109 dh_gencontrol -a
110 dh_md5sums -a
111 dh_builddeb -a
113 binary: binary-indep binary-arch
114 .PHONY: build clean binary-indep binary-arch binary install