Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 include /usr/share/openstack-pkg-tools/pkgos.make
4
5 %:
6 dh $@ --buildsystem=pybuild --with python3,sphinxdoc
7
8 override_dh_auto_clean:
9 dh_auto_clean
10 rm -rf .stestr build *.egg-info
11 rm -f $(CURDIR)/debian/aetos.postinst debian/aetos.service debian/aetos.init debian/aetos.config
12 find $(CURDIR) -name '*.pyc' -delete
13 for i in $$(find . -type d -iname __pycache__) ; do rm -rf $$i ; done
14 rm -f AUTHORS ChangeLog
15
16
17 override_dh_auto_build:
18 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func aetos.postinst
19 /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func aetos.config
20 pkgos-merge-templates aetos aetos endpoint ksat
21
22 override_dh_auto_test:
23 echo "Do nothing."
24
25 override_dh_auto_install:
26 echo "Do nothing."
27
28 override_dh_install:
29 pkgos-dh_auto_install --no-py2 --in-tmp
30 # Remove files form /usr/etc.
31 rm -rf $(CURDIR)/debian/tmp/usr/etc
32 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
33 pkgos-dh_auto_test 'aetos\.tests\.unit\..*'
34 endif
35
36 mkdir -p $(CURDIR)/debian/aetos/usr/share/aetos
37 PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslo-config-generator \
38 --output-file $(CURDIR)/debian/aetos/usr/share/aetos/aetos.conf \
39 --wrap-width 140 \
40 --namespace aetos \
41 --namespace oslo.log \
42 --namespace oslo.middleware.cors \
43 --namespace oslo.middleware.healthcheck \
44 --namespace oslo.middleware.http_proxy_to_wsgi \
45 --namespace oslo.policy \
46 --namespace keystonemiddleware.auth_token
47 pkgos-fix-config-default $(CURDIR)/debian/aetos/usr/share/aetos/aetos.conf DEFAULT log_dir /var/log/aetos
48 pkgos-fix-config-default $(CURDIR)/debian/aetos/usr/share/aetos/aetos.conf DEFAULT log_file aetos.log
49
50 pkgos-fix-config-default $(CURDIR)/debian/aetos/usr/share/aetos/aetos.conf DEFAULT auth_strategy keystone
51
52 # Use the policy.d folder
53 pkgos-fix-config-default $(CURDIR)/debian/aetos/usr/share/aetos/aetos.conf oslo_policy policy_dirs /etc/aetos/policy.d
54
55 mkdir -p $(CURDIR)/debian/aetos/etc/aetos/policy.d
56 PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslopolicy-sample-generator \
57 --output-file $(CURDIR)/debian/aetos/etc/aetos/policy.d/00_default_policy.yaml \
58 --namespace aetos
59
60 dh_install
61 ln -s /etc/aetos/api-paste.ini $(CURDIR)/debian/aetos/usr/lib/python3/dist-packages/aetos/api-paste.ini
62
63 override_dh_sphinxdoc:
64 ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
65 PYTHONPATH=. PYTHON=python3 python3 -m sphinx -b html doc/source $(CURDIR)/debian/aetos-doc/usr/share/doc/aetos-doc/html
66 rm -rf $(CURDIR)/debian/aetos-doc/usr/share/doc/aetos-doc/html/.doctrees
67 endif
68
69 override_dh_python3:
70 dh_python3 --shebang=/usr/bin/python3