2 # debian/rules for LilyPond in Debian.
4 # This is free software; see the GNU General Public Licence
5 # version 2 or later for copying conditions. There is NO warranty.
7 # Currently maintained by Anthony Fok <foka@debian.org>
8 # for Debian GNU/Linux.
14 r_data = debian/$(package)-data
15 r_doc = debian/$(package)-doc
16 d = usr/share/doc/$(package)
18 # since I'm building this a few times on my 8-way machine, try to
20 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
21 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
22 MAKEFLAGS += -j$(NUMJOBS) CPU_COUNT=$(NUMJOBS)
27 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)
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)
38 export USER_CFLAGS = -DDEBIAN
39 export DEB_BUILD = yes
40 export MAILADDRESS = lilypond@packages.debian.org
42 # fontconfig blows chunks if it can't write $HOME; and some buildd's
43 # set it to a bogus value.
46 # Uncomment this to turn on verbose mode.
49 # This has to be exported to make some magic below work.
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'
62 # ignore test failures on architectures which aren't i386 or
63 # amd64 until we properly fix failures when /dev/tty doesn't
65 if dpkg-architecture -eamd64 || dpkg-architecture -ei386; then \
68 $(MAKE) test || true; \
73 build-doc: build build-doc-stamp
78 # unfortunatly, this does not work well with multiple processors
79 $(MAKE) -j1 doc WEB_TARGETS="offline"
88 rm -f build-stamp build-doc-stamp
89 [ ! -f Makefile ] || $(MAKE) web-clean
90 [ ! -f Makefile ] || $(MAKE) distclean
92 rm -f ./stepmake/bin/config.guess ./stepmake/bin/config.guess.sub ./stepmake/bin/config.sub
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
113 # Add here commands to install the package into debian/tmp.
114 $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
116 dh_install --sourcedir=debian/tmp --list-missing
118 # Build architecture-independent files here.
119 binary-indep: DH_OPTIONS=-i
120 binary-indep: build-doc install
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*
129 find $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html \
130 -type d -empty -delete
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
139 # mv $(r_data)/usr/share/lilypond/$(VERSION)/fonts/map/lilypond.map \
140 # $(r_data)/etc/texmf/dvips/lilypond.map
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
155 dh_pysupport /usr/share/lilypond/${VERSION}/python
157 dh_compress -X$(d)/html/
164 binary-arch: DH_OPTIONS=-s
165 binary-arch: build install
168 dh_installdocs AUTHORS.txt NEWS.txt README.txt \
173 dh_installchangelogs Documentation/misc/CHANGES* Documentation/misc/ChangeLog*
184 binary: binary-indep binary-arch
185 .PHONY: build clean install binary-indep binary-arch binary