#!/usr/bin/make -f
# Made with the aid of dh_make, by Petr Cech.
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Some lines taken from debmake, by Christoph Lameter.

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    MAKEFLAGS += -j$(NUMJOBS)
endif
# No thumb support since thumb version is ~10% slower

build: 
	dh_testdir
	make -f makefile.unix

clean:
	dh_testdir
	dh_testroot

	make -f makefile.unix clean
	dh_clean

# Build architecture-independent files here.
binary-indep: build
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	dh_install

	install -o root -g root -s -m 0755 unrar debian/unrar/usr/bin/unrar-nonfree
	uudecode debian/rar-26.b64 -o debian/unrar/usr/share/icons/hicolor/26x26/mimetypes/application-x-rar.png
	uudecode debian/rar-48.b64 -o debian/unrar/usr/share/icons/hicolor/48x48/mimetypes/application-x-rar.png
	uudecode debian/rar-64.b64 -o debian/unrar/usr/share/icons/hicolor/64x64/mimetypes/application-x-rar.png
#
#	dh_installdocs
#	dh_installman debian/unrar-nonfree.1
#	dh_installchangelogs
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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