File: rules

package info (click to toggle)
maxima 5.38.1-8
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 141,320 kB
  • ctags: 69,979
  • sloc: lisp: 351,298; fortran: 14,666; perl: 14,365; tcl: 11,087; sh: 4,741; makefile: 2,537; ansic: 420; awk: 24; sed: 10; xml: 9
file content (267 lines) | stat: -rwxr-xr-x 10,730 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
#!/usr/bin/make -f
#-*- makefile -*-
# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Some lines taken from debmake, by Christoph Lameter.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

#FIXME remove when converting to dh
export SOURCE_DATE_EPOCH = $(shell date -d "$$(dpkg-parsechangelog -SDate)" +%s)

NO_STRIP:=

SAVES:=$(addprefix debian/save/,aclocal.m4 configure interfaces/emacs/imaxima/stamp-vti\
	 interfaces/emacs/imaxima/imaxima.info interfaces/emacs/imaxima/version.texi\
	 src/lisp\
	 \
	 admin/Makefile.in crosscompile-windows/Makefile.in crosscompile-windows/wxwidgets/Makefile.in\
	 demo/Makefile.in doc/emaxima/Makefile.in doc/info/de/Makefile.in doc/info/de.utf8/Makefile.in\
	 doc/info/es/Makefile.in doc/info/es.utf8/Makefile.in doc/info/Makefile.in doc/info/pt_BR/Makefile.in\
	 doc/info/pt_BR.utf8/Makefile.in doc/info/pt/Makefile.in doc/info/pt.utf8/Makefile.in doc/intromax/Makefile.in\
	 doc/Makefile.in doc/man/Makefile.in doc/share/Makefile.in interfaces/emacs/emaxima/Makefile.in\
	 interfaces/emacs/imaxima/Makefile.in interfaces/emacs/Makefile.in interfaces/emacs/misc/Makefile.in\
	 interfaces/Makefile.in interfaces/xmaxima/doc/figures/Makefile.in interfaces/xmaxima/doc/Makefile.in\
	 interfaces/xmaxima/Makefile.in interfaces/xmaxima/msgs/Makefile.in interfaces/xmaxima/win32/Makefile.in\
	 lisp-utils/Makefile.in locale/Makefile.in Makefile.in plotting/Makefile.in share/contrib/integration/Makefile.in\
	 share/contrib/Makefile.in share/contrib/maxima-odesolve/Makefile.in share/draw/Makefile.in\
	 share/logic/Makefile.in share/Makefile.in src/autoconf-variables.lisp src/Makefile.in\
	 src/share-subdirs.lisp tests/Makefile.in\
	 \
	doc/info/figures/Makefile.in doc/info/maxima-index.lisp doc/info/maxima.info doc/info/maxima.info-1 \
	doc/info/maxima.info-2 doc/info/maxima.info-3 \
	)

debian/save/%: %
	mkdir -p $(@D)
	[ -e $@ ] || cp $< $@

debian/save: $(SAVES)

restore: 
	! [ -d debian/save ] || ( cd debian/save && for i in $$(find -type f); do cp $$i ../../$$i; done )
	rm -rf debian/save

MVERS:=$(shell head -n 1 debian/changelog | cut -f2 -d\  | tr -d '()' | cut -f1 -d-)
build: build-arch build-indep
build-arch: debian/save build-stamp
build-indep: debian/save build-stamp
build-stamp:
	dh_testdir

	aclocal
	automake

	echo '(progn (setq si::*optimize-maximum-pages* nil)(si::save-system "gcl"))' | GCL_ANSI=t gcl

	git_found=false PATH=$$(pwd):$$PATH GCL_ANSI=t ./configure --enable-gcl $$(gcl -batch -eval '(progn #-native-reloc(princ "--enable-gcl-alt-link"))') \
		--enable-sys-proclaim \
		--prefix=/usr \
		--libexec=/usr/lib \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info 

	cp debian/favicon.ico doc/info/figures/

	rm -f src/sys-proclaim.lisp

	PATH=$$(pwd):$$PATH GCL_ANSI=t $(MAKE)

	echo ':lisp (setq maxima::*maxima-started* nil si::*optimize-maximum-pages* t si::*code-block-reserve* (make-array 10000000 :element-type (quote character) :static t))(si::sgc-on nil)(si::gbc t)(si::save-system "foo")' | ./maxima-local && mv foo src/binary-gcl/maxima


	chmod +x ./maxima-local
	touch tests/tests-gcl.log
	./maxima-local -g --lisp=gcl --batch-string="run_testsuite();"  >tmp 2>&1 & \
		j=$$! ; echo Waiting on pid $$j ; \
		tail -f --pid=$$j --retry tests/tests-gcl.log tmp & wait $$j

	touch tmp
	cat tmp >debian/test_results.out

	grep -q "No unexpected errors found." debian/test_results.out

	rm -f tmp

	echo ':lisp (setq si::*readline-prefix* "maxima::$$")(setq maxima::*maxima-started* nil maxima::*maxima-index-dir* "/usr/share/doc/maxima/info")(si::save-system "foo")' | ./maxima-local && mv foo src/binary-gcl/maxima

	touch build-stamp

