#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

#%:
#	dh  $@

#!/usr/bin/make -f
#export DH_VERBOSE=1

PACKAGE_NAME=python-demjson
MODULE_NAME=demjson

PYVERS=2.5

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  CFLAGS += -O0
else
  CFLAGS += -O2
endif
export CFLAGS

clean: 
	dh_testdir
	dh_testroot
	rm -rf dist build build-stamp build-ext-*
#	find . -name '*\.py[co]' -exec rm -f {} \;

	dh_clean install-stamp install-ext-*

build: build-stamp
build-stamp: $(PYVERS:%=build-ext-%)
	touch $@
build-ext-%:
	dh_testdir
	python$* setup.py build
	touch $@

install: install-stamp
install-stamp: build-stamp $(PYVERS:%=install-ext-%)
	touch $@
	rm $(CURDIR)/debian/$(PACKAGE_NAME)/usr/lib/python2.5/site-packages/*.py
install-ext-%:
	python$* setup.py install \
		--root $(CURDIR)/debian/$(PACKAGE_NAME)
	touch $@

binary-indep:

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
#	dh_link /usr/share/javascript/jquery/jquery.js \
#		/usr/share/doc/python-simplejson/docs/_static/jquery.js
	dh_strip
	dh_compress -X.py -X.json -X.js
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb -- -Z bzip2

binary: binary-indep binary-arch

.PHONY: clean binary-indep binary-arch binary unpatch
