[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [libvirt-php][PATCH 10/10] Install libvirt-php.ini more wisely



Instead of creating the file directly under the installation
directory, lets just create it locally and copy afterwards.

Signed-off-by: Michal Privoznik <mprivozn redhat com>
---
 configure.ac    |  2 +-
 src/Makefile.am | 33 ++++++++++++++++++---------------
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4584385..9e9fee0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -148,5 +148,5 @@ AC_SUBST([SHLIB_FLAGS])
 AC_SUBST([PHPIZE])
 AC_SUBST([PHPCONFIG])
 AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_FILES([$PACKAGE.spec])
+AC_CONFIG_FILES([libvirt-php.spec])
 AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
index a601ebe..cab0456 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,23 +6,24 @@ WL= WL@
 SHLIB_FLAGS= SHLIB_FLAGS@
 
 install-exec-local:
-	$(MKDIR_P) $(DESTDIR)$(PHPEDIR)
-	$(MKDIR_P) $(DESTDIR)$(PHPCDIR)
-	$(INSTALL) -m 644 -D .libs/$(PACKAGE).so $(DESTDIR)$(PHPEDIR)/$(PACKAGE).so
-	$(INSTALL) -m 755 -d $(DESTDIR)$(PHPCDIR)
-	$(ECHO) "extension=$(PACKAGE).so" > $(DESTDIR)$(PHPCDIR)/libvirt-php.ini
-	$(ECHO) >> $(DESTDIR)$(PHPCDIR)/libvirt-php.ini
-	$(ECHO) "[libvirt]" >> $(DESTDIR)$(PHPCDIR)/libvirt-php.ini
-	$(ECHO) "; Path to ISO images for VM installations" >> $(DESTDIR)$(PHPCDIR)/libvirt-php.ini
-	$(ECHO) "libvirt.iso_path=/var/lib/libvirt/images" >> $(DESTDIR)$(PHPCDIR)/libvirt-php.ini
-	$(ECHO) "; Path where disk images for new VMs should be created" >> $(DESTDIR)$(PHPCDIR)/libvirt-php.ini
-	$(ECHO) "libvirt.image_path=/var/lib/libvirt/images" >> $(DESTDIR)$(PHPCDIR)/libvirt-php.ini
-	$(ECHO) "; Limit maximum number of libvirt connections" >> $(DESTDIR)$(PHPCDIR)/libvirt-php.ini
-	$(ECHO) "libvirt.max_connections=5" >> $(DESTDIR)$(PHPCDIR)/libvirt-php.ini
+	$(MKDIR_P) $(DESTDIR)$(prefix)$(PHPEDIR)
+	$(MKDIR_P) $(DESTDIR)$(prefix)$(PHPCDIR)
+	$(INSTALL) -m 644 -D .libs/$(PACKAGE).so $(DESTDIR)$(prefix)$(PHPEDIR)/$(PACKAGE).so
+	$(INSTALL) -m 755 -d $(DESTDIR)$(prefix)$(PHPCDIR)
+	$(ECHO) "extension=$(PACKAGE).so" > libvirt-php.ini
+	$(ECHO) >> libvirt-php.ini
+	$(ECHO) "[libvirt]" >> libvirt-php.ini
+	$(ECHO) "; Path to ISO images for VM installations" >> libvirt-php.ini
+	$(ECHO) "libvirt.iso_path=/var/lib/libvirt/images" >> libvirt-php.ini
+	$(ECHO) "; Path where disk images for new VMs should be created" >> libvirt-php.ini
+	$(ECHO) "libvirt.image_path=/var/lib/libvirt/images" >> libvirt-php.ini
+	$(ECHO) "; Limit maximum number of libvirt connections" >> libvirt-php.ini
+	$(ECHO) "libvirt.max_connections=5" >> libvirt-php.ini
+	$(INSTALL) -m 644 -D libvirt-php.ini $(DESTDIR)$(prefix)$(PHPCDIR)/$(PACKAGE).ini
 
 uninstall-local:
-	$(RM) -f $(DESTDIR)$(PHPCDIR)/$(PACKAGE).ini
-	$(RM) -f $(DESTDIR)$(PHPEDIR)/$(PACKAGE).so
+	$(RM) -f $(DESTDIR)$(prefix)$(PHPCDIR)/$(PACKAGE).ini
+	$(RM) -f $(DESTDIR)$(prefix)$(PHPEDIR)/$(PACKAGE).so
 
 AM_CFLAGS = \
 	$(PHPINC) $(LIBXML_CFLAGS) \
@@ -43,3 +44,5 @@ libvirt_php_la_SOURCES = \
 libvirt_php_la_CFLAGS = \
 	$(AM_CFLAGS) \
 	-DCOMPILE_DL_LIBVIRT=1
+
+CLEANFILES = libvirt-php.ini
-- 
2.3.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]