#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# This file is public domain software, originally written by Joey Hess. 

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

build: build-stamp
build-stamp: build-arch

build-arch:
	dh_autoreconf
	# autoreconf
	./configure --prefix=/usr --mandir=/usr/share/man \
		--enable-hotplug-script-dir=/etc/hotplug/usb \
		--enable-hotplug-usermap-dir=/etc/hotplug/usb \
		--enable-quicktime --with-avcodec --without-dv1394 \
		--disable-local-ffmpeg
	$(MAKE)
	cd po; intltool-update --verbose -p
	touch build-arch

build-indep:
	touch build-indep

clean: clean1st
clean1st:
	dh_testdir
	dh_testroot
	rm -f build-indep build-arch
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -f debian/shlibs.local config.log
	dh_autoreconf_clean
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	$(MAKE) DESTDIR="$(CURDIR)/debian/kino/" install
	rm -r $(CURDIR)/debian/kino/usr/etc
	rm `find $(CURDIR)/debian/kino -name '*.la'`
	# install icon
	dh_install debian/kino.xpm usr/share/pixmaps
	mv $(CURDIR)/debian/kino/usr/share/kino/help $(CURDIR)/debian/kino/usr/share/doc/kino/

# Build architecture-independent files here.
binary-indep: build-indep install

# Build architecture-dependent files here.
binary-arch: build-arch install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installmenu
	dh_installman
	dh_installchangelogs ChangeLog
	dh_installudev
	dh_link
	dh_strip
	dh_compress -Xkino.xml
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
ifeq (linux,$(DEB_HOST_ARCH_OS))
	dh_gencontrol -pkino -- -Vudev-hotplug="udev | hotplug"
else
	dh_gencontrol -pkino
endif
	dh_md5sums
	dh_builddeb

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