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