Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Nov 2015 15:11:07 +0000 (UTC)
From:      Roman Bogorodskiy <novel@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r400619 - in head/devel/libvirt: . files
Message-ID:  <201511011511.tA1FB7Lc022277@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: novel
Date: Sun Nov  1 15:11:07 2015
New Revision: 400619
URL: https://svnweb.freebsd.org/changeset/ports/400619

Log:
  devel/libvirt: improve configuration handling
  
  libvirt stores various configuration objects in XML files and
  also uses symlinks to enable/disable various things. While
  using @sample could prevent from touching user-modified configs,
  it is quite cumbersome to preserve state of enabled or disabled
  symlink controlled objects across reinstall.
  
  In order to address this situation:
  
   * Install these configuration files into %%EXAMPLESDIR%%,
   * Update pkg-message with instructions how to apply the
     default configuration if user wants to. Also, pkg-message
     moved to files/pkg-message.in to allow substitution,
   * While here, convert virtlockd.conf to @sample
   * Bump PORTREVISION
  
  PR:			203865
  Differential Revision:	D3938

Added:
  head/devel/libvirt/files/pkg-message.in
     - copied, changed from r400618, head/devel/libvirt/pkg-message
Deleted:
  head/devel/libvirt/pkg-message
Modified:
  head/devel/libvirt/Makefile
  head/devel/libvirt/pkg-plist

Modified: head/devel/libvirt/Makefile
==============================================================================
--- head/devel/libvirt/Makefile	Sun Nov  1 15:06:18 2015	(r400618)
+++ head/devel/libvirt/Makefile	Sun Nov  1 15:11:07 2015	(r400619)
@@ -3,6 +3,7 @@
 
 PORTNAME=	libvirt
 PORTVERSION=	1.2.20
+PORTREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	http://libvirt.org/sources/ \
 		ftp://libvirt.org/libvirt/
@@ -86,6 +87,8 @@ PLIST_SUB=	PORTVERSION="-${PORTVERSION}"
 		SHLIB_VER=${SHLIB_VER}
 PORTDOCS=	*
 
+SUB_FILES=	pkg-message
+
 .include <bsd.port.options.mk>
 
 .if (exists(/usr/sbin/bhyve) && ${OSVERSION} >= 100051)
@@ -107,11 +110,20 @@ post-patch:
 	@${MV} ${WRKSRC}/daemon/libvirtd.conf ${WRKSRC}/daemon/libvirtd.conf.sample
 	@${REINPLACE_CMD} -e 's|libvirtd\.conf|libvirtd.conf.sample|' \
 		${WRKSRC}/daemon/Makefile.in
+	
+	@${REINPLACE_CMD} -e 's|ln -s ../default.xml|true|' \
+			  -e 's|$$(DESTDIR)$$(confdir)/qemu/networks|${STAGEDIR}${EXAMPLESDIR}/networks|' \
+			  ${WRKSRC}/src/Makefile.in
 
 	@${MV} ${WRKSRC}/src/libvirt.conf ${WRKSRC}/src/libvirt.conf.sample
 	@${REINPLACE_CMD} -e 's|conf_DATA = libvirt.conf|conf_DATA = libvirt.conf.sample|' \
 		${WRKSRC}/src/Makefile.in
 
+	@${MV} ${WRKSRC}/src/locking/virtlockd.conf ${WRKSRC}/src/locking/virtlockd.conf.sample
+	@${REINPLACE_CMD} -e 's|virtlockd.conf |virtlockd.conf.sample |' \
+			  -e 's|virtlockd.conf$$|virtlockd.conf.sample|' \
+		${WRKSRC}/src/Makefile.in
+
 	@${MV} ${WRKSRC}/src/qemu/qemu.conf ${WRKSRC}/src/qemu/qemu.conf.sample
 	@${REINPLACE_CMD} -e 's|qemu.conf |qemu.conf.sample |' \
 		${WRKSRC}/src/Makefile.in
@@ -128,6 +140,8 @@ post-patch:
 		${WRKSRC}/src/Makefile.in
 
 post-install:
+	@${RMDIR} ${STAGEDIR}${EXAMPLESDIR}/networks/autostart
+	@${MKDIR} ${STAGEDIR}${ETCDIR}/qemu/networks/autostart
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
 .for doc in AUTHORS ChangeLog INSTALL NEWS README TODO
 	${INSTALL_DATA} ${WRKSRC}/${doc} ${STAGEDIR}${DOCSDIR}

Copied and modified: head/devel/libvirt/files/pkg-message.in (from r400618, head/devel/libvirt/pkg-message)
==============================================================================
--- head/devel/libvirt/pkg-message	Sun Nov  1 15:06:18 2015	(r400618, copy source)
+++ head/devel/libvirt/files/pkg-message.in	Sun Nov  1 15:11:07 2015	(r400619)
@@ -1,3 +1,21 @@
 
 To enable libvirtd please add libvirtd_enable="YES" to
 /etc/rc.conf.
+
+NOTE ON CONFIGURATION:
+
+The libvirt port does not come with networking configuration enabled.
+The 'default' network definition is available at:
+
+  %%EXAMPLESDIR%%/networks/default.xml
+
+To enable this network please do the following:
+
+  cp %%EXAMPLESDIR%%/networks/default.xml %%ETCDIR%%/qemu/networks
+
+To configure this network for autostart, execute the following:
+
+  ln -s ../default.xml %%ETCDIR%%/qemu/networks/autostart/default.xml
+
+If you have libvirtd already running you'll need to restart it for changes
+to take effect.

Modified: head/devel/libvirt/pkg-plist
==============================================================================
--- head/devel/libvirt/pkg-plist	Sun Nov  1 15:06:18 2015	(r400618)
+++ head/devel/libvirt/pkg-plist	Sun Nov  1 15:11:07 2015	(r400619)
@@ -10,11 +10,10 @@ man/man8/libvirtd.8.gz
 man/man8/virtlockd.8.gz
 @sample %%ETCDIR%%/libvirt.conf.sample
 @sample %%ETCDIR%%/libvirtd.conf.sample
+@sample %%ETCDIR%%/virtlockd.conf.sample
+%%EXAMPLESDIR%%/networks/default.xml
 %%QEMU%%@sample %%ETCDIR%%/qemu.conf.sample
 %%XEN%%@sample %%ETCDIR%%/libxl.conf.sample
-%%ETCDIR%%/virtlockd.conf
-%%ETCDIR%%/qemu/networks/default.xml
-%%ETCDIR%%/qemu/networks/autostart/default.xml
 %%QEMU%%%%ETCDIR%%/qemu-lockd.conf
 %%XEN%%%%ETCDIR%%/libxl-lockd.conf
 etc/logrotate.d/libvirtd
@@ -300,6 +299,7 @@ lib/libvirt/connection-driver/libvirt_dr
 %%XEN%%@dir /var/lib/libvirt/libxl
 %%XEN%%@dir /var/log/libvirt/libxl
 %%XEN%%@dir /var/run/libvirt/libxl
+@dir %%ETCDIR%%/qemu/networks/autostart
 @dir /var/cache/libvirt
 @dir /var/lib/libvirt/boot
 @dir /var/lib/libvirt/dnsmasq



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511011511.tA1FB7Lc022277>