#!/usr/bin/make -f

# ispCP ω (OMEGA) a Virtual Hosting Control Panel
# Copyright (C) 2006-2010 by isp Control Panel - http://ispcp.net
#
# Version: $Id: BSDmakefile 3492 2010-10-19 17:27:36Z nuxwin $
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is "ispCP ω (OMEGA) a Virtual Hosting Control Panel".
#
# The Initial Developer of the Original Code is ispCP Team.
# Portions created by Initial Developer are Copyright (C) 2006-2010 by
# isp Control Panel. All Rights Reserved.
#
# The ispCP ω Home Page is:
#
#    http://isp-control.net
#

.ifdef $(OSTYPE)==FreeBSD
.include <../Makefile.fbsd>
.else
.include <../Makefile.inc>
.endif

CMD_INSTALL=/usr/bin/install -m 0700 -o root -g wheel
SYSTEM_SETUP_ROOT=$(SYSTEM_ROOT)/engine/setup

install:
	$(SYSTEM_MAKE_DIRS) $(SYSTEM_SETUP_ROOT)

	if test -f ./preinst.$(HOST_OS) || test -f ./postinst.$(HOST_OS) ; then \
		$(CMD_INSTALL) ./maintainer-helper.sh $(SYSTEM_SETUP_ROOT)/; \
	fi

	if test -f ./preinst.$(HOST_OS) ; then \
		$(CMD_INSTALL) ./preinst.$(HOST_OS) $(SYSTEM_SETUP_ROOT)/preinst; \
	fi

	if test -f ./postinst.$(HOST_OS) ; then \
		$(CMD_INSTALL) ./postinst.$(HOST_OS) $(SYSTEM_SETUP_ROOT)/postinst; \
	fi

uninstall:
	rm -f $(SYSTEM_SETUP_ROOT)/maintainer-helper.sh
	rm -f $(SYSTEM_SETUP_ROOT)/preinst
	rm -f $(SYSTEM_SETUP_ROOT)/postinst

.PHONY: install uninstall
