]> git.donarmstrong.com Git - lilypond.git/blob - debian/rules
fix CPU_COUNT with DOC_OPTIONS
[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) $(DEB_BUILD_OPTIONS) CPU_COUNT=$(firstword $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))))
28 endif
29
30 %:
31         dh $@ --parallel --with-autotools-dev
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_OPTIONS) doc
40
41 override_dh_auto_install-indep:
42         $(MAKE) install-doc prefix=$(CURDIR)/debian/tmp/usr/
43
44 ## this rule will update debian/control and the per-language install
45 ## files; all of the files it generates/modifies should be included in
46 ## the Debian package and should not need to be regenerated or
47 ## modified.
48 update-doc-packages:
49         perl debian/update_doc_packages
50
51
52 ## # Build architecture-independent files here.
53 ## binary-indep: DH_OPTIONS=-i
54 ## binary-indep: build-doc install
55 ##      dh_testdir
56 ##      dh_testroot
57 ##      # Install LilyPond web documentation...
58 ##      $(MAKE) install-doc prefix=$(CURDIR)/debian/lilypond-doc/usr/
59 ##      # it installs a random dir-dep file for no reason
60 ##      rm -f $(CURDIR)/debian/lilypond-doc/usr/share/info/*-dir-dep*
61 ## 
62 ##      dh_installinfo
63 ##      dh_installdocs
64 ##      # remove the useless offline-root directory
65 ##      mv $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html/offline-root/* \
66 ##              $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html/.;
67 ##      rmdir $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html/offline-root;
68 ##      find $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html \
69 ##              -type d -empty -delete
70 ##      dh_installemacsen
71 ## 
72 ##      install -m 644 debian/xiao-haizi-guai-guai.ly debian/sakura-sakura.ly \
73 ##              $(r_data)/$(d)/examples
74 ##      dh_installchangelogs
75 ## 
76 ##      dh_link usr/share/lilypond/$(VERSION)/tex \
77 ##                      usr/share/texmf/tex/lilypond \
78 ##              usr/share/lilypond/$(VERSION)/fonts/source \
79 ##                      usr/share/texmf/fonts/source/public/lilypond \
80 ##              usr/share/lilypond/$(VERSION)/fonts/type1 \
81 ##                      usr/share/texmf/fonts/type1/public/lilypond \
82 ## 
83 ##      dh_pysupport /usr/share/lilypond/${VERSION}/python
84 ## 
85 ##      dh_compress -X$(d)/html/
86 ##      dh_fixperms
87 ##      dh_installdeb
88 ##      dh_gencontrol
89 ##      dh_md5sums
90 ##      dh_builddeb
91 ## 
92 ## binary-arch: DH_OPTIONS=-s
93 ## binary-arch: build install
94 ##      dh_testdir
95 ##      dh_testroot
96 ##      dh_installdocs AUTHORS.txt NEWS.txt README.txt \
97 ##              DEDICATION THANKS 
98 ## 
99 ## 
100 ##      dh_installemacsen
101 ##      dh_installchangelogs Documentation/misc/CHANGES* Documentation/misc/ChangeLog*
102 ## 
103 ##      dh_strip
104 ##      dh_pysupport /usr/share/lilypond/${VERSION}/python
105 ##      dh_compress
106 ##      dh_fixperms
107 ##      dh_installdeb
108 ##      dh_shlibdeps
109 ##      dh_gencontrol
110 ##      dh_md5sums
111 ##      dh_builddeb