The R Project SVN R

Rev

Rev 26524 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 26524 Rev 27169
Line 1... Line 1...
1
#!/usr/bin/make -f
1
#!/usr/bin/make -f
2
# debian/rules file for the Debian GNU/Linux r-base package
2
# debian/rules file for the Debian GNU/Linux r-base package
3
# Copyright 1997-2003 by Douglas Bates <bates@stat.wisc.edu> 
3
# Copyright 1997-2003 by Douglas Bates <bates@stat.wisc.edu> 
4
#                    and Dirk Eddelbuettel <edd@debian.org>
4
#                    and Dirk Eddelbuettel <edd@debian.org>
5
 
5
 
6
# $Id: rules,v 1.54 2003/10/05 20:32:03 bates Exp $
6
# $Id: rules,v 1.55 2003/11/20 16:13:01 bates Exp $
7
 
7
 
8
corepackage	= r-base-core
8
corepackage	= r-base-core
9
latexpackage	= r-base-latex
9
latexpackage	= r-base-latex
10
pdfpackage	= r-doc-pdf
10
pdfpackage	= r-doc-pdf
11
htmlpackage	= r-doc-html
11
htmlpackage	= r-doc-html
Line 26... Line 26...
26
debmat		:= $(debbase)/$(nmathpackage)
26
debmat		:= $(debbase)/$(nmathpackage)
27
debetc		:= $(debbase)/$(corepackage)/usr/lib/R/etc
27
debetc		:= $(debbase)/$(corepackage)/usr/lib/R/etc
28
 
28
 
29
arch		:= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
29
arch		:= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
30
 
30
 
31
## set this to 1 if you want the skip the pdf creation and tests
-
 
32
#skipparts	= 1
-
 
33
 
-
 
34
# set this to 1 (default) if you want the Gnome GUI package
31
# set this to 1 (default) if you want the Gnome GUI package
35
gnome		= 1
32
gnome		= 1
36
ifeq ($(gnome),0)
33
ifeq ($(gnome),0)
37
gnomeconfig 	= --without-gnome
34
gnomeconfig 	= --without-gnome
38
else
35
else
Line 45... Line 42...
45
# edd 15 Aug 2001  default to blas, atlas can override it 
42
# edd 15 Aug 2001  default to blas, atlas can override it 
46
#atlas 		= --with-blas=blas
43
#atlas 		= --with-blas=blas
47
# dmb 04 Apr 2003  better to use no specify blas
44
# dmb 04 Apr 2003  better to use no specify blas
48
# atlas 		= --with-blas
45
# atlas 		= --with-blas
49
# edd 28 Apr 2003  try configuring with atlas
46
# edd 28 Apr 2003  try configuring with atlas
50
atlas		= --with-blas=atlas
47
# atlas		= --with-blas=atlas
-
 
48
# edd 16 Oct 2003  back to older default
-
 
49
atlas 		= --with-blas=blas
51
# edd 08 Mar 2003  use the new lapack feature
50
# edd 08 Mar 2003  use the new lapack feature
52
# edd 27 Apr 2003  Set this to =no as we currently see numerical errors
51
# edd 27 Apr 2003  Set this to =no as we currently see numerical errors
53
lapack		= --with-lapack=no
52
lapack		= --with-lapack=no
54
 
53
 
55
# edd 02 Sep 2001  default to g77 but let m68k use f2c
54
# edd 02 Sep 2001  default to g77 but let m68k use f2c
Line 95... Line 94...
95
get-orig-source: upstream
94
get-orig-source: upstream
96
upstream:
95
upstream:
97
	links http://cran.us.r-project.org/src/base
96
	links http://cran.us.r-project.org/src/base
98
 
97
 
99
upstreamdevel:
98
upstreamdevel:
100
        #links ftp://ftp.stat.math.ethz.ch/Software/R
99
	links ftp://ftp.stat.math.ethz.ch/Software/R
101
        #links http://cran.us.r-project.org/src/base
100
        #links http://cran.us.r-project.org/src/base
102
	rsync -vaC rsync.r-project.org::r-devel .
101
        #rsync -vaC rsync.r-project.org::r-devel .
-
 
102
 
-
 
103
## edd 24 Oct 2003  build is invoked by the buildd, so we would prefer to
-
 
104
##  		    not imply build-indep; unfortunately R does not build
-
 
105
##		    properly without it, so we have to stick with it
-
 
