# Makefile for scripts
#
# This file is part of drbd by Philipp Reisner
#
# drbd 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.
#
# drbd 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 drbd; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#
# for Debian:
#   update-rc.d drbd start 18 2 3 4 5 . stop 18 0 1 6 .
#

include ../Makefile.vars


ifeq ($(DIST),debian)
  INITD=$(PREFIX)etc/init.d/
endif

ifeq ($(DIST),redhat)
  INITD=$(PREFIX)etc/rc.d/init.d/
endif


all:

install:
	@ if [ -z "$(DIST)" ]; then echo "Can not guess distribution, pleas fix Makefile.vars"; fi
	mkdir -p /etc/ha.d/resource.d
	install drbd $(INITD)
	@ if [ ! -e $(PREFIX)etc/drbd.conf ]; then install drbd.conf $(PREFIX)etc/; fi
	ln -f $(INITD)drbd $(PREFIX)etc/ha.d/resource.d/datadisk
	@ echo
	@ echo "Don't forget to run update-rc.d or chkconfig"

clean:
	rm -f *~

uninstall:
	rm $(INITD)drbd
	rm $(PREFIX)etc/ha.d/resource.d/datadisk