File: rules

package info (click to toggle)
gsl 2.5+dfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 25,628 kB
  • sloc: ansic: 245,573; sh: 11,435; makefile: 911; python: 68
file content (308 lines) | stat: -rwxr-xr-x 9,426 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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
#!/usr/bin/make -f
#                                                       -*- makefile -*-
# debian/rules file for the Debian/GNU Linux gsl package
# Copyright (C) 1999 - 2017  Dirk Eddelbuettel <edd@debian.org>

source  := $(shell head -1 debian/changelog | awk '{print $$1}')
sonum   := 23
#libpack := libgsl$(sonum)ldbl
libpack := libgsl$(sonum)
libcblas := libgslcblas0
#devpack := $(libpack)-dev
#devpack := libgsl$(sonum)-dev
#dbgpack := libgsl$(sonum)-dbg
devpack := libgsl-dev
dbgpack := libgsl-dbg
binpack := $(source)-bin
#profpack := libgsl$(sonum)-prof
profpack := libgsl-prof
#docpack := $(source)-doc-pdf
#debtmp	:= $(CURDIR)/debian/$(libpack)
debtmp	:= $(CURDIR)/debian/tmp
#debdoc	:= $(CURDIR)/debian/$(docpack)
debprof := $(CURDIR)/debian/$(profpack)
arch 	:= $(shell dpkg-architecture -qDEB_HOST_ARCH)


#export DH_VERBOSE=1

## needed for texi2pdf / tetex as document has larger-than-normal indices
export pool_size=250000

export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

# FOR AUTOCONF 2.52 AND NEWER ONLY
CONFFLAGS =
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  CONFFLAGS += --build $(DEB_HOST_GNU_TYPE)
else
  CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

DEBUGFLAGS=-g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	DEBUGFLAGS += -O0
else
	DEBUGFLAGS += -O3
ifeq ($(arch),m68k)
	DEBUGFLAGS += -O0
endif
endif
# edd 12 Sep 2007  alpha fails with -O3
ifeq ($(arch),alpha)
	DEBUGFLAGS += -O2
endif

# edd 18 Nov 2006:  add -fexceptions, but don't use -O3 as 
#                   'make check' as gcc hangs in cblas/ after test_ger.c
# edd 05 Jul 2014:  add dpkg-buildflags call
CFLAGS	   :=-Wall -pipe -fexceptions -D_REENTRANT $(DEBUGFLAGS) $(shell dpkg-buildflags --get CFLAGS)
CFLAGSnog  :=-Wall -pipe -fexceptions -D_REENTRANT               $(shell dpkg-buildflags --get CFLAGS | sed -e 's/-g//')
# edd 29 Sep 2005   alpha needs -mieee with gcc 4.0
ifeq ($(arch),alpha)
CFLAGS	+= -mieee
endif

# edd 05 Jul 2014:  add dpkg-buildflags call
LDFLAGS	= $(shell dpkg-buildflags --get LDFLAGS)


#setting DEB_BUILD_OPTIONS=buildprof means we build a package
#consisting of static libraries (renamed to libfoo_p.a) with 
#profiling information in.
ifneq (,$(findstring buildprof,$(DEB_BUILD_OPTIONS)))
CONFIGTARGET = configure-prof-stamp
INSTALLTARGET = install-prof-stamp
BINARYTARGET = binary-prof
CFLAGS += -pg
export DH_OPTIONS =-N$(libpack) -N$(libcblas) -N$(devpack) -N$(binpack) -N$(dbgpack) -p$(profpack)
else
CONFIGTARGET = configure-stamp
INSTALLTARGET = install-stamp
BINARYTARGET = binary-arch binary-indep
export DH_OPTIONS =-N$(profpack)
endif

upstream: get-orig-source
get-orig-source: 
        #lynx ftp://sources.redhat.com/pub/gsl
        #lynx http://mirrors.rcn.net/pub/sourceware/gsl
	lynx http://www.network-theory.co.uk/download/gsl


configure: $(CONFIGTARGET)

