File: rules

package info (click to toggle)
swift 2.19.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 16,768 kB
  • sloc: python: 197,574; sh: 636; pascal: 253; makefile: 69; xml: 32
file content (92 lines) | stat: -rwxr-xr-x 3,077 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/make -f

#export DH_VERBOSE=1

include /usr/share/openstack-pkg-tools/pkgos.make

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

# clean sphinx build output
override_dh_clean:
	dh_clean
	rm -f debian/*.upstart
	rm -f debian/*.init
	rm -f debian/*.service
	rm -f debian/python-swift.postinst
	rm -f $(CURDIR)/swift-test.conf

# build with sphinx documentation
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
override_dh_sphinxdoc:
	dh_auto_build
	LC_ALL=C.UTF-8 PYTHONPATH=. python3 -m sphinx doc/source $(CURDIR)/debian/swift-doc/usr/share/doc/swift-doc/base
	LC_ALL=C.UTF-8 PYTHONPATH=. python3 -m sphinx api-ref/source $(CURDIR)/debian/swift-doc/usr/share/doc/swift-doc/api-ref
	dh_sphinxdoc -O--buildsystem=python_distutils
endif

ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	echo "[unit_test]\nfake_syslog = True" > $(CURDIR)/swift-test.conf
	SWIFT_TEST_CONFIG_FILE=$(CURDIR)/swift-test.conf PYTHONPATH=. nosetests -v test/unit --exe \
		--exclude-test=test.unit.common.test_utils.TestUtils.test_get_logger_sysloghandler_plumbing
	rm -f $(CURDIR)/swift-test.conf
endif

override_dh_auto_build:
	dh_auto_build
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func python-swift.postinst

override_dh_install:
	rm debian/tmp/usr/bin/swift-init

	# Create the init scripts and systemd unit files from the template
	set -e ; for i in $(sort $(wildcard debian/*.init.in)) ; do \
		MYINIT=`echo $$i | sed s/.init.in//` ; \
		cp $$i $$MYINIT.init ; \
		cat debian/init-script-template >>$$MYINIT.init ; \
		debian/gen-systemd-unit $$i ; \
	done

	dh_install
	rm -rf debian/python-swift/usr/lib/python*/dist-packages/test

gen-init-configurations:
	# Create the init scripts and systemd unit files from the template
	set -e ; for i in $(sort $(wildcard debian/*.init.in)) ; do \
		MYINIT=`echo $$i | sed s/.init.in//` ; \
		cp $$i $$MYINIT.init ; \
		cat debian/init-script-template >>$$MYINIT.init ; \
		debian/gen-systemd-unit $$i ; \
	done

override_dh_systemd_enable: gen-init-configurations
	echo "Do nothing"

override_dh_systemd_start:
	echo "Do nothing"

override_dh_installinit: gen-init-configurations
	set -e ; for i in $(sort $(wildcard debian/*.init.in)) ; do \
		MYINIT=`echo $$i | sed -e s/.init.in// -e s:debian/::` ; \
		INITPKG=`echo $$MYINIT | cut -d. -f1` ; \
		INITNAME=`echo $$MYINIT | cut -d. -f2` ; \
		echo "Package: $$INITPKG Init: $$INITNAME" ; \
		dh_systemd_enable -p$$INITPKG --name=$$INITNAME ; \
		case $$INITNAME in \
		swift-object-expirer|swift-container-reconciler) \
			dh_installinit --error-handler=true --restart-after-upgrade -p$$INITPKG --name=$$INITNAME ;; \
		*) \
			dh_installinit --error-handler=true --restart-after-upgrade -p$$INITPKG --name=$$INITNAME ; \
			cp debian/$$INITPKG.$$INITNAME@.service debian/$$INITPKG/lib/systemd/system/$$INITNAME@.service ;; \
		esac ; \
		dh_systemd_start -p$$INITPKG --name=$$INITNAME ; \
	done

override_dh_installdocs:
	dh_installdocs

	dh_installdocs -A AUTHORS

override_dh_missing:
	dh_missing --fail-missing