]> git.donarmstrong.com Git - lilypond.git/blob - debian/rules
lilypond.words for rpms, etc. Doc for autocompletion.
[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 #export CC = gcc-3.2
22 #export CXX = g++-3.2
23 gcc_version = $(shell g++ --version 2>&1 \
24                 | grep '[0-9]\.[0-9]' | head -1 \
25                 | sed -e 's/.*[^-.0-9]\([0-9][0-9]*\.[0-9][.0-9]*\).*/\1/' \
26                       -e 's/^\([0-9]\+\).*/\1/')
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 # Uncomment this to turn on verbose mode.
42 #export DH_VERBOSE=1
43
44 # This is the debhelper compatibility version to use.
45 export DH_COMPAT=3
46
47 # This has to be exported to make some magic below work.
48 export DH_OPTIONS
49
50 build: build-stamp
51 build-stamp:
52         dh_testdir
53
54         if [ "$(gcc_version)" = "3" ]; then ./lexer-gcc-3.1.sh; fi
55         CPPFLAGS=-I`pwd`/lily/out \
56         ./configure --enable-checking --enable-debugging \
57                 --prefix=/usr --enable-optimise \
58                 --infodir='$${prefix}/share/info' \
59                 --mandir='$${prefix}/share/man'
60         if [ "$(gcc_version)" = "3" ]; then ./lexer-gcc-3.1.sh; fi
61         $(MAKE) MAKE_PFA_FILES=1
62
63         touch build-stamp
64
65 build-doc: build build-doc-stamp
66 build-doc-stamp:
67         dh_testdir
68
69         $(MAKE) -C Documentation
70         $(MAKE) web
71
72         touch build-doc-stamp
73
74 clean:
75         dh_testdir
76         dh_testroot
77         rm -f build-stamp build-doc-stamp
78         -$(MAKE) WWW-clean top-WWW-clean
79         -$(MAKE) distclean
80
81         # Still not clean enough?  Let's use... BRUTE STRENGTH!  :-)
82         find . -type d -name 'out' -o -name 'out-www' | xargs rm -rf
83         rm -f debian/lilypond.links
84
85         dh_clean
86
87 install: DH_OPTIONS=
88 install: build
89         dh_testdir
90         dh_testroot
91         dh_clean -k
92
93         # Add here commands to install the package into debian/tmp.
94         dh_installdirs
95         $(MAKE) prefix=$(PWD)/$(r)/usr MAKE_PFA_FILES=1 install
96
97 #       # Change from an absolute symlink to a relative symlink (Lintian)
98 #       if [ -L $(r)/usr/share/lilypond/cmtfm ]; then \
99 #               rm -f $(r)/usr/share/lilypond/cmtfm; \
100 #               ln -s ../texmf/fonts/tfm/public/cm $(r)/usr/share/lilypond/cmtfm; \
101 #       fi
102
103 # Build architecture-independent files here.
104 binary-indep: DH_OPTIONS=-i
105 binary-indep: build-doc install
106         dh_testdir
107         dh_testroot
108         # Extract LilyPond website tarball ...
109         tar -C $(r_doc)/$(d)/html -xvzf out/web.tar.gz
110         # Add symlinks to the PostScript docs and LilyPond logo PNGs ...
111         cd $(r_doc)/$(d) \
112             && cp -s `find html/Documentation -name '*.ps.gz'` . \
113             && cp -s html/Documentation/pictures/out-www/*.png .
114         # Copy the DVI docs too ...
115         cp -a `find Documentation -name '*.dvi' ! -name 'lily-[0-9]*.dvi'` \
116                 $(r_doc)/$(d)/
117         dh_installdocs
118         dh_installchangelogs
119         dh_link
120         dh_compress -Xusr/share/doc/lilypond/html/
121         dh_fixperms
122         dh_installdeb
123         dh_gencontrol
124         dh_md5sums
125         dh_builddeb
126
127 binary-arch: DH_OPTIONS=-s
128 binary-arch: build install
129         dh_testdir
130         dh_testroot
131         cp -av lilypond-mode.el lilypond-font-lock.el lilypond-indent.el \
132                 lilypond.words $(r)/usr/share/emacs/site-lisp/
133         dh_installdocs DEDICATION NEWS ROADMAP *.txt
134
135 #       dh_installdocs DEDICATION NEWS ROADMAP *.txt \
136 #               Documentation/pictures/out/*.png
137 #               Documentation/out/*.txt
138 #               $(DVI_FILES) $(PS_FILES)
139 #       mkdir $(r)/$(d)/bibliography $(r)/$(d)/misc
140 #       cp -a Documentation/bibliography/*.bib $(r)/$(d)/bibliography/
141 #       cp -a Documentation/misc/[ACN]* $(r)/$(d)/misc/
142
143 #       dh_installexamples input
144         find input \( -name '*.*ly' -o -name '*.abc' -o -name '*.tex' -o -name 'TODO' \) \
145                 -exec cp -a --parents '{}' $(r)/$(d)/examples ';'
146         for i in `find $(r)/$(d)/examples/ -type d -name out`; do \
147                 mv -fv $$i/* $$i/..; rmdir $$i; done
148 #       dh_installmenu
149         dh_installemacsen
150 #       dh_installcron
151 #       dh_installman
152 #       dh_undocumented
153         dh_installchangelogs ChangeLog
154         dh_link usr/share/lilypond/$(VERSION)/tex \
155                         usr/share/texmf/tex/lilypond \
156                 usr/share/lilypond/$(VERSION)/fonts/source \
157                         usr/share/texmf/fonts/source/public/lilypond \
158                 usr/share/lilypond/$(VERSION)/fonts/afm \
159                         usr/share/texmf/fonts/afm/public/lilypond \
160                 usr/share/lilypond/$(VERSION)/fonts/tfm \
161                         usr/share/texmf/fonts/tfm/public/lilypond \
162                 usr/share/lilypond/$(VERSION)/dvips/lilypond.map \
163                         usr/share/texmf/dvips/config/lilypond.map
164         dh_strip
165         dh_compress
166         dh_fixperms
167         dh_installdeb
168         dh_shlibdeps
169         dh_gencontrol
170 #       dh_makeshlibs
171         dh_md5sums
172         dh_builddeb
173
174 binary: binary-indep binary-arch
175 .PHONY: build clean install binary-indep binary-arch binary