]> git.donarmstrong.com Git - lilypond.git/blob - debian/rules
remove config.sub too
[lilypond.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for LilyPond in Debian.
3 #
4 # This is free software; see the GNU General Public Licence
5 # version 2 or later for copying conditions.  There is NO warranty.
6 #
7 # Currently maintained by Anthony Fok <foka@debian.org>
8 # for Debian GNU/Linux.
9
10 package = lilypond
11
12 SHELL = /bin/sh
13 r = debian/$(package)
14 r_data = debian/$(package)-data
15 r_doc = debian/$(package)-doc
16 d = usr/share/doc/$(package)
17
18 # since I'm building this a few times on my 8-way machine, try to
19 # build it faster
20 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
21     NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
22     MAKEFLAGS += -j$(NUMJOBS) CPU_COUNT=$(NUMJOBS)
23 endif
24
25
26 include VERSION
27 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)
28
29 # "main_memory = 263000" in /etc/texmf/texmf.cnf isn't large enough
30 # for latex to process standchen.dvi.latex, so adding extra_mem_* ...
31 # export extra_mem_top = 100000
32 # export extra_mem_bot = 100000
33 # But now, building lilypond.dvi requires increased pool_size (2002-02-18)
34 # export pool_size = 500000
35 # But now, it seems that none of the above is needed in 1.4.11  (2002-02-24)
36 export MODE = ljfour
37 export BDPI = 600
38 export USER_CFLAGS = -DDEBIAN
39 export DEB_BUILD = yes
40 export MAILADDRESS = lilypond@packages.debian.org
41
42 # fontconfig blows chunks if it can't write $HOME; and some buildd's
43 # set it to a bogus value.
44 export HOME = /tmp
45
46 # Uncomment this to turn on verbose mode.
47 #export DH_VERBOSE=1
48
49 # This has to be exported to make some magic below work.
50 export DH_OPTIONS
51
52 build: build-stamp
53 build-stamp:
54         dh_testdir
55
56         cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub ./stepmake/bin/
57         ./configure --disable-checking --enable-debugging \
58                 --prefix=/usr --enable-optimising \
59                 --infodir='$${prefix}/share/info' \
60                 --mandir='$${prefix}/share/man'
61         $(MAKE)
62         # ignore test failures on architectures which aren't i386 or
63         # amd64 until we properly fix failures when /dev/tty doesn't
64         # exist (#572290)
65         if dpkg-architecture -eamd64 || dpkg-architecture -ei386; then \
66                 $(MAKE) test; \
67         else \
68                 $(MAKE) test || true; \
69         fi;
70
71         touch build-stamp
72
73 build-doc: build build-doc-stamp
74 build-doc-stamp:
75         dh_testdir
76
77         # make html
78         # unfortunatly, this does not work well with multiple processors
79         $(MAKE) -j1 doc WEB_TARGETS="offline"
80         # make info
81         $(MAKE) info
82
83         touch build-doc-stamp
84
85 clean:
86         dh_testdir
87         dh_testroot
88         rm -f build-stamp build-doc-stamp
89         [ ! -f Makefile ] || $(MAKE) web-clean
90         [ ! -f Makefile ] || $(MAKE) distclean
91         rm -f lib/python
92         rm -f ./stepmake/bin/config.guess ./stepmake/bin/config.guess.sub ./stepmake/bin/config.sub
93
94         # Still not clean enough?  Let's use... BRUTE STRENGTH!  :-)
95         find . -type d -name 'out' -o -name 'out-www' | xargs rm -rf
96         rm -f buildscripts/*.pyc
97         rm -f lib/lilypond/python examples.html
98         rm -f debian/emacsen-startup
99         rm -f debian/lilypond1.7*.dirs debian/lilypond.dirs
100         rm -f debian/postinst debian/prerm debian/postrm
101         rm -f debian/lilypond-data.doc-base debian/lilypond.doc-base
102         rm -f GNUmakefile config.log config.make config.status config.hh
103
104         dh_clean
105
106 install: DH_OPTIONS=
107 install: build
108         dh_testdir
109         dh_testroot
110         dh_clean -k
111         dh_installdirs
112
113         # Add here commands to install the package into debian/tmp.
114         $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
115
116         dh_install --sourcedir=debian/tmp --list-missing
117
118 # Build architecture-independent files here.
119 binary-indep: DH_OPTIONS=-i
120 binary-indep: build-doc install
121         dh_testdir
122         dh_testroot
123         # Install LilyPond web documentation...
124         $(MAKE) install-doc prefix=$(CURDIR)/debian/lilypond-doc/usr/
125         # it installs a random dir-dep file for no reason
126         rm -f $(CURDIR)/debian/lilypond-doc/usr/share/info/*-dir-dep*
127
128         dh_installdocs
129         find $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html \
130                 -type d -empty -delete
131         dh_installemacsen
132
133         #find input \( -name '*.*ly' -o -name '*.abc' -o -name '*.tex' -o -name 'TODO' \) ! -regex '.*/out-www/.*' \
134         #       -exec cp -a --parents '{}' $(r_data)/$(d)/examples ';'
135         install -m 644 debian/xiao-haizi-guai-guai.ly debian/sakura-sakura.ly \
136                 $(r_data)/$(d)/examples
137         dh_installchangelogs
138
139 #       mv $(r_data)/usr/share/lilypond/$(VERSION)/fonts/map/lilypond.map \
140 #          $(r_data)/etc/texmf/dvips/lilypond.map
141
142         dh_link usr/share/lilypond/$(VERSION)/tex \
143                         usr/share/texmf/tex/lilypond \
144                 usr/share/lilypond/$(VERSION)/fonts/source \
145                         usr/share/texmf/fonts/source/public/lilypond \
146                 usr/share/lilypond/$(VERSION)/fonts/afm \
147                         usr/share/texmf/fonts/afm/public/lilypond \
148                 usr/share/lilypond/$(VERSION)/fonts/tfm \
149                         usr/share/texmf/fonts/tfm/public/lilypond \
150                 usr/share/lilypond/$(VERSION)/fonts/type1 \
151                         usr/share/texmf/fonts/type1/public/lilypond \
152                 etc/texmf/dvips/lilypond.map \
153                         usr/share/lilypond/$(VERSION)/dvips/lilypond.map
154
155         dh_pysupport /usr/share/lilypond/${VERSION}/python
156
157         dh_compress -X$(d)/html/
158         dh_fixperms
159         dh_installdeb
160         dh_gencontrol
161         dh_md5sums
162         dh_builddeb
163
164 binary-arch: DH_OPTIONS=-s
165 binary-arch: build install
166         dh_testdir
167         dh_testroot
168         dh_installdocs AUTHORS.txt NEWS.txt README.txt \
169                 DEDICATION THANKS 
170
171
172         dh_installemacsen
173         dh_installchangelogs Documentation/misc/CHANGES* Documentation/misc/ChangeLog*
174
175         dh_strip
176         dh_compress
177         dh_fixperms
178         dh_installdeb
179         dh_shlibdeps
180         dh_gencontrol
181         dh_md5sums
182         dh_builddeb
183
184 binary: binary-indep binary-arch
185 .PHONY: build clean install binary-indep binary-arch binary