configure-stamp:
	dh_testdir
	dh_testdir

	rm -f config.cache

	#[ -d doc ] || mkdir doc
	#cp -vax debian/Makefile.in.doc doc/Makefile.in

	AUTOMAKE=automake ACLOCAL=aclocal dh_autoreconf
	./configure 	CFLAGS="$(CFLAGS)" 		\
			LDFLAGS="$(LDFLAGS)"		\
			--prefix=/usr 			\
			--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
			--enable-shared 		\
			--enable-static 		\
			--with-gnu-ld 			\
			--enable-maintainer-mode	\
			$(CONFFLAGS) 			

        # patch libtool re rpath (see lintian docu)
	sed < libtool > libtool-2 \
			-e 's/^hardcode_libdir_flag_spec.*$$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/' \
			-e '/^archive_cmds="/s/"$$/ \\$$deplibs"/'
	mv libtool-2 libtool
	chmod 755 libtool            
        # end libtool rpath patch
	touch configure-stamp

configure-prof-stamp:
	dh_testdir

	rm -f config.cache

	#[ -d doc ] || mkdir doc
	#cp -vax debian/Makefile.in.doc doc/Makefile.in
	AUTOMAKE=automake ACLOCAL=aclocal dh_autoreconf
	./configure 	CFLAGS="$(CFLAGS)" 		\
			--prefix=/usr 			\
			--disable-shared 		\
			--enable-static 		\
			--with-gnu-ld 			\
			$(CONFFLAGS) 			
	touch configure-prof-stamp


build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure-stamp
	dh_testdir
	$(MAKE)	
	touch build-stamp

build-doc: build-doc-stamp
build-doc-stamp: configure-stamp
	dh_testdir
	touch build-doc-stamp

deprecated-non-free-doc:
        # make ps files -- skip as we ship the upstream one in gsl-ref-psdoc
        #cd doc && $(MAKE) ps
        # make pdf
        ## edd 10 Apr 2005  added patch by Guiseppe Bonacci for #303757 
	cd doc && \
	   cp -p randist.texi randist.texi.orig && \
	   sed 's/^.*\\input \(rand.*\)\.tex.*$$/@end tex\n@center @image{\1}\n@tex/' \
	     randist.texi.orig > randist.texi && \
	   for i in rand-*.tex random-walk.tex ; do \
	     echo Converting $$i to eps; \
	     j=`basename $$i .tex`; \
	     tex "\batchmode\nopagenumbers\input $$j\bye"; \
	     dvips $$j; \
	     ps2eps -f $$j.ps; \
	   done && \
	   for i in *.eps; do \
	     echo Converting $$i to pdf... && epstopdf $$i ; \
	   done && $(MAKE) ps && ps2pdf gsl-ref.ps
        # edd 23 Mar 2006  'make pdf' is now inactive upstream
	touch build-doc-stamp

test:	build test-stamp
test-stamp: 
	-$(MAKE) check CFLAGS="$(CFLAGSnog)" | grep -C5 -v '^PASS:'
	touch test-stamp

