File: MatthewVernon.patch

package info (click to toggle)
gsl 2.3%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 20,392 kB
  • ctags: 15,188
  • sloc: ansic: 235,014; sh: 11,541; makefile: 869
file content (232 lines) | stat: -rw-r--r-- 7,754 bytes parent folder | download | duplicates (10)
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
diff -ruN unchanged/gsl-1.11+dfsg/debian/control gsl-1.11+dfsg/debian/control
--- unchanged/gsl-1.11+dfsg/debian/control	2008-10-29 11:35:22.000000000 +0000
+++ gsl-1.11+dfsg/debian/control	2008-10-29 10:28:07.000000000 +0000
@@ -73,3 +73,20 @@
  This package contains debugging symbol tables for the static  GSL libraries
  libgsl and libgslcblas from the libgsl0-dev package, and the binaries 
  gsl-randist and gsl-histogram from the gsl-bin package.
+
+
+Package: libgsl0-prof
+Section: libdevel
+Priority: extra
+Architecture: any
+Depends: libgsl0ldbl (= ${binary:Version})
+Description: GNU Scientific Library (GSL) -- Profiling Libraries
+ The GNU Scientific Library (GSL) is a collection of routines for
+ numerical analysis.  The routines are written from scratch by the GSL
+ team in C, and present a modern API for C programmers, while allowing
+ wrappers to be written for very high level languages.
+ .
+ This package contains static libraries compiled with profiling info (-pg)
+ suitable for use with gprof.
+ .
+ URL: http://www.gnu.org/software/gsl/
diff -ruN unchanged/gsl-1.11+dfsg/debian/libgsl0ldbl.docs gsl-1.11+dfsg/debian/libgsl0ldbl.docs
--- unchanged/gsl-1.11+dfsg/debian/libgsl0ldbl.docs	1970-01-01 01:00:00.000000000 +0100
+++ gsl-1.11+dfsg/debian/libgsl0ldbl.docs	2008-10-29 10:30:27.000000000 +0000
@@ -0,0 +1,7 @@
+AUTHORS
+NEWS
+README
+TODO
+BUGS
+THANKS
+SUPPORT
diff -ruN unchanged/gsl-1.11+dfsg/debian/libgsl0-prof.install gsl-1.11+dfsg/debian/libgsl0-prof.install
--- unchanged/gsl-1.11+dfsg/debian/libgsl0-prof.install	1970-01-01 01:00:00.000000000 +0100
+++ gsl-1.11+dfsg/debian/libgsl0-prof.install	2008-10-29 10:31:12.000000000 +0000
@@ -0,0 +1 @@
+usr/lib/libgsl*p.a
diff -ruN unchanged/gsl-1.11+dfsg/debian/README.Debian gsl-1.11+dfsg/debian/README.Debian
--- unchanged/gsl-1.11+dfsg/debian/README.Debian	2008-10-29 11:35:22.000000000 +0000
+++ gsl-1.11+dfsg/debian/README.Debian	2008-10-29 10:32:59.000000000 +0000
@@ -1,3 +1,4 @@
+			    Documentation
 
 Documentation (in info or pdf format) is no longer provided by the
 standard GNU GSL packages. Debian takes a hard stand on the
@@ -10,3 +11,25 @@
 apt-get and other tools can download from it.
 
  -- Dirk Eddelbuettel <edd@debian.org>, Tue, 26 Aug 2008 18:21:00 -0500
