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 config_opt = --enable-optimising
67 cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub ./stepmake/bin/
68 ./configure --disable-checking --enable-debugging \
69 --prefix=/usr $(config_opt) \
70 --infodir='$${prefix}/share/info' \
71 --mandir='$${prefix}/share/man'
72 ulimit -c unlimited && $(MAKE)
73 ulimit -c unlimited && $(MAKE) test;
77 build-doc: build build-doc-stamp
82 # unfortunatly, this does not work well with multiple processors
83 ulimit -c unlimited && $(MAKE) -j1 doc WEB_TARGETS="offline"
85 ulimit -c unlimited && $(MAKE) info
92 rm -f build-stamp build-doc-stamp
93 [ ! -f Makefile ] || $(MAKE) web-clean
94 [ ! -f Makefile ] || $(MAKE) distclean
97 rm -f buildscripts/*.pyc
98 rm -f lib/lilypond/python examples.html
99 rm -f debian/emacsen-startup
100 rm -f debian/lilypond1.7*.dirs debian/lilypond.dirs
101 rm -f debian/postinst debian/prerm debian/postrm
102 rm -f debian/lilypond-data.doc-base debian/lilypond.doc-base
103 rm -f GNUmakefile config.log config.make config.status config.hh
114 # Add here commands to install the package into debian/tmp.
115 $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
117 dh_install --sourcedir=debian/tmp --list-missing
119 # Build architecture-independent files here.
120 binary-indep: DH_OPTIONS=-i
121 binary-indep: build-doc install
124 # Install LilyPond web documentation...
125 $(MAKE) install-doc prefix=$(CURDIR)/debian/lilypond-doc/usr/
126 # it installs a random dir-dep file for no reason
127 rm -f $(CURDIR)/debian/lilypond-doc/usr/share/info/*-dir-dep*
131 # remove the useless offline-root directory
132 mv $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html/offline-root/* \
133 $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html/.;
134 rmdir $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html/offline-root;
135 find $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html \
136 -type d -empty -delete
139 install -m 644 debian/xiao-haizi-guai-guai.ly debian/sakura-sakura.ly \
140 $(r_data)/$(d)/examples
143 dh_link usr/share/lilypond/$(VERSION)/tex \
144 usr/share/texmf/tex/lilypond \
145 usr/share/lilypond/$(VERSION)/fonts/source \
146 usr/share/texmf/fonts/source/public/lilypond \
147 usr/share/lilypond/$(VERSION)/fonts/type1 \
148 usr/share/texmf/fonts/type1/public/lilypond \
150 dh_pysupport /usr/share/lilypond/${VERSION}/python
152 dh_compress -X$(d)/html/
159 binary-arch: DH_OPTIONS=-s
160 binary-arch: build install
163 dh_installdocs AUTHORS.txt NEWS.txt README.txt \
168 dh_installchangelogs Documentation/misc/CHANGES* Documentation/misc/ChangeLog*
171 dh_pysupport /usr/share/lilypond/${VERSION}/python
180 binary: binary-indep binary-arch
181 .PHONY: build clean install binary-indep binary-arch binary