Code

rules: Split build target into build-arch and build-indep.
[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-chat-screen \
44                         --enable-search-screen \
45                         --enable-song-screen \
46                         --enable-key-screen \
47                         --enable-lyrics-screen \
48                         --enable-outputs-screen \
49                         --enable-documentation \
50                         --with-ncursesw \
51                         CFLAGS="$(CFLAGS)"
53 build: build-arch build-indep
54 build-indep:
55 build-arch: 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:
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