File: rules

package info (click to toggle)
pgloader 3.6.10-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 12,060 kB
  • sloc: sql: 32,321; lisp: 14,793; makefile: 442; sh: 85; python: 26
file content (87 lines) | stat: -rwxr-xr-x 3,098 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
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

# get libsqlite3 package name from libsqlite3-dev
LIBSQLITE := $(shell dpkg-query --showformat='$${Depends}' --show libsqlite3-dev | grep -o 'libsqlite[^ ]*')
# make pgloader depend on the libssl package cl-plus-ssl depends on
LIBSSL := $(shell dpkg-query --showformat='$${Depends}' --show cl-plus-ssl | grep -o 'libssl[^ ]*')

BITS = $(shell dpkg-architecture -qDEB_BUILD_ARCH_BITS)
ifeq ($(BITS),32)
SIZE=1024
else
SIZE=16384
endif

MAKEFILE_VERSION = $(shell awk '/^VERSION/ { print $$3 }' Makefile)
DOC_VERSION = $(shell awk '/^release/ { print $$3 }' docs/conf.py | tr -d "'")
SPECFILE_VERSION = $(shell awk '/^Version/ { print $$2 }' pgloader.spec)
DEBIAN_VERSION = $(shell dpkg-parsechangelog -SVersion | cut -d- -f 1)
PGLOADER_MAJOR_VERSION = $(shell awk '/^.defparameter .major-version/ { print $$3 }' src/params.lisp | grep -Eo '[0-9.]+')
PGLOADER_MINOR_VERSION = $(shell awk '/^.defparameter .minor-version/ { print $$3 }' src/params.lisp | grep -Eo '[0-9.]+')

# buildd provides a build environment where $HOME is not writable, but the
# CL compilers here will need to fill-in a per-user cache
export HOME = $(CURDIR)/debian/home

override_dh_auto_clean:
	dh_auto_clean
	rm -rf debian/home
	# sanity checks on version number
	[ "$(MAKEFILE_VERSION)" = "$(DOC_VERSION)" ] # Makefile = docs/conf.py version
	[ "$(MAKEFILE_VERSION)" = "$(SPECFILE_VERSION)" ] # Makefile = pgloader.spec version
	[ "$(MAKEFILE_VERSION)" = "$(DEBIAN_VERSION)" ] # Makefile = debian/changelog version
	[ "$(MAKEFILE_VERSION)" = "$(PGLOADER_MAJOR_VERSION).$(PGLOADER_MINOR_VERSION)" ] # Makefile = src/params.lisp version

override_dh_auto_build-indep:
	# do nothing

override_dh_auto_build-arch:
	mkdir -p build/bin
	mkdir -p $(HOME)
	buildapp --require sb-posix						\
		--require sb-bsd-sockets					\
		--load /usr/share/common-lisp/source/cl-asdf/build/asdf.lisp	\
		--asdf-path .							\
		--asdf-tree /usr/share/common-lisp/systems			\
		--load-system asdf-finalizers					\
		--load-system asdf-system-connections				\
		--load-system cffi						\
		--load-system cl+ssl						\
		--load-system mssql						\
		--load src/hooks.lisp						\
		--load-system pgloader						\
		--entry pgloader:main						\
		--dynamic-space-size $(SIZE)					\
		--compress-core							\
		--logfile buildapp.log						\
		--output build/bin/pgloader					\
			|| echo $$? > buildapp.fail
	cat buildapp.log
	test ! -f buildapp.fail
	ls -l build/bin/pgloader
	$(MAKE) -C docs html

override_dh_auto_test:
	PATH=$(CURDIR)/build/bin:$(PATH) debian/tests/testsuite

override_dh_strip override_dh_dwz:
	# do nothing, sbcl doesn't write any debug info

override_dh_installman-arch:
	mkdir -p debian/pgloader/usr/share/man/man1/
	PATH=debian/pgloader/usr/bin:$(PATH) \
	help2man --version-string $(DEB_VERSION_UPSTREAM) \
		--no-info \
		--name "extract, transform and load data into PostgreSQL" \
		pgloader > \
		debian/pgloader/usr/share/man/man1/pgloader.1

override_dh_gencontrol:
	dh_gencontrol -- \
		-V"sqlite:Depends=$(LIBSQLITE)" \
		-V"ssl:Depends=$(LIBSSL)"

%:
	dh $@