Code

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