#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk

DEB_DH_STRIP_ARGS := --dbg-package=mc-dbg
DEB_CONFIGURE_EXTRA_FLAGS := --with-glib2 --without-ext2undel --enable-charset --without-samba --with-screen=slang
AWK := awk

#use building with n parallel processes with DEB_BUILD_OPTIONS=parallel=n
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
endif


cleanbuilddir/mc::
	rm -f po/*.gmo
	rm -f po/stamp-po
	rm -f NEWS
	rm -f README

makebuilddir/mc::
	if [ ! -f configure ]; then sh autogen.sh; fi

install/mc::
	cp ./debian/extra/icon.xpm ./debian/mc/usr/share/pixmaps/mc.xpm

binary-post-install/mc::
	chmod 644 ./debian/mc/usr/share/mc/bin/mc*
	chmod 751 ./debian/mc/usr/share/mc/edit.spell.rc
	chmod 751 ./debian/mc/usr/share/mc/edit.indent.rc
	rmdir ./debian/mc/usr/share/man/sr/man8
