[NEW PATCH] Add a recursive install target in Makefile (via gerrit-bot)
Federico Simoncelli
fsimonce at redhat.com
Wed Jul 27 11:48:53 UTC 2011
New patch submitted by Federico Simoncelli (fsimonce at redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/705
commit 8162129339aa3635a8d3ae6c343225e04ec1326a
Author: Federico Simoncelli <fsimonce at redhat.com>
Date: Wed Jul 13 15:52:56 2011 +0000
Add a recursive install target in Makefile
Change-Id: Id579f1ebea23e4f89e9b3b7c0e0695164c505019
diff --git a/Makefile b/Makefile
index ed31c72..75197ca 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@
# (at your option) any later version. See the files README and
# LICENSE_GPL_v2 which accompany this distribution.
#
-DIRS=vdsm_cli re vds_bootstrap vdsm vdsm_reg
+SUBDIRS=vdsm_cli re vds_bootstrap vdsm vdsm_reg vdsm_hooks
DOCS=LICENSE_GPL_v2 README
all: rpm
@@ -34,9 +34,12 @@ pyflakes:
@git ls-files '*.py' | xargs pyflakes \
|| (echo "Pyflakes errors or pyflakes not found"; exit 1)
+install:
+ for subdir in $(SUBDIRS); do make -C $$subdir $@; done
+
.PHONY: tarball
tarball: $(TARBALL)
-$(TARBALL): Makefile $(DIRS) $(DOCS) $(TESTS)
+$(TARBALL): Makefile $(SUBDIRS) $(DOCS) $(TESTS)
tar zcf $(TARBALL) `git ls-files | grep -v /ut/` \
`git ls-files vdsm/ut/faqemu`
diff --git a/vds_bootstrap/Makefile b/vds_bootstrap/Makefile
index 6ba23bc..2c023ae 100644
--- a/vds_bootstrap/Makefile
+++ b/vds_bootstrap/Makefile
@@ -7,15 +7,15 @@
#
INSTALL = install
-TARGET = /usr/share/vdsm-bootstrap
+VDSMBOOTDIR = /usr/share/vdsm-bootstrap
PYSRCS = vds_bootstrap.py vds_bootstrap_complete.py
all: $(PYSRCS)
install:
- $(INSTALL) -Dd 755 $(DESTDIR)$(TARGET)
- $(INSTALL) -Dm 755 $(PYSRCS) $(DESTDIR)$(TARGET)
- $(INSTALL) -Dm 644 deployUtil.py $(DESTDIR)$(TARGET)
+ $(INSTALL) -Dd 755 $(DESTDIR)$(VDSMBOOTDIR)
+ $(INSTALL) -Dm 755 $(PYSRCS) $(DESTDIR)$(VDSMBOOTDIR)
+ $(INSTALL) -Dm 644 deployUtil.py $(DESTDIR)$(VDSMBOOTDIR)
clean:
$(RM) *.pyc *.pyo *~
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 4660ac0..4d863c1 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -53,55 +53,25 @@ sed -i 's/^software_version =.*/software_version = "%{version}"/;s/software_revi
%install
rm -rf "%{buildroot}"
mkdir -p "%{buildroot}"
-make -C vdsm DESTDIR="%{buildroot}" \
- VDSMDIR=%{_datadir}/%{vdsm_name} \
- VDSMLOGDIR=%{_localstatedir}/log/%{vdsm_name} \
- TRUSTSTORE=%{_sysconfdir}/pki/%{vdsm_name} \
- BINDIR=%{_bindir} \
- LIBEXECDIR=%{_libexecdir}/%{vdsm_name} \
- CONFDIR=%{_sysconfdir}/%{vdsm_name} \
- VDSMRUNDIR=%{_localstatedir}/run/%{vdsm_name} \
- VDSMLIBDIR=%{_localstatedir}/lib/%{vdsm_name} \
- SOSPLUGINDIR=%{py_sitedir}/sos/plugins \
- install
+make DESTDIR="%{buildroot}" \
+ ETC=%{_sysconfdir} \
+ VDSMDIR=%{_datadir}/%{vdsm_name} \
+ VDSMLOGDIR=%{_localstatedir}/log/%{vdsm_name} \
+ TRUSTSTORE=%{_sysconfdir}/pki/%{vdsm_name} \
+ BINDIR=%{_bindir} \
+ LIBEXECDIR=%{_libexecdir}/%{vdsm_name} \
+ CONFDIR=%{_sysconfdir}/%{vdsm_name} \
+ REGCONFDIR=%{_sysconfdir}/%{vdsm_name}-reg \
+ VDSMRUNDIR=%{_localstatedir}/run/%{vdsm_name} \
+ VDSMLIBDIR=%{_localstatedir}/lib/%{vdsm_name} \
+ SOSPLUGINDIR=%{py_sitedir}/sos/plugins \
+ OVIRT_CONFIG_SETUP=%{py_sitedir}/ovirt_config_setup \
+ install
# this is not commonplace, but we want /var/log/core to be a world-writable
# dropbox for core dumps.
install -dDm 1777 "%{buildroot}"%{_localstatedir}/log/core
-# hook vhostmd
-make -C vdsm_hooks DESTDIR="%{buildroot}" \
- LIBEXECDIR=%{_libexecdir}/%{vdsm_name} \
- install
-
-#vdsm-cli
-make -C vdsm_cli DESTDIR="%{buildroot}" \
- CONFDIR=%{_sysconfdir}/%{vdsm_name} \
- BINDIR=%{_bindir} \
- COMPDIR=%{_sysconfdir}/bash_completion.d \
- VDSMDIR=%{_datadir}/%{vdsm_name} \
- TRUSTSTORE=%{_sysconfdir}/pki/%{vdsm_name} \
- TARGET=%{_datadir}/%{vdsm_name} install
-
-#vdsm-reg
-make -C vdsm_reg \
- DESTDIR="%{buildroot}" \
- ETC=%{_sysconfdir} \
- CONFDIR=%{_sysconfdir}/%{vdsm_reg} \
- LOGDIR=%{_localstatedir}/log/%{vdsm_reg} \
- VDSMREGDIR=%{_datadir}/%{vdsm_reg} \
- TRUSTSTORE=%{_sysconfdir}/pki/%{vdsm_name} \
- VDSMRUNDIR=%{_localstatedir}/run/%{vdsm_name} \
- OVIRT_CONFIG_SETUP=%{py_sitedir}/ovirt_config_setup \
- install
-
-#vdsm-bootstrap
-make -C vds_bootstrap \
- DESTDIR="%{buildroot}" \
- TARGET=%{_datadir}/%{vdsm_bootstrap} install
-
-
-
%clean
%{__rm} -rf %{buildroot}
diff --git a/vdsm_cli/Makefile b/vdsm_cli/Makefile
index f135d27..287284b 100644
--- a/vdsm_cli/Makefile
+++ b/vdsm_cli/Makefile
@@ -8,7 +8,7 @@
INSTALL = install
-TARGET = /usr/share/vdsm
+VDSMDIR = /usr/share/vdsm
PYSRCS = vdsClient.py vdscli.py dumpStorageTable.py
CONFDIR = /etc/vdsm
BINDIR = bin
@@ -24,8 +24,8 @@ fixpaths:
sed -i "s:@TRUSTSTORE@:$(TRUSTSTORE):" vdscli.py
install: fixpaths
- $(INSTALL) -Dd $(DESTDIR)/$(TARGET)
- $(INSTALL) -Dm 644 $(PYSRCS) $(DESTDIR)/$(TARGET)
+ $(INSTALL) -Dd $(DESTDIR)/$(VDSMDIR)
+ $(INSTALL) -Dm 644 $(PYSRCS) $(DESTDIR)/$(VDSMDIR)
$(INSTALL) -Dm 755 vdsClient $(DESTDIR)/$(BINDIR)/vdsClient
$(INSTALL) -Dm 644 vdsClient.completion $(DESTDIR)$(COMPDIR)/vdsClient
$(INSTALL) -Dm 644 vdsClient.1 $(DESTDIR)$(MANDIR)/man1/vdsClient.1
diff --git a/vdsm_hooks/Makefile b/vdsm_hooks/Makefile
index 64dd604..9145f4a 100644
--- a/vdsm_hooks/Makefile
+++ b/vdsm_hooks/Makefile
@@ -26,5 +26,5 @@ install:
$(INSTALL) -Dm 755 persist-vdsm-hooks $(DESTDIR)$(LIBEXECDIR)/persist-vdsm-hooks
$(INSTALL) -Dm 755 unpersist-vdsm-hook $(DESTDIR)$(LIBEXECDIR)/unpersist-vdsm-hook
(for hook in $(SUBDIRS); do \
- make -C $$hook $@ \
+ make -C $$hook $@; \
done)
diff --git a/vdsm_reg/Makefile b/vdsm_reg/Makefile
index 83b2649..035d45a 100644
--- a/vdsm_reg/Makefile
+++ b/vdsm_reg/Makefile
@@ -2,8 +2,8 @@ INSTALL=install
LN_S=ln -s
VDSMREGDIR=/usr/share/vdsm-reg
ETC=/etc
-CONFDIR=$(ETC)/vdsm-reg
-LOGDIR=/var/log/vdsm-reg
+REGCONFDIR=$(ETC)/vdsm-reg
+VDSMREGLOGDIR=/var/log/vdsm-reg
VDSMRUNDIR=/var/run/vdsm
MANDIR=/usr/share/man
@@ -17,13 +17,13 @@ fixpaths:
sed -i "s:@VDSMRUNDIR@:$(VDSMRUNDIR):" vdsm-reg.conf
install: fixpaths
- $(INSTALL) -Dd $(DESTDIR)$(CONFDIR)
+ $(INSTALL) -Dd $(DESTDIR)$(REGCONFDIR)
$(INSTALL) -Dd $(DESTDIR)$(VDSMREGDIR)
- $(INSTALL) -Dd $(DESTDIR)$(LOGDIR)
+ $(INSTALL) -Dd $(DESTDIR)$(VDSMREGLOGDIR)
$(INSTALL) -Dd $(DESTDIR)$(OVIRT_CONFIG_SETUP)
$(INSTALL) -Dm 755 vdsm-reg $(DESTDIR)$(ETC)/init.d/vdsm-reg
- $(INSTALL) -Dm 644 logger.conf $(DESTDIR)$(CONFDIR)/logger.conf
- $(INSTALL) -Dm 644 vdsm-reg.conf $(DESTDIR)$(CONFDIR)/vdsm-reg.conf
+ $(INSTALL) -Dm 644 logger.conf $(DESTDIR)$(REGCONFDIR)/logger.conf
+ $(INSTALL) -Dm 644 vdsm-reg.conf $(DESTDIR)$(REGCONFDIR)/vdsm-reg.conf
$(INSTALL) -Dm 644 $(FILES) $(DESTDIR)$(VDSMREGDIR)
$(INSTALL) -Dm 755 save-config $(DESTDIR)$(VDSMREGDIR)
$(INSTALL) -Dm 755 vdsm-reg-setup.py $(DESTDIR)$(VDSMREGDIR)/vdsm-reg-setup
@@ -35,4 +35,4 @@ install: fixpaths
$(INSTALL) -Dm 644 vdsm-reg-logrotate.conf $(DESTDIR)$(ETC)/logrotate.d/vdsm-reg
$(INSTALL) -Dm 755 vdsm-reg-logrotate $(DESTDIR)$(ETC)/cron.hourly
$(INSTALL) -Dm 644 vdsm-reg.8 $(DESTDIR)$(MANDIR)/man8/vdsm-reg.8
- $(INSTALL) -Dm 644 rhevm.py $(DESTDIR)$(OVIRT_CONFIG_SETUP)
+ $(INSTALL) -Dm 644 rhevm.py $(DESTDIR)$(OVIRT_CONFIG_SETUP)/rhevm.py
More information about the vdsm-patches
mailing list