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 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
14 CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
15 CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
16 CFLAGS += -Wall -g
18 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
19 CFLAGS += -O0
20 else
21 CFLAGS += -O2
22 endif
24 CHECK = check
26 ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
27 CHECK =
28 endif
30 config.status: configure
31 dh_testdir
33 ./configure \
34 --host=$(DEB_HOST_GNU_TYPE) \
35 --build=$(DEB_BUILD_GNU_TYPE) \
36 --prefix=/usr \
37 --mandir=\$${prefix}/share/man \
38 CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)"
40 build: build-arch build-indep
42 build-arch: build-stamp
43 build-indep: build-stamp
45 build-stamp: config.status
46 dh_testdir
48 $(MAKE)
49 test -z '$(CHECK)' || make $(CHECK)
51 touch build-stamp
53 clean:
54 dh_testdir
55 dh_testroot
56 rm -f build-stamp
58 [ ! -f Makefile ] || $(MAKE) distclean
60 dh_clean
62 install: build
63 dh_testdir
64 dh_testroot
65 dh_prep
66 dh_installdirs
68 $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
70 # we do not want .la files in Debian
71 rm -f debian/tmp/usr/lib/libmpdclient.la
73 # these files do not include any useful content
74 rm -f debian/tmp/usr/share/doc/libmpdclient/README
75 rm -f debian/tmp/usr/share/doc/libmpdclient/COPYING
77 # install that file as changelog instead
78 rm -f debian/tmp/usr/share/doc/libmpdclient/NEWS
80 dh_install --sourcedir=debian/tmp --fail-missing
82 binary-indep: build install
83 dh_testdir
84 dh_testroot
85 dh_installchangelogs -i NEWS
86 dh_installdocs -i -A AUTHORS
87 dh_compress -i
88 dh_fixperms -i
89 dh_installdeb -i
90 dh_gencontrol -i
91 dh_md5sums -i
92 dh_builddeb -i
94 binary-arch: build install
95 dh_testdir
96 dh_testroot
97 dh_installchangelogs -a NEWS
98 dh_installdocs -a -A AUTHORS
99 dh_link -a
100 dh_strip -a --dbg-package=libmpdclient2-dbg
101 dh_compress -a
102 dh_fixperms -a
103 dh_makeshlibs -a -V 'libmpdclient2 (>= 2.2)'
104 dh_installdeb -a
105 dh_shlibdeps -a
106 dh_gencontrol -a
107 dh_md5sums -a
108 dh_builddeb -a
110 binary: binary-indep binary-arch
111 .PHONY: build clean binary-indep binary-arch binary install