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.
8 export MAILADDRESS = lilypond@packages.debian.org
10 # fontconfig blows chunks if it can't write to $HOME; and some
11 # buildds set it to a bogus value.
14 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
15 CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
16 CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
17 ifneq (,$(filter $(DEB_HOST_ARCH), i386 kfreebsd-i386))
18 config_opt = --disable-optimising
19 CFLAGS := $(filter-out -O%, $(CFLAGS))
20 CXXFLAGS := $(filter-out -O%, $(CXXFLAGS))
22 config_opt = --enable-optimising
25 DOC_OPTIONS := WEB_TARGETS="offline"
26 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
27 DOC_OPTIONS := $(DOC_OPTIONS) $(DEB_BUILD_OPTIONS) CPU_COUNT=$(firstword $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))))
31 dh $@ --parallel --with-autotools-dev --with-python2 --list-missing
34 override_dh_auto_configure:
35 dh_auto_configure -- --disable-checking --enable-debugging $(config_opt)
37 override_dh_auto_build-indep:
39 $(MAKE) $(DOC_OPTIONS) doc
41 override_dh_auto_install-indep:
42 $(MAKE) install-doc prefix=$(CURDIR)/debian/tmp/usr/
44 ## we need to install only the png, ly and english html files into the
45 ## doc-html package, and only the english pdfs into the doc-pdf
46 ## package. Because dh_install doesn't support regexes, we'll use find
47 ## to replace the contents of the .install file before we call
50 echo -e 'usr/share/doc/lilypond/html/*/*/*.ly\nusr/share/doc/lilypond/html/*/*/*.png' \
51 > $(CURDIR)/debian/lilypond-doc-html.install
52 find $(CURDIR)/debian/tmp/ -type f \
53 -regex '.*usr/share/doc/lilypond/.*/[^\.]+.html' \
54 -printf '%P\n' >> $(CURDIR)/debian/lilypond-doc-html.install
55 echo -e ''> $(CURDIR)/debian/lilypond-doc-pdf.install
56 find $(CURDIR)/debian/tmp/ -type f \
57 -regex '.*usr/share/doc/lilypond/.*/[^\.]+.pdf' \
58 -printf '%P\n' >> $(CURDIR)/debian/lilypond-doc-pdf.install
62 ## this rule will update debian/control and the per-language install
63 ## files; all of the files it generates/modifies should be included in
64 ## the Debian package and should not need to be regenerated or
67 perl debian/update_doc_packages
70 ## # Build architecture-independent files here.
71 ## binary-indep: DH_OPTIONS=-i
72 ## binary-indep: build-doc install
75 ## # Install LilyPond web documentation...
76 ## $(MAKE) install-doc prefix=$(CURDIR)/debian/lilypond-doc/usr/
77 ## # it installs a random dir-dep file for no reason
78 ## rm -f $(CURDIR)/debian/lilypond-doc/usr/share/info/*-dir-dep*
82 ## # remove the useless offline-root directory
83 ## mv $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html/offline-root/* \
84 ## $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html/.;
85 ## rmdir $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html/offline-root;
86 ## find $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html \
87 ## -type d -empty -delete
90 ## install -m 644 debian/xiao-haizi-guai-guai.ly debian/sakura-sakura.ly \
91 ## $(r_data)/$(d)/examples
92 ## dh_installchangelogs
94 ## dh_link usr/share/lilypond/$(VERSION)/tex \
95 ## usr/share/texmf/tex/lilypond \
96 ## usr/share/lilypond/$(VERSION)/fonts/source \
97 ## usr/share/texmf/fonts/source/public/lilypond \
98 ## usr/share/lilypond/$(VERSION)/fonts/type1 \
99 ## usr/share/texmf/fonts/type1/public/lilypond \
101 ## dh_pysupport /usr/share/lilypond/${VERSION}/python
103 ## dh_compress -X$(d)/html/
110 ## binary-arch: DH_OPTIONS=-s
111 ## binary-arch: build install
114 ## dh_installdocs AUTHORS.txt NEWS.txt README.txt \
119 ## dh_installchangelogs Documentation/misc/CHANGES* Documentation/misc/ChangeLog*
122 ## dh_pysupport /usr/share/lilypond/${VERSION}/python