]> git.donarmstrong.com Git - lilypond.git/blob - debian/rules
c95956fbd1527b66f56ed386c86d740d2674e8d8
[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_doc = debian/$(package)-doc
15 d = usr/share/doc/$(package)
16
17 include VERSION
18 VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_LEVEL)
19
20 # "main_memory = 263000" in /etc/texmf/texmf.cnf isn't large enough
21 # for latex to process standchen.dvi.latex, so adding extra_mem_* ...
22 # export extra_mem_top = 100000
23 # export extra_mem_bot = 100000
24 # But now, building lilypond.dvi requires increased pool_size (2002-02-18)
25 # export pool_size = 500000
26 # But now, it seems that none of the above is needed in 1.4.11  (2002-02-24)
27 export MODE = ljfour
28 export BDPI = 600
29 export USER_CFLAGS = -DDEBIAN
30 export DEB_BUILD = yes
31 export MAILADDRESS = lilypond@packages.debian.org
32
33 # Uncomment this to turn on verbose mode.
34 #export DH_VERBOSE=1
35
36 # This is the debhelper compatibility version to use.
37 export DH_COMPAT=4
38
39 # This has to be exported to make some magic below work.
40 export DH_OPTIONS
41
42 build: build-stamp
43 build-stamp:
44         dh_testdir
45
46         ./configure --enable-checking --enable-debugging \
47                 --prefix=/usr --enable-optimise \
48                 --infodir='$${prefix}/share/info' \
49                 --mandir='$${prefix}/share/man'
50         $(MAKE) MAKE_PFA_FILES=1
51
52         touch build-stamp
53
54 build-doc: build build-doc-stamp
55 build-doc-stamp:
56         dh_testdir
57
58         # make info
59         $(MAKE) -C Documentation
60         # make html
61         $(MAKE) web
62         $(MAKE) -C Documentation/user omf
63 #       find . -type d -name 'out-www' | xargs rm -rf
64
65         touch build-doc-stamp
66
67 clean:
68         dh_testdir
69         dh_testroot
70         rm -f build-stamp build-doc-stamp
71         -$(MAKE) WWW-clean top-WWW-clean
72         -$(MAKE) distclean
73
74         # Still not clean enough?  Let's use... BRUTE STRENGTH!  :-)
75         find . -type d -name 'out' -o -name 'out-www' | xargs rm -rf
76
77         dh_clean
78
79 install: DH_OPTIONS=
80 install: build
81         dh_testdir
82         dh_testroot
83         dh_clean -k
84
85         # Add here commands to install the package into debian/tmp.
86         dh_installdirs
87         $(MAKE) prefix=$(PWD)/$(r)/usr MAKE_PFA_FILES=1 install
88         # Ugh, remove hundred music-glossary copies
89 #       find . -name 'music-glossary.info-*' | xargs rm -f
90
91 #       # Change from an absolute symlink to a relative symlink (Lintian)
92 #       if [ -L $(r)/usr/share/lilypond/cmtfm ]; then \
93 #               rm -f $(r)/usr/share/lilypond/cmtfm; \
94 #               ln -s ../texmf/fonts/tfm/public/cm $(r)/usr/share/lilypond/cmtfm; \
95 #       fi
96
97 # Build architecture-independent files here.
98 binary-indep: DH_OPTIONS=-i
99 binary-indep: build-doc install
100         dh_testdir
101         dh_testroot
102         # Install LilyPond web documentation...
103         $(MAKE) prefix=$(PWD)/$(r_doc)/usr webdir=$(PWD)/$(r_doc)/$(d)/html out=www web-install
104         # Add symlinks to the PostScript docs and LilyPond logo PNGs ...
105         cd $(r_doc)/$(d) \
106             && cp -s `find html/Documentation -name '*.ps.gz'` . \
107             && cp -s html/Documentation/pictures/out-www/*.png .
108 #       # Copy the DVI docs too ...
109 #       cp -a `find Documentation -name '*.dvi' ! -name 'lily-[0-9]*.dvi'` \
110 #               $(r_doc)/$(d)/
111         dh_installdocs
112         dh_installchangelogs
113         dh_link
114         dh_compress -X$(d)/html/
115         dh_fixperms
116         dh_installdeb
117         dh_gencontrol
118         dh_md5sums
119         dh_builddeb
120
121 binary-arch: DH_OPTIONS=-s
122 binary-arch: build install
123         dh_testdir
124         dh_testroot
125         dh_installdocs AUTHORS.txt NEWS.txt README.txt \
126                 DEDICATION THANKS 
127
128 #       dh_installdocs DEDICATION NEWS ROADMAP *.txt \
129 #               Documentation/pictures/out/*.png
130 #               Documentation/out/*.txt
131 #               $(DVI_FILES) $(PS_FILES)
132 #       mkdir $(r)/$(d)/bibliography $(r)/$(d)/misc
133 #       cp -a Documentation/bibliography/*.bib $(r)/$(d)/bibliography/
134 #       cp -a Documentation/misc/[ACN]* $(r)/$(d)/misc/
135
136 #       dh_installexamples input
137
138         find input \( -name '*.*ly' -o -name '*.abc' -o -name '*.tex' -o -name 'TODO' \) ! -regex '.*/out-www/.*' \
139                 -exec cp -a --parents '{}' $(r)/$(d)/examples ';'
140 #       for i in `find $(r)/$(d)/examples/ -type d -name out`; do \
141 #               mv -fv $$i/* $$i/..; rmdir $$i; done
142
143 #       dh_installmenu
144         dh_installemacsen
145         dh_scrollkeeper
146 #       dh_installcron
147 #       dh_installman
148 #       dh_undocumented
149         dh_installchangelogs ChangeLog
150
151         mv $(r)/usr/share/lilypond/$(VERSION)/dvips/lilypond.map \
152            $(r)/etc/texmf/dvips/lilypond.map
153         dh_link usr/share/lilypond/$(VERSION)/tex \
154                         usr/share/texmf/tex/lilypond \
155                 usr/share/lilypond/$(VERSION)/fonts/source \
156                         usr/share/texmf/fonts/source/public/lilypond \
157                 usr/share/lilypond/$(VERSION)/fonts/afm \
158                         usr/share/texmf/fonts/afm/public/lilypond \
159                 usr/share/lilypond/$(VERSION)/fonts/tfm \
160                         usr/share/texmf/fonts/tfm/public/lilypond \
161                 usr/share/lilypond/$(VERSION)/fonts/type1 \
162                         usr/share/texmf/fonts/type1/public/lilypond \
163                 etc/texmf/dvips/lilypond.map \
164                         usr/share/lilypond/$(VERSION)/dvips/lilypond.map
165         dh_strip
166         dh_compress
167         dh_fixperms
168         dh_installdeb
169         dh_shlibdeps
170         dh_gencontrol
171 #       dh_makeshlibs
172         dh_md5sums
173         dh_builddeb
174
175 binary: binary-indep binary-arch
176 .PHONY: build clean install binary-indep binary-arch binary