BOOK:=debian/maximabook-19-Sept-2004.pdf

clean: #restore
	dh_testdir
	dh_testroot

	debian/rules restore
	rm -rf $(BOOK) src/binary-gcl binary gcl src/sys-proclaim.lisp tests/tests-gcl.log
	rm -rf admin/Makefile config.log config.status crosscompile-windows/Makefile\
		crosscompile-windows/wxwidgets/Makefile demo/Makefile doc/emaxima/Makefile\
		doc/info/de/Makefile doc/info/de.utf8/Makefile doc/info/es/include-maxima.texi\
		doc/info/es/Makefile doc/info/es.utf8/Makefile\
		doc/info/Makefile doc/info/pt_BR/Makefile doc/info/pt_BR.utf8/Makefile\
		doc/info/pt/include-maxima.texi doc/info/pt/Makefile doc/info/pt.utf8/Makefile\
		doc/intromax/Makefile doc/Makefile doc/man/Makefile doc/man/maxima.1 doc/man/ru/maxima.1\
		doc/share/Makefile interfaces/emacs/emaxima/Makefile interfaces/emacs/imaxima/Makefile\
		interfaces/emacs/Makefile interfaces/emacs/misc/Makefile interfaces/Makefile\
		interfaces/xmaxima/autoconf-variables.tcl interfaces/xmaxima/doc/figures/Makefile\
		interfaces/xmaxima/doc/Makefile interfaces/xmaxima/Makefile interfaces/xmaxima/msgs/Makefile\
		interfaces/xmaxima/Tkmaxima/Header.tcl interfaces/xmaxima/win32/Makefile interfaces/xmaxima/xmaxima\
		lisp-utils/Makefile locale/Makefile Makefile maxima.iss maxima-local maxima.spec plotting/Makefile\
		plotting/mgnuplot share/contrib/integration/Makefile share/contrib/Makefile\
		share/contrib/maxima-odesolve/Makefile share/draw/Makefile share/logic/Makefile share/Makefile\
		src/gcl-depends.mk src/Makefile src/maxima src/maxima.bat src/rmaxima tests/Makefile xmaxima-local\
		interfaces/xmaxima/Tkmaxima/tclIndex
	rm -rf bin/interfaces bin/doc bin/src bin/xmaxima
	rm -f doc/info/figures/Makefile
	rm -f tmp
	rm -f share/contrib/maxima-odesolve/maxima-odesolve-index.lisp

	rm -f $(INSTALLS)
	rm -f debian/ChangeLog

	dh_clean


LOC_DOC=<a href=file://usr/share/doc/maxima/html/maxima_toc.html> (local copy) </a>

debian/%.install: debian/%.install.in
	cat $< | sed "s,@MVERS@,$(MVERS),g" >$@

