[phodav] spice: add msi installer file



commit f8ff91128f5f4668164832554f0d88611c74483c
Author: Marc-André Lureau <marcandre lureau gmail com>
Date:   Tue Feb 11 13:51:47 2014 +0100

    spice: add msi installer file

 Makefile.am          |   21 +++++++++++++
 configure.ac         |   29 ++++++++++++++++++
 spice-webdavd.wxs.in |   80 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 130 insertions(+), 0 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 10afc2c..313fa8c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,6 +50,27 @@ spice_webdavd_LDADD =                \
        $(PIE_LDFLAGS)          \
        $(NULL)
 
+EXTRA_DIST += spice-webdavd.wxs.in
+CONFIG_STATUS_DEPENDENCIES = spice-webdavd.wxs.in
+
+deps.txt:
+       $(AM_V_GEN)rpm -qa | grep $(host_os) | sort | unix2dos > $@
+
+MANUFACTURER = The Spice Project
+
+spice-webdavd-$(WIXL_ARCH)-$(VERSION)$(BUILDID).msi: spice-webdavd.wxs deps.txt all
+       $(AM_V_GEN)DESTDIR=`mktemp -d`&&                                \
+       make -C $(top_builddir) install DESTDIR=$$DESTDIR >/dev/null && \
+       MANUFACTURER="$(MANUFACTURER)" wixl -D SourceDir=$(prefix)      \
+         -D DESTDIR=$$DESTDIR$(prefix)                                 \
+         --arch $(WIXL_ARCH)  -o $@ $<
+
+msi: spice-webdavd-$(WIXL_ARCH)-$(VERSION)$(BUILDID).msi
+
+CLEANFILES = spice-webavd-$(WIXL_ARCH)-$(VERSION)$(BUILDID).msi
+
+.PHONY: msi
+
 chezdav_SOURCES = libphodav/chezdav.c
 
 chezdav_CFLAGS =               \
diff --git a/configure.ac b/configure.ac
index 81fd74e..044a470 100644
--- a/configure.ac
+++ b/configure.ac
@@ -122,12 +122,41 @@ if test "x$XMLTO" = "x" || test "x$ASCIIDOC" = "x"; then
   AC_MSG_WARN([xmlto or asciidoc not found - cannot create man pages without it])
 fi
 
+AC_ARG_WITH([buildid],
+AS_HELP_STRING([--with-buildid=id], [Set additional build version details]))
+AC_DEFINE_UNQUOTED([BUILDID], "$with_buildid", [Build version details])
+if test "x$with_buildid" != x; then
+  AC_SUBST([BUILDID], "-$with_buildid")
+fi
+
+major=`echo $PACKAGE_VERSION | cut -d. -f1`
+minor=`echo $PACKAGE_VERSION | cut -d. -f2`
+micro=`echo $PACKAGE_VERSION | cut -d. -f3`
+buildid=`echo $with_buildid | cut -d. -f1`
+if test "x$buildid" = x; then
+  buildid=0
+fi
+build=`expr $micro \* 256 + $buildid`
+WINDOWS_PRODUCTVERSION="$major.$minor.$build"
+AC_SUBST([WINDOWS_PRODUCTVERSION])
+
+case "$host" in
+  amd64*|x86_64*)
+    WIXL_ARCH="x64"
+  ;;
+  *)
+    WIXL_ARCH="x86"
+  ;;
+esac
+AC_SUBST(WIXL_ARCH)
+
 AC_CONFIG_FILES([
 Makefile
 doc/Makefile
 po/Makefile.in
 spice/Makefile
 libphodav/Makefile
+spice-webdavd.wxs
 ])
 AC_OUTPUT
 
