File: rules

package info (click to toggle)
libtommath 1.2.0-6%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,492 kB
  • sloc: ansic: 19,707; sh: 412; perl: 407; makefile: 287; asm: 30
file content (73 lines) | stat: -rwxr-xr-x 2,047 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  IGNORE_SPEED=yes
  export IGNORE_SPEED
endif

# https://wiki.debian.org/HardeningWalkthrough#Selecting_security_hardening_options
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
include /usr/share/dpkg/buildflags.mk

# makefile_include.mk does not support CPPFLAGS
CFLAGS += $(shell dpkg-buildflags --get CPPFLAGS)

export DESTDIR=$(CURDIR)/debian/tmp
export PREFIX=/usr

# see https://wiki.debian.org/Multiarch/Implementation
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export LIBPATH = $(PREFIX)/lib/$(DEB_HOST_MULTIARCH)

export FORCE_SOURCE_DATE=1

%:
	dh $@

override_dh_auto_build-arch:
	echo "removing files built upstream"
	rm -rf pre_gen
	echo "Creating libtool executable"
	mkdir debian/libtool
	cp debian/configure.ac debian/libtool/
	cd debian/libtool && LIBTOOLIZE='libtoolize -i' autoreconf -f -i
	dh_auto_configure --sourcedirectory=debian/libtool

	echo "Building libtommath"
	dh_auto_build --buildsystem=makefile -- -f makefile.shared LIBTOOL=$(CURDIR)/debian/libtool/libtool

override_dh_auto_build-indep:
	echo "removing files built upstream"
	rm -f doc/bn.pdf

	echo "Building docs"
	$(MAKE) docs V=1

override_dh_auto_test-arch:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	echo "compiling test programs"
	$(MAKE) -f makefile.shared LIBTOOL=$(CURDIR)/debian/libtool/libtool test_standalone
	echo "running test"
	./test
endif

override_dh_auto_test-indep:

override_dh_auto_install-arch:
	$(MAKE) -f makefile.shared LIBTOOL=$(CURDIR)/debian/libtool/libtool install
	# remove libtool .la files
	find debian/tmp -name '*.la' -delete

override_dh_auto_install-indep:

override_dh_install-arch:
	dh_install --sourcedir=debian/tmp

override_dh_clean:
	dh_clean doc/tommath.out demo/.libs/ demo/demo.lo libtommath.pc debian/libtool/
	# move back the built doc shipped in tarball
	for i in $(CURDIR)/doc/*.pdf.dod; do if [ -e $$i ] ; then mv $$i $${i%%.dod}; fi; done

override_dh_installchangelogs:
	dh_installchangelogs changes.txt