2 # Copyright (C) 2006-2021 Red Hat, Inc. All rights reserved.
4 # This file is part of LVM2.
6 # This copyrighted material is made available to anyone wishing to use,
7 # modify, copy, or redistribute it subject to the terms and conditions
8 # of the GNU General Public License v.2.
10 # You should have received a copy of the GNU General Public License
11 # along with this program; if not, write to the Free Software Foundation,
12 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15 top_srcdir
= @top_srcdir@
16 top_builddir
= @top_builddir@
18 include $(top_builddir
)/make.tmpl
20 ifeq ("@BUILD_DMEVENTD@", "yes")
21 LDFLAGS
+= -Wl
,-rpath-link
,$(top_builddir
)/daemons
/dmeventd
24 LVM_SCRIPTS
= lvmdump.sh
27 ifeq ("@FSADM@", "yes")
28 LVM_SCRIPTS
+= fsadm.sh
31 ifeq ("@LVMIMPORTVDO@", "yes")
32 LVM_SCRIPTS
+= lvm_import_vdo.sh
35 ifeq ("@BLKDEACTIVATE@", "yes")
36 DM_SCRIPTS
+= blkdeactivate.sh
41 OCF_SCRIPTS
+= VolumeGroup.ocf
48 $(SHOW
) " [INSTALL] $^"
49 $(Q
) $(INSTALL_PROGRAM
) -D
$< $(sbindir
)/$(basename $(<F
))
52 $(SHOW
) " [INSTALL] $^"
53 $(Q
) $(INSTALL_DIR
) $(ocf_scriptdir
)
54 $(Q
) $(INSTALL_SCRIPT
) $< $(ocf_scriptdir
)/$(basename $(<F
))
56 install_lvm2
: install_libexec
$(LVM_SCRIPTS
:.sh
=_install
)
57 install_device-mapper
: $(DM_SCRIPTS
:.sh
=_install
)
59 install_ocf
: $(OCF_SCRIPTS
:.ocf
=_install
)
61 install_libexec
: lvresize_fs_helper.sh
62 $(SHOW
) " [INSTALL] $^"
63 $(Q
) $(INSTALL_DIR
) $(libexecdir
)
64 $(Q
) $(INSTALL_SCRIPT
) $< $(libexecdir
)/$(basename $(<F
))
66 install: install_lvm2 install_ocf install_device-mapper
69 # FIXME Customize for other distributions
71 $(SHOW
) " [INSTALL] initscripts"
72 $(Q
) $(INSTALL_DIR
) $(initdir
)
73 ifeq ("@BUILD_DMEVENTD@", "yes")
74 $(Q
) $(INSTALL_SCRIPT
) lvm2_monitoring_init_red_hat
$(initdir
)/lvm2-monitor
76 ifeq ("@BUILD_LVMPOLLD@", "yes")
77 $(Q
) $(INSTALL_SCRIPT
) lvm2_lvmpolld_init_red_hat
$(initdir
)/lvm2-lvmpolld
79 ifeq ("@BUILD_CMIRRORD@", "yes")
80 $(Q
) $(INSTALL_SCRIPT
) cmirrord_init_red_hat
$(initdir
)/cmirrord
82 ifeq ("@BLKDEACTIVATE@", "yes")
83 $(Q
) $(INSTALL_SCRIPT
) blk_availability_init_red_hat
$(initdir
)/blk-availability
86 install_systemd_units
: install_dbus_service
87 $(SHOW
) " [INSTALL] systemd_units"
88 $(Q
) $(INSTALL_DIR
) $(systemd_unit_dir
)
89 ifeq ("@BUILD_DMEVENTD@", "yes")
90 $(Q
) $(INSTALL_DATA
) dm_event_systemd_red_hat.socket
$(systemd_unit_dir
)/dm-event.socket
91 $(Q
) $(INSTALL_DATA
) dm_event_systemd_red_hat.service
$(systemd_unit_dir
)/dm-event.service
92 $(Q
) $(INSTALL_DATA
) lvm2_monitoring_systemd_red_hat.service
$(systemd_unit_dir
)/lvm2-monitor.service
94 ifeq ("@BLKDEACTIVATE@", "yes")
95 $(Q
) $(INSTALL_DATA
) blk_availability_systemd_red_hat.service
$(systemd_unit_dir
)/blk-availability.service
97 ifeq ("@BUILD_LVMPOLLD@", "yes")
98 $(Q
) $(INSTALL_DATA
) lvm2_lvmpolld_systemd_red_hat.socket
$(systemd_unit_dir
)/lvm2-lvmpolld.socket
99 $(Q
) $(INSTALL_DATA
) lvm2_lvmpolld_systemd_red_hat.service
$(systemd_unit_dir
)/lvm2-lvmpolld.service
101 ifeq ("@BUILD_LVMLOCKD@", "yes")
102 $(Q
) $(INSTALL_DATA
) lvmlockd.service
$(systemd_unit_dir
)/lvmlockd.service
103 $(Q
) $(INSTALL_DATA
) lvmlocks.service
$(systemd_unit_dir
)/lvmlocks.service
105 ifeq ("@BUILD_CMIRRORD@", "yes")
106 $(Q
) $(INSTALL_DATA
) lvm2_cmirrord_systemd_red_hat.service
$(systemd_unit_dir
)/lvm2-cmirrord.service
108 ifeq ("@BUILD_LVMDBUSD@", "yes")
109 $(Q
) $(INSTALL_DATA
) lvm2_lvmdbusd_systemd_red_hat.service
$(systemd_unit_dir
)/lvm2-lvmdbusd.service
111 $(Q
) $(INSTALL_DATA
) lvm-devices-import.path
$(systemd_unit_dir
)/lvm-devices-import.path
112 $(Q
) $(INSTALL_DATA
) lvm-devices-import.service
$(systemd_unit_dir
)/lvm-devices-import.service
114 ifeq ("@BUILD_LVMDBUSD@", "yes")
115 install_dbus_service
:
116 $(SHOW
) " [INSTALL] dbus_service"
117 $(Q
) $(INSTALL_DIR
) $(dbusconfdir
)
118 $(Q
) $(INSTALL_DIR
) $(dbusservicedir
)
119 $(Q
) $(INSTALL_DATA
) $(top_srcdir
)/scripts
/com.redhat.lvmdbus1.conf
$(dbusconfdir
)
120 $(Q
) $(INSTALL_DATA
) com.redhat.lvmdbus1.service
$(dbusservicedir
)
122 install_systemd_units
: install_dbus_service
125 install_tmpfiles_configuration
:
126 $(SHOW
) " [INSTALL] configuration"
127 $(Q
) $(INSTALL_DIR
) $(tmpfiles_dir
)
128 $(Q
) $(INSTALL_DATA
) lvm2_tmpfiles_red_hat.conf
$(tmpfiles_dir
)/lvm2.conf
130 .PHONY
: install_systemd_units install_initscripts
131 .PHONY
: install_libexec install_ocf
133 DISTCLEAN_TARGETS
+= \
135 blk_availability_init_red_hat \
136 blk_availability_systemd_red_hat.service \
138 cmirrord_init_red_hat \
139 com.redhat.lvmdbus1.service \
140 dm_event_systemd_red_hat.service \
141 dm_event_systemd_red_hat.socket \
143 lvm2-pvscan.service \
144 lvm2_cluster_activation_red_hat.sh \
145 lvm2_cluster_activation_systemd_red_hat.service \
146 lvm2_clvmd_systemd_red_hat.service \
147 lvm2_cmirrord_systemd_red_hat.service \
148 lvm2_lvmdbusd_systemd_red_hat.service \
149 lvm2_lvmpolld_init_red_hat \
150 lvm2_lvmpolld_systemd_red_hat.service \
151 lvm2_lvmpolld_systemd_red_hat.socket \
154 lvm2_monitoring_init_red_hat \
155 lvm2_monitoring_systemd_red_hat.service \
156 lvm2_pvscan_systemd_red_hat@.service \
157 lvm2_tmpfiles_red_hat.conf
159 # Remove ancient files
160 DISTCLEAN_TARGETS
+= \
161 lvm2_lvmlocking_systemd_red_hat.service