#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

PACKAGE=python-central
SHELL=/bin/bash

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

build: build-stamp
build-stamp:
	dh_testdir
	pod2man -c Debhelper -r "$(VERSION)" dh_pycentral dh_pycentral.1
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	install -m755 py_compilefiles \
		debian/$(PACKAGE)/usr/bin
	install -m755 py3_compilefiles \
		debian/$(PACKAGE)/usr/bin
	install -m644 pyversions.py \
		debian/$(PACKAGE)/usr/share/pycentral-data/
	install -m644 pycentral.mk \
		debian/$(PACKAGE)/usr/share/pycentral-data/
	install -m755 pycentral.py \
		debian/$(PACKAGE)/usr/bin/pycentral
	install -m755 dh_pycentral \
		debian/$(PACKAGE)/usr/bin
	install -m644 preinst-pycentral prerm-pycentral postinst-pycentral \
		debian/$(PACKAGE)/usr/share/debhelper/autoscripts
	install -m755 pycentral.{rtinstall,rtremove,rtupdate} \
		debian/$(PACKAGE)/usr/share/python/runtime.d/
	install -m644 python_central.pm \
		debian/$(PACKAGE)/usr/share/perl5/Debian/Debhelper/Sequence/
	install -m755 python-central.explain \
		debian/$(PACKAGE)/usr/lib/cruft/explain/python-central

	( \
	  echo '# the presence of this file allows calling pkgremove on upgrade'; \
	  echo '# for packages which did create the symlinks in the preinst.'; \
	) > debian/$(PACKAGE)/var/lib/pycentral/pkgremove

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installexamples
	dh_installman dh_pycentral.1 pycentral.1 py_compilefiles.1
	dh_installinfo
	dh_installchangelogs 
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do by default.

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
