File: rules

package info (click to toggle)
cdist 4.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 19,960 kB
  • sloc: sh: 8,196; python: 4,013; makefile: 338
file content (29 lines) | stat: -rwxr-xr-x 785 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
#!/usr/bin/make -f
include /usr/share/dpkg/default.mk
export PYBUILD_DESTDIR = debian/cdist

clean build-arch build-indep: cdist/version.py
%:
	dh $@ --with python3,linktree,sphinxdoc,bash_completion \
	    --buildsystem=pybuild

# Upstream build system assumes git checkout. Since Debian source packages
# should be buildable from tarballs, we have to reimplement some of upstream
# build trickery.

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

override_dh_auto_build:
	$(MAKE) man html

# If something have shebang, then `chmod +x'.
override_dh_fixperms:
	dh_fixperms
	find debian/cdist -type f -execdir \
	    /bin/sh -c '(head -n1 {} | grep -qF "#!") && chmod +x {}' \;

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