Code

rules: Run 'make check'.
[pkg-ncmpc.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for ncmpc
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
30         ./configure --host=$(DEB_HOST_GNU_TYPE) \
31                         --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \
32                         --mandir=\$${prefix}/share/man \
33                         --disable-mini \
34                         --enable-wide \
35                         --enable-multibyte \
36                         --enable-locale \
37                         --enable-nls \
38                         --enable-colors \
39                         --enable-lirc \
40                         --enable-help-screen \
41                         --enable-mouse \
42                         --enable-artist-screen \
43                         --enable-search-screen \
44                         --enable-song-screen \
45                         --enable-key-screen \
46                         --enable-lyrics-screen \
47                         --enable-outputs-screen \
48                         --with-ncursesw \
49                         CFLAGS="$(CFLAGS)"
51 build: build-stamp
53 build-stamp: config.status
54         dh_testdir
55         
56         $(MAKE)
57         test -z '$(CHECK)' || make $(CHECK)
58         
59         touch build-stamp
61 clean:
62         dh_testdir
63         dh_testroot
64         rm -f build-stamp
65         
66         [ ! -f Makefile ] || $(MAKE) distclean
67         
68         dh_clean
70 install-indep:
71         dh_testdir
72         dh_testroot
73         dh_prep
74         dh_installdirs -i
75         
76         mkdir -p debian/ncmpc-lyrics/usr/lib/ncmpc/lyrics/
77         cp lyrics/* debian/ncmpc-lyrics/usr/lib/ncmpc/lyrics/
79 install-arch: build
80         dh_testdir
81         dh_testroot
82         dh_prep
83         dh_installdirs -a
84         
85         $(MAKE) install DESTDIR=$(CURDIR)/debian/ncmpc
86         
87         rm -rf debian/ncmpc/usr/lib/ncmpc/lyrics/
88         # fail if any of these directories is not empty
89         rmdir debian/ncmpc/usr/lib/ncmpc/
90         rmdir debian/ncmpc/usr/lib/
91         
92         mkdir debian/ncmpc/usr/share/doc/ncmpc/examples
93         mv debian/ncmpc/usr/share/doc/ncmpc/*.sample \
94                 debian/ncmpc/usr/share/doc/ncmpc/examples
95         mv debian/ncmpc/usr/share/doc/ncmpc/ncmpc.lirc \
96                 debian/ncmpc/usr/share/doc/ncmpc/examples
98 binary-indep: install-indep
99         dh_testdir
100         dh_testroot
101         dh_installchangelogs -i
102         dh_installdocs -A -i NEWS README AUTHORS
103         dh_compress -i
104         dh_fixperms -i
105         dh_installdeb -i
106         dh_gencontrol -i
107         dh_md5sums -i
108         dh_builddeb -i
110 binary-arch: build install-arch
111         dh_testdir
112         dh_testroot
113         dh_installchangelogs -a
114         dh_installdocs -A -a NEWS README
115         dh_installmenu -a
116         dh_link -a
117         dh_strip -a
118         dh_compress -a
119         dh_fixperms -a
120         dh_installdeb -a
121         dh_shlibdeps -a
122         dh_gencontrol -a
123         dh_md5sums -a
124         dh_builddeb -a
126 binary: binary-arch binary-indep
127 .PHONY: build clean binary-indep binary-arch binary install-indep install-arch