File: rules

package info (click to toggle)
libfann 2.2.0%2Bds-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 11,780 kB
  • sloc: ansic: 6,033; cpp: 1,436; makefile: 117; sh: 27
file content (109 lines) | stat: -rwxr-xr-x 2,894 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
#!/usr/bin/make -f
# -*- makefile -*-

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

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:
ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
	# Simulate partial autopkgtest run by providing an AUTOPKGTEST_TMP
	# and setting CPATH/LIBRARY_PATH/LD_LIBRARY_PATH for the build test
	testrundir=$$(mktemp -d) ;\
		AUTOPKGTEST_TMP=$$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
endif


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_installexamples-indep:
	dh_installexamples -i
	# Note that libfann-doc installs its files into libfann-dev, into what
	# debhelper calls the doc-main-package
	
	# 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-dev/examples/datasets|' \
		-e 's|"xor.data"|"/usr/share/doc/libfann-dev/examples/xor.data"|' \
		-e 's|"scaling.data"|"/usr/share/doc/libfann-dev/examples/scaling.data"|' \
		debian/libfann-doc/usr/share/doc/libfann-dev/examples/*.c
	
	# Add Makefile and compile/run instructions for the examples
	cp debian/libfann-doc.examples.Makefile \
		debian/libfann-doc/usr/share/doc/libfann-dev/examples/Makefile
	cp debian/libfann-doc.examples.README \
		debian/libfann-doc/usr/share/doc/libfann-dev/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-dev/examples/datasets/*


override_dh_missing:
	dh_missing --fail-missing


override_dh_compress:
	# FIXME: This is only needed because of #922795. It can be removed
	# after either depending on debhelper (>= 12.1.1), or the next
	# compat bump.
	dh_compress -Xexamples


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