#!/usr/bin/make -f

tmp=debian/tmp

build-arch:

build-indep:

build: build-arch build-indep

binary-arch:

binary-indep:
	install -d $(tmp)/usr/share/doc/fields
	install -m 644 debian/changelog \
	  $(tmp)/usr/share/doc/fields/changelog
	gzip -n -9 $(tmp)/usr/share/doc/fields/changelog
	dh_md5sums -pfields -P$(tmp)
	dpkg-gencontrol -pfields -P$(tmp)
	dpkg --build $(tmp) ..
	rm -rf $(tmp)

	# Create another package with a different version
	dh_md5sums -panother-version -P$(tmp)
	dpkg-gencontrol -panother-version -v123.4-0 -P$(tmp)
	dpkg --build $(tmp) ..

binary: binary-arch binary-indep

clean:
	rm -rf debian/files $(tmp) debian/substvars

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