clean:
	dh_testdir
	dh_testroot
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -f build-stamp install-stamp test-stamp build-doc-stamp \
		configure-stamp install-doc-stamp configure-prof-stamp \
		install-prof-stamp
	rm -rf debian/static/
	-rm -f doc/*.pdf doc/*.dvi doc/*.log doc/*.ps
	dh_clean lib/*so* build/*.so*
	#dh_autoreconf_clean
	#rm -rf doc/
	rm -rf $(debtmp) $(debprof)

install: test $(INSTALLTARGET)
install-stamp: 
	$(MAKE) -f debian/rules DH_OPTIONS= install-work
install-work:
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	$(MAKE) prefix=$(debtmp)/usr	 		\
		libdir=$(debtmp)/usr/lib/$(DEB_HOST_MULTIARCH)	\
		infodir=$(debtmp)/usr/share/info	\
		includedir=$(debtmp)/usr/include	\
		mandir=$(debtmp)/usr/share/man		install
        # deal with automake / install-info issue #215538
	rm -vf	$(debtmp)/usr/share/info/dir 		\
		$(debtmp)/usr/share/info/dir.old 	
        # purify for DFSG compliance and delete (!!) documentation
	rm -rvf	$(debtmp)/usr/share/info
        # deal with libtool leftover .la files (#245556)
	rm -vf $(debtmp)/usr/lib/$(DEB_HOST_MULTIARCH)/libgsl*.la
        #
	dh_installdirs		-p$(binpack)	usr/share/man/man1
        #dh_installman		-p$(binpack)	debian/gsl-histogram.1 \
        #					debian/gsl-randist.1
        # move static libs into dev-package  and binaries into bin package
	dh_install --sourcedir=debian/tmp -p$(libpack)
	dh_install --sourcedir=debian/tmp -p$(libcblas)
	dh_install --sourcedir=debian/tmp -p$(devpack) 
	dh_install --sourcedir=debian/tmp -p$(binpack) 

        # lintian silencer for the 'ldbl' transition package
	dh_installdirs -p$(libpack) usr/share/lintian/overrides
	install -m0644 debian/$(libpack).overrides \
		$(CURDIR)/debian/$(libpack)/usr/share/lintian/overrides/$(libpack)

	touch install-stamp

install-prof-stamp: test-stamp
	dh_testdir
	dh_testroot
	dh_prep
	$(MAKE) prefix=$(debtmp)/usr	 		\
		libdir=$(debtmp)/usr/lib/$(DEB_HOST_MULTIARCH)	\
		infodir=$(debtmp)/usr/share/info	\
		includedir=$(debtmp)/usr/include	\
		mandir=$(debtmp)/usr/share/man		install
	#rename the profiling libraries
	for lib in $(debtmp)/usr/lib/$(DEB_HOST_MULTIARCH)/*.a ;\
		do mv "$$lib" "$${lib%%.a}_p.a"; done
	dh_install --sourcedir=$(debtmp)
	touch install-prof-stamp


install-doc: install-doc-stamp
install-doc-stamp: build-doc
	dh_testdir
	dh_testroot
	touch install-doc-stamp

deprecated-non-free-doc:
	mkdir -p -m 0755 $(debdoc)/usr/share/doc/$(docpack)
	install -m 0644 doc/gsl-ref.pdf  $(debdoc)/usr/share/doc/$(docpack)

# This single target is used to build all the packages, all at once, or
# one at a time. So keep in mind: any options passed to commands here will
# affect _all_ packages. Anything you want to only affect one package
# should be put in another target, such as the install target.
binary-common: build test install 
        #dh_testversion 2.0
	dh_testdir
	dh_testroot
        #dh_installdebconf
	dh_link
	dh_installdocs
        #dh_installexamples
        #dh_installmenu
        #dh_installemacsen
        #dh_installpam
        #dh_installinit
        #dh_installcron
        #dh_installinfo		-p$(devpack)
        #dh_undocumented	-p$(binpack)	gsl-histogram.1 gsl-randist.1
	dh_installchangelogs			ChangeLog
	dh_compress
	dh_fixperms
#	dh_strip		-N$(devpack)
	dh_strip -X_p.a	--dbg-package=$(dbgpack)
        #dh_suidregister
	dh_makeshlibs
	dh_installdeb
        #dh_perl
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture independant packages using the common target.
binary-indep: build-doc install-doc
	$(MAKE) -f debian/rules DH_OPTIONS="-i -N$(profpack)" binary-common

# Build architecture dependant packages using the common target.
binary-arch: build install
	$(MAKE) -f debian/rules DH_OPTIONS="-a -N$(profpack)" binary-common

binary-prof: binary-common
# Any other binary targets build just one binary package at a time.
#binary-%: build install
#	make -f debian/rules binary-common DH_OPTIONS=-p$*

binary: $(BINARYTARGET)
.PHONY: build build-doc clean binary-indep binary-arch binary install install-doc