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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
#!/usr/bin/make -f
include /usr/share/openstack-pkg-tools/pkgos.make
%:
dh $@ --buildsystem=python_distutils --with python3,sphinxdoc
override_dh_install:
echo "Do nothing..."
override_dh_auto_clean:
python3 setup.py clean
rm -rf build .coverage
rm -rf $(CURDIR)/static
rm -rf $(CURDIR)/horizon/build
rm -rf $(CURDIR)/horizon.egg-info
rm -rf $(CURDIR)/openstack_dashboard/openstack_dashboard.egg-info
rm -rf doc/source/sourcecode
rm -rf $(CURDIR)/doc/build
rm -f horizon/openstack_dashboard/test/.secret_key_store
find $(CURDIR)/openstack_dashboard -iname '*.pyc' -delete
rm -rf .eggs
rm -f AUTHORS
rm -f ChangeLog
find . -iname '*.pyc' -delete
for i in $$(find . -type d -iname __pycache__) ; do rm -rf $$i ; done
override_dh_auto_build:
echo "Do nothing..."
override_dh_auto_install:
# Compile language files
chmod +x debian/compile-messages
$(CURDIR)/debian/compile-messages
set -e && for pyvers in $(PYTHON3S); do \
python$$pyvers setup.py install \
--install-layout=deb \
--root $(CURDIR)/debian/tmp \
--no-compile -O0; \
done
# Prepare openstack-dashboard folder and copy manage.py
install -d -m 755 $(CURDIR)/debian/tmp/usr/share/openstack-dashboard
cp $(CURDIR)/manage.py $(CURDIR)/debian/tmp/usr/share/openstack-dashboard/
# Move themes folder to standard location
mv -f $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/openstack_dashboard/themes \
$(CURDIR)/debian/tmp/usr/share/openstack-dashboard/
# Create /etc/openstack-dashboard/ and move policy files into
install -d -m 755 $(CURDIR)/debian/tmp/etc/openstack-dashboard/
mv -f $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/openstack_dashboard/conf \
$(CURDIR)/debian/tmp/etc/openstack-dashboard/policy
# Move conf to standard location
mv -f $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/openstack_dashboard/local/enabled \
$(CURDIR)/debian/tmp/etc/openstack-dashboard/
rm -f $(CURDIR)/debian/tmp/etc/openstack-dashboard/enabled/__init__.py
rm -f $(CURDIR)/debian/tmp/etc/openstack-dashboard/enabled/*.example
# Move wsgi file to standard location
mv $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/openstack_dashboard/wsgi.py \
$(CURDIR)/debian/tmp/usr/share/openstack-dashboard/
# Move local_settings.d to /etc and modify local_settings.py
mv -f $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/openstack_dashboard/local/local_settings.d \
$(CURDIR)/debian/tmp/etc/openstack-dashboard/
rm -f $(CURDIR)/debian/tmp/etc/openstack-dashboard/local_settings.d/*.example
install -d -m 755 $(CURDIR)/debian/tmp/usr/share/openstack-dashboard/examples
mv -f $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/openstack_dashboard/local/local_settings.py.example \
$(CURDIR)/debian/tmp/usr/share/openstack-dashboard/examples/local_settings.py
# Secret key has to be replaced here
sed -i -e 's/os.path.join(LOCAL_PATH,/os.path.join("\/","var","lib","openstack-dashboard","secret-key",/' $(CURDIR)/debian/tmp/usr/share/openstack-dashboard/examples/local_settings.py
# Set debug to false in local.settings.d not working as expected
# So, it needs to be replaced to false directly in local_settings.py
sed -i -e 's/DEBUG = True/DEBUG = False/g' $(CURDIR)/debian/tmp/usr/share/openstack-dashboard/examples/local_settings.py
# Move osprofiler conf files to be enabled to standard location
# and remove /usr/lib/python3/dist-packages/openstack_dashboard/contrib/developer/enabled
mv -f $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/openstack_dashboard/contrib/developer/enabled/_[0-9]*.py \
$(CURDIR)/debian/tmp/etc/openstack-dashboard/enabled/
rm -rf $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/openstack_dashboard/contrib/developer/enabled
# Remove secret_key_store as we will use it in /var/lib/
rm -f $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/openstack_dashboard/local/.secret_key_store
## Delete __pycache__
find . -name __pycache__ -prune -exec rm -rf {} +;
## Delete not needed files
rm -f $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/openstack_dashboard/local/_build*.lock
dh_install
dh_missing --fail-missing
find $(CURDIR)/debian -iname .eslintrc -delete
override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
python3 -m sphinx -b html doc/source debian/horizon-doc/usr/share/doc/horizon-doc/html
dh_sphinxdoc -O--buildsystem=python_distutils
endif
override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
# We should add --compilemessages when the .mo are removed.
set -e ; set -x ; for i in $(PYTHON3S) ; do \
http_proxy=127.0.0.1:9 https_proxy=127.0.0.9:9 \
HTTP_PROXY=127.0.0.1:9 HTTPS_PROXY=127.0.0.1:9 \
PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages PYTHON=python$$i python$$i -m coverage run -a -m pytest horizon/test/ -n $$(nproc --all) -v --ds=horizon.test.settings -m "not selenium and not integration" ; \
PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages PYTHON=python$$i python$$i -m coverage run -a -m pytest openstack_dashboard -v --ds=openstack_dashboard.test.settings -m "not selenium and not integration" ; \
PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages PYTHON=python$$i python$$i -m coverage run -a -m pytest openstack_auth/tests -n $$(nproc --all) -v --ds=openstack_auth.tests.settings -m "not selenium and not integration" ; \
done
## Delete __pycache__
find . -name __pycache__ -prune -exec rm -rf {} +;
endif
|