INSTALLS:=$(shell ls -1 debian/*.install.in | sed 's,\.in$$,,1')

debian/%.pdf: debian/%.pdf.uu
	cat $< | uudecode >$@

CHANGELOGS:=$(shell ls -1 ChangeLog*)
debian/ChangeLog: $(CHANGELOGS)
	for i in $^; do echo "==========">>$@;echo "File: $$i" >>$@;echo "==========">>$@;cat $$i >>$@; done

install: install-stamp
install-stamp: build-stamp $(BOOK) $(INSTALLS) debian/ChangeLog
	dh_testdir
	dh_testroot
	dh_prep

	$(MAKE) install DESTDIR=$$(pwd)/debian/tmp INSTALL="/usr/bin/install -D"

	mkdir -p $$(pwd)/debian/tmp/usr/share/doc/maxima-doc
	cp -a debian/tmp/usr/share/maxima/$(MVERS)/doc/* \
		$$(pwd)/debian/tmp/usr/share/doc/maxima-doc 
	rm -rf debian/tmp/usr/share/maxima/$(MVERS)/doc
	ln -snf ../../doc/maxima-doc debian/tmp/usr/share/maxima/$(MVERS)/doc

	mkdir -p $$(pwd)/debian/tmp/usr/share/doc/xmaxima
	cp -a debian/tmp/usr/share/maxima/$(MVERS)/xmaxima/* \
		$$(pwd)/debian/tmp/usr/share/doc/xmaxima 
	rm -rf debian/tmp/usr/share/maxima/$(MVERS)/xmaxima
	ln -snf ../../doc/xmaxima debian/tmp/usr/share/maxima/$(MVERS)/xmaxima

	mkdir -p debian/tmp/usr/share/emacs/site-lisp/maxima
	cp -a debian/tmp/usr/share/maxima/$(MVERS)/emacs/* \
		debian/tmp/usr/share/emacs/site-lisp/maxima
	rm debian/tmp/usr/share/emacs/site-lisp/maxima/dbl.el
	mkdir -p debian/tmp/usr/share/texmf/tex/latex
	mv debian/tmp/usr/share/emacs/site-lisp/maxima/*sty \
		debian/tmp/usr/share/texmf/tex/latex
	rm -rf debian/tmp/usr/share/maxima/$(MVERS)/emacs
	ln -snf ../../emacs/site-lisp/maxima debian/tmp/usr/share/maxima/$(MVERS)/emacs

	for i in debian/tmp/usr/bin/xmaxima \
		debian/tmp/usr/lib/maxima/$(MVERS)/mgnuplot ; do \
		cat $$i | sed  -e 's,^#!/bin/sh,#!/usr/bin/wish,1' \
			-e 's,^exec wish,#exec wish,1' \
			-e 's,\$${prefix}/share,/usr/share,1' \
                        -e 's,[Nn]etscape,sensible-browser,g' >tmp && chmod 755 tmp && \
			mv tmp $$i ; done

	mkdir -p debian/tmp/usr/share/applications
	cp debian/xmaxima.desktop debian/tmp/usr/share/applications
	mkdir -p debian/tmp/usr/share/pixmaps
	ln -s /usr/share/doc/xmaxima/maxima-icon.png debian/tmp/usr/share/pixmaps/maxima-icon.png

	cp $(BOOK) debian/tmp/usr/share/doc/maxima-doc

	cd debian/tmp/usr/share/info && \
		for i in $$(find -name "*.info"); do if ! grep -q START-INFO-DIR-ENTRY $$i ; then k=$$(basename $$i); k=$${k%.*}; awk '{if (!i) {i=1;printf("INFO-DIR-SECTION Maxima\nSTART-INFO-DIR-ENTRY\n* Maxima-%s: (%s).  A computer algebra system -- contributions.\nEND-INFO-DIR-ENTRY\n",k,k);}} {print}' k=$$k $$i >$$i.tmp; diff -u $$i $$i.tmp ; mv $$i.tmp $$i ; fi ; done

	cat debian/tmp/usr/share/info/maxima.info | \
		awk '/START-INFO-DIR-ENTRY/ {print "INFO-DIR-SECTION Maxima"}{print}' >debian/foo && \
		mv debian/foo debian/tmp/usr/share/info/maxima.info

	cat debian/tmp/usr/share/man/man1/maxima.1 | \
		sed 's,^.TH MAXIMA 1L,.TH MAXIMA 1,1' >debian/foo && \
		mv debian/foo debian/tmp/usr/share/man/man1/maxima.1

	for i in $$(find debian/tmp/usr/share/info -name "maxima-index.lisp") ; do \
		mkdir -p debian/tmp/usr/share/doc/maxima/$$(basename $$(dirname $$i)) && \
		cat $$i | sed 's,^(load-info-hashtables,(clrhash cl-info::*info-tables*)\n(load-info-hashtables,1' >tmp &&\
	        ! cmp $$i tmp && mv tmp $$i &&\
                mv $$i debian/tmp/usr/share/doc/maxima/$$(basename $$(dirname $$i)) ; done

	chmod 755 ./debian/tmp/usr/share/maxima/$(MVERS)/share/contrib/lurkmathml/mathmltest

	rm -f debian/tmp/usr/share/info/dir debian/tmp/usr/share/maxima/$(MVERS)/share/logic/COPYING

	! [ -e debian/tmp/usr/share/maxima/$(MVERS)/share/contrib/gentran/man/MANUAL.ps.gz ] ||\
		gunzip debian/tmp/usr/share/maxima/$(MVERS)/share/contrib/gentran/man/MANUAL.ps.gz

	rm -f debian/tmp/usr/share/maxima/$(MVERS)/share/.gitattributes

	dh_install

	touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i
	dh_installexamples -i
	dh_installmenu -i
	dh_installemacsen -i
	dh_installtex -i -p maxima-emacs
	dh_installcron -i
	dh_installman -i
#	dh_desktop -i
	dh_installinfo -p maxima-doc debian/tmp/usr/share/info/*info*
	dh_installchangelogs  -i debian/ChangeLog
	dh_link -i
	dh_strip -i
	dh_compress -i -X.shtml -X.hh -Xmaxima-index.lisp
	dh_fixperms -i
	dh_installdeb -i
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installdocs -a
	dh_installexamples -a
	dh_installmenu -a
	dh_installemacsen -a
	dh_installcron -a
	dh_installman -a
#	dh_desktop -a
	dh_installinfo -a
	dh_installchangelogs  -a debian/ChangeLog
	dh_link -a
	dh_strip -a $(NO_STRIP)
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch
.PHONY: build build-arch build-indep clean binary-indep binary-arch binary install