]> git.donarmstrong.com Git - lilypond.git/blob - debian/rules
release: 1.3.153
[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 TMP = $(PWD)/$(r)
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 export MODE=ljfour
22 export BDPI=600
23
24 # Uncomment this to turn on verbose mode.
25 #export DH_VERBOSE=1
26
27 # This is the debhelper compatibility version to use.
28 export DH_COMPAT=3
29
30 # This has to be exported to make some magic below work.
31 export DH_OPTIONS
32
33 build: build-stamp
34 build-stamp:
35         dh_testdir
36
37         ./configure --enable-checking --disable-debugging \
38                 --enable-printing --prefix=/usr --enable-optimise \
39                 --enable-shared \
40                 --infodir='$${prefix}/share/info' \
41                 --mandir='$${prefix}/share/man'
42         $(MAKE) USER_CFLAGS=-DDEBIAN all
43         $(MAKE) -C Documentation/user dvi ps
44         $(MAKE) -C Documentation/pictures pngs
45
46         touch build-stamp
47
48 clean:
49         dh_testdir
50         dh_testroot
51         rm -f build-stamp
52         -$(MAKE) distclean
53         dh_clean
54
55         # Correct the owner of the out/dummy.dep files when built with sudo.
56         if [ -n "$$SUDO_USER" -a -n "$$SUDO_GID" ]; then \
57                 find . -user root | xargs -r chown --dereference $$SUDO_USER.$$SUDO_GID; \
58         fi
59
60 install: DH_OPTIONS=
61 install: build
62         dh_testdir
63         dh_testroot
64         dh_clean -k
65         dh_installdirs usr/share/doc/texmf \
66                 $(d)/examples \
67                 usr/share/emacs/site-lisp \
68                 usr/share/texmf/tex \
69                 usr/share/texmf/fonts/source/public \
70                 usr/share/texmf/fonts/afm/public \
71                 usr/share/texmf/fonts/tfm/public
72         ln -fs ../$(package) $(r)/usr/share/doc/texmf/lilypond
73
74         $(MAKE) prefix=$(TMP)/usr USER_CFLAGS=-DDEBIAN install
75
76         ln -s ../../lilypond/tex $(r)/usr/share/texmf/tex/lilypond
77         ln -s ../../../../lilypond/mf $(r)/usr/share/texmf/fonts/source/public/lilypond
78         ln -s ../../../../lilypond/afm $(r)/usr/share/texmf/fonts/afm/public/lilypond
79         ln -s ../../../../lilypond/tfm $(r)/usr/share/texmf/fonts/tfm/public/lilypond
80
81         # Change from an absolute symlink to a relative symlink (Lintian)
82         if [ -L $(r)/usr/share/lilypond/cmtfm ]; then \
83                 rm -f $(r)/usr/share/lilypond/cmtfm; \
84                 ln -s ../texmf/fonts/tfm/public/cm $(r)/usr/share/lilypond/cmtfm; \
85         fi
86
87 # Build architecture-independent files here.
88 binary-indep: DH_OPTIONS=-i
89 binary-indep: build install
90         dh_testdir
91         dh_testroot
92         dh_installdocs
93         dh_installchangelogs
94         dh_link
95         dh_compress
96         dh_fixperms
97         dh_installdeb
98         dh_gencontrol
99         dh_md5sums
100         dh_builddeb
101
102 binary-arch: DH_OPTIONS=-a
103 binary-arch: build install
104         dh_testdir
105         dh_testroot
106         cp -av lilypond-mode.el lilypond-font-lock.el \
107                 $(r)/usr/share/emacs/site-lisp/
108         dh_installdocs DEDICATION NEWS ROADMAP *.txt \
109                 Documentation/pictures/out/*.png \
110                 Documentation/out/*.txt \
111                 $(DVI_FILES) $(PS_FILES)
112         mkdir $(r)/$(d)/bibliography $(r)/$(d)/misc
113         cp -a Documentation/bibliography/*.bib $(r)/$(d)/bibliography/
114         cp -a Documentation/misc/[ACN]* $(r)/$(d)/misc/
115 #       dh_installexamples input
116         cp -aP `find input mutopia \( -name '*.*ly' -o -name '*.abc' -o -name '*.tex' -o -name 'TODO' \)` \
117                 $(r)/$(d)/examples
118         for i in `find $(r)/$(d)/examples/ -type d -name out`; do \
119                 mv -fv $$i/* $$i/..; rmdir $$i; done
120 #       dh_installmenu
121         dh_installemacsen
122 #       dh_installcron
123 #       dh_installmanpages
124 #       dh_undocumented
125         dh_installchangelogs -k CHANGES
126         dh_link
127         dh_strip
128         dh_compress
129         dh_fixperms
130         dh_installdeb
131         dh_shlibdeps
132         dh_gencontrol
133 #       dh_makeshlibs
134         dh_md5sums
135         dh_builddeb
136
137 binary: binary-indep binary-arch
138 .PHONY: build clean install binary-indep binary-arch binary