blob: 3c95b3c5e65deb87eb79605524eff89e7c4c27b2 [file] [log] [blame]
# 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@
systemdunitdir = @systemdunitdir@
tmpfilesdir = @tmpfilesdir@
udevrulesdir = @udevrulesdir@
initscripttype = @initscripttype@
BASH_COMPLETION_SUFFIX = @BASH_COMPLETION_SUFFIX@
UDEV_RULE_SUFFIX = @UDEV_RULE_SUFFIX@
INITDIR = @INITDIR@
LIBDIR = @prefix@/lib/@PACKAGE_TARNAME@
LN_S = @LN_S@
# features enabled or disabled by configure
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:
install -d $(DESTDIR)$(LIBDIR)
# "sysv" or "both"
ifeq ($(subst both,sysv,$(initscripttype)),sysv)
install -d $(DESTDIR)$(INITDIR)
install -m 755 drbd $(DESTDIR)$(INITDIR)/
endif
# yes, debian apparently allows installing both types from the same package
# "systemd" or "both"
ifeq ($(subst both,systemd,$(initscripttype)),systemd)
install -d $(DESTDIR)$(systemdunitdir)
install -m 644 drbd.service $(DESTDIR)$(systemdunitdir)/
install -d $(DESTDIR)/lib/drbd/
install -m 755 drbd $(DESTDIR)/lib/drbd/
install -d $(DESTDIR)$(tmpfilesdir)/
install -m 444 drbd.tmpfiles.conf $(DESTDIR)$(tmpfilesdir)/drbd.conf
endif
@ 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 -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),debian)
@ echo "Don't forget to run update-rc.d"
else
@ echo "Don't forget to run chkconfig"
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)
install -m 755 crm-fence-peer.9.sh $(DESTDIR)$(LIBDIR)
( set -e ; cd $(DESTDIR)$(LIBDIR) ;\
$(LN_S) -f crm-fence-peer.sh crm-unfence-peer.sh ;\
$(LN_S) -f crm-fence-peer.9.sh crm-unfence-peer.9.sh )
mkdir -p $(DESTDIR)/usr/lib/ocf/resource.d/linbit
install -m 755 drbd.ocf $(DESTDIR)/usr/lib/ocf/resource.d/linbit/drbd
install -m 644 drbd.shellfuncs.sh $(DESTDIR)/usr/lib/ocf/resource.d/linbit/
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)$(udevrulesdir)
install -m 644 drbd.rules $(DESTDIR)$(udevrulesdir)/65-drbd.rules$(UDEV_RULE_SUFFIX)
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:
# "sysv" or "both"
ifeq ($(subst both,sysv,$(initscripttype)),sysv)
rm -f $(DESTDIR)$(INITDIR)/drbd
endif
# "systemd" or "both"
ifeq ($(subst both,systemd,$(initscripttype)),systemd)
rm -f $(DESTDIR)$(systemdunitdir)/drbd.service
endif
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/drbdadm$(BASH_COMPLETION_SUFFIX)
rm -f $(DESTDIR)$(sbindir)/drbd-overview
! test -L $(DESTDIR)/sbin/rcdrbd || rm $(DESTDIR)/sbin/rcdrbd
.PHONY: install uninstall clean distclean
../../configure:
@echo "please (re-)run ./autogen.sh with appropriate arguments"; exit 1
../../config.status: ../../configure
@echo "please (re-)run ./configure with appropriate arguments"; exit 1
Makefile.in: ;
Makefile: Makefile.in ../config.status
cd .. && ./config.status scripts/Makefile