#!/usr/bin/make -f
# rules file for developers-reference
-#
-# I do not use debstd, debhelper, or any of that stuff.
-# I believe in stripped down rules files; nothing that is not required
-# I believe in readability through abstraction
package := developers-reference
compress := gzip -9f
# version abstraction
-DEB_VERSION := $(shell LC_ALL=C dpkg-parsechangelog | grep '^Version: ' | sed 's/^Version: *//')
-DEB_DATE := $(shell dpkg-parsechangelog | sed -n 's/^Date: *//p')
+DEB_VERSION := $(shell awk -F '[()]' '/^$(package)/{ print $$2; exit }' debian/changelog)
+DEB_DATE := $(shell dpkg-parsechangelog 2>/dev/null | sed -n 's/^Date: *//p')
# pretty-print the date; I wish this was dynamic like the top-level makefile but oh well
DATE_EN := $(shell LC_ALL=C date --date="$(DEB_DATE)" '+%d %B, %Y')
DATE_FR := $(shell LC_ALL=fr_FR date --date="$(DEB_DATE)" '+%d %B %Y')
dh_installchangelogs -i
dh_compress -i
dh_fixperms -i
-# debian/tocsubstvars
-# be tricky about putting the TOC sections into the description of the package
-# perl -ne '/^\d+\.\s/ && print " $$_";' < developers-reference.txt \
-# >> $(prefix)/DEBIAN/control
+ debian/tocsubstvars -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i