rules 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/make -f
  2. # Uncomment this to turn on verbose mode.
  3. #export DH_VERBOSE=1
  4. VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | sed 's/^Version: \([^+]*\).*/\1/')
  5. DISTRO := $(shell dpkg-parsechangelog | egrep '^Distribution:' | sed 's/^Distribution: \([^+]*\).*/\1/')
  6. REPORTBUG_VERSION := $(shell python -c "import reportbug; print reportbug.VERSION_NUMBER")
  7. %:
  8. dh $@ --with=python2
  9. override_dh_auto_build:
  10. # Test if versions are synchronized (only if releasing); this will bomb if not synced
  11. if [ "$(DISTRO)" != "UNRELEASED" -a "$(REPORTBUG_VERSION)" != "$(VERSION)" ] ; \
  12. then \
  13. echo 'Please update VERSION_NUMBER variable in reportbug/__init__.py'; exit 1 ; \
  14. fi
  15. python setup.py build
  16. override_dh_auto_install:
  17. python setup.py install --root $(CURDIR)/debian/reportbug --install-layout=deb
  18. mv $(CURDIR)/debian/reportbug/usr/lib $(CURDIR)/debian/python-reportbug/usr
  19. chmod 0755 $(CURDIR)/debian/reportbug/usr/bin/*
  20. cp -p conf/reportbug.conf $(CURDIR)/debian/reportbug/etc
  21. cp -p debian/desktop $(CURDIR)/debian/reportbug/usr/share/applications/reportbug.desktop
  22. override_dh_installman:
  23. dh_installman man/*