]> git.donarmstrong.com Git - lilypond.git/blob - debian/rules
Revert previous patch (no parallel); the issue was actually running tests on architec...
[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
8 include VERSION
9
10 export MAILADDRESS = lilypond@packages.debian.org
11
12 # fontconfig blows chunks if it can't write to $HOME; and some
13 # buildds set it to a bogus value.
14 export HOME = /tmp
15
16 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
17 CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
18 CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
19 ifneq (,$(filter $(DEB_HOST_ARCH), i386 kfreebsd-i386))
20   config_opt = --disable-optimising
21   CFLAGS := $(filter-out -O%, $(CFLAGS))
22   CXXFLAGS := $(filter-out -O%, $(CXXFLAGS))
23 else
24 ifneq (,$(filter $(DEB_BUILD_OPTIONS),noopt))
25   config_opt = --disable-optimising
26 else
27   config_opt = --enable-optimising
28 endif
29 endif
30
31 DOC_OPTIONS := WEB_TARGETS="offline"
32 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
33         DOC_OPTIONS := $(DOC_OPTIONS) CPU_COUNT=$(firstword $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))))
34 endif
35
36 %:
37         dh $@ --parallel --with autotools-dev --with python2 --with quilt
38
39 ## we need to nuke the parser files, because if there is a mistmatch
40 ## between upstreams bison and our bison, the build will fail epically
41 override_dh_auto_configure:
42         rm -f lily/out/parser.*
43         dh_auto_configure -- --disable-checking --enable-debugging $(config_opt)
44
45 override_dh_auto_build-indep:
46         dh_auto_build
47         $(MAKE) doc $(DOC_OPTIONS)
48
49 override_dh_auto_install-indep:
50         $(MAKE) install-doc $(DOC_OPTIONS) prefix=$(CURDIR)/debian/tmp/usr/
51         $(MAKE) install-info $(DOC_OPTIONS) prefix=$(CURDIR)/debian/tmp/usr
52         rm -rf $(CURDIR)/debian/tmp/usr/share/omf
53         rm -rf $(CURDIR)/debian/tmp/usr/share/doc/lilypond/html/input
54         perl debian/move_info_images_from_html_doc $(CURDIR)/debian/tmp/usr/share/info/ $(CURDIR)/debian/tmp/usr/share/doc/lilypond/html/Documentation/
55         perl debian/symlink_html_images_to_info_images $(CURDIR)/debian/tmp/usr/share/info/lilypond
56         perl debian/remove_w3c_callback $(CURDIR)/debian/tmp/usr/share/doc/lilypond/ $(CURDIR)/debian/tmp/usr/share/info/
57
58 ## Unfortunately, lilypond is kind of broken, and installs the wrong
59 ## info documentation (missing images) if we call their makefile
60 ## directly. They also don't provide an install rule which doesn't
61 ## install the documentation, which we don't care about for the
62 ## architecture dependent build
63 override_dh_auto_install-arch:
64         for dir in `echo */*makefile|xargs -n 1 dirname|grep -v Documentation`; do \
65                 $(MAKE) --no-builtin-rules PACKAGE=LILYPOND package=lilypond -C $$dir install $(DOC_OPTIONS) prefix=$(CURDIR)/debian/tmp/usr/; \
66         done;
67
68 ## we need to nuke the parser files, because if there is a mistmatch
69 ## between upstreams bison and our bison, the build will fail epically
70 override_dh_auto_clean:
71         rm -f lily/out/parser.*
72         dh_auto_clean
73
74 ## we need to install only the png, jpg, css, ly and english html
75 ## files into the doc-html package, and only the english pdfs into the
76 ## doc-pdf package. Because dh_install doesn't support regexes, we'll
77 ## use find to replace the contents of the .install file before we
78 ## call dh_install
79 override_dh_install:
80         /bin/echo -e 'usr/share/doc/lilypond/html/*/*/*.ly\nusr/share/doc/lilypond/html/*/*/*.png' \
81                 > $(CURDIR)/debian/lilypond-doc-html.install
82         /bin/echo -e 'usr/share/doc/lilypond/html/*/*/*.jpg\nusr/share/doc/lilypond/html/*/*/*.css' \
83                 >> $(CURDIR)/debian/lilypond-doc-html.install
84         find $(CURDIR)/debian/tmp/ -type f \
85                 -regex '.*usr/share/doc/lilypond/.*/[^\.]+.html' \
86                 -printf '%P\n' >> $(CURDIR)/debian/lilypond-doc-html.install
87         /bin/echo -e ''> $(CURDIR)/debian/lilypond-doc-pdf.install
88         find $(CURDIR)/debian/tmp/ -type f \
89                 -regex '.*usr/share/doc/lilypond/.*/[^\.]+.pdf' \
90                 -printf '%P\n' >> $(CURDIR)/debian/lilypond-doc-pdf.install
91         find $(CURDIR)/debian/tmp/ -type f \
92                 -regex '.*usr/share/doc/lilypond/.*/[^\.]+.preview.pdf' \
93                 -printf '%P\n' >> $(CURDIR)/debian/lilypond-doc-pdf.install
94         dh_install --list-missing
95
96 override_dh_python2:
97         dh_python2 --verbose
98         dh_python2 --verbose usr/share/lilypond/$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)/python/
99
100 override_dh_compress:
101         dh_compress -X.ly
102
103 override_dh_installdocs:
104         dh_installdocs
105         for a in $(wildcard $(CURDIR)/debian/*.doc-base-special); do \
106                 package=`basename $$a .doc-base-special`; \
107                 install -d debian/$$package/usr/share/doc-base; \
108                 install -m0644 $$a debian/$$package/usr/share/doc-base/$$package; \
109         done;
110
111 override_dh_auto_test:
112 ifneq (,$(filter $(DEB_BUILD_OPTIONS),nocheck))
113         $(MAKE) test-baseline
114     $(MAKE) test
115 endif
116
117 ## this rule will update debian/control and the per-language install
118 ## files; all of the files it generates/modifies should be included in
119 ## the Debian package and should not need to be regenerated or
120 ## modified.
121 update-doc-packages:
122         perl debian/update_doc_packages