deb-glare/debian/rules

79 lines
2.9 KiB
Makefile
Executable File

#!/usr/bin/make -f
include /usr/share/openstack-pkg-tools/pkgos.make
%:
dh $@ --buildsystem=python_distutils --with python2,sphinxdoc,systemd
override_dh_auto_clean:
find . -iname '*.pyc' -delete
rm -f debian/*.init debian/*.upstart debian/*.service
rm -f debian/glare-common.postinst debian/glare-common.config debian/glare-api.config debian/glare-api.postinst
rm -rf build
override_dh_auto_build:
dh_auto_build
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func glare-common.config
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func glare-common.postinst
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func glare-api.config
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func glare-api.postinst
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 'glare\.tests\.unit\.*' | 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_auto_install:
echo "Please do nothing"
override_dh_installman:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
sphinx-build $(SPHINXOPTS) -b man doc/source doc/build/man
dh_installman -O--buildsystem=python_distutils
endif
override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
echo "No doc for now."
# sphinx-build $(SPHINXOPTS) -b html doc/source $(CURDIR)/debian/glare-doc/usr/share/doc/glare-doc/html
# dh_sphinxdoc -O--buildsystem=python_distutils
endif
override_dh_install:
rm -rf $(CURDIR)/debian/tmp
python2.7 setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp
mkdir -p $(CURDIR)/debian/glare-common/usr/share/glare-common
PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python2.7/dist-packages oslo-config-generator \
--output-file $(CURDIR)/debian/glare-common/usr/share/glare-common/glare.conf \
--wrap-width 140 \
--namespace glare \
--namespace glance.store \
--namespace keystonemiddleware.auth_token \
--namespace oslo.concurrency \
--namespace oslo.db \
--namespace oslo.db.concurrency \
--namespace oslo.log \
--namespace oslo.messaging \
--namespace oslo.middleware.cors \
--namespace oslo.middleware.http_proxy_to_wsgi \
--namespace oslo.policy
cp etc/glare-paste.ini $(CURDIR)/debian/glare-common/usr/share/glare-common
cp etc/glare-swift.conf.sample $(CURDIR)/debian/glare-common/usr/share/glare-common/glare-swift.conf
rm -rf $(CURDIR)/debian/tmp/usr/etc
dh_install -O--buildsystem=python_distutils --fail-missing