GARNAME = pmount
GARVERSION = 0.9.7
CATEGORIES = bootstrap
DISTFILES = $(GARNAME)-$(GARVERSION).tar.bz2

MASTER_SITES = http://www.gnome.org/~bobk/garnome/

LIBDEPS = freedesktop/hal

DESCRIPTION = pmount
define BLURB
 #FIXME: blurb goes here
endef

CONFIGURE_SCRIPTS = $(WORKSRC)/configure
BUILD_SCRIPTS = $(WORKSRC)/Makefile
INSTALL_SCRIPTS = custom

CONFIGURE_ARGS = $(DIRPATHS)

include ../category.mk

install-custom:
	@if [[ -n "${UNATTENDED}" || -e $(COOKIEDIR)/install ]] ; then : ; \
	else \
		if [ `id -u` = "0" ] ; then \
			$(MAKE) -C $(WORKSRC) install PREFIX=$(prefix); \
		else \
			echo " ==> You need to be root to install pmount" ; \
			echo " ==> If you do not have the root password then press <ENTER>" ; \
			if [ -x `which sudo` -a -e /etc/sudoers ] && [ -e /etc/issue.warty ] || [ "`grep -i ubuntu /etc/issue`" ] ; then \
				echo " ==> Please provide your password" ; \
				sudo sh -c "$(MAKE) -C $(WORKSRC) install PREFIX=$(prefix)" ; \
				if [ $$? -gt 0 ] ; then \
					mv ../pmount ../.pmount ; \
				fi ; \
				elif [ -x `which su` ] ; then \
					echo " ==> Please provide the root password" ; \
					su -m -c "$(MAKE) -C $(WORKSRC) install PREFIX=$(prefix)" ; \
					if [ $$? -gt 0 ] ; then \
						mv ../pmount ../.pmount ; \
					echo " ==> You chose not to provide a root password" ; \
					echo " ==> pmount support will NOT be included" ; \
					fi ; \
				fi ; \
			fi ; \
		fi
