Makefile.am 5.9 KB
Newer Older
D
Daniel P. Berrange 已提交
1 2
## Process this file with automake to produce Makefile.in

3
## Copyright (C) 2005-2015 Red Hat, Inc.
E
Eric Blake 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library 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
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library.  If not, see
## <http://www.gnu.org/licenses/>.
18

19 20
CLEANFILES =

21
DISTCLEANFILES =
22 23 24 25 26 27 28 29 30 31
EXTRA_DIST = \
	libvirtd.policy.in \
	libvirt.rules \
	libvirtd.sasl \
	libvirtd.sysctl \
	libvirtd.logrotate.in \
	libvirtd.qemu.logrotate.in \
	libvirtd.lxc.logrotate.in \
	libvirtd.libxl.logrotate.in \
	libvirtd.uml.logrotate.in \
32
	$(NULL)
33

34
BUILT_SOURCES =
35

36 37
if WITH_LIBVIRTD

38 39
if WITH_POLKIT
if WITH_POLKIT0
40
policydir = $(datadir)/PolicyKit/policy
C
Cole Robinson 已提交
41
policyauth = auth_admin_keep_session
42
else ! WITH_POLKIT0
43
policydir = $(datadir)/polkit-1/actions
C
Cole Robinson 已提交
44
policyauth = auth_admin_keep
45 46
rulesdir = $(datadir)/polkit-1/rules.d
rulesfile = libvirt.rules
47 48
endif ! WITH_POLKIT0
endif WITH_POLKIT
49

C
Cole Robinson 已提交
50 51
libvirtd.policy: libvirtd.policy.in $(top_builddir)/config.status
	$(AM_V_GEN) sed \
52
	    -e 's|[@]authaction[@]|$(policyauth)|g' \
C
Cole Robinson 已提交
53 54 55 56
	    < $< > $@-t && \
	mv $@-t $@
BUILT_SOURCES += libvirtd.policy

57
install-data-local: install-data-sasl install-data-polkit \
58
		install-logrotate install-sysctl
