File: rules

package info (click to toggle)
libfann 2.2.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 11,796 kB
  • ctags: 765
  • sloc: ansic: 6,033; cpp: 1,436; makefile: 135; sh: 27
file content (132 lines) | stat: -rwxr-xr-x 3,318 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
#!/usr/bin/make -f
# -*- makefile -*-

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


# For get-orig-source
PKGDIR := $(dir $(firstword $(MAKEFILE_LIST)))..
DEBVER := $(shell dpkg-parsechangelog -l$(PKGDIR)/debian/changelog -S Version)
UPVER := $(shell echo $(DEBVER) | sed -re 's/\+ds-.*//')

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie
export DEB_CFLAGS_MAINT_APPEND = -Wall


%:
	dh $@


override_dh_auto_configure-arch:
	dh_auto_configure -- -DLIB_SUFFIX=/${DEB_HOST_MULTIARCH}


override_dh_auto_configure-indep:
	# Nothing to do


override_dh_auto_build-arch:
	# Library
	dh_auto_build


override_dh_auto_build-indep:
	# Build just the documentation
	mkdir -p doc/html doc/proj
	naturaldocs -i src/include -o HTML doc/html -p doc/proj


override_dh_auto_test-arch:
	# Simulate partial autopkgtest run by providing an ADTTMP and setting
	# CPATH/LIBRARY_PATH/LD_LIBRARY_PATH for the build test
	testrundir=$$(mktemp -d) ;\
		ADTTMP=$$testrundir \
		CPATH=$(CURDIR)/src/include \
		LIBRARY_PATH=$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/src/ \
		LD_LIBRARY_PATH=$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/src/ \
	/bin/sh $(CURDIR)/debian/tests/build ;\
	res=$$? ;\
	rm -rf "$$testrundir" ;\
	exit $$res


override_dh_auto_test-indep:
	# Nothing to do


override_dh_auto_install-arch:
	# Library
	dh_auto_install


override_dh_auto_install-indep:
	# Nothing to do


override_dh_install:
	dh_install --fail-missing
	

override_dh_installexamples-indep:
	dh_installexamples -i
	
	# Modify dataset paths in examples to point to libfann-doc datasets. This
	# was not implemented as a patch to upstream to preserve the ability to
	# run upstream's own tests within the source dir.
	sed -i \
		-e 's|\.\./datasets|/usr/share/doc/libfann-doc/examples/datasets|' \
		-e 's|"xor.data"|"/usr/share/doc/libfann-doc/examples/xor.data"|' \
		-e 's|"scaling.data"|"/usr/share/doc/libfann-doc/examples/scaling.data"|' \
		debian/libfann-doc/usr/share/doc/libfann-doc/examples/*.c
	
	# Add Makefile and compile/run instructions for the examples
	cp debian/libfann-doc.examples.Makefile \
		debian/libfann-doc/usr/share/doc/libfann-doc/examples/Makefile
	cp debian/libfann-doc.examples.README \
		debian/libfann-doc/usr/share/doc/libfann-doc/examples/README
	

override_dh_fixperms-indep:
	dh_fixperms -i
	# Remove unnecessary executable bits from training data sets
	chmod 644 debian/libfann-doc/usr/share/doc/libfann-doc/examples/datasets/*


override_dh_link:
	# dh_link does not remove pre-existing destination dirs, only files
	rm -rf debian/libfann-dbg/usr/share/doc/libfann-dbg
	dh_link


override_dh_compress:
	dh_compress -Xexamples -Xjavascript


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


override_dh_auto_clean:
	# Perform regular clean process
	dh_auto_clean
	
	# Remove output generated by naturaldocs
	rm -rf doc/proj doc/html

# Remove upstream's non-DFSG-compliant files
get-orig-source:
	uscan \
		--noconf \
		--download-version $(UPVER) \
		--force-download \
		--check-dirname-level=0 \
		--destdir=$(CURDIR) \
		--rename \
		--repack \
		--compression xz \
		--copyright-file=$(PKGDIR)/debian/files-excluded \
		$(PKGDIR)