File: rules

package info (click to toggle)
radicale 2.1.11-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 936 kB
  • sloc: python: 5,450; sh: 241; makefile: 44; perl: 20; xml: 20
file content (61 lines) | stat: -rwxr-xr-x 1,943 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/make -f

include /usr/share/cdbs/1/class/python-distutils.mk
include /usr/share/cdbs/1/rules/debhelper.mk

pkg = radicale
pkg-lib = python3-radicale

# workaround: python-distutils.mk by default adds unusual option -a
DEB_PYTHON_CLEAN_ARGS =

# Disable system daemon by default
DEB_DH_INSTALLINIT_ARGS_radicale = --no-enable

# check upstream testsuite
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
build/python3-radicale build/radicale:: debian/stamp-pytest
debian/stamp-pytest:
	HOME="$(CURDIR)" py.test-3
	rm -rf .config
	touch $@
clean::
	rm -f debian/stamp-pytest
endif

# generate manpage based on --help option of script itself
#  * TODO: Drop PYTHONPATH wildcard when cdbs 0.4.131 is in oldstable
manpages = debian/radicale.1
DEB_INSTALL_MANPAGES_radicale = $(manpages)
common-binary-indep:: $(manpages)
$(manpages): debian/%.1: $(cdbs_python_destdir)/usr/bin/% install/python3-radicale
	export PYTHONPATH="$(cdbs_python_destdir)/usr/lib/python3/dist-packages/"; \
	  help2man \
		--name="a simple calendar server" \
		--version-string="$(DEB_NOEPOCH_VERSION)" \
		--no-info \
		--output=$@ \
		$< \
		|| { $< --help; false; }
	find "$(cdbs_python_destdir)/usr/lib" -name '*.pyc' -delete
	find "$(cdbs_python_destdir)/usr/lib" -type d -empty -delete
clean::
	rm -f $(manpages)
	rm -rf build/

# Ensure proper hash-bang in Python script (Python Policy 0.9 ยง3.1)
binary-fixup/radicale::
	egrep -r -l -Z '^#! ?/usr/bin/(env )?python[[:print:]]*$$' \
		debian/$(cdbs_curpkg)/usr/bin/* \
		debian/$(cdbs_curpkg)/usr/share/radicale/* \
		| xargs -r -0 perl -pi -e 's,^#! ?/usr/bin/(env )?python[[:print:]]*$$,#!/usr/bin/python$(or $(cdbs_python3_nondefault_version),3),'

# fix unset execution bit on FCGI and WSGI scripts
binary-fixup/radicale::
	chmod -x \
		debian/$(cdbs_curpkg)/usr/share/radicale/radicale.fcgi \
		debian/$(cdbs_curpkg)/usr/share/radicale/radicale.wsgi

clean::
	rm -rf Radicale.egg-info
	rm -rf .eggs