59 60 61
	$(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt \
		   $(DESTDIR)$(localstatedir)/run/libvirt \
		   $(DESTDIR)$(localstatedir)/lib/libvirt
62

63
uninstall-local:: uninstall-data-sasl uninstall-data-polkit \
64
		uninstall-logrotate uninstall-sysctl
65
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
66
	rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
67
	rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
68

69
if WITH_POLKIT
70
install-data-polkit::
71
	$(MKDIR_P) $(DESTDIR)$(policydir)
C
Cole Robinson 已提交
72
	$(INSTALL_DATA) libvirtd.policy $(DESTDIR)$(policydir)/org.libvirt.unix.policy
73 74 75 76 77
if ! WITH_POLKIT0
	$(MKDIR_P) $(DESTDIR)$(rulesdir)
	$(INSTALL_DATA) $(srcdir)/$(rulesfile) $(DESTDIR)$(rulesdir)/50-libvirt.rules
endif ! WITH_POLKIT0

78
uninstall-data-polkit::
79
	rm -f $(DESTDIR)$(policydir)/org.libvirt.unix.policy
80
	rmdir $(DESTDIR)$(policydir) || :
81 82 83 84 85
if ! WITH_POLKIT0
	rm -f $(DESTDIR)$(rulesdir)/50-libvirt.rules
	rmdir $(DESTDIR)$(rulesdir) || :
endif ! WITH_POLKIT0

86
else ! WITH_POLKIT
87 88
install-data-polkit::
uninstall-data-polkit::
89
endif ! WITH_POLKIT
90

91
LOGROTATE_CONFS = libvirtd.qemu.logrotate libvirtd.lxc.logrotate \
J
Jim Fehlig 已提交
92 93
		  libvirtd.libxl.logrotate libvirtd.uml.logrotate \
		  libvirtd.logrotate
94

95 96
BUILT_SOURCES += $(LOGROTATE_CONFS)

97
libvirtd.logrotate: libvirtd.logrotate.in
98 99
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
100
	    < $< > $@-t && \
101 102
	mv $@-t $@

103
libvirtd.qemu.logrotate: libvirtd.qemu.logrotate.in
104 105
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
106
	    < $< > $@-t && \
107 108 109
	mv $@-t $@

libvirtd.lxc.logrotate: libvirtd.lxc.logrotate.in
110 111 112
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
113
	    mv $@-t $@
114

J
Jim Fehlig 已提交
115
libvirtd.libxl.logrotate: libvirtd.libxl.logrotate.in
116 117 118
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
J
Jim Fehlig 已提交
119 120
	    mv $@-t $@

121
libvirtd.uml.logrotate: libvirtd.uml.logrotate.in
122 123 124
	$(AM_V_GEN)sed \
	    -e 's|[@]localstatedir[@]|$(localstatedir)|g' \
	    < $< > $@-t && \
125
	    mv $@-t $@
G
Guido Günther 已提交
126

127
install-logrotate: $(LOGROTATE_CONFS)
128 129 130 131
	$(MKDIR_P) $(DESTDIR)$(localstatedir)/log/libvirt/qemu/ \
		   $(DESTDIR)$(localstatedir)/log/libvirt/lxc/ \
		   $(DESTDIR)$(localstatedir)/log/libvirt/uml/ \
		   $(DESTDIR)$(sysconfdir)/logrotate.d/
132 133 134 135 136 137
	$(INSTALL_DATA) libvirtd.logrotate \
		$(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd
	$(INSTALL_DATA) libvirtd.qemu.logrotate \
		$(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.qemu
	$(INSTALL_DATA) libvirtd.lxc.logrotate \
		$(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.lxc
J
Jim Fehlig 已提交
138 139
	$(INSTALL_DATA) libvirtd.libxl.logrotate \
		$(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.libxl
140 141
	$(INSTALL_DATA) libvirtd.uml.logrotate \
		$(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.uml
G
Guido Günther 已提交
142

143 144 145 146
uninstall-logrotate:
	rm -f $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd \
	      $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.qemu \
	      $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.lxc \
J
Jim Fehlig 已提交
147
	      $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.libxl \
148 149 150 151 152 153
	      $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.uml
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt/qemu || :
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt/lxc || :
	rmdir $(DESTDIR)$(localstatedir)/log/libvirt/uml || :
	rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || :

154
if WITH_SYSCTL
155 156
# Use $(prefix)/lib rather than $(libdir), since man sysctl.d insists on
# /usr/lib/sysctl.d/ even when libdir is /usr/lib64
157
install-sysctl:
158
	$(MKDIR_P) $(DESTDIR)$(prefix)/lib/sysctl.d
E
Eric Blake 已提交
159
	$(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
160
	  $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf
161

162
uninstall-sysctl:
163
	rm -f $(DESTDIR)$(prefix)/lib/sysctl.d/60-libvirtd.conf
164
	rmdir $(DESTDIR)$(prefix)/lib/sysctl.d || :
165
else ! WITH_SYSCTL
166 167
install-sysctl:
uninstall-sysctl:
168
endif ! WITH_SYSCTL
169

170
else ! WITH_LIBVIRTD
171 172
install-data-local: install-data-sasl
uninstall-local:: uninstall-data-sasl
173
endif ! WITH_LIBVIRTD
174

175 176
# This is needed for clients too, so can't wrap in
# the WITH_LIBVIRTD conditional
177
if WITH_SASL
178
install-data-sasl:
179
	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sasl2/
180 181
	$(INSTALL_DATA) $(srcdir)/libvirtd.sasl \
		$(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
182 183 184

uninstall-data-sasl:
	rm -f $(DESTDIR)$(sysconfdir)/sasl2/libvirt.conf
D
Dave Allan 已提交
185
	rmdir $(DESTDIR)$(sysconfdir)/sasl2/ || :
186
else ! WITH_SASL
D
Daniel P. Berrange 已提交
187 188
install-data-sasl:
uninstall-data-sasl:
189
endif ! WITH_SASL
190 191


192
CLEANFILES += $(BUILT_SOURCES)
193
CLEANFILES += *.cov *.gcov .libs/*.gcda .libs/*.gcno *.gcno *.gcda