diff --git a/spice-webdavd.wxs.in b/spice-webdavd.wxs.in
new file mode 100644
index 0000000..0d85ba4
--- /dev/null
+++ b/spice-webdavd.wxs.in
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>
+
+  <?define Version = "@WINDOWS_PRODUCTVERSION@"?>
+  <?define UpgradeCode = "7eb9b146-db04-42d7-a8ba-71fc8ced7eed"?>
+  <?define Arch = "@WIXL_ARCH@"?>
+  <?if $(var.Arch) = "x64"?>
+      <?define GLIB_ARCH = "win64"?>
+      <?define ArchString = "64-bit"?>
+      <?define ArchProgramFilesFolder = "ProgramFiles64Folder"?>
+      <?define Win64 = "yes"?>
+  <?else?>
+      <?define GLIB_ARCH = "win32"?>
+      <?define ArchString = "32-bit"?>
+      <?define ArchProgramFilesFolder = "ProgramFilesFolder"?>
+      <?define Win64 = "no"?>
+  <?endif?>
+
+  <?require glib2.wxi?>
+
+  <Product Id="*" Name="Spice webdavd @VERSION@@BUILDID@ ($(var.ArchString))"
+           Manufacturer="$(env.MANUFACTURER)"
+           Version="$(var.Version)" UpgradeCode="$(var.UpgradeCode)"
+           Language="1033">
+
+    <Package InstallerVersion="200" Compressed="yes" Comments="comments"/>
+    <Media Id="1" Cabinet="cabinet.cab" EmbedCab="yes"/>
+
+    <Property Id="ARPHELPLINK" Value="http://www.spice-space.org"/>
+    <Property Id="ARPNOMODIFY" Value="1"/>
+    <Property Id="ARPNOREPAIR" Value="1"/>
+    <Upgrade Id="$(var.UpgradeCode)">
+      <UpgradeVersion Minimum="$(var.Version)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED"/>
+      <UpgradeVersion Minimum="0.0.0" Maximum="$(var.Version)" IncludeMinimum="yes" IncludeMaximum="no" 
Property="OLDERVERSIONBEINGUPGRADED"/>
+    </Upgrade>
+    <Condition Message="Product already installed.">NOT NEWERVERSIONDETECTED</Condition>
+    <InstallExecuteSequence>
+      <RemoveExistingProducts After="InstallFinalize"/>
+    </InstallExecuteSequence>
+
+    <Directory Id="TARGETDIR" Name="SourceDir">
+      <Directory Id="$(var.ArchProgramFilesFolder)">
+        <Directory Id="INSTALLDIR" Name="SPICE webdavd">
+          <Directory Id="Dbindir" Name="bin">
+            <Component Id="CWebdavd" Guid="*">
+              <File Id='spicewebdavd' Name='spice-webdavd.exe' DiskId='1' 
Source='$(var.DESTDIR)/sbin/spice-webdavd.exe' KeyPath='yes'/>
+              <ServiceInstall Id="WebdavdServiceInstall"
+                            Name="spice-webdavd"
+                            DisplayName="Spice webdav proxy"
+                            Description="A Spice service for folder sharing"
+                            Type="ownProcess"
+                            Start="auto"
+                            Account="[SERVICEACCOUNT]"
+                            Password="[SERVICEPASSWORD]"
+                            Arguments="-p 9843"
+                            ErrorControl="normal"/>
+              <ServiceControl Id="StartService"
+                            Name="spice-webdavd"
+                            Start="install"
+                            Stop="both"
+                            Remove="uninstall"
+                            Wait="yes"/>
+            </Component>
+          </Directory>
+          <Component Id="CDepsTxt" Guid="*">
+            <File Id='depstxt' Name='deps.txt' DiskId='1' Source='deps.txt' KeyPath='yes'/>
+          </Component>
+        </Directory>
+      </Directory>
+    </Directory>
+
+    <Feature Id="Complete"  Level="1">
+      <ComponentGroupRef Id="CG.glib2"/>
+      <ComponentRef Id="CWebdavd"/>
+      <ComponentRef Id="CDepsTxt"/>
+    </Feature>
+
+  </Product>
+</Wix>


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