#!/usr/bin/make -f
# Sample debian.rules file - for GNU Hello (1.3).
# Copyright 1994,1995 by Ian Jackson.
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself.  (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)
# This file may have to be extensively modified
#
# Modified by Goran Andersson <goran_a@maths.lth.se>

package=iswedish

build:
	$(checkdir)
	make
	make svenska.ordlista
	touch build

clean:
	$(checkdir)
	-rm -f build
	-make distclean
	-rm `find . -name "*~"`
	-rm -rf debian/[iw]swedish debian/files* core

binary-indep:	checkroot build
	$(checkdir)
	-rm -rf debian/[iw]swedish
	install -d -m755 debian/iswedish/usr/lib/ispell
	install -d -m755 debian/wswedish/usr/dict
	install -d -m755 debian/wswedish/usr/man/man5
	install -m644 svenska.{aff,hash} debian/iswedish/usr/lib/ispell
	(cd debian/iswedish/usr/lib/ispell; ln -si svenska.aff swedish.aff ; \
		ln -si svenska.hash swedish.hash)
	install -m644 svenska.ordlista debian/wswedish/usr/dict/swedish
	install -m644 diverse/swedish.5.gz debian/wswedish/usr/man/man5
	install -d -m755 debian/iswedish/DEBIAN
	install -d -m755 debian/wswedish/DEBIAN
	install -m755 debian/iswedish.postinst debian/iswedish/DEBIAN/postinst
	install -m755 debian/iswedish.prerm debian/iswedish/DEBIAN/prerm
	install -m755 debian/wswedish.postinst debian/wswedish/DEBIAN/postinst
	install -m755 debian/wswedish.postrm debian/wswedish/DEBIAN/postrm
	install -m755 debian/wswedish.prerm debian/wswedish/DEBIAN/prerm
	install -d -m755 debian/iswedish/usr/doc/iswedish
	install -d -m755 debian/wswedish/usr/doc/wswedish
	install -m644 diverse/svenska.html debian/iswedish/usr/doc/iswedish
	install -m644 diverse/swedish.html debian/iswedish/usr/doc/iswedish
	install -m644 debian/changelog \
		debian/iswedish/usr/doc/iswedish/changelog.Debian
	install -m644 debian/changelog \
		debian/wswedish/usr/doc/wswedish/changelog.Debian
	gzip -9 `find debian/[iw]swedish/usr/doc -type f`
	install -m644 diverse/copyright debian/iswedish/usr/doc/iswedish
	install -m644 diverse/copyright debian/wswedish/usr/doc/wswedish
	chown -R root.root debian/[iw]swedish
	dpkg-gencontrol -piswedish -Pdebian/iswedish
	dpkg --build debian/iswedish
	dpkg-name -s .. debian/iswedish.deb
	dpkg-gencontrol -pwswedish -Pdebian/wswedish
	dpkg --build debian/wswedish
	dpkg-name -s .. debian/wswedish.deb

binary-arch:	checkroot build
	$(checkdir)
# There are no architecture-dependent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

define checkdir
	test -f debian/rules -a -d Adjektiv.j
endef

# Below here is fairly generic really

binary:		binary-indep binary-arch

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

checkroot:
	$(checkdir)
	test root = "`whoami`"

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

