File: rules

package info (click to toggle)
chezscheme 9.5+dfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 47,280 kB
  • sloc: ansic: 15,892; sh: 593; csh: 463; makefile: 432
file content (137 lines) | stat: -rwxr-xr-x 5,119 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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/usr/bin/make -f
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/pkg-info.mk

export CHEZ_VERSION = $(shell echo '$(DEB_VERSION_UPSTREAM)' | sed -e 's/[+~].*$$//')
export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

DOPACKAGES = $(shell dh_listpackages)

# Translate the host architecture (the arch we're building for) to
# terms the build system understands.
ifeq ($(DEB_HOST_GNU_TYPE), x86_64-linux-gnu)
    export HOST_MACHINE_TYPE = ta6le
else ifeq ($(DEB_HOST_GNU_TYPE), i386-linux-gnu)
    export HOST_MACHINE_TYPE = ti3le
else ifeq ($(DEB_HOST_GNU_TYPE), i686-linux-gnu)
    export HOST_MACHINE_TYPE = ti3le
else ifeq ($(DEB_HOST_GNU_TYPE), arm-linux-gnueabihf)
    export HOST_MACHINE_TYPE = arm32le
else ifeq ($(DEB_HOST_GNU_TYPE), arm-linux-gnueabi)
    export HOST_MACHINE_TYPE = arm32le
else
    $(error Cannot yet build for $(DEB_HOST_GNU_TYPE))
endif
ifeq ($(origin CC),default)
CC := $(DEB_HOST_GNU_TYPE)-gcc
LD := $(DEB_HOST_GNU_TYPE)-ld
endif

# Avoid using /usr/bin/scheme to run stex
ifeq ($(wildcard /usr/bin/chezscheme),)
    INSTALLED_CHEZ=/usr/bin/chezscheme9.5
else
    # Available since 9.5+dfsg-6
    INSTALLED_CHEZ=/usr/bin/chezscheme
endif

LIBDIR=usr/lib/csv$(CHEZ_VERSION)/$(HOST_MACHINE_TYPE)

%:
	dh $@

override_dh_auto_configure:
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
	if [ ! -d boot/$(HOST_MACHINE_TYPE) ]; then \
          cp -r /usr/lib/csv$(CHEZ_VERSION)/$(HOST_MACHINE_TYPE) boot/$(HOST_MACHINE_TYPE); \
          touch boot/$(HOST_MACHINE_TYPE)/.debian-cleanup; \
	fi
	CC=$(CC) ./configure --workarea=build -m=$(HOST_MACHINE_TYPE) --installprefix=/usr --temproot=$(shell pwd)/debian/tmp
else
	./configure --workarea=crossbuilder --threads --installprefix=/usr --temproot=$(shell pwd)/debian/tmp
	make -C crossbuilder
	./workarea $(HOST_MACHINE_TYPE)
	mv $(HOST_MACHINE_TYPE) build
endif
	(cd build/s; ln -s ../../s/primdata.ss primdata.ss)
	cp -a release_notes/ build/
	cp -a csug/ build/
	(echo "\def\INSERTREVISIONMONTHSPACEYEAR{}"; cat csug/copyright.stex) > \
	    build/csug/copyright.stex

override_dh_auto_test:
ifeq (fullcheck,$(filter fullcheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test
endif

override_dh_auto_build-arch:
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
	make -C build
else
	$(eval BUILD_MACHINE_TYPE = $(shell awk -F= '/^m=/ {print $$2}' crossbuilder/Mf-install))
	make -C build/s -f Mf-cross m=$(BUILD_MACHINE_TYPE) xm=$(HOST_MACHINE_TYPE) base=$(CURDIR)/crossbuilder
	make -C build/c CC=$(CC) LD=$(LD)
endif

override_dh_auto_build-indep:
ifneq (,$(filter chezscheme$(CHEZ_VERSION)-doc,$(DOPACKAGES)))
	make -C build/release_notes Scheme=$(INSTALLED_CHEZ) STEXLIB=/usr/share/stex
	make -C build/csug Scheme=$(INSTALLED_CHEZ) STEXLIB=/usr/share/stex
endif

override_dh_auto_install-arch:
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
	make install
else
	make -C build -f ../crossbuilder/Mf-install m=$(HOST_MACHINE_TYPE)
endif
	sed -e 's,^\\fI\(Chez Scheme\)\\fP,chezscheme$(CHEZ_VERSION) \- Chez Scheme,' \
	    -e 's,^\\fI\(Petite Chez Scheme\)\\fP,petite$(CHEZ_VERSION) \- Petite Chez Scheme,' \
	    build/scheme.1 > build/chezscheme$(CHEZ_VERSION).1

override_dh_auto_install-indep:
ifneq (,$(filter chezscheme$(CHEZ_VERSION)-doc,$(DOPACKAGES)))
	make -C build/release_notes Scheme=$(INSTALLED_CHEZ) STEXLIB=/usr/share/stex INSTALL=../installsh \
	    installdir=$(shell pwd)/debian/tmp/usr/share/doc/chezscheme-doc/ \
	    install
	make -C build/csug Scheme=$(INSTALLED_CHEZ) STEXLIB=/usr/share/stex INSTALL=../installsh \
	    installdir=$(shell pwd)/debian/tmp/usr/share/doc/chezscheme-doc/html/ \
	    install
	rm -f debian/tmp/usr/share/doc/chezscheme-doc/html/canned/*-orig.png
	ln -sf ../csug.css debian/tmp/usr/share/doc/chezscheme-doc/html/canned/csug.css
endif

override_dh_link:
	dh_link $(LIBDIR)/petite.boot $(LIBDIR)/petite$(CHEZ_VERSION).boot \
	        $(LIBDIR)/scheme.boot $(LIBDIR)/chezscheme$(CHEZ_VERSION).boot \
	        $(LIBDIR)/scheme.boot $(LIBDIR)/chezscheme.boot \
	        $(LIBDIR)/scheme.boot $(LIBDIR)/scheme-script.boot \
	        $(LIBDIR)/scheme.boot $(LIBDIR)/scheme-script$(CHEZ_VERSION).boot \
	        /usr/share/man/man1/chezscheme$(CHEZ_VERSION).1.gz \
	        /usr/share/man/man1/petite$(CHEZ_VERSION).1.gz \
	        /usr/share/man/man1/chezscheme$(CHEZ_VERSION).1.gz \
	        /usr/share/man/man1/scheme-script$(CHEZ_VERSION).1.gz
	dh_link -pchezscheme \
               /usr/bin/chezscheme$(CHEZ_VERSION) usr/bin/chezscheme \
	       /usr/bin/chezscheme$(CHEZ_VERSION) usr/bin/petite \
	       /usr/share/man/man1/chezscheme$(CHEZ_VERSION).1.gz \
	       /usr/share/man/man1/petite.1.gz \
	       /usr/share/man/man1/chezscheme$(CHEZ_VERSION).1.gz \
               /usr/share/man/man1/chezscheme.1.gz

override_dh_auto_clean:
	rm -f Makefile
	dh_auto_clean
	if [ -f boot/$(HOST_MACHINE_TYPE)/.debian-cleanup ]; then \
	  rm -rf boot/$(HOST_MACHINE_TYPE); \
	fi

override_dh_installdocs:
	dh_installdocs -A NOTICE

override_dh_installchangelogs:
	dh_installchangelogs LOG

override_dh_installman-arch:
	dh_installman build/chezscheme$(CHEZ_VERSION).1