106
#build: build-arch build-indep
-
 
107
build: build-arch
103
 
108
 
104
build: build-arch build-indep
109
build-arch: make-arch 
105
 
110
 
106
build-arch: configure make-arch-stamp build-arch-stamp
-
 
107
build-arch-stamp:
-
 
108
	@echo "*** build-arch ***"
-
 
109
	touch build-arch-stamp
-
 
110
 
-
 
111
build-indep: configure make-indep-stamp build-indep-stamp
-
 
112
build-indep-stamp:
111
build-indep: make-indep 
113
	@echo "*** build-indep ***"
-
 
114
	touch build-indep-stamp
-
 
115
 
112
 
116
configure: configure-stamp
113
configure: configure-stamp
117
configure-stamp:	
114
configure-stamp:	
118
	@echo "*** configure ***"
115
	@echo "*** configure ***"
-
 
116
 
-
 
117
        # we have to disable use of the expanded R_LD_LIBRARY_PATH as it
-
 
118
        # conflicts with Debian's Atlas-can-replace-Blas scheme
-
 
119
        # so set R_LD_LIBRARY_PATH to the minimal value R_HOME/bin
-
 
120
        # and discard what configure finds for it on this machine
-
 
121
	perl -p -i -e 's|:\@R_LD_LIBRARY_PATH\@||' src/scripts/R.sh.in
-
 
122
 
119
	dh_testdir
123
	dh_testdir
120
	PERL=/usr/bin/perl				\
124
	PERL=/usr/bin/perl				\
121
	R_UNZIPCMD=/usr/bin/miniunzip			\
125
	R_UNZIPCMD=/usr/bin/miniunzip			\
122
	R_ZIPCMD=/usr/bin/minizip			\
126
	R_ZIPCMD=/usr/bin/minizip			\
-
 
127
	R_PRINTCMD=/usr/bin/lpr				\
123
	CC=${compiler}					\
128
	CC=${compiler}					\
124
	CXX=${cxxcompiler}				\
129
	CXX=${cxxcompiler}				\
125
	${fortrancompiler}				\
130
	${fortrancompiler}				\
126
	CPPFLAGS=					\
131
	CPPFLAGS=					\
127
	LDFLAGS=					\
132
	LDFLAGS=					\
128
	FLIBS=						\
133
	FLIBS=						\
129
	./configure --prefix=/usr			\
134
	./configure --prefix=/usr			\
130
		    --with-tcltk			\
135
		    --with-tcltk			\
131
		    --mandir=/usr/share/man		\
136
		    --mandir=/usr/share/man		\
132
		    --infodir=/usr/share/info		\
137
		    --infodir=/usr/share/info		\
133
		    $(atlas) $(lapack)			\
138
		    $(atlas) 				\
-
 
139
		    $(lapack)				\
134
		    $(gnomeconfig)			\
140
		    $(gnomeconfig)			\
135
		    --enable-R-profiling		\
141
		    --enable-R-profiling		\
136
		    --enable-R-shlib			\
142
		    --enable-R-shlib			\
137
		    --with-recommended-packages		\
143
		    --with-recommended-packages		\
138
		    --build $(arch)
144
		    --build $(arch)
Line 150... Line 156...
150
			FFLAGS="$(compilerflags)"		\
156
			FFLAGS="$(compilerflags)"		\
151
			CC=${compiler} 				\
157
			CC=${compiler} 				\
152
			CXX=${cxxcompiler}			\
158
			CXX=${cxxcompiler}			\
153
			${fortrancompiler}			\
159
			${fortrancompiler}			\
154
			R
160
			R
-
 
161
 
-
 
162
        # the top-level 'make stamp-recommended' target implies 'make docs'
-
 
163
        # which (for the buildds) implies a lot of time wasted generating 
-
 
164
        # output we already take from the initial i386 build
155
	make		CFLAGS="$(compilerflags)"		\
165
	make		CFLAGS="$(compilerflags)"		\
156
			CXXFLAGS="$(compilerflags)"		\
166
			CXXFLAGS="$(compilerflags)"		\
157
			FFLAGS="$(compilerflags)"		\
167
			FFLAGS="$(compilerflags)"		\
158
			CC=${compiler} 				\
168
			CC=${compiler} 				\
159
			CXX=${cxxcompiler}			\
169
			CXX=${cxxcompiler}			\
160
			${fortrancompiler}			\
