File: rules

package info (click to toggle)
tryton-server 7.0.43-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,760 kB
  • sloc: python: 53,744; xml: 5,194; sh: 803; sql: 217; makefile: 28
file content (41 lines) | stat: -rwxr-xr-x 1,392 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
#!/usr/bin/make -f

MAJOR := $(shell python3 setup.py --version | awk -F "." '{print $$1 "." $$2}')

export PYBUILD_DESTDIR_python3=debian/tryton-server
# Run tests on sqlite memory database
# For the complete test suites refer to http://tests.tryton.org/
export TRYTOND_DATABASE_URI=sqlite://
export DB_NAME=:memory:

# Disable tests on bullseye, Python < 3.10 needs backports.entry_points_selectable
# not available in Debian
TARGET_DIST := $(shell dpkg-parsechangelog -SDistribution)
ifneq ($(TARGET_DIST),bullseye-7.0)
export PYBUILD_TEST_CUSTOM=1
export PYBUILD_TEST_ARGS=DB_NAME=:memory: cd {build_dir}; python{version} -m unittest discover -s trytond.tests
else
export PYBUILD_DISABLE=test
endif

%:
	dh $@ --with python3,sphinxdoc --buildsystem=pybuild

override_dh_auto_clean:
	dh_auto_clean
	rm -rf build

override_dh_auto_build:
	dh_auto_build
	sphinx-build -C doc build/html

override_dh_gencontrol:
	dh_gencontrol -- -VAPI="tryton-server-api-$(MAJOR)"

override_dh_installinit:
	dh_installinit --name=tryton-server --restart-after-upgrade --no-enable
	dh_installinit --name=tryton-server-cron --restart-after-upgrade --no-enable
	dh_installinit --name=tryton-server-worker --restart-after-upgrade --no-enable
	dh_installsystemd --name=tryton-server --no-enable
	dh_installsystemd --name=tryton-server-cron@ --no-enable
	dh_installsystemd --name=tryton-server-worker@ --no-enable