File: rules

package info (click to toggle)
mit-scheme 12.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 208,288 kB
  • sloc: lisp: 781,881; xml: 425,435; ansic: 86,059; sh: 10,135; makefile: 2,501; asm: 2,121; csh: 1,143
file content (123 lines) | stat: -rwxr-xr-x 4,210 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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/usr/bin/make -f

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

# for DEB_HOST_GNU_CPU
include /usr/share/dpkg/architecture.mk
# for DEB_VERSION_UPSTREAM
include /usr/share/dpkg/pkg-info.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# Passing --no-parallel because of some creepy race conditions, like
# on building x11-compat which can get built twice and if the second
# build happens at just the wrong time it interferes with the first
# build or with an invocation of the generated executable.

%:
	dh $@ --no-parallel

override_dh_autoreconf:
	dh_autoreconf sh -- -e -x -c \
	  'for d in src doc; \
	    do (cd $$d && autoreconf -f -i) done'

CONF_FLAGS += --docdir=/usr/share/doc/mit-scheme-doc
CONF_FLAGS += --enable-html=/usr/share/doc/mit-scheme-doc/html
CONF_FLAGS += --enable-pdf=/usr/share/doc/mit-scheme-doc/pdf
CONF_FLAGS += --enable-ps=no

CONF_FLAGS += --enable-blowfish=yes
CONF_FLAGS += --enable-gdbm=yes
CONF_FLAGS += --enable-pgsql=yes

# According to https://savannah.gnu.org/support/?110264 a build error like
#
#  Bad compiled-code version in FASL File: make.com
#  File has: compiled-code interface 3; architecture 14.
#  Expected: compiled-code interface 4; architecture 14.
#
# can occur when, e.g., 10.1.11 is installed but 11.1 is being built.
# And can be prevented using a configuration flag.

INSTALLED_MAJOR_VERSION:=$(shell dpkg --status mit-scheme | egrep '^Version:' | sed 's/^Version: //' | cut --delimiter=. --fields=1)
BUILDING_MAJOR_VERSION:=$(shell echo $(DEB_VERSION_UPSTREAM) | cut --delimiter=. --fields=1)
ifneq ($(INSTALLED_MAJOR_VERSION),$(BUILDING_MAJOR_VERSION))
CONF_FLAGS += --enable-cross-compiling
endif

override_dh_auto_configure:
# -arch
	dh_auto_configure --sourcedirectory=src -- $(CONF_FLAGS)
# -indep
	dh_auto_configure --sourcedirectory=doc -- $(CONF_FLAGS)

# May wish to pass parameter in dh_auto_build
#  SCHEME_COMPILER=mit-scheme

override_dh_auto_build:
# -arch
	dh_auto_build --sourcedirectory=src
# -indep
	dh_auto_build --sourcedirectory=doc

ifeq ($(DEB_HOST_GNU_CPU),x86_64)
export BIN_ARCH=x86-64
else
export BIN_ARCH=$(DEB_HOST_GNU_CPU)
endif

override_dh_auto_install:
# -arch
	dh_auto_install --sourcedirectory=src
# -indep
#	# This doesn't work because doc/ hasn't been *configured*
#	# which hardly seems worth working around
#	dh_auto_install --sourcedirectory=doc -- install-man
	dh_auto_install --sourcedirectory=doc -- install-html install-pdf

execute_after_dh_auto_install:
# -arch
	@echo "remove symbolic link executables"
	cd debian/tmp/usr/bin && \
	for f in scheme bchscheme mit-scheme mit-scheme-native; do \
	  if [ -L $$f ]; then \
	    rm --verbose -f $$f; \
	  else \
	    echo skipping $$f; \
	  fi; \
	done
#	@echo "delete runtime.com for MYSTERIOUS reasons"
#	@echo "stop doing this because it breaks future builds"
#	find debian/tmp/usr/lib -name runtime.com -ls -delete
	@echo "remove .la library support files as these are not actually used by the dynamic linker"
	find debian/tmp -name '*.la' -ls -delete
	@echo "allow dh scripts to compress info files themselves"
	find debian/tmp \( -name '*.info.gz' -o -name '*.info-*.gz' \) -ls -exec gunzip '{}' ';'

execute_after_dh_install-arch:
	@echo "All .bci files belong in -dbg, move them manually for robustness"
	mkdir -p debian/mit-scheme-dbg
	tar -C debian/mit-scheme --create --file=- --files-from=/dev/null $$(cd debian/mit-scheme && find -name '*.bci') \
	 | tar -C debian/mit-scheme-dbg -xvf -
	find debian/mit-scheme -name '*.bci' -delete
	@echo "remove empty directory"
	-rmdir debian/mit-scheme/usr/lib/x86_64-linux-gnu/mit-scheme/lib

execute_after_dh_installman-arch:
	@echo "install man page using arch; generic is via alternatives"
	cd debian/mit-scheme/usr/share/man && \
	 mv man1/mit-scheme.1 man1/mit-scheme-$(BIN_ARCH).1

# Upstream changelog is over 5MB, leave a copy in the doc package but
# remove it from the binary package to reduce bloat.
# See http://dedup.debian.net/.
override_dh_installchangelogs-arch:
	dh_installchangelogs
	-rm --verbose \
	   debian/mit-scheme/usr/share/doc/mit-scheme/changelog \
	   debian/mit-scheme-dbg/usr/share/doc/mit-scheme-dbg/changelog

override_dh_auto_clean:
	-dh_auto_clean