# Copyright 2005-2012 by Purdue Research Foundation, West Lafayette, IN 47906.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License,
# Version 2 as published by the Free Software Foundation.

USRBINDIR=/usr/bin
INSTDIR=$(DESTDIR)$(USRBINDIR)

# to support rpm's using this makefile when building package, debian has a --fakeroot option when building
# their package, rpm does not, so we fake it out by passing these when calling this makefile
OWNER=$(shell if [ -z "$(INSTALLOWNER)" ]; then echo "root"; else echo $(INSTALLOWNER); fi)
GROUP=$(shell if [ -z "$(INSTALLGROUP)" ]; then echo "root"; else echo $(INSTALLGROUP); fi)

# to support architecture specific logic
ARCH = $(shell if [ -f /etc/redhat-release ]; then echo "rh"; else echo "deb"; fi)

install:
	@echo "inside our install"
	@echo "INSTDIR="$(INSTDIR)
	@echo "DESTDIR="$(DESTDIR)
	install --owner $(OWNER) --group $(GROUP) --mode 0770 -d $(INSTDIR)
	install hubuseradd $(INSTDIR)/hubuseradd --owner $(OWNER) --group $(GROUP) --mode 0755
clean:
