prefix = /usr/local
sbindir = $(prefix)/sbin
sharedir = $(prefix)/share
mandir = $(sharedir)/man
man1dir = $(mandir)/man1

# mirror = -m 'http://liw.iki.fi/debian main'

all: piuparts.1

piuparts.1: piuparts.docbook
	docbook2x-man piuparts.docbook

install: all
	install -d $(sbindir) $(man1dir)
	install -m 0644 piuparts.1 $(man1dir)
	gzip -9f $(man1dir)/piuparts.1
	install piuparts.py $(sbindir)/piuparts

# The 'check' target probably only works for me. Sorry. Eventually this
# should get a proper test suite, but that's for a later day.
check:
	python piuparts.py $(mirror) -l tmp.log -d sarge test-debs/liwc*.deb
	python piuparts.py $(mirror) -l tmp2.log -d sarge -d etch test-debs/liwc*.deb
	python piuparts.py $(mirror) -l tmp3.log -d sarge -d etch -a liwc

clean:
	rm -rf tmp* piuparts.1
