File: rules

package info (click to toggle)
cdist 7.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,992 kB
  • sloc: sh: 16,815; python: 9,199; makefile: 344; awk: 261
file content (46 lines) | stat: -rwxr-xr-x 1,473 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
#!/usr/bin/make -f
include /usr/share/dpkg/default.mk
export PYBUILD_DESTDIR = debian/cdist

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

cdist/version.py:
	echo 'VERSION = "$(DEB_VERSION_UPSTREAM)"' > cdist/version.py

override_dh_auto_configure: cdist/version.py
	dh_auto_configure

override_dh_auto_build: cdist/version.py
	# This directory is lost during
	#
	# upstream git -> tarball -> git-buildpackage
	#
	# process, since .gitignore files are excluded by
	# git-archive(1) and tarballs can store empty directories,
	# but git can not.
	#
	# Without this directory, build from git repository fails.
	mkdir -p docs/src/man7
	$(MAKE) man html

# This file contains instruction how to install cdist system-wide. It
# gets installed in wrong place and actually redundant.
execute_after_dh_auto_install:
	find debian/cdist/usr/lib -name 'README' -delete

execute_after_dh_install:
	jdupes --link-soft --recurse debian/cdist-doc

# If something has shebang, then `chmod +x'. But it is important to
# search only among scripts, since some manpages trigger false-positive
# (compressed manpages are considered to have single line by head(1),
# and somewhere in that line #! sometimes occurs)
execute_after_dh_fixperms:
	find debian/cdist/usr/lib/python3 -type f -execdir \
	    /bin/sh -c '(head -n1 {} | grep -qF "#!") && chmod +x {}' \;

override_dh_auto_clean: cdist/version.py
	$(MAKE) clean
	dh_auto_clean
	rm -rf ./build cdist/version.py