Rev 23970 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
#!/usr/bin/make -f# debian/rules file for the Debian GNU/Linux r-base package# Copyright 1997-2003 by Douglas Bates <bates@stat.wisc.edu># and Dirk Eddelbuettel <edd@debian.org># $Id: rules,v 1.50 2003/04/16 12:03:35 bates Exp $corepackage = r-base-corelatexpackage = r-base-latexpdfpackage = r-doc-pdfhtmlpackage = r-doc-htmlgnomepackage = r-gnomenmathpackage = r-mathlibinfopackage = r-doc-inforecdpackage = r-recommended# for the standalone library, no sonames are assigned in the upstream Makefilessomaj = 1somin = 0sorel = 0libver = $(somaj).$(somin).$(sorel)debbase := $(CURDIR)/debiandebtmp := $(debbase)/tmpdebdoc := $(debbase)/$(corepackage)/usr/share/doc/$(corepackage)debmat := $(debbase)/$(nmathpackage)debetc := $(debbase)/$(corepackage)/usr/lib/R/etcarch := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)## set this to 1 if you want the skip the pdf creation and tests#skipparts = 1# set this to 1 (default) if you want the Gnome GUI packagegnome = 1ifeq ($(gnome),0)gnomeconfig = --without-gnomeelsegnomeconfig = --with-gnomeendif#export DH_VERBOSE = 1export DH_COMPAT = 3# edd 15 Aug 2001: default to blas, atlas can override it#atlas = --with-blas=blas# dmb 04 Apr 2003 better to no specify blasatlas = --with-blasatlas = --with-blas# edd 08 Mar 2003: use the new lapack featurelapack = --with-lapack# edd 02 Sep 2001: default to g77 but let m68k use f2c# edd 06 Mar 2003: enforce 3.2 versions explicitly so that on testing we will pick them over 2.95fortrancompiler = F77=g77-3.2compiler = gcc-3.2cxxcompiler = g++-3.2compilerflags = -O2# edd 04 Sep 2001 default compiler flags, lowered for m68kcompilerflags = -O2# m68k barks when using g77, and when gcc use -O2# edd 26 Nov 2002 switched back to g77#ifeq ($(arch),m68k-linux)#fortrancompiler = F2C=f2c#endif## edd 09 Nov 2001 ia64 needs gcc-3.0, hppa gets it by default#ifeq ($(arch),ia64-linux)#fortrancompiler = F77=g77-3.0#compiler = gcc-3.0#cxxcompiler = g++-3.0#compilerflags = -O2#endif## lamont@debian.org 06 Dec 2001 hppa needs -ffunction-sectionsifeq ($(arch),hppa-linux)compilerflags = -O2 -ffunction-sectionsendif## edd 20 Jun 2002 no optimisation or debugging on baby systemsifneq "$(findstring $(arch), m68k-linux arm-linux)" ""compilerflags = -O0 -g0endif## try gcc-3.0 on i386 -- appears to work#ifeq ($(arch),i386-linux)#fortrancompiler= F77=g77-3.0#compiler = gcc-3.0#cxxcompiler = g++-3.0#compilerflags = -O2#endifget-orig-source: upstreamupstream:links http://cran.us.r-project.org/src/baseupstreamdevel:#links ftp://ftp.stat.math.ethz.ch/Software/Rlinks http://cran.us.r-project.org/src/basebuild: build-arch build-indepbuild-arch: configure make-arch-stamp build-arch-stampbuild-arch-stamp:@echo "*** build-arch ***"touch build-arch-stampbuild-indep: configure make-indep-stamp build-indep-stampbuild-indep-stamp:@echo "*** build-indep ***"touch build-indep-stampconfigure: configure-stampconfigure-stamp:@echo "*** configure ***"dh_testdirPERL=/usr/bin/perl \R_UNZIPCMD=/usr/bin/miniunzip \R_ZIPCMD=/usr/bin/minizip \CC=${compiler} \CXX=${cxxcompiler} \${fortrancompiler} \CPPFLAGS= \LDFLAGS= \FLIBS= \./configure --prefix=/usr \--with-tcltk \--mandir=/usr/share/man \--infodir=/usr/share/info \$(atlas) $(lapack) \$(gnomeconfig) \--enable-R-profiling \--enable-R-shlib \--build $(arch)# --with-tcl-config=/usr/lib/tcl8.3/tclConfig.sh# --with-tk-config=/usr/lib/tk8.3/tkConfig.shtouch configure-stampmake-arch: configure make-arch-stampmake-arch-stamp:@echo "*** make-arch ***"make CFLAGS="$(compilerflags)" \CXXFLAGS="$(compilerflags)" \FFLAGS="$(compilerflags)" \CC=${compiler} \CXX=${cxxcompiler} \FC=${fortrancompiler} \Rmake CFLAGS="$(compilerflags)" \CXXFLAGS="$(compilerflags)" \FFLAGS="$(compilerflags)" \CC=${compiler} \CXX=${cxxcompiler} \FC=${fortrancompiler} \stamp-recommended# currently needed for binary package with docs [FIXME: how?]make docs# make standalone math lib(cd src/nmath/standalone; \make CFLAGS="$(compilerflags) -D_REENTRANT" \CXXFLAGS="$(compilerflags) -D_REENTRANT"\FFLAGS="$(compilerflags) -D_REENTRANT" \CC=${compiler} \CXX=${cxxcompiler} \FC=${fortrancompiler} \libRmath_la_LDFLAGS=-Wl,-soname,libRmath.so.$(somaj) \)# FIXMEmake html# currently needed for binary package [FIXME: into r-doc-help]make helptouch make-arch-stampmake-indep: configure make-indep-stampmake-indep-stamp:@echo "*** make-indep ***"# FIXME would be nice here: make docs# make help# currently needed for binary package [FIXME: into r-doc-info]make infomake pdftouch make-indep-stampmake: configure make-arch-stamp make-indep-stamp make-stampmake-stamp:# Already made in general 'make': make htmltouch make-stampcheck: configure make-arch check-stampcheck-stamp:@echo "*** check ***"ifneq ($(arch),arm-linux)-make checkendiftouch check-stampclean:@echo "*** clean ***"dh_testdirdh_testrootrm -f configure-stamp \build-stamp build-indep-stamp build-arch-stamp \make-stamp make-arch-stamp make-indep-stamp \install-indep-stamp install-arch-stamp \check-stamp-make distclean-rm -f `find . -name "*~"`-rm -rf debian/tmp debian/files* core debian/substvars-rm -f doc/html/function.html doc/html/packages.html-rm -f modules/*.so# left over in CVS from r-base --> r-base-core transition(cd debian; rm -vf r-base.dirs r-base.files r-base.lintian \r-base.menu r-base.postinst)dh_cleaninstall: install-arch install-indepinstall-arch: make-arch check install-arch-stampinstall-arch-stamp:@echo "*** install-arch ***"dh_testdirdh_testrootdh_clean -a -kdh_installdirs -Amake prefix=$(debtmp)/usr \mandir=$(debtmp)/usr/share/man install# Now for a set of fixes / corrections for the Debian installation# set R_HOME_DIR env.var. in R shell scriptsed -e '/^R_HOME_DIR=.*/s::R_HOME_DIR=/usr/lib/R:' \< bin/R > $(debtmp)/usr/bin/Rsed -e '/^R_HOME_DIR=.*/s::R_HOME_DIR=/usr/lib/R:' \< bin/R > $(debtmp)/usr/lib/R/bin/R# set browser to mozilla as mozilla-1.0.0 works with help.start()sed -e '/^R_BROWSER=.*/s::R_BROWSER=$${R_BROWSER-/usr/bin/mozilla}:' \< etc/Renviron > $(debtmp)/usr/lib/R/etc/Renviron# fix permissions (Lintian)chmod a+x $(debtmp)/usr/lib/R/share/sh/echo.sh \$(debtmp)/usr/lib/R/share/sh/help-links.sh \$(debtmp)/usr/lib/R/share/sh/help-print.sh# remove unneeded license files, but link them backrm -v $(debtmp)/usr/lib/R/COPYING \$(debtmp)/usr/lib/R/COPYING.LIB(cd $(debtmp)/usr/lib/R/; \ln -s ../../share/common-licenses/GPL COPYING; \ln -s ../../share/common-licenses/LGPL COPYING.LIB)# edd 15 Jul 2002 reduce compile load on small machinesifneq "$(findstring $(arch), m68k-linux arm-linux)" ""perl -p -i -e 's/-g -O2/-g0 -O0/g' $(debtmp)/usr/lib/R/etc/Makeconfendif# edd 10 Jan 2003 fix Perl interpreter path(cd $(debtmp)/usr/lib/R/bin; \for file in Rdconv Rdindex Rprof Sd2Rd build check; do \perl -p -i -e "s|/usr/local/bin/perl|/usr/bin/perl|" \$${file}; \done)# that being done, now install in different sub-packages# move the GNOME version to the r-gnome packageifneq ($(gnome),0)dh_movefiles -p$(gnomepackage) usr/lib/R/modules/R_gnome.soendif# move files for r-recommended# doing this before html/latex moves ensure they keep their tex/latexdh_movefiles -p$(recdpackage)# move the html manual files in r-doc-html.files into r-doc-html# these get built in make-arch too ...dh_movefiles -p$(htmlpackage)# move files for r-base-htmldh_movefiles -pr-base-html# move files for r-base-latexdh_movefiles -pr-base-latex# move all the rest into r-base-coredh_movefiles -p$(corepackage)# for the standalone library package, move the two libs# as 'make install' ignore these, we have to do it by handdh_installdirs -p$(nmathpackage) usr/include usr/libinstall -m 0644 src/nmath/standalone/libRmath.a \$(debmat)/usr/libinstall -m 0644 src/nmath/standalone/libRmath.so \$(debmat)//usr/lib/libRmath.so.$(libver)(cd $(debmat)/usr/lib; \ln -s libRmath.so.$(libver) libRmath.so.$(somaj); \ln -s libRmath.so.$(somaj) libRmath.so)# and create a link for Rmath.h(cd $(debmat)/usr/include; \ln -s ../lib/R/include/Rmath.h .)# now deal with $R_HOME/etc <--> /etc/R# edd 03 Apr 2003 patch Renviron for new R_LIBS standard(cd $(debetc); \cat $(debbase)/Renviron-R_LIBS.patch | patch --verbose; \mv Makeconf Renviron ../../../../etc/R/; \ln -s /etc/R/Makeconf .; \ln -s /etc/R/Renviron . )#touch install-arch-stamp#install-indep: make-arch make-indep install-arch install-indep-stampinstall-indep: make-indep install-indep-stampinstall-indep-stamp:@echo "*** install-indep ***"dh_testdirdh_testrootdh_clean -a -kdh_installdirs -Amake prefix=$(debtmp)/usr install-pdf# the indep package r-doc-info is made nowmake prefix=$(debtmp)/usr \infodir=$(debtmp)/usr/share/info install-info# move the pdf manual files listed in r-doc-pdf.files into r-doc-pdfdh_movefiles -p$(pdfpackage)# move the html manual files in r-doc-html.files into r-doc-htmldh_movefiles -p$(htmlpackage)touch install-indep-stamp# move files for r-doc-infodh_movefiles -p$(infopackage)# but clean up dir and old.dirrm -vf $(debbase)/$(infopackage)/usr/share/info/dir \$(debbase)/$(infopackage)/usr/share/info/dir.old# Build architecture-independent files here.binary-indep: build-indep install-indep@echo "*** binary-indep ***"dh_testdir -idh_testroot -idh_link -i#dh_installdebconf -idh_installdocs -i#dh_installexamples -i#dh_installmenu -i#dh_installemacsen -i#dh_installpam -i#dh_installmime -i#dh_installinit -i#dh_installcron -i#dh_installmanpages -i#dh_installinfo -i#dh_undocumented -idh_installchangelogs -i# install lintian "silencer"install -p -m 0644 debian/$(latexpackage).lintian \$(debbase)/$(latexpackage)/usr/share/lintian/overrides/$(latexpackage)dh_compress -idh_fixperms -i#dh_suidregister -idh_installdeb -i#dh_perl -idh_gencontrol -idh_md5sums -idh_builddeb -i# Build architecture-dependent files here.binary-arch: build-arch install-arch check@echo "*** binary-arch ***"dh_testdir -adh_testroot -a#dh_installdebconf -adh_link -adh_installdocs -p$(corepackage) AUTHORS BUGS NEWS ONEWS README \RESOURCES THANKS Y2K \debian/README.Atlas \debian/README.mathlibdh_installexamples -adh_installexamples -p$(corepackage) src/nmath/standalone/test.cdh_installmenu -a#dh_installemacsen -a#dh_installpam -a#dh_installmime -a#dh_installinit -a#dh_installcron -a#dh_installmanpages -a -N$(gnomepackage) -p$(corepackage) getline.3#dh_installman -p$(corepackage) doc/R.1## dh_installinfo -a -n doc/manual/R-*.info*## edd 04 Apr 2004 manual is dangling unless r-doc-pdf is installed ...##(cd $(debdoc)/doc && ln -s ../../../../lib/R/doc/html .)##(cd $(debdoc)/doc && ln -s ../../../../lib/R/doc/manual .)# ... so install doc as a link, as we already did with library(cd $(debdoc) && ln -s ../../../lib/R/doc .)(cd $(debdoc) && ln -s ../../../lib/R/library .)# install lintian "silencer"install -p -m 0644 debian/$(corepackage).lintian \$(debbase)/$(corepackage)/usr/share/lintian/overrides/$(corepackage)install -p -m 0644 debian/$(recdpackage).lintian \$(debbase)/$(recdpackage)/usr/share/lintian/overrides/$(recdpackage)#dh_undocumented -adh_installchangelogs -a -k NEWSdh_strip -adh_compress -adh_fixperms -a#dh_suidregister -adh_makeshlibs -adh_installdeb -adh_perl -adh_shlibdeps -aecho "*** Hack alert ***"echo "*** Pruning shlibdeps result from double atlas entry ***"cat debian/r-base-core.substvarsperl -p -i -e 's/atlas2-base, //' debian/r-base-core.substvarscat debian/r-base-core.substvarsecho "*** Hack done ***"dh_gencontrol -adh_md5sums -a -X'usr/bin/R' -XLibIndex -Xindex.txt \-Xfunction.html -Xpackages.htmldh_builddeb -abinary: binary-arch binary-indep.PHONY: build clean binary-indep binary-arch binary install install-arch install-indep