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.
7 # Currently maintained by Anthony Fok <foka@debian.org>
8 # for Debian GNU/Linux.
14 r_data = debian/$(package)-data
15 r_doc = debian/$(package)-doc
16 d = usr/share/doc/$(package)
18 # since I'm building this a few times on my 8-way machine, try to
20 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
21 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
22 MAKEFLAGS += -j$(NUMJOBS) CPU_COUNT=$(NUMJOBS)
26 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)
28 # "main_memory = 263000" in /etc/texmf/texmf.cnf isn't large enough
29 # for latex to process standchen.dvi.latex, so adding extra_mem_* ...
30 # export extra_mem_top = 100000
31 # export extra_mem_bot = 100000
32 # But now, building lilypond.dvi requires increased pool_size (2002-02-18)
33 # export pool_size = 500000
34 # But now, it seems that none of the above is needed in 1.4.11 (2002-02-24)
37 export USER_CFLAGS = -DDEBIAN
38 export DEB_BUILD = yes
39 export MAILADDRESS = lilypond@packages.debian.org
41 # fontconfig blows chunks if it can't write $HOME; and some buildd's
42 # set it to a bogus value.
45 # Uncomment this to turn on verbose mode.
48 # This has to be exported to make some magic below work.
51 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
52 CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
53 CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS)
54 ifneq (,$(filter $(DEB_HOST_ARCH), i386 kfreebsd-i386))
55 config_opt = --disable-optimising
56 CFLAGS := $(filter-out -O%, $(CFLAGS))
57 CXXFLAGS := $(filter-out -O%, $(CXXFLAGS))
59 ifneq (,$(filter $(DEB_BUILD_OPTIONS),noopt))
60 config_opt = --disable-optimising
62 config_opt = --enable-optimising
71 cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub ./stepmake/bin/
72 ./configure --disable-checking --enable-debugging \
73 --prefix=/usr $(config_opt) \
74 --infodir='$${prefix}/share/info' \
75 --mandir='$${prefix}/share/man'
76 ulimit -c unlimited && $(MAKE)
77 ulimit -c unlimited && $(MAKE) test;
81 build-doc: build build-doc-stamp
86 # unfortunatly, this does not work well with multiple processors
87 ulimit -c unlimited && $(MAKE) -j1 doc WEB_TARGETS="offline"
89 ulimit -c unlimited && $(MAKE) info
96 rm -f build-stamp build-doc-stamp
97 [ ! -f Makefile ] || $(MAKE) web-clean
98 [ ! -f Makefile ] || $(MAKE) distclean
101 rm -f buildscripts/*.pyc
102 rm -f lib/lilypond/python examples.html
103 rm -f debian/emacsen-startup
104 rm -f debian/lilypond1.7*.dirs debian/lilypond.dirs
105 rm -f debian/postinst debian/prerm debian/postrm
106 rm -f debian/lilypond-data.doc-base debian/lilypond.doc-base
107 rm -f GNUmakefile config.log config.make config.status config.hh
118 # Add here commands to install the package into debian/tmp.
119 $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
121 dh_install --sourcedir=debian/tmp --list-missing
123 # Build architecture-independent files here.
124 binary-indep: DH_OPTIONS=-i
125 binary-indep: build-doc install
128 # Install LilyPond web documentation...
129 $(MAKE) install-doc prefix=$(CURDIR)/debian/lilypond-doc/usr/
130 # it installs a random dir-dep file for no reason
131 rm -f $(CURDIR)/debian/lilypond-doc/usr/share/info/*-dir-dep*
135 # remove the useless offline-root directory
136 mv $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html/offline-root/* \
137 $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html/.;
138 rmdir $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html/offline-root;
139 find $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html \
140 -type d -empty -delete
143 install -m 644 debian/xiao-haizi-guai-guai.ly debian/sakura-sakura.ly \
144 $(r_data)/$(d)/examples
147 dh_link usr/share/lilypond/$(VERSION)/tex \
148 usr/share/texmf/tex/lilypond \
149 usr/share/lilypond/$(VERSION)/fonts/source \
150 usr/share/texmf/fonts/source/public/lilypond \
151 usr/share/lilypond/$(VERSION)/fonts/type1 \
152 usr/share/texmf/fonts/type1/public/lilypond \
154 dh_pysupport /usr/share/lilypond/${VERSION}/python
156 dh_compress -X$(d)/html/
163 binary-arch: DH_OPTIONS=-s
164 binary-arch: build install
167 dh_installdocs AUTHORS.txt NEWS.txt README.txt \
172 dh_installchangelogs Documentation/misc/CHANGES* Documentation/misc/ChangeLog*
175 dh_pysupport /usr/share/lilypond/${VERSION}/python
184 binary: binary-indep binary-arch
185 .PHONY: build clean install binary-indep binary-arch binary