+
+			    Profiling GSL
+
+Sometimes when writing complex code, you may want to profile it using
+gprof. In this case, having libraries with profiling information
+compiled in is invaluable. It is possible to build your own .deb
+containing profiling libraries, that may be installed on your system
+in parallel to the usual libraries. To do this, follow these simple
+instructions: 
+
+i) download the gsl source (and the build dependancies if necessary):
+apt-get source libgsl0
+apt-get build-dep libgsl0
+ii) build a binary profiling package:
+DEB_BUILD_OPTIONS=buildprof dpkg-buildpackage -b -rfakeroot -us -uc
+iii) install the resulting .deb
+dpkg -i ../libgsl0-prof_[version]_[arch].deb
+
+Finally, you need to specify -lgsl_p and -lgslcblas_p to link your
+program against the profiling libraries.
+
+ -- Matthew Vernon <matthew@debian.org>, Wed, 29 Oct 2008 10:34:19 +0000
diff -ruN unchanged/gsl-1.11+dfsg/debian/rules gsl-1.11+dfsg/debian/rules
--- unchanged/gsl-1.11+dfsg/debian/rules	2008-10-29 11:35:22.000000000 +0000
+++ gsl-1.11+dfsg/debian/rules	2008-10-29 11:32:48.000000000 +0000
@@ -10,10 +10,12 @@
 devpack := libgsl$(sonum)-dev
 dbgpack := libgsl$(sonum)-dbg
 binpack := $(source)-bin
+profpack := libgsl$(sonum)-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)
 
 
@@ -56,13 +58,31 @@
 CFLAGS	+= -mieee
 endif
 
+#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$(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: configure-stamp
+
+configure: $(CONFIGTARGET)
+
 configure-stamp:
 	dh_testdir
 	dh_testdir
@@ -90,6 +110,25 @@
         # end libtool rpath patch
 	touch configure-stamp
 
+configure-prof-stamp:
+	dh_testdir
+
+	ln -sf /usr/share/misc/config.sub .
+	ln -sf /usr/share/misc/config.guess .
+	rm -f config.cache
+
+	[ -d doc ] || mkdir doc
+	cp -vax debian/Makefile.in.doc doc/Makefile.in
+
+	./configure 	CFLAGS="$(CFLAGS)" 		\
+			--prefix=/usr 			\
+			--disable-shared 		\
+			--enable-static 		\
+			--with-gnu-ld 			\
+			$(CONFFLAGS) 			
+	touch configure-prof-stamp
+
+
 build: configure build-stamp
 build-stamp:
 	dh_testdir
@@ -132,15 +171,17 @@
 	dh_testdir
 	dh_testroot
 	rm -f build-stamp install-stamp test-stamp build-doc-stamp \
-		configure-stamp install-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*
-	[ ! -f Makefile ] || $(MAKE) distclean	
+	[ ! -f Makefile ] || $(MAKE) distclean || true
 	rm -vf config.sub config.guess
 	rm -rf doc/
+	rm -rf $(debtmp) $(debprof)
 
-install: test install-stamp 
+install: test $(INSTALLTARGET)
 install-stamp: 
 	$(MAKE) -f debian/rules DH_OPTIONS= install-work
 install-work:
@@ -174,6 +215,21 @@
 
 	touch install-stamp
 
+install-prof-stamp: test-stamp
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	$(MAKE) prefix=$(debtmp)/usr	 		\
+		libdir=$(debtmp)/usr/lib		\
+		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/*.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
@@ -195,9 +251,7 @@
 	dh_testroot
         #dh_installdebconf
 	dh_link
-	dh_installdocs		-p$(libpack)	AUTHORS NEWS README TODO \
-						BUGS THANKS SUPPORT \
-						debian/README.Debian
+	dh_installdocs
         #dh_installexamples
         #dh_installmenu
         #dh_installemacsen
@@ -210,7 +264,7 @@
 	dh_compress
 	dh_fixperms
 #	dh_strip		-N$(devpack)
-	dh_strip	--sourcedir=debian/tmp	--dbg-package=libgsl0-dbg
+	dh_strip -X_p.a	--sourcedir=debian/tmp	--dbg-package=libgsl0-dbg
         #dh_suidregister
 	dh_makeshlibs
 	dh_installdeb
@@ -222,15 +276,16 @@
 
 # Build architecture independant packages using the common target.
 binary-indep: build-doc install-doc
-	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+	$(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 binary-common
+	$(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: binary-arch binary-indep 
+binary: $(BINARYTARGET)
 .PHONY: build build-doc clean binary-indep binary-arch binary install install-doc