#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

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

INSTALL=/usr/bin/install

build:

clean:
	dh_testdir
	dh_testroot
	dh_clean 

install: build
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs

	# this is the conversion script
	$(INSTALL) bin/xbel2bookmarks $(CURDIR)/debian/bookmarks/usr/share/bookmarks/scripts/
	
	# include the original master file
	$(INSTALL) --mode=644 public_html/bookmarks.xbel $(CURDIR)/debian/bookmarks/usr/share/bookmarks/

	# these are generic xhtml 1.1 files, suitable for every browser
	bin/xbel2bookmarks --format=singlehtml --output=$(CURDIR)/debian/bookmarks/usr/share/bookmarks/bookmarks.html --input=public_html/bookmarks.xbel
	bin/xbel2bookmarks --format=splithtml --output=$(CURDIR)/debian/bookmarks/usr/share/bookmarks/public_html/ --input=public_html/bookmarks.xbel
	$(INSTALL) --mode=644 public_html/style.css $(CURDIR)/debian/bookmarks/usr/share/bookmarks/
	$(INSTALL) --mode=644 public_html/style.css $(CURDIR)/debian/bookmarks/usr/share/bookmarks/public_html/
	
	# these are special formats for widely known browsers
	bin/xbel2bookmarks --format=mozilla --output=$(CURDIR)/debian/bookmarks/usr/share/bookmarks/mozilla.html --input=public_html/bookmarks.xbel
	bin/xbel2bookmarks --format=opera --output=$(CURDIR)/debian/bookmarks/usr/share/bookmarks/opera.dat --input=public_html/bookmarks.xbel
	$(INSTALL) --mode=644 public_html/bookmarks.xbel $(CURDIR)/debian/bookmarks/usr/share/bookmarks/konqueror.xml
	
# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch:
# We have nothing to do by default.

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