170
			${fortrancompiler}			\
161
			stamp-recommended
171
			stamp-recommended
162
        # currently needed for binary package with docs [FIXME: how?]
-
 
163
	make docs
-
 
164
 
172
 
165
        # make standalone math lib
173
        # make standalone math lib
166
	(cd src/nmath/standalone; 				\
174
	(cd src/nmath/standalone; 				\
167
		make	CFLAGS="$(compilerflags) -D_REENTRANT"	\
175
		make	CFLAGS="$(compilerflags) -D_REENTRANT"	\
168
			CXXFLAGS="$(compilerflags) -D_REENTRANT"\
176
			CXXFLAGS="$(compilerflags) -D_REENTRANT"\
Line 170... Line 178...
170
			CC=${compiler} 				\
178
			CC=${compiler} 				\
171
			CXX=${cxxcompiler} 			\
179
			CXX=${cxxcompiler} 			\
172
			${fortrancompiler}			\
180
			${fortrancompiler}			\
173
			libRmath_la_LDFLAGS=-Wl,-soname,libRmath.so.$(somaj) \
181
			libRmath_la_LDFLAGS=-Wl,-soname,libRmath.so.$(somaj) \
174
			)
182
			)
175
        # FIXME
-
 
176
	make html
-
 
177
        # currently needed for binary package [FIXME: into r-doc-help]
-
 
178
	make help
183
 
179
	touch make-arch-stamp
184
	touch make-arch-stamp
180
 
185
 
181
make-indep: configure make-indep-stamp
186
make-indep: configure make-indep-stamp
182
make-indep-stamp:
187
make-indep-stamp:
183
	@echo "*** make-indep ***"
188
	@echo "*** make-indep ***"
184
        # FIXME would be nice here:   make docs
189
#	make docs
-
 
190
	make html
185
        #                             make help
191
	make help
186
        # currently needed for binary package [FIXME: into r-doc-info]
-
 
187
	make info
192
	make info
188
	make pdf
193
	make pdf
189
	touch make-indep-stamp
194
	touch make-indep-stamp
190
 
195
 
191
make: configure make-arch-stamp make-indep-stamp make-stamp
196
make: make-arch make-indep 
192
make-stamp: 
-
 
193
        # Already made in general 'make': make html
-
 
194
	touch make-stamp
-
 
195
 
197
 
196
check: configure make-arch check-stamp
198
check: make-arch check-stamp
197
check-stamp: 
199
check-stamp: 
198
	@echo "*** check ***"
200
	@echo "*** check ***"
199
ifneq	($(arch),arm-linux)
201
ifneq	($(arch),arm-linux)
200
	-make check
202
	-make check
201
endif
203
endif
Line 231... Line 233...
231
	dh_installdirs -A
233
	dh_installdirs -A
232
 
234
 
233
	make    	prefix=$(debtmp)/usr   	 		\
235
	make    	prefix=$(debtmp)/usr   	 		\
234
			mandir=$(debtmp)/usr/share/man	 	install
236
			mandir=$(debtmp)/usr/share/man	 	install
235
 
237
 
236
        # Now for a set of fixes / corrections for the Debian installation 
238
        # link $R_HOME/bin/R to real one, and set R_HOME_DIR env.var. 
237
 
-
 
238
        # set R_HOME_DIR env.var. in R shell script
239
	(cd $(debtmp)/usr/lib/R/bin/; 					\
239
	sed -e '/^R_HOME_DIR=.*/s::R_HOME_DIR=/usr/lib/R:' \
240
		ln -svf ../../../bin/R R;				\
240
	  < bin/R > $(debtmp)/usr/bin/R
241
		cd ../../../bin;					\
-
 
242
		perl -p -i -e						\
241
	sed -e '/^R_HOME_DIR=.*/s::R_HOME_DIR=/usr/lib/R:' \
243
		    's|^R_HOME_DIR=.*|R_HOME_DIR=/usr/lib/R|' R)
242
	  < bin/R > $(debtmp)/usr/lib/R/bin/R
-
 
243
 
244
 
244
        # set browser to mozilla as mozilla-1.0.0 works with help.start()
245
        # set browser to mozilla as mozilla-1.0.0 works with help.start()
-
 
