]> git.donarmstrong.com Git - lilypond.git/blob - debian/rules
Disable optimization on i386 and kfreebsd-i386 to avoid segfaults with python7; thank...
[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 # Currently maintained by Anthony Fok <foka@debian.org>
8 # for Debian GNU/Linux.
9
10 package = lilypond
11
12 SHELL = /bin/sh
13 r = debian/$(package)
14 r_data = debian/$(package)-data
15 r_doc = debian/$(package)-doc
16 d = usr/share/doc/$(package)
17
18 # since I'm building this a few times on my 8-way machine, try to
19 # build it faster
20 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
21     NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
22     MAKEFLAGS += -j$(NUMJOBS) CPU_COUNT=$(NUMJOBS)
23 endif
24
25 include VERSION
26 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)
27
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)
35 export MODE = ljfour
36 export BDPI = 600
37 export USER_CFLAGS = -DDEBIAN
38 export DEB_BUILD = yes
39 export MAILADDRESS = lilypond@packages.debian.org
40
41 # fontconfig blows chunks if it can't write $HOME; and some buildd's
42 # set it to a bogus value.
43 export HOME = /tmp
44
45 # Uncomment this to turn on verbose mode.
46 #export DH_VERBOSE=1
47
48 # This has to be exported to make some magic below work.
49 export DH_OPTIONS
50
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))
58 else
59   config_opt = --enable-optimising
60 endif
61
62
63 build: build-stamp
64 build-stamp:
65         dh_testdir
66
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;
74
75         touch build-stamp
76
77 build-doc: build build-doc-stamp
78 build-doc-stamp:
79         dh_testdir
80
81         # make html
82         # unfortunatly, this does not work well with multiple processors
83         ulimit -c unlimited && $(MAKE) -j1 doc WEB_TARGETS="offline"
84         # make info
85         ulimit -c unlimited && $(MAKE) info
86
87         touch build-doc-stamp
88
89 clean:
90         dh_testdir
91         dh_testroot
92         rm -f build-stamp build-doc-stamp
93         [ ! -f Makefile ] || $(MAKE) web-clean
94         [ ! -f Makefile ] || $(MAKE) distclean
95         rm -f lib/python
96
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
104
105         dh_clean
106
107 install: DH_OPTIONS=
108 install: build
109         dh_testdir
110         dh_testroot
111         dh_clean -k
112         dh_installdirs
113
114         # Add here commands to install the package into debian/tmp.
115         $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
116
117         dh_install --sourcedir=debian/tmp --list-missing
118
119 # Build architecture-independent files here.
120 binary-indep: DH_OPTIONS=-i
121 binary-indep: build-doc install
122         dh_testdir
123         dh_testroot
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*
128
129         dh_installinfo
130         dh_installdocs
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
137         dh_installemacsen
138
139         install -m 644 debian/xiao-haizi-guai-guai.ly debian/sakura-sakura.ly \
140                 $(r_data)/$(d)/examples
141         dh_installchangelogs
142
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 \
149
150         dh_pysupport /usr/share/lilypond/${VERSION}/python
151
152         dh_compress -X$(d)/html/
153         dh_fixperms
154         dh_installdeb
155         dh_gencontrol
156         dh_md5sums
157         dh_builddeb
158
159 binary-arch: DH_OPTIONS=-s
160 binary-arch: build install
161         dh_testdir
162         dh_testroot
163         dh_installdocs AUTHORS.txt NEWS.txt README.txt \
164                 DEDICATION THANKS 
165
166
167         dh_installemacsen
168         dh_installchangelogs Documentation/misc/CHANGES* Documentation/misc/ChangeLog*
169
170         dh_strip
171         dh_pysupport /usr/share/lilypond/${VERSION}/python
172         dh_compress
173         dh_fixperms
174         dh_installdeb
175         dh_shlibdeps
176         dh_gencontrol
177         dh_md5sums
178         dh_builddeb
179
180 binary: binary-indep binary-arch
181 .PHONY: build clean install binary-indep binary-arch binary