File: rules

package info (click to toggle)
manila 1%3A3.0.0-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,272 kB
  • ctags: 16,488
  • sloc: python: 149,825; sh: 1,898; pascal: 73; makefile: 58
file content (76 lines) | stat: -rwxr-xr-x 3,421 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/make -f

include /usr/share/openstack-pkg-tools/pkgos.make
export OSLO_PACKAGE_VERSION=$(shell dpkg-parsechangelog | grep Version: | cut -d' ' -f2 | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//' -e 's/~/.0/' | head -n 1)

%:
	dh $@ --buildsystem=python_distutils --with python2,systemd,sphinxdoc

override_dh_auto_build:
	dh_auto_build -O--buildsystem=python_distutils
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func manila-common.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func manila-common.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func manila-api.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func manila-api.config

override_dh_auto_install:
	python2.7 setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp

	# Generate the config file
	mkdir -p $(CURDIR)/debian/manila-common/usr/share/manila-common
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python2.7/dist-packages oslo-config-generator \
		--namespace manila \
		--namespace oslo.messaging \
		--namespace oslo.middleware.cors \
		--namespace oslo.middleware.http_proxy_to_wsgi \
		--namespace oslo.db \
		--namespace oslo.db.concurrency \
		--namespace keystonemiddleware.auth_token \
		--output-file $(CURDIR)/debian/manila-common/usr/share/manila-common/manila.conf

	pkgos-fix-config-default $(CURDIR)/debian/manila-common/usr/share/manila-common/manila.conf keystone_authtoken auth_protocol http
	pkgos-fix-config-default $(CURDIR)/debian/manila-common/usr/share/manila-common/manila.conf oslo_concurrency lock_path /var/lock/manila

	# and copy the remaining
	set -e ; for i in api-paste.ini policy.json rootwrap.conf ; do \
		cp $(CURDIR)/etc/manila/$$i $(CURDIR)/debian/manila-common/usr/share/manila-common ; \
	done
	cp $(CURDIR)/etc/manila/logging_sample.conf $(CURDIR)/debian/manila-common/usr/share/manila-common/logging.conf
	cp -rfv $(CURDIR)/etc/manila/rootwrap.d $(CURDIR)/debian/manila-common/usr/share/manila-common

	install -D -m 0440 debian/manila-common.sudoers $(CURDIR)/debian/manila-common/etc/sudoers.d/manila-common

override_dh_auto_clean:
	dh_auto_clean
	rm -f etc/manila/manila.conf
	rm -f debian/*.service debian/*.upstart debian/*.init
	rm -f debian/manila-common.postinst debian/manila-common.config debian/manila-api.config debian/manila-api.postinst

override_dh_install:
	dh_install --fail-missing

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	@echo "===> Running tests"
	set -e ; set -x ; for i in 2.7 ; do \
		PYMAJOR=`echo $$i | cut -d'.' -f1` ; \
		echo "===> Testing with python$$i (python$$PYMAJOR)" ; \
		rm -rf .testrepository ; \
		testr-python$$PYMAJOR init ; \
		TEMP_REZ=`mktemp -t` ; \
		PYTHONPATH=$(CURDIR) PYTHON=python$$i testr-python$$PYMAJOR run --subunit --parallel | tee $$TEMP_REZ | subunit2pyunit ; \
		cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \
		rm -f $$TEMP_REZ ; \
		testr-python$$PYMAJOR slowest ; \
	done
endif

override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
	sphinx-build -b html doc/source $(CURDIR)/debian/manila-doc/usr/share/doc/manila-doc/html
	# We've got to do this, otherwise we get:
	# "search.html doesn't look like a Sphinx search page"
	# and the package FTBFS
	rm -f $(CURDIR)/debian/manila-doc/usr/share/doc/manila-doc/html/search.html
	dh_sphinxdoc -O--buildsystem=python_distutils
endif