246
	(cd $(debtmp)/usr/lib/R/etc; \
-
 
247
		perl -p -i -e \
245
	sed -e '/^R_BROWSER=.*/s::R_BROWSER=$${R_BROWSER-/usr/bin/mozilla}:' \
248
			"s|R_BROWSER-'.*'|R_BROWSER-'/usr/bin/mozilla'|" \
246
	  < etc/Renviron > $(debtmp)/usr/lib/R/etc/Renviron
249
			Renviron)
247
 
250
 
248
        # fix permissions (Lintian)
251
        # fix permissions (Lintian)
249
	chmod a+x 	$(debtmp)/usr/lib/R/share/sh/echo.sh 		\
252
	chmod a+x 	$(debtmp)/usr/lib/R/share/sh/echo.sh 		\
250
			$(debtmp)/usr/lib/R/share/sh/help-links.sh	\
253
			$(debtmp)/usr/lib/R/share/sh/help-links.sh	\
251
			$(debtmp)/usr/lib/R/share/sh/help-print.sh
254
			$(debtmp)/usr/lib/R/share/sh/help-print.sh
Line 288... Line 291...
288
	dh_movefiles	-pr-base-latex
291
	dh_movefiles	-pr-base-latex
289
        # move all the rest into r-base-core
292
        # move all the rest into r-base-core
290
	dh_movefiles	-p$(corepackage)
293
	dh_movefiles	-p$(corepackage)
291
 
294
 
292
        # for the standalone library package, move the two libs
295
        # for the standalone library package, move the two libs
293
        # as 'make install' ignore these, we have to do it by hand
296
        # as 'make install' ignores these, we have to do it by hand
294
	dh_installdirs -p$(nmathpackage) usr/include usr/lib
297
	dh_installdirs -p$(nmathpackage) usr/include usr/lib
295
	install -m 0644 src/nmath/standalone/libRmath.a     \
298
	install -m 0644 src/nmath/standalone/libRmath.a     \
296
			$(debmat)/usr/lib
299
			$(debmat)/usr/lib
297
	install -m 0644 src/nmath/standalone/libRmath.so    \
300
	install -m 0644 src/nmath/standalone/libRmath.so    \
298
			$(debmat)//usr/lib/libRmath.so.$(libver)
301
			$(debmat)//usr/lib/libRmath.so.$(libver)
Line 302... Line 305...
302
        # and create a link for Rmath.h 
305
        # and create a link for Rmath.h 
303
	(cd $(debmat)/usr/include; \
306
	(cd $(debmat)/usr/include; \
304
			ln -s ../lib/R/include/Rmath.h .)
307
			ln -s ../lib/R/include/Rmath.h .)
305
 
308
 
306
        # now deal with $R_HOME/etc <--> /etc/R
309
        # now deal with $R_HOME/etc <--> /etc/R
307
	# edd 03 Apr 2003  patch Renviron for new R_LIBS standard
310
        # edd 03 Apr 2003  patch Renviron for new R_LIBS standard
308
	(cd $(debetc); \
311
	(cd $(debetc); \
309
		cat $(debbase)/Renviron-R_LIBS.patch | patch --verbose;	\
312
		cat $(debbase)/Renviron-R_LIBS.patch | patch --verbose;	\
310
		mv Makeconf Renviron	../../../../etc/R/; 		\
313
		mv Makeconf Renviron	../../../../etc/R/; 		\
311
		ln -s  /etc/R/Makeconf  .; 				\
314
		ln -s  /etc/R/Makeconf  .; 				\
312
		ln -s  /etc/R/Renviron  .  				)
315
		ln -s  /etc/R/Renviron  .  				)
313
        #
316
 
314
	touch install-arch-stamp
317
	touch install-arch-stamp
315
 
318
 
316
#install-indep: make-arch make-indep install-arch install-indep-stamp
319
#install-indep: make-arch make-indep install-arch install-indep-stamp
317
install-indep: make-indep install-indep-stamp
320
install-indep: make-indep install-indep-stamp
318
install-indep-stamp: 
321
install-indep-stamp: 
Line 369... Line 372...
369
	dh_gencontrol -i
372
	dh_gencontrol -i
370
	dh_md5sums -i
373
	dh_md5sums -i
371
	dh_builddeb -i
374
	dh_builddeb -i
372
 
375
 
373
# Build architecture-dependent files here.
376
# Build architecture-dependent files here.
374
binary-arch: build-arch install-arch check
377
binary-arch: build-arch check install-arch 
375
	@echo "*** binary-arch ***"
