Code

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