]> git.donarmstrong.com Git - lilypond.git/blob - debian/rules
release: 1.4.2
[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 # TELY_FILES := $(notdir $(wildcard Documentation/user/*.tely))
19 # DVI_FILES = $(addprefix Documentation/user/out/, $(TELY_FILES:.tely=.dvi))
20 # PS_FILES = $(DVI_FILES:.dvi=.ps)
21
22 # "main_memory = 263000" in /etc/texmf/texmf.cnf isn't large enough
23 # for latex to process standchen.dvi.latex, so adding extra_mem_* ...
24 export extra_mem_top=100000
25 export extra_mem_bot=100000
26 export MODE=ljfour
27 export BDPI=600
28 export MAILADDRESS=lilypond@packages.debian.org
29
30 # Uncomment this to turn on verbose mode.
31 #export DH_VERBOSE=1
32
33 # This is the debhelper compatibility version to use.
34 export DH_COMPAT=3
35
36 # This has to be exported to make some magic below work.
37 export DH_OPTIONS
38
39 build: build-stamp
40 build-stamp:
41         dh_testdir
42
43         ./configure --enable-checking --disable-debugging \
44                 --prefix=/usr --enable-optimise \
45                 --infodir='$${prefix}/share/info' \
46                 --mandir='$${prefix}/share/man'
47         $(MAKE) USER_CFLAGS=-DDEBIAN all
48
49         touch build-stamp
50
51 build-doc: build build-doc-stamp
52 build-doc-stamp:
53         dh_testdir
54
55         $(MAKE) -C Documentation
56         $(MAKE) web
57
58         touch build-doc-stamp
59
60 clean:
61         dh_testdir
62         dh_testroot
63         rm -f build-stamp build-doc-stamp
64         -$(MAKE) WWW-clean top-WWW-clean
65         -$(MAKE) distclean
66
67         # Still not clean enough?  Let's use... BRUTE STRENGTH!  :-)
68         find . -type d -name 'out' -o -name 'out-www' | xargs rm -rf
69         rm -f debian/doc-base debian/TODO
70
71         dh_clean
72
73 install: DH_OPTIONS=
74 install: build
75         dh_testdir
76         dh_testroot
77         dh_clean -k
78
79         # Add here commands to install the package into debian/tmp.
80         dh_installdirs
81         $(MAKE) prefix=$(PWD)/$(r)/usr USER_CFLAGS=-DDEBIAN install
82
83         # Change from an absolute symlink to a relative symlink (Lintian)
84         if [ -L $(r)/usr/share/lilypond/cmtfm ]; then \
85                 rm -f $(r)/usr/share/lilypond/cmtfm; \
86                 ln -s ../texmf/fonts/tfm/public/cm $(r)/usr/share/lilypond/cmtfm; \
87         fi
88
89 # Build architecture-independent files here.
90 binary-indep: DH_OPTIONS=-i
91 binary-indep: build-doc install
92         dh_testdir
93         dh_testroot
94         # Extract LilyPond website tarball ...
95         tar -C $(r_doc)/$(d)/html -xvzf out/web.tar.gz
96         # Add symlinks to the PostScript docs and LilyPond logo PNGs ...
97         cd $(r_doc)/$(d) \
98             && cp -s `find html/Documentation -name '*.ps.gz'` . \
99             && cp -s html/Documentation/pictures/out-www/*.png .
100         # Copy the DVI docs too ...
101         cp -a `find Documentation -name '*.dvi' ! -name 'lily-[0-9]*.dvi'` \
102                 $(r_doc)/$(d)/
103         dh_installdocs
104         dh_installchangelogs
105         dh_link
106         dh_compress
107         dh_fixperms
108         dh_installdeb
109         dh_gencontrol
110         dh_md5sums
111         dh_builddeb
112
113 binary-arch: DH_OPTIONS=-a
114 binary-arch: build install
115         dh_testdir
116         dh_testroot
117         cp -av lilypond-mode.el lilypond-font-lock.el \
118                 $(r)/usr/share/emacs/site-lisp/
119         dh_installdocs DEDICATION NEWS ROADMAP *.txt
120
121 #       dh_installdocs DEDICATION NEWS ROADMAP *.txt \
122 #               Documentation/pictures/out/*.png
123 #               Documentation/out/*.txt
124 #               $(DVI_FILES) $(PS_FILES)
125 #       mkdir $(r)/$(d)/bibliography $(r)/$(d)/misc
126 #       cp -a Documentation/bibliography/*.bib $(r)/$(d)/bibliography/
127 #       cp -a Documentation/misc/[ACN]* $(r)/$(d)/misc/
128
129 #       dh_installexamples input
130         cp -aP `find input mutopia \( -name '*.*ly' -o -name '*.abc' -o -name '*.tex' -o -name 'TODO' \)` \
131                 $(r)/$(d)/examples
132         for i in `find $(r)/$(d)/examples/ -type d -name out`; do \
133                 mv -fv $$i/* $$i/..; rmdir $$i; done
134 #       dh_installmenu
135         dh_installemacsen
136 #       dh_installcron
137 #       dh_installman
138 #       dh_undocumented
139         dh_installchangelogs -k CHANGES
140         dh_link
141         dh_strip
142         dh_compress
143         dh_fixperms
144         dh_installdeb
145 #       dh_shlibdeps
146         # Ugh, ugly kludge to avoid the circular symlinks under html/
147         cd debian/lilypond && dpkg-shlibdeps -T../substvars -dDepends \
148                 usr/bin/lilypond usr/bin/midi2ly
149         dh_gencontrol
150 #       dh_makeshlibs
151         dh_md5sums
152         dh_builddeb
153
154 binary: binary-indep binary-arch
155 .PHONY: build clean install binary-indep binary-arch binary