#!/usr/bin/make -f

export OSLO_PACKAGE_VERSION=$(shell dpkg-parsechangelog | grep Version: | cut -d' ' -f2 | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//' -e 's/~/.0/' | head -n 1)

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk

binary-post-install/python-lp-reports::
	mkdir -p debian/$(cdbs_curpkg)/etc/lpreports
	mkdir -p debian/$(cdbs_curpkg)/etc/nginx/sites-available
	mkdir -p debian/$(cdbs_curpkg)/etc/uwsgi/apps-available
	mkdir -p debian/$(cdbs_curpkg)/usr/lib/python2.7/dist-packages/lpreports/templates/includes
	mkdir -p debian/$(cdbs_curpkg)/var/log/lpreports
	cp config/* debian/$(cdbs_curpkg)/etc/lpreports/
	cp -r lpreports/static debian/$(cdbs_curpkg)/usr/lib/python2.7/dist-packages/lpreports/
	cp -r lpreports/templates debian/$(cdbs_curpkg)/usr/lib/python2.7/dist-packages/lpreports/
	cp nginx/lpreports.conf debian/$(cdbs_curpkg)/etc/nginx/sites-available/
	cp uwsgi/lpreports.yaml debian/$(cdbs_curpkg)/etc/uwsgi/apps-available/
	cp wsgi.py debian/$(cdbs_curpkg)/usr/lib/python2.7/dist-packages/lpreports/
	cp manage.py debian/$(cdbs_curpkg)/usr/lib/python2.7/dist-packages/lpreports/
