| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
# debian/rules file for the Debian/GNU Linux gsl package |
| 4 |
# Copyright (C) 1999 - 2007 by Dirk Eddelbuettel <[email protected]> |
| 5 |
|
| 6 |
source := $(shell head -1 debian/changelog | awk '{print $$1}') |
| 7 |
sonum := 0 |
| 8 |
libpack := libgsl$(sonum)ldbl |
| 9 |
#devpack := $(libpack)-dev |
| 10 |
devpack := libgsl$(sonum)-dev |
| 11 |
dbgpack := libgsl$(sonum)-dbg |
| 12 |
binpack := $(source)-bin |
| 13 |
docpack := $(source)-doc-pdf |
| 14 |
#debtmp := $(CURDIR)/debian/$(libpack) |
| 15 |
debtmp := $(CURDIR)/debian/tmp |
| 16 |
debdoc := $(CURDIR)/debian/$(docpack) |
| 17 |
arch := $(shell dpkg-architecture -qDEB_HOST_ARCH) |
| 18 |
|
| 19 |
|
| 20 |
#export DH_VERBOSE=1 |
| 21 |
|
| 22 |
## needed for texi2pdf / tetex as document has larger-than-normal indices |
| 23 |
export pool_size=250000 |
| 24 |
|
| 25 |
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
| 26 |
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
| 27 |
|
| 28 |
# FOR AUTOCONF 2.52 AND NEWER ONLY |
| 29 |
CONFFLAGS = |
| 30 |
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) |
| 31 |
CONFFLAGS += --build $(DEB_HOST_GNU_TYPE) |
| 32 |
else |
| 33 |
CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) |
| 34 |
endif |
| 35 |
|
| 36 |
DEBUGFLAGS=-g |
| 37 |
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
| 38 |
DEBUGFLAGS += -O0 |
| 39 |
else |
| 40 |
DEBUGFLAGS += -O3 |
| 41 |
ifeq ($(arch),m68k) |
| 42 |
DEBUGFLAGS += -O0 |
| 43 |
endif |
| 44 |
endif |
| 45 |
# edd 12 Sep 2007 alpha fails with -O3 |
| 46 |
ifeq ($(arch),alpha) |
| 47 |
DEBUGFLAGS += -O2 |
| 48 |
endif |
| 49 |
|
| 50 |
# edd 18 Nov 2006: add -fexceptions, but don't use -O3 as |
| 51 |
# 'make check' as gcc hangs in cblas/ after test_ger.c |
| 52 |
CFLAGS :=-Wall -pipe -fexceptions -D_REENTRANT $(DEBUGFLAGS) |
| 53 |
CFLAGSnog :=-Wall -pipe -fexceptions -D_REENTRANT -O2 |
| 54 |
# edd 29 Sep 2005 alpha needs -mieee with gcc 4.0 |
| 55 |
ifeq ($(arch),alpha) |
| 56 |
CFLAGS += -mieee |
| 57 |
endif |
| 58 |
|
| 59 |
upstream: get-orig-source |
| 60 |
get-orig-source: |
| 61 |
#lynx ftp://sources.redhat.com/pub/gsl |
| 62 |
#lynx http://mirrors.rcn.net/pub/sourceware/gsl |
| 63 |
lynx http://www.network-theory.co.uk/download/gsl |
| 64 |
|
| 65 |
configure: configure-stamp |
| 66 |
configure-stamp: |
| 67 |
dh_testdir |
| 68 |
dh_testdir |
| 69 |
|
| 70 |
ln -sf /usr/share/misc/config.sub . |
| 71 |
ln -sf /usr/share/misc/config.guess . |
| 72 |
rm -f config.cache |
| 73 |
|
| 74 |
./configure CFLAGS="$(CFLAGS)" \ |
| 75 |
--prefix=/usr \ |
| 76 |
--enable-shared \ |
| 77 |
--enable-static \ |
| 78 |
--with-gnu-ld \ |
| 79 |
$(CONFFLAGS) |
| 80 |
|
| 81 |
# patch libtool re rpath (see lintian docu) |
| 82 |
sed < libtool > libtool-2 \ |
| 83 |
-e 's/^hardcode_libdir_flag_spec.*$$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/' \ |
| 84 |
-e '/^archive_cmds="/s/"$$/ \\$$deplibs"/' |
| 85 |
mv libtool-2 libtool |
| 86 |
chmod 755 libtool |
| 87 |
# end libtool rpath patch |
| 88 |
touch configure-stamp |
| 89 |
|
| 90 |
build: configure build-stamp |
| 91 |
build-stamp: |
| 92 |
dh_testdir |
| 93 |
$(MAKE) |
| 94 |
touch build-stamp |
| 95 |
|
| 96 |
build-doc: build-doc-stamp |
| 97 |
build-doc-stamp: configure-stamp |
| 98 |
dh_testdir |
| 99 |
# make ps files -- skip as we ship the upstream one in gsl-ref-psdoc |
| 100 |
#cd doc && $(MAKE) ps |
| 101 |
# make pdf |
| 102 |
## edd 10 Apr 2005 added patch by Guiseppe Bonacci for #303757 |
| 103 |
cd doc && \ |
| 104 |
cp -p randist.texi randist.texi.orig && \ |
| 105 |
sed 's/^.*\\input \(rand.*\)\.tex.*$$/@end tex\n@center @image{\1}\n@tex/' \ |
| 106 |
randist.texi.orig > randist.texi && \ |
| 107 |
for i in rand-*.tex random-walk.tex ; do \ |
| 108 |
echo Converting $$i to eps; \ |
| 109 |
j=`basename $$i .tex`; \ |
| 110 |
tex "\batchmode\nopagenumbers\input $$j\bye"; \ |
| 111 |
dvips $$j; \ |
| 112 |
ps2eps -f $$j.ps; \ |
| 113 |
done && \ |
| 114 |
for i in *.eps; do \ |
| 115 |
echo Converting $$i to pdf... && epstopdf $$i ; \ |
| 116 |
done && $(MAKE) ps && ps2pdf gsl-ref.ps |
| 117 |
# edd 23 Mar 2006 'make pdf' is now inactive upstream |
| 118 |
touch build-doc-stamp |
| 119 |
|
| 120 |
test: build test-stamp |
| 121 |
test-stamp: |
| 122 |
-$(MAKE) check CFLAGS="$(CFLAGSnog)" | grep -C5 -v '^PASS:' |
| 123 |
touch test-stamp |
| 124 |
|
| 125 |
clean: |
| 126 |
dh_testdir |
| 127 |
dh_testroot |
| 128 |
rm -f build-stamp install-stamp test-stamp build-doc-stamp \ |
| 129 |
configure-stamp install-doc-stamp |
| 130 |
rm -rf debian/static/ |
| 131 |
-rm -f doc/*.pdf doc/*.dvi doc/*.log doc/*.ps |
| 132 |
dh_clean lib/*so* build/*.so* |
| 133 |
[ ! -f Makefile ] || $(MAKE) distclean |
| 134 |
rm -vf config.sub config.guess |
| 135 |
|
| 136 |
install: test install-stamp |
| 137 |
install-stamp: |
| 138 |
$(MAKE) -f debian/rules DH_OPTIONS= install-work |
| 139 |
install-work: |
| 140 |
dh_testdir |
| 141 |
dh_testroot |
| 142 |
dh_clean -k |
| 143 |
dh_installdirs |
| 144 |
$(MAKE) prefix=$(debtmp)/usr \ |
| 145 |
libdir=$(debtmp)/usr/lib \ |
| 146 |
infodir=$(debtmp)/usr/share/info \ |
| 147 |
includedir=$(debtmp)/usr/include \ |
| 148 |
mandir=$(debtmp)/usr/share/man install |
| 149 |
# deal with automake / install-info issue #215538 |
| 150 |
rm -vf $(debtmp)/usr/share/info/dir \ |
| 151 |
$(debtmp)/usr/share/info/dir.old |
| 152 |
# deal with libtool leftover .la files (#245556) |
| 153 |
rm -vf $(debtmp)/usr/lib/libgsl*.la |
| 154 |
# |
| 155 |
dh_installdirs -p$(binpack) usr/share/man/man1 |
| 156 |
#dh_installman -p$(binpack) debian/gsl-histogram.1 \ |
| 157 |
# debian/gsl-randist.1 |
| 158 |
# move static libs into dev-package and binaries into bin package |
| 159 |
dh_install --sourcedir=debian/tmp -p$(binpack) -p$(devpack) -p$(libpack) |
| 160 |
|
| 161 |
# lintian silencer for the 'ldbl' transition package |
| 162 |
dh_installdirs -p$(libpack) usr/share/lintian/overrides |
| 163 |
install -m0644 debian/libgsl0ldbl.overrides \ |
| 164 |
$(CURDIR)/debian/$(libpack)/usr/share/lintian/overrides/libgsl0ldbl |
| 165 |
|
| 166 |
touch install-stamp |
| 167 |
|
| 168 |
|
| 169 |
install-doc: install-doc-stamp |
| 170 |
install-doc-stamp: build-doc |
| 171 |
dh_testdir |
| 172 |
dh_testroot |
| 173 |
mkdir -p -m 0755 $(debdoc)/usr/share/doc/$(docpack) |
| 174 |
install -m 0644 doc/gsl-ref.pdf $(debdoc)/usr/share/doc/$(docpack) |
| 175 |
touch install-doc-stamp |
| 176 |
|
| 177 |
# This single target is used to build all the packages, all at once, or |
| 178 |
# one at a time. So keep in mind: any options passed to commands here will |
| 179 |
# affect _all_ packages. Anything you want to only affect one package |
| 180 |
# should be put in another target, such as the install target. |
| 181 |
binary-common: build test install |
| 182 |
#dh_testversion 2.0 |
| 183 |
dh_testdir |
| 184 |
dh_testroot |
| 185 |
#dh_installdebconf |
| 186 |
dh_link |
| 187 |
dh_installdocs -p$(libpack) AUTHORS NEWS README TODO \ |
| 188 |
BUGS THANKS SUPPORT |
| 189 |
#dh_installexamples |
| 190 |
#dh_installmenu |
| 191 |
#dh_installemacsen |
| 192 |
#dh_installpam |
| 193 |
#dh_installinit |
| 194 |
#dh_installcron |
| 195 |
dh_installinfo -p$(devpack) |
| 196 |
#dh_undocumented -p$(binpack) gsl-histogram.1 gsl-randist.1 |
| 197 |
dh_installchangelogs ChangeLog |
| 198 |
dh_compress |
| 199 |
dh_fixperms |
| 200 |
# dh_strip -N$(devpack) |
| 201 |
dh_strip --sourcedir=debian/tmp --dbg-package=libgsl0-dbg |
| 202 |
#dh_suidregister |
| 203 |
dh_makeshlibs |
| 204 |
dh_installdeb |
| 205 |
#dh_perl |
| 206 |
dh_shlibdeps |
| 207 |
dh_gencontrol |
| 208 |
dh_md5sums |
| 209 |
dh_builddeb |
| 210 |
|
| 211 |
# Build architecture independant packages using the common target. |
| 212 |
binary-indep: build-doc install-doc |
| 213 |
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common |
| 214 |
|
| 215 |
# Build architecture dependant packages using the common target. |
| 216 |
binary-arch: build install |
| 217 |
$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common |
| 218 |
|
| 219 |
# Any other binary targets build just one binary package at a time. |
| 220 |
#binary-%: build install |
| 221 |
# make -f debian/rules binary-common DH_OPTIONS=-p$* |
| 222 |
|
| 223 |
binary: binary-arch binary-indep |
| 224 |
.PHONY: build build-doc clean binary-indep binary-arch binary install install-doc |