File: rules

package info (click to toggle)
congress 4.0.0%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,720 kB
  • sloc: python: 40,843; sh: 810; makefile: 57
file content (56 lines) | stat: -rwxr-xr-x 2,532 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
#!/usr/bin/make -f

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

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

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	antlr3 congress/datalog/Congress.g
	PYTHONPATH=$(CURDIR) bash run_tests.sh -N -P
	rm -f congress/datalog/CongressLexer.py congress/datalog/CongressParser.py
endif

override_dh_clean:
	dh_clean
	rm -f debian/congress-common.config debian/congress-common.postinst debian/congress-server.config debian/congress-api.postinst
	rm -rf debian/*.upstart debian/*.service
	rm -f congress/datalog/CongressLexer.py congress/datalog/CongressParser.py

override_dh_auto_install:
	echo "Please do nothing."

override_dh_auto_build:
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func congress-common.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func congress-common.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func congress-server.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func congress-server.postinst

override_dh_install:
	antlr3 congress/datalog/Congress.g
	sed -i '1 s/#.*/# Generated by antlr3/' congress/datalog/CongressParser.py
	sed -i '1 s/#.*/# Generated by antlr3/' congress/datalog/CongressLexer.py
	set -e ; for pyvers in $(PYTHONS); do \
		python$$pyvers setup.py install --install-layout=deb \
			--root $(CURDIR)/debian/tmp; \
        done
	rm -rf $(CURDIR)/debian/tmp/usr/lib/python2.7/dist-packages/congress/datalog/Python*

	mkdir -p $(CURDIR)/debian/congress-common/usr/share/congress-common
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python2.7/dist-pacakges oslo-config-generator --output-file $(CURDIR)/debian/congress-common/usr/share/congress-common/congress.conf \
		--wrap-width 79 \
		--namespace congress \
		--namespace oslo.log \
		--namespace oslo.policy \
		--namespace oslo.db \
		--namespace oslo.middleware.cors \
		--namespace oslo.messaging \
		--namespace keystonemiddleware.auth_token
	sed -i 's/[ \t#]*auth_protocol[ \t]*=.*/auth_protocol = http/' $(CURDIR)/debian/congress-common/usr/share/congress-common/congress.conf

	dh_install --fail-missing

	install -D -m 0644 $(CURDIR)/etc/api-paste.ini $(CURDIR)/debian/congress-common/usr/share/congress-common/api-paste.ini
	install -D -m 0644 $(CURDIR)/etc/policy.json $(CURDIR)/debian/congress-common/usr/share/congress-common/policy.json
	cp congress/db/migration/alembic.ini $(CURDIR)/debian/python-congress/usr/lib/python2.7/dist-packages/congress/db/migration/