378
	@echo "*** binary-arch ***"
376
	dh_testdir -a
379
	dh_testdir -a
377
	dh_testroot -a
380
	dh_testroot -a
378
        #dh_installdebconf -a
381
        #dh_installdebconf -a
379
	dh_link -a
382
	dh_link -a
Line 389... Line 392...
389
        #dh_installmime -a
392
        #dh_installmime -a
390
        #dh_installinit -a
393
        #dh_installinit -a
391
        #dh_installcron -a
394
        #dh_installcron -a
392
        #dh_installmanpages -a	-N$(gnomepackage) -p$(corepackage) getline.3
395
        #dh_installmanpages -a	-N$(gnomepackage) -p$(corepackage) getline.3
393
        #dh_installman 		-p$(corepackage) doc/R.1
396
        #dh_installman 		-p$(corepackage) doc/R.1
394
	## dh_installinfo -a	-n doc/manual/R-*.info*
397
        ## dh_installinfo -a	-n doc/manual/R-*.info*
395
	## edd 04 Apr 2004 manual is dangling unless r-doc-pdf is installed ...
398
        ## edd 04 Apr 2004 manual is dangling unless r-doc-pdf is installed ...
396
	##(cd $(debdoc)/doc && ln -s ../../../../lib/R/doc/html .)
399
        ##(cd $(debdoc)/doc && ln -s ../../../../lib/R/doc/html .)
397
	##(cd $(debdoc)/doc && ln -s ../../../../lib/R/doc/manual .)
400
        ##(cd $(debdoc)/doc && ln -s ../../../../lib/R/doc/manual .)
398
	# ... so install doc as a link, as we already did with library
401
        # ... so install doc as a link, as we already did with library
399
	(cd $(debdoc) && ln -s ../../../lib/R/doc .)
402
	(cd $(debdoc) && ln -s ../../../lib/R/doc .)
400
	(cd $(debdoc) && ln -s ../../../lib/R/library .)
403
	(cd $(debdoc) && ln -s ../../../lib/R/library .)
401
        # install lintian "silencer"
404
        # install lintian "silencer"
402
	install -p -m 0644  debian/$(corepackage).lintian \
405
	install -p -m 0644  debian/$(corepackage).lintian \
403
	   $(debbase)/$(corepackage)/usr/share/lintian/overrides/$(corepackage)
406
	   $(debbase)/$(corepackage)/usr/share/lintian/overrides/$(corepackage)
Line 411... Line 414...
411
        #dh_suidregister -a
414
        #dh_suidregister -a
412
	dh_makeshlibs -a
415
	dh_makeshlibs -a
413
	dh_installdeb -a
416
	dh_installdeb -a
414
	dh_perl -a
417
	dh_perl -a
415
	dh_shlibdeps -a
418
	dh_shlibdeps -a
416
	@echo "*** Pruning shlibdeps result from double atlas entry ***"
419
#	@echo "*** Pruning shlibdeps result from double atlas entry ***"
417
	cat debian/r-base-core.substvars
420
#	cat debian/r-base-core.substvars
418
	perl -p -i -e 's/atlas2-base, //' debian/r-base-core.substvars
421
#	perl -p -i -e 's/atlas2-base, //' debian/r-base-core.substvars
419
	cat debian/r-base-core.substvars
422
#	cat debian/r-base-core.substvars
420
	@echo "*** Pruning atlas from r-recommended shlibdeps ***"
423
#	@echo "*** Pruning atlas from r-recommended shlibdeps ***"
421
	cat debian/r-recommended.substvars
424
#	cat debian/r-recommended.substvars
422
	perl -p -i -e 's/atlas2-base, //' debian/r-recommended.substvars
425
#	perl -p -i -e 's/atlas2-base, //' debian/r-recommended.substvars
423
	cat debian/r-recommended.substvars
426
#	cat debian/r-recommended.substvars
424
	echo "*** Done ***"
427
#	echo "*** Done ***"
425
	dh_gencontrol -a
428
	dh_gencontrol -a
426
	dh_md5sums -a		-X'usr/bin/R'  -XLibIndex -Xindex.txt \
429
	dh_md5sums -a		-X'usr/bin/R'  -XLibIndex -Xindex.txt \
427
					-Xfunction.html -Xpackages.html
430
					-Xfunction.html -Xpackages.html
428
	dh_builddeb -a
431
	dh_builddeb -a
429
 
432