]> git.donarmstrong.com Git - lilypond.git/blob - debian/rules
install info; remove useless offline-root directory
[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
26 include VERSION
27 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)
28
29 # "main_memory = 263000" in /etc/texmf/texmf.cnf isn't large enough
30 # for latex to process standchen.dvi.latex, so adding extra_mem_* ...
31 # export extra_mem_top = 100000
32 # export extra_mem_bot = 100000
33 # But now, building lilypond.dvi requires increased pool_size (2002-02-18)
34 # export pool_size = 500000
35 # But now, it seems that none of the above is needed in 1.4.11  (2002-02-24)
36 export MODE = ljfour
37 export BDPI = 600
38 export USER_CFLAGS = -DDEBIAN
39 export DEB_BUILD = yes
40 export MAILADDRESS = lilypond@packages.debian.org
41
42 # fontconfig blows chunks if it can't write $HOME; and some buildd's
43 # set it to a bogus value.
44 export HOME = /tmp
45
46 # Uncomment this to turn on verbose mode.
47 #export DH_VERBOSE=1
48
49 # This has to be exported to make some magic below work.
50 export DH_OPTIONS
51
52 build: build-stamp
53 build-stamp:
54         dh_testdir
55
56         cp -f /usr/share/misc/config.guess /usr/share/misc/config.sub ./stepmake/bin/
57         ./configure --disable-checking --enable-debugging \
58                 --prefix=/usr --enable-optimising \
59                 --infodir='$${prefix}/share/info' \
60                 --mandir='$${prefix}/share/man'
61         ulimit -c unlimited && $(MAKE)
62         ulimit -c unlimited && $(MAKE) test;
63
64         touch build-stamp
65
66 build-doc: build build-doc-stamp
67 build-doc-stamp:
68         dh_testdir
69
70         # make html
71         # unfortunatly, this does not work well with multiple processors
72         ulimit -c unlimited && $(MAKE) -j1 doc WEB_TARGETS="offline"
73         # make info
74         ulimit -c unlimited && $(MAKE) info
75
76         touch build-doc-stamp
77
78 clean:
79         dh_testdir
80         dh_testroot
81         rm -f build-stamp build-doc-stamp
82         [ ! -f Makefile ] || $(MAKE) web-clean
83         [ ! -f Makefile ] || $(MAKE) distclean
84         rm -f lib/python
85
86         rm -f buildscripts/*.pyc
87         rm -f lib/lilypond/python examples.html
88         rm -f debian/emacsen-startup
89         rm -f debian/lilypond1.7*.dirs debian/lilypond.dirs
90         rm -f debian/postinst debian/prerm debian/postrm
91         rm -f debian/lilypond-data.doc-base debian/lilypond.doc-base
92         rm -f GNUmakefile config.log config.make config.status config.hh
93
94         dh_clean
95
96 install: DH_OPTIONS=
97 install: build
98         dh_testdir
99         dh_testroot
100         dh_clean -k
101         dh_installdirs
102
103         # Add here commands to install the package into debian/tmp.
104         $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
105
106         dh_install --sourcedir=debian/tmp --list-missing
107
108 # Build architecture-independent files here.
109 binary-indep: DH_OPTIONS=-i
110 binary-indep: build-doc install
111         dh_testdir
112         dh_testroot
113         # Install LilyPond web documentation...
114         $(MAKE) install-doc prefix=$(CURDIR)/debian/lilypond-doc/usr/
115         # it installs a random dir-dep file for no reason
116         rm -f $(CURDIR)/debian/lilypond-doc/usr/share/info/*-dir-dep*
117
118         dh_installinfo
119         dh_installdocs
120         # remove the useless offline-root directory
121         mv $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html/offline-root/* \
122                 $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html/.;
123         rmdir $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html/offline-root;
124         find $(CURDIR)/debian/lilypond-doc/usr/share/doc/lilypond/html \
125                 -type d -empty -delete
126         dh_installemacsen
127
128         install -m 644 debian/xiao-haizi-guai-guai.ly debian/sakura-sakura.ly \
129                 $(r_data)/$(d)/examples
130         dh_installchangelogs
131
132         dh_link usr/share/lilypond/$(VERSION)/tex \
133                         usr/share/texmf/tex/lilypond \
134                 usr/share/lilypond/$(VERSION)/fonts/source \
135                         usr/share/texmf/fonts/source/public/lilypond \
136                 usr/share/lilypond/$(VERSION)/fonts/type1 \
137                         usr/share/texmf/fonts/type1/public/lilypond \
138
139         dh_pysupport /usr/share/lilypond/${VERSION}/python
140
141         dh_compress -X$(d)/html/
142         dh_fixperms
143         dh_installdeb
144         dh_gencontrol
145         dh_md5sums
146         dh_builddeb
147
148 binary-arch: DH_OPTIONS=-s
149 binary-arch: build install
150         dh_testdir
151         dh_testroot
152         dh_installdocs AUTHORS.txt NEWS.txt README.txt \
153                 DEDICATION THANKS 
154
155
156         dh_installemacsen
157         dh_installchangelogs Documentation/misc/CHANGES* Documentation/misc/ChangeLog*
158
159         dh_strip
160         dh_pysupport /usr/share/lilypond/${VERSION}/python
161         dh_compress
162         dh_fixperms
163         dh_installdeb
164         dh_shlibdeps
165         dh_gencontrol
166         dh_md5sums
167         dh_builddeb
168
169 binary: binary-indep binary-arch
170 .PHONY: build clean install binary-indep binary-arch binary