debian/rules
author Philippe Pepiot <ph@itsalwaysdns.eu>
Tue, 31 Mar 2020 19:15:03 +0200
changeset 12957 0c973204033a
parent 12709 280c9db41038
permissions -rwxr-xr-x
[server] prevent returning closed cursor to the database pool In since c8c6ad8 init_repository use repo.internal_cnx() instead of repo.system_source.get_connection() so it use the pool and we should not close cursors from the pool before returning it back. Otherwise we may have "connection already closed" error. This bug only trigger when connection-pool-size = 1. Since we are moving to use a dynamic pooler we need to get this fixed. This does not occur with sqlite since the connection wrapper instantiate new cursor everytime, but this occur with other databases.

#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

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

export PYBUILD_NAME=cubicweb
export PYBUILD_DISABLE_python3=test

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

override_dh_auto_build: export http_proxy=127.0.0.1:9
override_dh_auto_build: export https_proxy=127.0.0.1:9
override_dh_auto_build:
	dh_auto_build
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=. sphinx-build -N -bhtml doc/ debian/cubicweb-doc/html
endif

override_dh_auto_install:
	dh_auto_install
	mv debian/python3-${PYBUILD_NAME}/usr/bin/cubicweb-ctl \
		debian/cubicweb-ctl/usr/bin/cubicweb-ctl

override_dh_installchangelogs:
	dh_installchangelogs -Xdoc/changes

# Should extra sections in requires.txt go to Recommends, Suggests or be
# ignored?
#
# All sections must be listed so we don't forget any in cases of future
# changes.

RECOMMENDS_SECTIONS = ext crypto ical pyramid rdf
SUGGESTS_SECTIONS = captcha zmq
# sparql currently requires fyzz which is not compatible with Python 3
IGNORED_SECTIONS = sparql

override_dh_python3:
	@set -e && trap 'rm -f requires-sections debian-sections' EXIT && \
		sed -n -e 's/\[\(.*\)\]/\1/p' cubicweb.egg-info/requires.txt | sort > requires-sections && \
		printf "%s\n" $(RECOMMENDS_SECTIONS) $(SUGGESTS_SECTIONS) $(IGNORED_SECTIONS) | sort > debian-sections && \
		FORGOTTEN_SECTIONS=$$(comm -23 requires-sections debian-sections) && \
		if [ "$$FORGOTTEN_SECTIONS" ]; then \
			echo "The following sections are not listed in debian/rules:" && \
			echo "$$FORGOTTEN_SECTIONS" && \
			echo "Please add them in either RECOMMENDS_SECTIONS, SUGGESTS_SECTIONS or IGNORED_SECTIONS" && \
			exit 1; \
		fi
	dh_python3 \
		$(foreach section,$(RECOMMENDS_SECTIONS),--recommends-section=$(section)) \
		$(foreach section,$(SUGGESTS_SECTIONS),--suggests-section=$(section))