File: rules

package info (click to toggle)
gap-browse 1.8.21%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,296 kB
  • sloc: xml: 1,961; ansic: 1,342; makefile: 163; javascript: 155; sh: 20
file content (67 lines) | stat: -rwxr-xr-x 1,878 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
#!/usr/bin/make -f
# Copyright 2022 Joachim Zobel <jz-2017@heute-morgen.de>

include /usr/share/dpkg/default.mk
export FORCE_SOURCE_DATE = 1
export LC_ALL = C

CGAP = /usr/bin/gap

export DEB_BUILD_GAP_INFO_ARCH ?= $(shell echo 'Print(GAPInfo.Architecture);' | $(CGAP) -A -q -T)
#DEB_BUILD_MULTIARCH  ?= $(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)
#DEB_BUILD_GAP_KERNEL_MAJOR_VERSION ?= $(shell sed -n -e 's/^GAP_KERNEL_MAJOR_VERSION=//p' /usr/lib/gap/sysinfo.gap )


debian/gaproot/pkg:
	mkdir -p debian/gaproot/pkg
	ln -s ../../.. debian/gaproot/pkg/Browse

doc: debian/gaproot/pkg
	make -C doc && touch doc

ifneq (,$(filter check,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test: debian/gaproot/pkg
	gap -q -l 'debian/gaproot;/usr/share/gap' < tst/test.g | tee debian/gap.tst
	grep -q "^#I  No errors detected while testing" debian/gap.tst
endif

override_dh_auto_configure: ;

override_dh_auto_build: 
	/usr/bin/gac -d -p "$(CFLAGS)" -o bin/$(DEB_BUILD_GAP_INFO_ARCH)/ncurses.so src/ncurses.c \
									 -L "$(LDFLAGS) -lpanel -lncurses"

execute_after_dh_auto_build: doc;

override_dh_install:
	dh_install *.g app bibl lib usr/share/gap/pkg/Browse
	dh_install bin/*/ncurses.so usr/lib/${DEB_HOST_MULTIARCH}/gap/pkg/Browse/bin
	make -C doc install DESTDIR=../debian/gap-browse

override_dh_installdocs:
	dh_installdocs README

override_dh_installchangelogs:
	dh_installchangelogs  CHANGES

# The links file can not link directories
execute_after_dh_link:
	dh_link -p gap-browse \
		/usr/lib/gap/pkg/Browse/bin /usr/share/gap/pkg/Browse/bin

override_dh_gencontrol:
	dh_gencontrol -- $(SUBSTVARS)

clean:
	dh_testdir
	dh_testroot
	rm -rf debian/gaproot
	rm -f debian/gap.tst
	make -C doc clean
	rm -rf bin
	dh_clean

%:
	dh $@

.PHONY: execute_after_dh_auto_test execute_after_dh_auto_build clean override_dh_install override_dh_installdocs override_dh_installchangelogs