# Copyright 2006-2009 by Purdue Research Foundation, West Lafayette, IN 47906.
# All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License, version 2.1 as published by the Free Software Foundation.

INSTDIR=$(DESTDIR)/etc
MANDIR=$(DESTDIR)/usr/share/man
OWNER=root
GROUP=root

clean:
	rm -f build-stamp configure-stamp

install:
	install -d $(INSTDIR) --owner $(OWNER) --group $(GROUP) --mode 0755
	install environ $(INSTDIR) --owner $(OWNER) --group $(GROUP) --mode 0755
	install -d $(INSTDIR)/profile.d --owner $(OWNER) --group $(GROUP) --mode 0755
	install environ.sh $(INSTDIR)/profile.d --owner $(OWNER) --group $(GROUP) --mode 0644
	install setenv.sh  $(INSTDIR)/profile.d --owner $(OWNER) --group $(GROUP) --mode 0644
	install -d $(INSTDIR)/environ.d --owner $(OWNER) --group $(GROUP) --mode 0755
	install environ.d/emacs $(INSTDIR)/environ.d --owner $(OWNER) --group $(GROUP) --mode 0644
	install environ.d/gedit $(INSTDIR)/environ.d --owner $(OWNER) --group $(GROUP) --mode 0644
	install environ.d/joe $(INSTDIR)/environ.d --owner $(OWNER) --group $(GROUP) --mode 0644
	install environ.d/vi $(INSTDIR)/environ.d --owner $(OWNER) --group $(GROUP) --mode 0644
	install environ.d/vim $(INSTDIR)/environ.d --owner $(OWNER) --group $(GROUP) --mode 0644
	install -d $(MANDIR) --owner $(OWNER) --group $(GROUP) --mode 0755
	install -d $(MANDIR)/man1 --owner $(OWNER) --group $(GROUP) --mode 0755
	install unuse.1 $(MANDIR)/man1 --owner $(OWNER) --group $(GROUP) --mode 0750
	install use.1 $(MANDIR)/man1 --owner $(OWNER) --group $(GROUP) --mode 0750

configure:
	patch  /etc/profile profile.patch
