File: rules

package info (click to toggle)
libgap-sage 4.8.6%2B3%2B20160327g69a66f0%2Bdsx-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,164 kB
  • ctags: 7,356
  • sloc: ansic: 107,448; python: 342; makefile: 178; sh: 151; asm: 62; sed: 11
file content (75 lines) | stat: -rwxr-xr-x 3,130 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
74
75
#!/usr/bin/make -f

CGAP = /usr/bin/gap

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

DEB_PKG_VERSION := $(shell dpkg-parsechangelog -S Version)
DEB_PKG_DOTVERSION :=   $(word 1,$(subst +, ,$(DEB_PKG_VERSION)))
DEB_PKG_VERSION_NANO := $(word 2,$(subst +, ,$(DEB_PKG_VERSION)))
UPS_PKG_GIT_EPOCH :=    $(word 3,$(subst +, ,$(DEB_PKG_VERSION)))

DEB_PKG_VERSION_MAJOR := $(word 1,$(subst ., ,$(DEB_PKG_DOTVERSION)))
DEB_PKG_VERSION_MINOR := $(word 2,$(subst ., ,$(DEB_PKG_DOTVERSION)))
DEB_PKG_VERSION_MICRO := $(word 3,$(subst ., ,$(DEB_PKG_DOTVERSION)))

UPS_PKG_VERSION :=         $(DEB_PKG_VERSION_MAJOR).$(DEB_PKG_VERSION_MINOR).$(DEB_PKG_VERSION_NANO)
DEB_PKG_GAP_DOTVERSION :=  $(DEB_PKG_VERSION_MAJOR).$(DEB_PKG_VERSION_MINOR).$(DEB_PKG_VERSION_MICRO)
DEB_PKG_GAP_VERSION :=     $(DEB_PKG_VERSION_MAJOR)r$(DEB_PKG_VERSION_MINOR)p$(DEB_PKG_VERSION_MICRO)
DEB_PKG_LIBGAP_XVERSION := $(DEB_PKG_GAP_DOTVERSION)+$(DEB_PKG_VERSION_NANO)

DEB_BUILD_GAP_BUILD_DATETIME := $(shell LC_ALL=C date -u -d @$(SOURCE_DATE_EPOCH) +"%F %T (%Z) (Debian $(DEB_PKG_VERSION))")


export DEB_BUILD_MULTIARCH ?= $(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)
DEB_BUILD_GAP_INFO_ARCH ?= $(shell echo 'Print(GAPInfo.Architecture);' | $(CGAP) -q -A -T)

export ACLOCAL_PATH=/usr/share/gnulib/m4

default:
	@uscan --no-conf --dehs --report || true

%:
	dh $@ --with autoreconf --builddirectory=_build --parallel

override_dh_auto_configure:
	# preamble: none
	# amble:
	dh_auto_configure -B _build -- --with-gap_system_arch=$(DEB_BUILD_GAP_INFO_ARCH)
	# postamble: based on the dist-hook target and the hacking section in README
	cp -t _build/src $(wildcard $(addprefix gapcore/gap$(DEB_PKG_GAP_VERSION)/src/,*.h *.c *.s))
	cp -t _build/src $(wildcard $(addprefix src/,*.h *.c))
	patch --directory _build/src --strip 1 < patches/gap-$(UPS_PKG_VERSION).patch
	scripts/libGAPify.py --modify _build/src
	sed -i -e 's/SyKernelVersion = "[0-9]*\.[0-9]*\.[0-9]*"/SyKernelVersion = "$(DEB_PKG_GAP_DOTVERSION)"/g' _build/src/system.c
	sed -i \
			-e 's/GAP_BUILD_VERSION  "libgap-[0-9]*\.[0-9]*\.[0-9]*"/GAP_BUILD_VERSION  "libgap-$(DEB_PKG_GAP_DOTVERSION)"/g' \
			-e 's/GAP_BUILD_DATETIME "\(.*\)"/GAP_BUILD_DATETIME "$(DEB_BUILD_GAP_BUILD_DATETIME)"/g' \
		_build/src/gap_version.h
	$(foreach _t, $(wildcard test/*.c) , sed -f debian/adhoc/scripts/libGAPify-test.sed $(_t) > _build/$(_t) ;)

override_dh_auto_configure-indep:
	@true

override_dh_auto_build-indep:
	@true

override_dh_auto_test-indep:
	@true

override_dh_installchangelogs:
	dh_installchangelogs --keep pkgextra/GitChangeLog

override_dh_compress-indep:
	dh_compress -X.pdf -Xexamples

get-orig-source:
	debian/get-orig-source.sh --upstream-libgap-xversion $(DEB_PKG_LIBGAP_XVERSION) --upstream-libgap-commit-epoch $(UPS_PKG_GIT_EPOCH)

get-info:
	@echo "DEB_PKG_VERSION:         $(DEB_PKG_VERSION)"
	@echo "UPS_PKG_VERSION:         $(UPS_PKG_VERSION)"
	@echo "UPS_PKG_GIT_EPOCH:       $(UPS_PKG_GIT_EPOCH)"
	@echo "DEB_PKG_GAP_DOTVERSION:  $(DEB_PKG_GAP_DOTVERSION)"
	@echo "DEB_PKG_GAP_VERSION:     $(DEB_PKG_GAP_VERSION)"
	@echo "DEB_PKG_LIBGAP_XVERSION: $(DEB_PKG_LIBGAP_XVERSION)"