1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
# Makefile for scripts
#
# This file is part of DRBD by Philipp Reisner & Lars Ellenberg.
#
# Copright 2001-2008 LINBIT Information Technologies
# Philipp Reisner, Lars Ellenberg
#
# 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 defaults 70 08
#
# variables set by configure
DISTRO = @DISTRO@
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
datadir = @datadir@
sbindir = @sbindir@
sysconfdir = @sysconfdir@
BASH_COMPLETION_SUFFIX = @BASH_COMPLETION_SUFFIX@
UDEV_RULE_SUFFIX = @UDEV_RULE_SUFFIX@
INITDIR = @INITDIR@
LIBDIR = @prefix@/lib/@PACKAGE_TARNAME@
LN_S = @LN_S@
INITSCRIPT_SYMLINK = @INITSCRIPT_SYMLINK@
# features enabled or disabled by configure
WITH_UTILS = @WITH_UTILS@
WITH_KM = @WITH_KM@
WITH_UDEV = @WITH_UDEV@
WITH_XEN = @WITH_XEN@
WITH_PACEMAKER = @WITH_PACEMAKER@
WITH_HEARTBEAT = @WITH_HEARTBEAT@
WITH_RGMANAGER = @WITH_RGMANAGER@
WITH_BASHCOMPLETION = @WITH_BASHCOMPLETION@
# variables meant to be overridden from the make command line
DESTDIR ?= /
all:
install: install-utils install-udev install-xen install-heartbeat install-pacemaker install-rgmanager install-bashcompletion
install-utils:
ifeq ($(WITH_UTILS),yes)
install -d $(DESTDIR)$(INITDIR)
install -m 755 drbd $(DESTDIR)$(INITDIR)/
@ if [ ! -e $(DESTDIR)$(sysconfdir)/drbd.conf ]; then \
install -d $(DESTDIR)$(sysconfdir)/; \
install -m 644 drbd.conf $(DESTDIR)$(sysconfdir)/; \
install -d $(DESTDIR)$(sysconfdir)/drbd.d; \
install -m 644 global_common.conf $(DESTDIR)$(sysconfdir)/drbd.d; \
fi
install -d $(DESTDIR)$(LIBDIR)
install -m 755 outdate-peer.sh $(DESTDIR)$(LIBDIR)
install -m 755 snapshot-resync-target-lvm.sh $(DESTDIR)$(LIBDIR)
install -m 755 notify.sh $(DESTDIR)$(LIBDIR)
install -m 755 stonith_admin-fence-peer.sh $(DESTDIR)$(LIBDIR)
( set -e ; cd $(DESTDIR)$(LIBDIR) ;\
$(LN_S) -f snapshot-resync-target-lvm.sh unsnapshot-resync-target-lvm.sh ;\
$(LN_S) -f notify.sh notify-split-brain.sh ;\
$(LN_S) -f notify.sh notify-io-error.sh ;\
$(LN_S) -f notify.sh notify-pri-on-incon-degr.sh ;\
$(LN_S) -f notify.sh notify-pri-lost.sh ;\
$(LN_S) -f notify.sh notify-pri-lost-after-sb.sh ;\
$(LN_S) -f notify.sh notify-emergency-reboot.sh ;\
$(LN_S) -f notify.sh notify-emergency-shutdown.sh ;\
$(LN_S) -f notify.sh notify-out-of-sync.sh; )
install -d $(DESTDIR)$(sbindir)
install -m 755 drbd-overview.pl $(DESTDIR)$(sbindir)/drbd-overview
ifeq ($(DISTRO),suse)
$(LN_S) -f ..$(sysconfdir)/init.d/drbd $(DESTDIR)$(INITSCRIPT_SYMLINK)
endif
ifeq ($(DISTRO),debian)
@ echo "Don't forget to run update-rc.d"
else
@ echo "Don't forget to run chkconfig"
endif
endif
install-heartbeat:
ifeq ($(WITH_HEARTBEAT),yes)
mkdir -p $(DESTDIR)$(sysconfdir)/ha.d/resource.d
install -m 755 drbddisk $(DESTDIR)$(sysconfdir)/ha.d/resource.d
install -m 755 drbdupper $(DESTDIR)$(sysconfdir)/ha.d/resource.d
endif
# Do not use $(prefix) for the resource agent. The OCF standard
# explicitly mandates where resource agents must live,
# no matter what prefix is configured to.
install-pacemaker:
ifeq ($(WITH_PACEMAKER),yes)
install -d $(DESTDIR)$(LIBDIR)
install -m 755 crm-fence-peer.sh $(DESTDIR)$(LIBDIR)
( set -e ; cd $(DESTDIR)$(LIBDIR) ;\
$(LN_S) -f crm-fence-peer.sh crm-unfence-peer.sh ; )
mkdir -p $(DESTDIR)/usr/lib/ocf/resource.d/linbit
install -m 755 drbd.ocf $(DESTDIR)/usr/lib/ocf/resource.d/linbit/drbd
endif
install-rgmanager:
ifeq ($(WITH_RGMANAGER),yes)
mkdir -p $(DESTDIR)$(datadir)/cluster
install -m 755 drbd.sh.rhcs $(DESTDIR)$(datadir)/cluster/drbd.sh
install -m 644 drbd.metadata.rhcs $(DESTDIR)$(datadir)/cluster/drbd.metadata
install -d $(DESTDIR)$(LIBDIR)
install -m 755 rhcs_fence $(DESTDIR)$(LIBDIR)
endif
install-xen:
ifeq ($(WITH_XEN),yes)
mkdir -p $(DESTDIR)$(sysconfdir)/xen/scripts
install -m 755 block-drbd $(DESTDIR)$(sysconfdir)/xen/scripts
endif
install-udev:
ifeq ($(WITH_UDEV),yes)
mkdir -p $(DESTDIR)$(sysconfdir)/udev/rules.d
install -m 644 drbd.rules $(DESTDIR)$(sysconfdir)/udev/rules.d/65-drbd.rules
endif
install-bashcompletion:
ifeq ($(WITH_BASHCOMPLETION),yes)
mkdir -p $(DESTDIR)$(sysconfdir)/bash_completion.d
install -m 644 drbdadm.bash_completion $(DESTDIR)$(sysconfdir)/bash_completion.d/drbdadm$(BASH_COMPLETION_SUFFIX)
endif
clean:
rm -f *~
rm -f datadisk
distclean: clean
uninstall:
rm -f $(DESTDIR)$(INITDIR)/drbd
rm -f $(DESTDIR)$(sysconfdir)/ha.d/resource.d/drbddisk
rm -f $(DESTDIR)$(sysconfdir)/ha.d/resource.d/drbdupper
rm -f $(DESTDIR)$(sysconfdir)/xen/scripts/block-drbd
rm -f $(DESTDIR)$(sysconfdir)/bash_completion.d/$(COMPLETION)
! test -L $(DESTDIR)/sbin/rcdrbd || rm $(DESTDIR)/sbin/rcdrbd
|