Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # debian/rules file for the Debian/GNU Linux gsl package
4 # Copyright (C) 1999 - 2024 Dirk Eddelbuettel <[email protected]>
5
6 source := $(shell head -1 debian/changelog | awk '{print $$1}')
7 sonum := 28
8 #libpack := libgsl$(sonum)ldbl
9 libpack := libgsl$(sonum)
10 libcblas := libgslcblas0
11 #devpack := $(libpack)-dev
12 #devpack := libgsl$(sonum)-dev
13 #dbgpack := libgsl$(sonum)-dbg
14 devpack := libgsl-dev
15 dbgpack := libgsl-dbg
16 binpack := $(source)-bin
17 #profpack := libgsl$(sonum)-prof
18 profpack := libgsl-prof
19 #docpack := $(source)-doc-pdf
20 #debtmp := $(CURDIR)/debian/$(libpack)
21 debtmp := $(CURDIR)/debian/tmp
22 #debdoc := $(CURDIR)/debian/$(docpack)
23 debprof := $(CURDIR)/debian/$(profpack)
24 arch := $(shell dpkg-architecture -qDEB_HOST_ARCH)
25
26
27 #export DH_VERBOSE=1
28
29 ## needed for texi2pdf / tetex as document has larger-than-normal indices
30 export pool_size=250000
31
32 export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
33 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
34
35 # FOR AUTOCONF 2.52 AND NEWER ONLY
36 CONFFLAGS =
37 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
38 CONFFLAGS += --build $(DEB_HOST_GNU_TYPE)
39 else
40 CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
41 endif
42
43 export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
44
45 DEBUGFLAGS=-g
46 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
47 DEBUGFLAGS += -O0
48 else
49 DEBUGFLAGS += -O3
50 ifeq ($(arch),m68k)
51 DEBUGFLAGS += -O0
52 endif
53 endif
54 # edd 12 Sep 2007 alpha fails with -O3
55 ifeq ($(arch),alpha)
56 DEBUGFLAGS += -O2
57 endif
58
59 # edd 18 Nov 2006: add -fexceptions, but don't use -O3 as
60 # 'make check' as gcc hangs in cblas/ after test_ger.c
61 # edd 05 Jul 2014: add dpkg-buildflags call
62 CFLAGS :=-Wall -pipe -fexceptions -D_REENTRANT $(DEBUGFLAGS) $(shell dpkg-buildflags --get CFLAGS)
63 CFLAGSnog :=-Wall -pipe -fexceptions -D_REENTRANT $(shell dpkg-buildflags --get CFLAGS | sed -e 's/-g//')
64 # edd 29 Sep 2005 alpha needs -mieee with gcc 4.0
65 ifeq ($(arch),alpha)
66 CFLAGS += -mieee
67 endif
68
69 # edd 05 Jul 2014: add dpkg-buildflags call
70 LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
71
72
73 #setting DEB_BUILD_PROFILES=pkg.gsl.prof means we build a package
74 #consisting of static libraries (renamed to libfoo_p.a) with
75 #profiling information in.
76 ifneq (,$(findstring pkg.gsl.prof,$(DEB_BUILD_PROFILES)))
77 CONFIGTARGET = configure-prof-stamp
78 INSTALLTARGET = install-prof-stamp
79 BINARYTARGET = binary-prof
80 CFLAGS += -pg
81 export DH_OPTIONS =-N$(libpack) -N$(libcblas) -N$(devpack) -N$(binpack) -N$(dbgpack) -p$(profpack)
82 else
83 CONFIGTARGET = configure-stamp
84 INSTALLTARGET = install-stamp
85 BINARYTARGET = binary-arch binary-indep
86 export DH_OPTIONS =-N$(profpack)
87 endif
88
89 upstream: get-orig-source
90 get-orig-source:
91 #lynx ftp://sources.redhat.com/pub/gsl
92 #lynx http://mirrors.rcn.net/pub/sourceware/gsl
93 lynx http://www.network-theory.co.uk/download/gsl
94
95
96 configure: $(CONFIGTARGET)
97
98 configure-stamp:
99 dh_testdir
100 dh_testdir
101
102 rm -f config.cache
103
104 #[ -d doc ] || mkdir doc
105 #cp -vax debian/Makefile.in.doc doc/Makefile.in
106
107 AUTOMAKE=automake ACLOCAL=aclocal dh_autoreconf
108 ./configure CFLAGS="$(CFLAGS)" \
109 LDFLAGS="$(LDFLAGS)" \
110 --prefix=/usr \
111 --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
112 --enable-shared \
113 --enable-static \
114 --with-gnu-ld \
115 --enable-maintainer-mode \
116 $(CONFFLAGS)
117
118 # patch libtool re rpath (see lintian docu)
119 sed < libtool > libtool-2 \
120 -e 's/^hardcode_libdir_flag_spec.*$$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/' \
121 -e '/^archive_cmds="/s/"$$/ \\$$deplibs"/'
122 mv libtool-2 libtool
123 chmod 755 libtool
124 # end libtool rpath patch
125 touch configure-stamp
126
127 configure-prof-stamp:
128 dh_testdir
129
130 rm -f config.cache
131
132 #[ -d doc ] || mkdir doc
133 #cp -vax debian/Makefile.in.doc doc/Makefile.in
134 AUTOMAKE=automake ACLOCAL=aclocal dh_autoreconf
135 ./configure CFLAGS="$(CFLAGS)" \
136 --prefix=/usr \
137 --disable-shared \
138 --enable-static \
139 --with-gnu-ld \
140 $(CONFFLAGS)
141 touch configure-prof-stamp
142
143
144 build: build-arch build-indep
145 build-arch: build-stamp
146 build-indep: build-stamp
147 build-stamp: configure-stamp
148 dh_testdir
149 $(MAKE)
150 touch build-stamp
151
152 build-doc: build-doc-stamp
153 build-doc-stamp: configure-stamp
154 dh_testdir
155 touch build-doc-stamp
156
157 # deprecated-non-free-doc:
158 # # make ps files -- skip as we ship the upstream one in gsl-ref-psdoc
159 # #cd doc && $(MAKE) ps
160 # # make pdf
161 # ## edd 10 Apr 2005 added patch by Guiseppe Bonacci for #303757
162 # cd doc && \
163 # cp -p randist.texi randist.texi.orig && \
164 # sed 's/^.*\\input \(rand.*\)\.tex.*$$/@end tex\n@center @image{\1}\n@tex/' \
165 # randist.texi.orig > randist.texi && \
166 # for i in rand-*.tex random-walk.tex ; do \
167 # echo Converting $$i to eps; \
168 # j=`basename $$i .tex`; \
169 # tex "\batchmode\nopagenumbers\input $$j\bye"; \
170 # dvips $$j; \
171 # ps2eps -f $$j.ps; \
172 # done && \
173 # for i in *.eps; do \
174 # echo Converting $$i to pdf... && epstopdf $$i ; \
175 # done && $(MAKE) ps && ps2pdf gsl-ref.ps
176 # # edd 23 Mar 2006 'make pdf' is now inactive upstream
177 # touch build-doc-stamp
178
179 test: build test-stamp
180 test-stamp:
181 -$(MAKE) check CFLAGS="$(CFLAGSnog)" | grep -C5 -v '^PASS:'
182 touch test-stamp
183
184 clean:
185 dh_testdir
186 dh_testroot
187 [ ! -f Makefile ] || $(MAKE) distclean
188 rm -f build-stamp install-stamp test-stamp build-doc-stamp \
189 configure-stamp install-doc-stamp configure-prof-stamp \
190 install-prof-stamp
191 rm -rf debian/static/
192 -rm -f doc/*.pdf doc/*.dvi doc/*.log doc/*.ps
193 dh_clean lib/*so* build/*.so*
194 #dh_autoreconf_clean
195 #rm -rf doc/
196 rm -rf $(debtmp) $(debprof)
197
198 install: test $(INSTALLTARGET)
199 install-stamp:
200 $(MAKE) -f debian/rules DH_OPTIONS= install-work
201 install-work:
202 dh_testdir
203 dh_testroot
204 dh_prep
205 dh_installdirs
206 $(MAKE) prefix=$(debtmp)/usr \
207 libdir=$(debtmp)/usr/lib/$(DEB_HOST_MULTIARCH) \
208 infodir=$(debtmp)/usr/share/info \
209 includedir=$(debtmp)/usr/include \
210 mandir=$(debtmp)/usr/share/man install
211 # deal with automake / install-info issue #215538
212 rm -vf $(debtmp)/usr/share/info/dir \
213 $(debtmp)/usr/share/info/dir.old
214 # purify for DFSG compliance and delete (!!) documentation
215 rm -rvf $(debtmp)/usr/share/info
216 # deal with libtool leftover .la files (#245556)
217 rm -vf $(debtmp)/usr/lib/$(DEB_HOST_MULTIARCH)/libgsl*.la
218 #
219 dh_installdirs -p$(binpack) usr/share/man/man1
220 #dh_installman -p$(binpack) debian/gsl-histogram.1 \
221 # debian/gsl-randist.1
222 # move static libs into dev-package and binaries into bin package
223 dh_install --sourcedir=debian/tmp -p$(libpack)
224 dh_install --sourcedir=debian/tmp -p$(libcblas)
225 dh_install --sourcedir=debian/tmp -p$(devpack)
226 dh_install --sourcedir=debian/tmp -p$(binpack)
227
228 # lintian silencer for the 'ldbl' transition package
229 dh_installdirs -p$(libpack) usr/share/lintian/overrides
230 #install -m0644 debian/$(libpack).overrides \
231 # $(CURDIR)/debian/$(libpack)/usr/share/lintian/overrides/$(libpack)
232
233 touch install-stamp
234
235 install-prof-stamp: test-stamp
236 dh_testdir
237 dh_testroot
238 dh_prep
239 $(MAKE) prefix=$(debtmp)/usr \
240 libdir=$(debtmp)/usr/lib/$(DEB_HOST_MULTIARCH) \
241 infodir=$(debtmp)/usr/share/info \
242 includedir=$(debtmp)/usr/include \
243 mandir=$(debtmp)/usr/share/man install
244 #rename the profiling libraries
245 for lib in $(debtmp)/usr/lib/$(DEB_HOST_MULTIARCH)/*.a ;\
246 do mv "$$lib" "$${lib%%.a}_p.a"; done
247 dh_install --sourcedir=$(debtmp)
248 touch install-prof-stamp
249
250
251 install-doc: install-doc-stamp
252 install-doc-stamp: build-doc
253 dh_testdir
254 dh_testroot
255 touch install-doc-stamp
256
257 deprecated-non-free-doc:
258 mkdir -p -m 0755 $(debdoc)/usr/share/doc/$(docpack)
259 install -m 0644 doc/gsl-ref.pdf $(debdoc)/usr/share/doc/$(docpack)
260
261 # This single target is used to build all the packages, all at once, or
262 # one at a time. So keep in mind: any options passed to commands here will
263 # affect _all_ packages. Anything you want to only affect one package
264 # should be put in another target, such as the install target.
265 binary-common: build test install
266 #dh_testversion 2.0
267 dh_testdir
268 dh_testroot
269 #dh_installdebconf
270 dh_link
271 dh_installdocs
272 #dh_installexamples
273 #dh_installmenu
274 #dh_installemacsen
275 #dh_installpam
276 #dh_installinit
277 #dh_installcron
278 #dh_installinfo -p$(devpack)
279 #dh_undocumented -p$(binpack) gsl-histogram.1 gsl-randist.1
280 dh_installchangelogs ChangeLog
281 dh_compress
282 dh_fixperms
283 # dh_strip -N$(devpack)
284 dh_strip -X_p.a --dbg-package=$(dbgpack)
285 #dh_suidregister
286 dh_makeshlibs
287 dh_installdeb
288 #dh_perl
289 dh_shlibdeps
290 dh_gencontrol
291 dh_md5sums
292 dh_builddeb
293
294 # Build architecture independant packages using the common target.
295 binary-indep: build-doc install-doc
296 $(MAKE) -f debian/rules DH_OPTIONS="-i -N$(profpack)" binary-common
297
298 # Build architecture dependant packages using the common target.
299 binary-arch: build install
300 $(MAKE) -f debian/rules DH_OPTIONS="-a -N$(profpack)" binary-common
301
302 binary-prof: binary-common
303 # Any other binary targets build just one binary package at a time.
304 #binary-%: build install
305 # make -f debian/rules binary-common DH_OPTIONS=-p$*
306
307 binary: $(BINARYTARGET)
308 .PHONY: build build-doc clean binary-indep binary-arch binary install install-doc