debian/rules
author Nsukami Patrick <ptrck at nskm dot xyz>
Fri, 22 Nov 2019 12:06:52 +0000
changeset 12783 842939e69f3a
parent 12709 280c9db41038
permissions -rwxr-xr-x
[pkginfo] Remove unused parameter To retrieve cube dependencies or cube requirements, no more need to pass the 'oldkey' parameter to _cube_deps function as this parameter is unused.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11515
b3267ba817b4 Initial debian packaging
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
     1
#!/usr/bin/make -f
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     2
# Sample debian/rules that uses debhelper.
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     3
# GNU copyright 1997 to 1999 by Joey Hess.
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     4
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     5
# Uncomment this to turn on verbose mode.
11832
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
     6
# export DH_VERBOSE=1
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     7
11832
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
     8
export PYBUILD_NAME=cubicweb
12630
1c156d9f224a [debian] Remove test/doc Build-Depends
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 11836
diff changeset
     9
export PYBUILD_DISABLE_python3=test
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    10
11832
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    11
%:
12641
002ae96afeab [pkg] Switch all Debian packages to Python 3
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12631
diff changeset
    12
	dh $@ --with python3,sphinxdoc --buildsystem=pybuild
11515
b3267ba817b4 Initial debian packaging
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    13
11832
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    14
override_dh_auto_build: export http_proxy=127.0.0.1:9
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    15
override_dh_auto_build: export https_proxy=127.0.0.1:9
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    16
override_dh_auto_build:
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    17
	dh_auto_build
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    18
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    19
	PYTHONPATH=. sphinx-build -N -bhtml doc/ debian/cubicweb-doc/html
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    20
endif
11515
b3267ba817b4 Initial debian packaging
Julien Cristau <julien.cristau@logilab.fr>
parents:
diff changeset
    21
12641
002ae96afeab [pkg] Switch all Debian packages to Python 3
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12631
diff changeset
    22
override_dh_auto_install:
002ae96afeab [pkg] Switch all Debian packages to Python 3
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12631
diff changeset
    23
	dh_auto_install
002ae96afeab [pkg] Switch all Debian packages to Python 3
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12631
diff changeset
    24
	mv debian/python3-${PYBUILD_NAME}/usr/bin/cubicweb-ctl \
002ae96afeab [pkg] Switch all Debian packages to Python 3
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12631
diff changeset
    25
		debian/cubicweb-ctl/usr/bin/cubicweb-ctl
002ae96afeab [pkg] Switch all Debian packages to Python 3
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12631
diff changeset
    26
11832
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    27
override_dh_installchangelogs:
e8be49ecb522 [debian] Update debian packaging (closes #16133259)
David Douard <david.douard@logilab.fr>
parents: 11631
diff changeset
    28
	dh_installchangelogs -Xdoc/changes
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    29
12656
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    30
# Should extra sections in requires.txt go to Recommends, Suggests or be
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    31
# ignored?
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    32
#
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    33
# All sections must be listed so we don't forget any in cases of future
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    34
# changes.
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    35
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    36
RECOMMENDS_SECTIONS = ext crypto ical pyramid rdf
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    37
SUGGESTS_SECTIONS = captcha zmq
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    38
# sparql currently requires fyzz which is not compatible with Python 3
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    39
IGNORED_SECTIONS = sparql
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    40
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    41
override_dh_python3:
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    42
	@set -e && trap 'rm -f requires-sections debian-sections' EXIT && \
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    43
		sed -n -e 's/\[\(.*\)\]/\1/p' cubicweb.egg-info/requires.txt | sort > requires-sections && \
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    44
		printf "%s\n" $(RECOMMENDS_SECTIONS) $(SUGGESTS_SECTIONS) $(IGNORED_SECTIONS) | sort > debian-sections && \
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    45
		FORGOTTEN_SECTIONS=$$(comm -23 requires-sections debian-sections) && \
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    46
		if [ "$$FORGOTTEN_SECTIONS" ]; then \
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    47
			echo "The following sections are not listed in debian/rules:" && \
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    48
			echo "$$FORGOTTEN_SECTIONS" && \
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    49
			echo "Please add them in either RECOMMENDS_SECTIONS, SUGGESTS_SECTIONS or IGNORED_SECTIONS" && \
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    50
			exit 1; \
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    51
		fi
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    52
	dh_python3 \
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    53
		$(foreach section,$(RECOMMENDS_SECTIONS),--recommends-section=$(section)) \
91178bc271c7 [pkg] Use sections from requires.txt to populate Recommends and Suggests
Jérémy Bobbio <jeremy.bobbio@irq7.fr>
parents: 12641
diff changeset
    54
		$(foreach section,$(SUGGESTS_SECTIONS),--suggests-section=$(section))