]> git.donarmstrong.com Git - lilypond.git/blob - debian/rules
* Fix noopt support to use --disable-optimising as ./configure does crazy things.
[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 ifneq (,$(filter $(DEB_BUILD_OPTIONS),noopt))
60   config_opt = --disable-optimising
61 else
62   config_opt = --enable-optimising
63 endif
64 endif
65
66
67 build: build-stamp
68 build-stamp:
69         dh_testdir
70
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;
78
79         touch build-stamp
80
81 build-doc: build build-doc-stamp
82 build-doc-stamp:
83         dh_testdir
84
85         # make html
86         # unfortunatly, this does not work well with multiple processors
87         ulimit -c unlimited && $(MAKE) -j1 doc WEB_TARGETS="offline"
88         # make info
89         ulimit -c unlimited && $(MAKE) info
90
91         touch build-doc-stamp
92
93 clean:
94         dh_testdir
95         dh_testroot
96         rm -f build-stamp build-doc-stamp
97         [ ! -f Makefile ] || $(MAKE) web-clean
98         [ ! -f Makefile ] || $(MAKE) distclean
99         rm -f lib/python
100
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
108
109         dh_clean
110
111 install: DH_OPTIONS=
112 install: build
113         dh_testdir
114         dh_testroot
115         dh_clean -k
116         dh_installdirs
117
118         # Add here commands to install the package into debian/tmp.
119         $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
120
121         dh_install --sourcedir=debian/tmp --list-missing
122
123 # Build architecture-independent files here.
124 binary-indep: DH_OPTIONS=-i
125 binary-indep: build-doc install
126         dh_testdir
127         dh_testroot
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*
132
133         dh_installinfo
134         dh_installdocs
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
141         dh_installemacsen
142
143         install -m 644 debian/xiao-haizi-guai-guai.ly debian/sakura-sakura.ly \
144                 $(r_data)/$(d)/examples
145         dh_installchangelogs
146
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 \
153
154         dh_pysupport /usr/share/lilypond/${VERSION}/python
155
156         dh_compress -X$(d)/html/
157         dh_fixperms
158         dh_installdeb
159         dh_gencontrol
160         dh_md5sums
161         dh_builddeb
162
163 binary-arch: DH_OPTIONS=-s
164 binary-arch: build install
165         dh_testdir
166         dh_testroot
167         dh_installdocs AUTHORS.txt NEWS.txt README.txt \
168                 DEDICATION THANKS 
169
170
171         dh_installemacsen
172         dh_installchangelogs Documentation/misc/CHANGES* Documentation/misc/ChangeLog*
173
174         dh_strip
175         dh_pysupport /usr/share/lilypond/${VERSION}/python
176         dh_compress
177         dh_fixperms
178         dh_installdeb
179         dh_shlibdeps
180         dh_gencontrol
181         dh_md5sums
182         dh_builddeb
183
184 binary: binary-indep binary-arch
185 .PHONY: build clean install binary-indep binary-arch binary