rules: Let dh_makeshlibs create a dependency on libmpdclient2 >= 2.2.
[libmpdclient-debian.git] / debian / rules
1 #! /usr/bin/make -f
2 # debian/rules for libmpdclient
3 #
4 # Written by Sebastian Harl <tokkee@debian.org>
5
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
8
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)
13
14 CFLAGS = -Wall -g
15
16 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
17         CFLAGS += -O0
18 else
19         CFLAGS += -O2
20 endif
21
22 CHECK = check
23
24 ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
25         CHECK =
26 endif
27
28 config.status: configure
29         dh_testdir
30         
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)"
37
38 build: build-stamp
39
40 build-stamp: config.status
41         dh_testdir
42         
43         $(MAKE)
44         test -z '$(CHECK)' || make $(CHECK)
45         
46         touch build-stamp
47
48 clean:
49         dh_testdir
50         dh_testroot
51         rm -f build-stamp
52         
53         [ ! -f Makefile ] || $(MAKE) distclean
54         
55         dh_clean
56
57 install: build
58         dh_testdir
59         dh_testroot
60         dh_prep
61         dh_installdirs
62         
63         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
64         
65         # we do not want .la files in Debian
66         rm -f debian/tmp/usr/lib/libmpdclient.la
67         
68         # these files do not include any useful content
69         rm -f debian/tmp/usr/share/doc/libmpdclient/README
70         rm -f debian/tmp/usr/share/doc/libmpdclient/COPYING
71         
72         # install that file as changelog instead
73         rm -f debian/tmp/usr/share/doc/libmpdclient/NEWS
74         
75         dh_install --sourcedir=debian/tmp --fail-missing
76
77 binary-indep: build install
78         dh_testdir
79         dh_testroot
80         dh_installchangelogs -i NEWS
81         dh_installdocs -i -A AUTHORS
82         dh_compress -i
83         dh_fixperms -i
84         dh_installdeb -i
85         dh_gencontrol -i
86         dh_md5sums -i
87         dh_builddeb -i
88
89 binary-arch: build install
90         dh_testdir
91         dh_testroot
92         dh_installchangelogs -a NEWS
93         dh_installdocs -a -A AUTHORS
94         dh_link -a
95         dh_strip -a --dbg-package=libmpdclient2-dbg
96         dh_compress -a
97         dh_fixperms -a
98         dh_makeshlibs -a -V 'libmpdclient2 (>= 2.2)'
99         dh_installdeb -a
100         dh_shlibdeps -a
101         dh_gencontrol -a
102         dh_md5sums -a
103         dh_builddeb -a
104
105 binary: binary-indep binary-arch
106 .PHONY: build clean binary-indep binary-arch binary install
107