File: rules

package info (click to toggle)
liblinear 1.8%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 484 kB
  • ctags: 331
  • sloc: cpp: 2,266; ansic: 1,432; python: 320; makefile: 127; sh: 9
file content (82 lines) | stat: -rwxr-xr-x 2,420 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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1


# Path to package source directory 
PKGDIR := $(dir $(firstword $(MAKEFILE_LIST)))..

# Get version numbers for SONAME from changelog
DVER := $(shell cd $(PKGDIR) && dpkg-parsechangelog | grep '^Version')
UPVER := $(shell echo $(DVER) | sed -rne 's/Version: ([^+]+).*/\1/p')
LVER := $(shell echo $(UPVER) | sed -rne 's/([0-9]+)\..*/\1/p')
LSUBVER := $(shell echo $(UPVER) | sed -rne 's/[0-9]+\.([0-9]+)/\1/p')
# Export for upstream's Makefile
export LVER
export LSUBVER

# Get Dpkg version (needed for override_dh_makeshlibs)
DPKGVER := $(shell dpkg -l dpkg-dev | grep '^i' | awk '{print $$3}')

export DEB_CFLAGS_MAINT_APPEND += -Wall
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
ifeq (amd64,$(DEB_HOST_ARCH))
    DEB_CFLAGS_MAINT_APPEND += -msse
endif
endif

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

%:
	dh $@ --with=python2


override_dh_auto_install:
	dh_auto_install -- libdir=/usr/lib/$(DEB_HOST_MULTIARCH)/

# Help out backporters on platforms not supporting c++ tags in symbols files
override_dh_makeshlibs:
	dpkg --compare-versions "$(DPKGVER)" ge "1.15.6" || \
		rm -f debian/liblinear1.symbols
	dh_makeshlibs


override_dh_compress:
	dh_compress -Xexamples


override_dh_strip:
	dh_strip --dbg-package=liblinear-dbg


get-orig-source:
	test -x /usr/bin/unzip || { echo "Package 'unzip' required"; exit 1; }
	
	uscan --noconf --force-download --download-version $(LVER).$(LSUBVER) \
		--check-dirname-level=0 --destdir=$(CURDIR) $(PKGDIR)
	
	unzip liblinear-$(UPVER).zip
	rm -f liblinear-$(UPVER).zip
	
	# Remove Windows binaries
	rm -rf liblinear-$(UPVER)/windows/
	
	# Remove BLAS implementation with unknown license
	rm -rf liblinear-$(UPVER)/blas/
	# matlab Makefile
	sed -i -e '/^\.\.\/blas\/blas\.a:/,+2d' liblinear-$(UPVER)/matlab/Makefile
	sed -i -e 's| ../blas/blas.a||' liblinear-$(UPVER)/matlab/Makefile
	sed -i -e '/blas/d' liblinear-$(UPVER)/matlab/Makefile
	# main Makefile
	sed -i -e '/^/blas\/blas\.a:/,+2d' liblinear-$(UPVER)/Makefile
	sed -i -e 's| blas/blas.a||' liblinear-$(UPVER)/Makefile
	sed -i -e '/blas/d' liblinear-$(UPVER)/Makefile
	
	mv liblinear-$(UPVER) liblinear-$(UPVER).orig
	GZIP="-9" tar --owner=root --group=root --mode=a+rX \
			-czf liblinear_$(UPVER)+dfsg.orig.tar.gz \
			liblinear-$(UPVER).orig
	
	rm -rf liblinear-$(UPVER).orig