]> git.donarmstrong.com Git - lilypond.git/blob - debian/rules
update changelog and tweak dh2 python override to not require changing each new version
[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 export MAILADDRESS = lilypond@packages.debian.org
9
10 # fontconfig blows chunks if it can't write to $HOME; and some
11 # buildds set it to a bogus value.
12 export HOME = /tmp
13
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))
21 else
22   config_opt = --enable-optimising
23 endif
24
25 DOC_OPTIONS := WEB_TARGETS="offline"
26 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
27         DOC_OPTIONS := $(DOC_OPTIONS) CPU_COUNT=$(firstword $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))))
28 endif
29
30 %:
31         dh $@ --parallel --with autotools-dev --with python2
32
33
34 override_dh_auto_configure: 
35         dh_auto_configure -- --disable-checking --enable-debugging $(config_opt)
36
37 override_dh_auto_build-indep:
38         dh_auto_build
39         $(MAKE) doc $(DOC_OPTIONS)
40
41 override_dh_auto_install-indep:
42         $(MAKE) install-doc $(DOC_OPTIONS) prefix=$(CURDIR)/debian/tmp/usr/
43         $(MAKE) install-info $(DOC_OPTIONS) prefix=$(CURDIR)/debian/tmp/usr
44         rm -rf $(CURDIR)/debian/tmp/usr/share/omf
45         rm -rf $(CURDIR)/debian/tmp/usr/share/doc/lilypond/html/input
46
47 ## Unfortunately, lilypond is kind of broken, and installs the wrong
48 ## info documentation (missing images) if we call their makefile
49 ## directly. They also don't provide an install rule which doesn't
50 ## install the documentation, which we don't care about for the
51 ## architecture dependent build
52 override_dh_auto_install-arch:
53         for dir in `echo */*makefile|xargs -n 1 dirname|grep -v Documentation`; do \
54                 $(MAKE) --no-builtin-rules PACKAGE=LILYPOND package=lilypond -C $$dir install $(DOC_OPTIONS) prefix=$(CURDIR)/debian/tmp/usr/; \
55         done;
56
57
58 ## we need to install only the png, jpg, css, ly and english html
59 ## files into the doc-html package, and only the english pdfs into the
60 ## doc-pdf package. Because dh_install doesn't support regexes, we'll
61 ## use find to replace the contents of the .install file before we
62 ## call dh_install
63 override_dh_install:
64         /bin/echo -e 'usr/share/doc/lilypond/html/*/*/*.ly\nusr/share/doc/lilypond/html/*/*/*.png' \
65                 > $(CURDIR)/debian/lilypond-doc-html.install
66         /bin/echo -e 'usr/share/doc/lilypond/html/*/*/*.jpg\nusr/share/doc/lilypond/html/*/*/*.css' \
67                 >> $(CURDIR)/debian/lilypond-doc-html.install
68         find $(CURDIR)/debian/tmp/ -type f \
69                 -regex '.*usr/share/doc/lilypond/.*/[^\.]+.html' \
70                 -printf '%P\n' >> $(CURDIR)/debian/lilypond-doc-html.install
71         /bin/echo -e ''> $(CURDIR)/debian/lilypond-doc-pdf.install
72         find $(CURDIR)/debian/tmp/ -type f \
73                 -regex '.*usr/share/doc/lilypond/.*/[^\.]+.pdf' \
74                 -printf '%P\n' >> $(CURDIR)/debian/lilypond-doc-pdf.install
75         find $(CURDIR)/debian/tmp/ -type f \
76                 -regex '.*usr/share/doc/lilypond/.*/[^\.]+.preview.pdf' \
77                 -printf '%P\n' >> $(CURDIR)/debian/lilypond-doc-pdf.install
78         dh_install --list-missing
79
80 override_dh_python2:
81         dh_python2
82         dh_python2 usr/share/lilypond/*/python/
83
84 override_dh_compress:
85         dh_compress -X.ly
86
87 override_dh_installdocs:
88         dh_installdocs
89         for a in $(wildcard $(CURDIR)/debian/*.doc-base-special); do \
90                 package=`basename $$a .doc-base-special`; \
91                 install -d debian/$$package/usr/share/doc-base; \
92                 install -m0644 $$a debian/$$package/usr/share/doc-base/$$package; \
93         done;
94
95 ## this rule will update debian/control and the per-language install
96 ## files; all of the files it generates/modifies should be included in
97 ## the Debian package and should not need to be regenerated or
98 ## modified.
99 update-doc-packages:
100         perl debian/update_doc_packages