| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
source := $(shell head -1 debian/changelog | awk '{print $$1}') |
| 7 |
sonum := 28 |
| 8 |
|
| 9 |
libpack := libgsl$(sonum) |
| 10 |
libcblas := libgslcblas0 |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
devpack := libgsl-dev |
| 15 |
dbgpack := libgsl-dbg |
| 16 |
binpack := $(source)-bin |
| 17 |
|
| 18 |
profpack := libgsl-prof |
| 19 |
|
| 20 |
|
| 21 |
debtmp := $(CURDIR)/debian/tmp |
| 22 |
|
| 23 |
debprof := $(CURDIR)/debian/$(profpack) |
| 24 |
arch := $(shell dpkg-architecture -qDEB_HOST_ARCH) |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 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 |
|
| 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 |
|
| 55 |
ifeq ($(arch),alpha) |
| 56 |
DEBUGFLAGS += -O2 |
| 57 |
endif |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 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 |
|
| 65 |
ifeq ($(arch),alpha) |
| 66 |
CFLAGS += -mieee |
| 67 |
endif |
| 68 |
|
| 69 |
|
| 70 |
LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 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 |
|
| 92 |
|
| 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 |
|
| 105 |
|
| 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 |
|
| 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 |
|
| 125 |
touch configure-stamp |
| 126 |
|
| 127 |
configure-prof-stamp: |
| 128 |
dh_testdir |
| 129 |
|
| 130 |
rm -f config.cache |
| 131 |
|
| 132 |
|
| 133 |
|
| 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 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
Guiseppe |
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 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 |
|
| 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 |
|
| 212 |
rm -vf $(debtmp)/usr/share/info/dir \ |
| 213 |
$(debtmp)/usr/share/info/dir.old |
| 214 |
|
| 215 |
rm -rvf $(debtmp)/usr/share/info |
| 216 |
|
| 217 |
rm -vf $(debtmp)/usr/lib/$(DEB_HOST_MULTIARCH)/libgsl*.la |
| 218 |
|
| 219 |
dh_installdirs -p$(binpack) usr/share/man/man1 |
| 220 |
dh_installman |
| 221 |
|
| 222 |
|
| 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 |
|
| 229 |
dh_installdirs -p$(libpack) usr/share/lintian/overrides |
| 230 |
|
| 231 |
|
| 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 |
|
| 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 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
binary-common: build test install |
| 266 |
dh_testversion |
| 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 |
| 279 |
dh_undocumented |
| 280 |
dh_installchangelogs ChangeLog |
| 281 |
dh_compress |
| 282 |
dh_fixperms |
| 283 |
|
| 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 |
independant |
| 295 |
binary-indep: build-doc install-doc |
| 296 |
$(MAKE) -f debian/rules DH_OPTIONS="-i -N$(profpack)" binary-common |
| 297 |
|
| 298 |
|
| 299 |
binary-arch: build install |
| 300 |
$(MAKE) -f debian/rules DH_OPTIONS="-a -N$(profpack)" binary-common |
| 301 |
|
| 302 |
binary-prof: binary-common |
| 303 |
|
| 304 |
|
| 305 |
|
| 306 |
|
| 307 |
binary: $(BINARYTARGET) |
| 308 |
.PHONY: build build-doc clean binary-indep binary-arch binary install install-doc |