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