File: rules

package info (click to toggle)
liblinear 2.1.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 516 kB
  • ctags: 395
  • sloc: cpp: 2,789; ansic: 1,742; python: 425; makefile: 132; sh: 9
file content (91 lines) | stat: -rwxr-xr-x 2,494 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
#!/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)))..

# Needed for our Makefile customizations, and for get-orig-source
DEBVER := $(shell dpkg-parsechangelog -l$(PKGDIR)/debian/changelog -SVersion)
UPVER := $(shell echo $(DEBVER) | sed -rne 's/([0-9]\.[0-9]\.[0-9]).*/\1/p')
DMAJOR := $(shell echo $(UPVER) | sed -rne 's/([0-9])\.[0-9]\.[0-9].*/\1/p')
DMINOR := $(shell echo $(UPVER) | sed -rne 's/[0-9]\.([0-9])\.[0-9].*/\1/p')
DPATCH := $(shell echo $(UPVER) | sed -rne 's/[0-9]\.[0-9]\.([0-9]).*/\1/p')
# Replicate upstream's naming convention... (see d/watch)
ifeq ($(DPATCH),0)
    UPVER := $(DMAJOR).$(DMINOR)
else
    UPVER := $(DMAJOR).$(DMINOR)$(DPATCH)
endif
export UPVER DEBVER DMAJOR DMINOR DPATCH


export DEB_BUILD_MAINT_OPTIONS += hardening=+all
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,python3


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


override_dh_compress:
	dh_compress -Xexamples


override_dh_strip:
	dh_strip --dbgsym-migration='liblinear-dbg (<< $(DEBVER)~)'


get-orig-source:
	test -x /usr/bin/unzip || { echo "Package 'unzip' required"; exit 1; }
	
	uscan \
		--noconf \
		--no-symlink \
		--force-download \
		--download-version $(DEBVER) \
		--check-dirname-level=0 \
		--destdir=$(CURDIR) \
		$(PKGDIR)
	
	tar -xzf liblinear-$(UPVER).tar.gz
	rm -f liblinear-$(UPVER).tar.gz
	
	# 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-$(DEBVER)+dfsg
	tar \
		--owner=root \
		--group=root \
		--mode=a+rX \
		--xz \
		-cf liblinear_$(DEBVER)+dfsg.orig.tar.xz \
		liblinear-$(DEBVER)+dfsg
	
	rm -rf liblinear-$(DEBVER)+dfsg