File: rules

package info (click to toggle)
libpreludedb 5.1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 9,828 kB
  • sloc: ansic: 29,639; cpp: 16,573; sh: 12,818; sql: 1,436; python: 472; makefile: 290; yacc: 227; lex: 106; xml: 36
file content (43 lines) | stat: -rwxr-xr-x 1,365 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
#! /usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/architecture.mk
CONFIGURE_FLAGS = --without-python2 --enable-easy-bindings

ifeq ($(filter nopython,$(DEB_BUILD_PROFILES)),)
	DH_ADDONS += --with python3
	CONFIGURE_FLAGS += --with-python3=yes
	PY3VERS=$(shell py3versions -vr)
else
	CONFIGURE_FLAGS += --with-python3=no
endif

ifneq ($(filter libpreludedb-doc,$(shell dh_listpackages)),)
	CONFIGURE_FLAGS += --enable-gtk-doc
endif

override_dh_auto_configure:
	dh_auto_configure -- $(CONFIGURE_FLAGS)

override_dh_auto_build: build-core $(PY3VERS:%=build-python%)

build-core:
	dh_auto_build

build-python%:
	cd bindings/python && python$* setup.py build

override_dh_auto_install: install-core $(PY3VERS:%=install-python%)
install-core:
	dh_auto_install
	find . -name "__pycache__" -exec rm -rvf {} +
	find . -name "*.la" -exec sed -i -e 's/^dependency_libs=.*$$/dependency_libs=/g' {} +
	mkdir -p debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}/libpreludedb/bin
	mv debian/tmp/usr/bin/libpreludedb-config debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}/libpreludedb/bin/libpreludedb-config
	chmod +x debian/tmp/usr/share/libpreludedb/classic/mysql2sqlite.sh debian/tmp/usr/share/libpreludedb/classic/mysql2pgsql.sh

install-python%:
	cd bindings/python && python$* setup.py install --root $(CURDIR)/debian/tmp

%:
	dh $@ $(DH_ADDONS)