#! /usr/bin/make -f
#
# debian/rules for authbind
#
# authbind is Copyright (C) 1998 Ian Jackson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# $Id$

package=authbind

INSTALL = install
INSTALL_FILE    = $(INSTALL) -p    -m  644
INSTALL_PROGRAM = $(INSTALL) -p    -m  755
INSTALL_SCRIPT  = $(INSTALL) -p    -m  755
INSTALL_DIR     = $(INSTALL) -p -d -m  755
STRIP = true

export INSTALL
export INSTALL_FILE
export INSTALL_PROGRAM
export INSTALL_SCRIPT
export INSTALL_DIR
export STRIP

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

%:
	dh $@


override_dh_auto_build:
	# prefix is needed here because it is recorded in the authbind binary
	# (as a part of an error message). It would probably be fine without it,
	# but it seems weird to be inconsistent between the installed location
	# and the error message.
	dh_auto_build -- prefix=/usr


override_dh_auto_install:
	dh_auto_install -- prefix=/usr install install_man

execute_after_dh_fixperms:
	# Redo the setuid mode that `dh_fixperms` removes
	chmod u+s debian/$(package)/usr/lib/authbind/helper
