rules 1.44 KB
Newer Older
1 2 3 4 5 6 7
#!/usr/bin/make -f

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

Dominique Dumont's avatar
Dominique Dumont committed
8
# https://wiki.debian.org/HardeningWalkthrough#Selecting_security_hardening_options
Dominique Dumont's avatar
Dominique Dumont committed
9
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
10
include /usr/share/dpkg/buildflags.mk
Dominique Dumont's avatar
Dominique Dumont committed
11

Dominique Dumont's avatar
Dominique Dumont committed
12 13 14
export DESTDIR=$(CURDIR)/debian/tmp
export PREFIX=/usr

15 16
# see https://wiki.debian.org/Multiarch/Implementation
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
Dominique Dumont's avatar
Dominique Dumont committed
17 18
export LIBPATH = $(PREFIX)/lib/$(DEB_HOST_MULTIARCH)

19

20 21
%:
	dh $@
22

23
override_dh_auto_build:
24
	echo "Creating libtool executable"
25 26 27 28 29
	mkdir debian/libtool
	cp debian/configure.ac debian/libtool/
	cd debian/libtool && LIBTOOLIZE='libtoolize -i' autoreconf -f -i
	dh_auto_configure --sourcedirectory=debian/libtool

30 31 32
	echo "Building libtommath"
	$(MAKE) -f makefile.shared LIBTOOL=$(CURDIR)/debian/libtool/libtool
	echo "Building docs"
Dominique Dumont's avatar
Dominique Dumont committed
33
	$(MAKE) manual docs
34

35 36 37 38 39 40
override_dh_auto_test:
	echo "compiling test programs"
	$(MAKE) -f makefile.shared LIBTOOL=$(CURDIR)/debian/libtool/libtool test_standalone
	echo "running test"
	./test

41
override_dh_auto_install:
42
	$(MAKE) -f makefile.shared LIBTOOL=$(CURDIR)/debian/libtool/libtool install
43

44 45 46 47 48
# Override if not processing -docs
ifeq (,$(findstring libtommath-docs, $(shell dh_listpackages)))
override_dh_install:
	dh_install --sourcedir=debian/tmp
endif
49

50
override_dh_clean:
51
	dh_clean tommath.out debian/libtool
52 53

override_dh_installchangelogs:
54 55
	dh_installchangelogs changes.txt