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
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/
43 rm -rf $(CURDIR)/debian/tmp/usr/share/omf
44 rm -rf $(CURDIR)/debian/tmp/usr/share/doc/lilypond/html/input
46 ## we need to install only the png, jpg, css, ly and english html
47 ## files into the doc-html package, and only the english pdfs into the
48 ## doc-pdf package. Because dh_install doesn't support regexes, we'll
49 ## use find to replace the contents of the .install file before we
52 /bin/echo -e 'usr/share/doc/lilypond/html/*/*/*.ly\nusr/share/doc/lilypond/html/*/*/*.png' \
53 > $(CURDIR)/debian/lilypond-doc-html.install
54 /bin/echo -e 'usr/share/doc/lilypond/html/*/*/*.jpg\nusr/share/doc/lilypond/html/*/*/*.css' \
55 >> $(CURDIR)/debian/lilypond-doc-html.install
56 find $(CURDIR)/debian/tmp/ -type f \
57 -regex '.*usr/share/doc/lilypond/.*/[^\.]+.html' \
58 -printf '%P\n' >> $(CURDIR)/debian/lilypond-doc-html.install
59 /bin/echo -e ''> $(CURDIR)/debian/lilypond-doc-pdf.install
60 find $(CURDIR)/debian/tmp/ -type f \
61 -regex '.*usr/share/doc/lilypond/.*/[^\.]+.pdf' \
62 -printf '%P\n' >> $(CURDIR)/debian/lilypond-doc-pdf.install
63 find $(CURDIR)/debian/tmp/ -type f \
64 -regex '.*usr/share/doc/lilypond/.*/[^\.]+.preview.pdf' \
65 -printf '%P\n' >> $(CURDIR)/debian/lilypond-doc-pdf.install
66 dh_install --list-missing
70 dh_python2 usr/share/lilypond/2.16.0/python/
75 override_dh_installdocs:
77 for a in $(wildcard $(CURDIR)/debian/*.doc-base-special); do \
78 package=$$(basename $$a .doc-base-special); \
79 install -d debian/$$package/usr/share/doc-base \
80 install $$a debian/$$package/usr/share/doc-base/$$package; \
83 ## this rule will update debian/control and the per-language install
84 ## files; all of the files it generates/modifies should be included in
85 ## the Debian package and should not need to be regenerated or
88 perl debian/update_doc_packages