# HG changeset patch
# User John Donoghue
# Date 1534182581 14400
#      Mon Aug 13 13:49:41 2018 -0400
# Node ID d9d2a89d1df78f3d9e369363456d065793c54beb
# Parent  0c6d7d14a6158ce34a9cd4317711572aa12b1a8f
add msys2 environment/tools option, use seprate post-install script to finalize install

* src/msys2-bash.mk: new file

* src/msys2-coreutils.mk: new file

* src/msys2-diffutils.mk: new file

* src/msys2-dos2unix.mk: new file

* src/msys2-filesystem.mk: new file

* src/msys2-findutils.mk: new file

* src/msys2-gawk.mk: new file

* src/msys2-gcc-libs.mk: new file

* src/msys2-gmp.mk: new file

* src/msys2-gnupg.mk: new file

* src/msys2-grep.mk: new file

* src/msys2-gzip.mk: new file

* src/msys2-icu.mk: new file

* src/msys2-info.mk: new file

* src/msys2-less.mk: new file

* src/msys2-libassuan.mk: new file

* src/msys2-libbz2.mk: new file

* src/msys2-libexpat.mk: new file

* src/msys2-libgpg-error.mk: new file

* src/msys2-libgpgme.mk: new file

* src/msys2-libiconv.mk: new file

* src/msys2-libidn2.mk: new file

* src/msys2-libintl.mk: new file

* src/msys2-liblzma.mk: new file

* src/msys2-libmetalink.mk: new file

* src/msys2-libopenssl.mk: new file

* src/msys2-libpcre.mk: new file

* src/msys2-libpsl.mk: new file

* src/msys2-libreadline.mk: new file

* src/msys2-libunistring.mk: new file

* src/msys2-libutil-linux.mk: new file

* src/msys2-libxml2.mk: new file

* src/msys2-make.mk: new file

* src/msys2-mintty.mk: new file

* src/msys2-ncurses.mk: new file

* src/msys2-pacman-mirrors.mk: new file

* src/msys2-pacman.mk: new file

* src/msys2-patch.mk: new file

* src/msys2-runtime.mk: new file

* src/msys2-sed.mk: new file

* src/msys2-tar.mk: new file

* src/msys2-unzip.mk: new file

* src/msys2-wget.mk: new file

* src/msys2-zip.mk: new file

* src/msys2-zlib.mk: new file

* src/msys2-mpfr.mk: new file

* src/msys2-libsqlite.mk: new file

* src/msys2-keyring.mk: new file

* src/msys2-libffi.mk: new file

* src/msys2-libgnutls.mk: new file

* src/msys2-libhogweed.mk: new file

* src/msys2-libksba.mk: new file

* src/msys2-libnettle.mk: new file

* src/msys2-libnpth.mk: new file

* src/msys2-libp11-kit.mk: new file

* src/msys2-libtasn1.mk: new file

* Makefile.in: add msys2 vars and base rules

* index.html: ref new msys2 targets

* dist-files.mk: added refs to new msys2 mk files

* binary-dist-rules.mk: added conditional msys/msys2 dist files, post-install.bat

* configure.ac: added --with-msys2 option

* installer-files/post-install.bat: new file

* tools/makeinst-script.sh.in: call post-install.bat instead of fc_update and octave,
  and use nsExec to hide comd windows while executing it

* tools/msys2-install.py; new file

* installer-files/cmdshell.bat, installer-files/fc_update.bat,
  installer-files/octave-firsttime.vbs, installer-files/octave.vbs:
  update paths when running msys2

diff -r 0c6d7d14a615 -r d9d2a89d1df7 Makefile.in
--- a/Makefile.in	Wed Aug 08 13:57:32 2018 -0400
+++ b/Makefile.in	Mon Aug 13 13:49:41 2018 -0400
@@ -70,6 +70,9 @@
 # use qt5 instead of qt4
 ENABLE_QT5 := @ENABLE_QT5@
 
+# Set to "yes" to use msys2
+USE_MSYS2 := @USE_MSYS2@
+
 # Should match what config.guess prints for your system.
 # If cross compiling, you must set it manually (defaults are set by configure).
 ifeq ($(MXE_NATIVE_BUILD),yes)
@@ -446,7 +449,13 @@
     MSYS_BASE_SOURCES := $(addprefix src-,$(MSYS_BASE_PACKAGES))
     PKGS += $(MSYS_BASE_SOURCES)
 
-     NOTEPAD_BASE_DIR := $(TOP_BUILD_DIR)/notepad++
+    NOTEPAD_BASE_DIR := $(TOP_BUILD_DIR)/notepad++
+
+    MSYS2_ARCH = $(shell echo $(TARGET) | $(SED) -n 's|\([^-]*\).*|\1|p')
+    MSYS2_PACKAGES := $(shell $(SED) -n 's/^.* class="package">\([^<]*\)<.*$$/\1/p' '$(TOP_DIR)/index.html' | $(GREP) msys2-)
+    MSYS2_URL := https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/$(MSYS2_ARCH)
+    MSYS2_DIR := $(TOP_BUILD_DIR)/msys2
+
   endif
 else ifeq ($(MXE_SYSTEM),msvc)
   MXE_WINDOWS_BUILD := yes
@@ -632,6 +641,17 @@
 .PHONY: msys-base-sources
 msys-base-sources:  $(MSYS_BASE_SOURCES)
 
+define MSYS2_PKG_BUILD
+  cd '$(1)/' && \
+  mkdir -p '$(3)' && \
+  (tar cf $(3)/$($(PKG)_FILE) '.') && \
+  (TMP="$(3)" \
+  $(TOP_DIR)/tools/msys2-install.py --verbose --msys-dir="$(MSYS2_DIR)" "$(3)/$($(PKG)_FILE)")
+endef
+
+.PHONY: msys2
+msys2:  $(MSYS2_PACKAGES)
+
 .PHONY: octave-forge-packages
 octave-forge-packages: $(OCTAVE_FORGE_DEPS) $(OCTAVE_FORGE_PACKAGES)
 
@@ -899,6 +919,7 @@
 	rm -rf $(call TMP_DIR,*) $(BUILD_TOOLS_PREFIX)
 	rm -rf $(STAMP_DIR) $(MSYS_INFO_DIR) $(LOG_DIR)
 	rm -rf $(MSYS_BASE_DIR) $(MSYS_EXTENSION_DIR) $(NOTEPAD_BASE_DIR)
+	rm -rf $(MSYS2_DIR)
 	rm -rf native-tools cross-tools octave gnuplot
 	rm -f Makefile cmake-toolchain-file.stamp cmake-native-toolchain-file.stamp
 	rm -f tools/set-mxe-env.sh
diff -r 0c6d7d14a615 -r d9d2a89d1df7 binary-dist-rules.mk
--- a/binary-dist-rules.mk	Wed Aug 08 13:57:32 2018 -0400
+++ b/binary-dist-rules.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -21,13 +21,27 @@
 
 OCTAVE_NSI_FILE := $(TOP_BUILD_DIR)/dist/octave.nsi
 
+OCTAVE_ADD_PATH :=
 ifeq ($(MXE_WINDOWS_BUILD),yes)
   TAR_H_OPTION := -h
   WINDOWS_BINARY_DIST_DEPS := \
-    msys-base \
-    msys-base-sources \
     win7appid
 
+  ifeq ($(USE_MSYS2),yes)
+    WINDOWS_BINARY_DIST_DEPS += \
+      msys2
+
+    ifeq ($(ENABLE_WINDOWS_64),yes)
+      OCTAVE_ADD_PATH := /mingw64
+    else
+      OCTAVE_ADD_PATH := /mingw32
+    endif
+  else
+    WINDOWS_BINARY_DIST_DEPS += \
+      msys-base \
+      msys-base-sources
+  endif
+
   ifeq ($(MXE_NATIVE_BUILD),no)
     WINDOWS_BINARY_DIST_DEPS += \
       native-binutils \
@@ -53,16 +67,16 @@
 
 define make-dist-directory
   echo "creating dist directory..."
-  mkdir -p $(OCTAVE_DIST_DIR)
+  mkdir -p $(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)
 endef
 
 define copy-dist-files
   echo "copying files..."
   echo "  octave and dependencies..."
   cd $(HOST_PREFIX) \
-    && tar -c $(TAR_H_OPTION) -f - . | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - )
+    && tar -c $(TAR_H_OPTION) -f - . | ( cd $(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH) ; tar xpf - )
   echo "  octaverc file..."
-  cp $(TOP_DIR)/octaverc $(OCTAVE_DIST_DIR)/share/octave/site/m/startup/octaverc
+  cp $(TOP_DIR)/octaverc $(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/share/octave/site/m/startup/octaverc
   if [ $(ENABLE_BINARY_PACKAGES) = no ]; then \
     echo "  build_packages.m..."; \
     cp $(TOP_DIR)/build_packages.m $(OCTAVE_DIST_DIR)/src; \
@@ -73,43 +87,50 @@
   ifeq ($(MXE_NATIVE_BUILD),no)
     define copy-windows-dist-files
       echo "  DLL files..."
-      cp $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/*.dll $(OCTAVE_DIST_DIR)/bin
-      cp $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/*.dll $(OCTAVE_DIST_DIR)/bin
-      cp $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/$(build-gcc_VERSION)/*.dll $(OCTAVE_DIST_DIR)/bin
-      echo "  msys base files..."
-      cd $(TOP_BUILD_DIR)/msys-base \
-        && tar -c $(TAR_H_OPTION) -f - . | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - )
-      echo "  msys extension files..."
-      cd $(TOP_BUILD_DIR)/msys-extension \
-        && tar -c $(TAR_H_OPTION) -f - . | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - )
+      cp $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/*.dll $(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/bin
+      cp $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/*.dll $(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/bin
+      cp $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/$(build-gcc_VERSION)/*.dll $(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/bin
+      if [ "$(USE_MSYS2)" = "yes" ]; then \
+        echo "  msys2 files..."; \
+        cd $(TOP_BUILD_DIR)/msys2 \
+          && tar -c $(TAR_H_OPTION) -f - . | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - ); \
+      else \
+        echo "  msys base files..."; \
+        cd $(TOP_BUILD_DIR)/msys-base \
+          && tar -c $(TAR_H_OPTION) -f - . | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - ); \
+        echo "  msys extension files..."; \
+        cd $(TOP_BUILD_DIR)/msys-extension \
+          && tar -c $(TAR_H_OPTION) -f - . | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - ); \
+      fi
       echo "  notepad++..."
       cd $(TOP_BUILD_DIR) \
           && tar -c $(TAR_H_OPTION) -f - notepad++ | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - )
       echo "  README.html..."
       cp $(TOP_DIR)/installer-files/README.html $(OCTAVE_DIST_DIR)/
       echo "  refblas..."
-      cp $(OCTAVE_DIST_DIR)/bin/libblas.dll $(OCTAVE_DIST_DIR)/bin/librefblas.dll
+      cp $(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/bin/libblas.dll $(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/bin/librefblas.dll
       echo "  octave.vbs..."
       cp $(TOP_DIR)/installer-files/octave.vbs $(OCTAVE_DIST_DIR)/
       cp $(TOP_DIR)/installer-files/octave-firsttime.vbs $(OCTAVE_DIST_DIR)/
       cp $(TOP_DIR)/installer-files/fc_update.bat $(OCTAVE_DIST_DIR)/
+      cp $(TOP_DIR)/installer-files/post-install.bat $(OCTAVE_DIST_DIR)/
       cp $(TOP_BUILD_DIR)/HG-ID $(OCTAVE_DIST_DIR)/
       echo "  updating octave .exe to script files..."
-      rm -f $(OCTAVE_DIST_DIR)/bin/octave.exe
-      rm -f $(OCTAVE_DIST_DIR)/bin/octave-$($(OCTAVE_TARGET)_VERSION).exe
-      cp $(TOP_DIR)/installer-files/octave.bat $(OCTAVE_DIST_DIR)/bin/octave.bat
-      cp $(TOP_DIR)/installer-files/octave.bat $(OCTAVE_DIST_DIR)/bin/octave-$($(OCTAVE_TARGET)_VERSION).bat
+      rm -f $(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/bin/octave.exe
+      rm -f $(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/bin/octave-$($(OCTAVE_TARGET)_VERSION).exe
+      cp $(TOP_DIR)/installer-files/octave.bat $(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/bin/octave.bat
+      cp $(TOP_DIR)/installer-files/octave.bat $(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/bin/octave-$($(OCTAVE_TARGET)_VERSION).bat
       echo "  updating libtool references..."
-      find '$(OCTAVE_DIST_DIR)/' -type f -name "*.la" \
+      find '$(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/' -type f -name "*.la" \
         -exec $(SED) -i 's|$(HOST_PREFIX)|/usr|g;s|$(BUILD_TOOLS_PREFIX)|/usr|g' {} \; ;
       echo "  updating pkg-config .pc references..."
-      find '$(OCTAVE_DIST_DIR)/lib/pkgconfig' -type f -name "*.pc" \
+      find '$(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/lib/pkgconfig' -type f -name "*.pc" \
         -exec $(SED) -i 's|$(HOST_PREFIX)|/usr|g;s|$(BUILD_TOOLS_PREFIX)|/usr|g' {} \; ;
       if [ "$(ENABLE_DEVEL_TOOLS)" = "yes" ]; then \
         cp $(TOP_DIR)/installer-files/cmdshell.bat $(OCTAVE_DIST_DIR)/; \
       fi
       echo "  updating script config tool references..."
-      find '$(OCTAVE_DIST_DIR)/bin' -type f -name "*-config" \
+      find '$(OCTAVE_DIST_DIR)$(OCTAVE_ADD_PATH)/bin' -type f -name "*-config" \
         -exec $(SED) -i 's|$(HOST_PREFIX)|/usr|g;s|$(BUILD_TOOLS_PREFIX)|/usr|g' {} \; ;
     endef
   else
@@ -124,6 +145,7 @@
       cp $(TOP_DIR)/installer-files/octave.vbs $(OCTAVE_DIST_DIR)/
       cp $(TOP_DIR)/installer-files/octave-firsttime.vbs $(OCTAVE_DIST_DIR)/
       cp $(TOP_DIR)/installer-files/fc_update.bat $(OCTAVE_DIST_DIR)/
+      cp $(TOP_DIR)/installer-files/post-install.bat $(OCTAVE_DIST_DIR)/
       echo "  updating octave .exe to script files..."
       rm -f $(OCTAVE_DIST_DIR)/bin/octave.exe
       rm -f $(OCTAVE_DIST_DIR)/bin/octave-$($(OCTAVE_TARGET)_VERSION).exe
diff -r 0c6d7d14a615 -r d9d2a89d1df7 configure.ac
--- a/configure.ac	Wed Aug 08 13:57:32 2018 -0400
+++ b/configure.ac	Mon Aug 13 13:49:41 2018 -0400
@@ -83,6 +83,15 @@
    esac], [USE_CCACHE=no])
 AC_SUBST(USE_CCACHE)
 
+AC_ARG_WITH([msys2],
+  [AS_HELP_STRING([--with-msys2], [use msys2 in windows distribution (default: no)])],
+  [case $withval in
+     no) USE_MSYS2=no ;;
+     yes) USE_MSYS2=yes ;;
+     *) AC_MSG_ERROR([bad value "$enableval" for --with-msys]) ;;
+   esac], [USE_MSYS2=no])
+AC_SUBST(USE_MSYS2)
+
 AC_ARG_ENABLE([windows-64],
   [AS_HELP_STRING([--disable-windows-64],
     [don't build a Windows 64 cross compiler])],
diff -r 0c6d7d14a615 -r d9d2a89d1df7 dist-files.mk
--- a/dist-files.mk	Wed Aug 08 13:57:32 2018 -0400
+++ b/dist-files.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -890,6 +890,64 @@
 SRC_MSVCTOOLS_MATH_FILES := \
   $(addprefix src/build-msvctools/math/, $(SRC_MSVCTOOLS_MATH_FILES_1))
 
+SRC_MSYS2_FILES := \
+  msys2-bash.mk \
+  msys2-coreutils.mk \
+  msys2-diffutils.mk \
+  msys2-dos2unix.mk \
+  msys2-filesystem.mk \
+  msys2-findutils.mk \
+  msys2-gawk.mk \
+  msys2-gcc-libs.mk \
+  msys2-gmp.mk \
+  msys2-gnupg.mk \
+  msys2-grep.mk \
+  msys2-gzip.mk \
+  msys2-icu.mk \
+  msys2-info.mk \
+  msys2-keyring.mk \
+  msys2-less.mk \
+  msys2-libassuan.mk \
+  msys2-libbz2.mk \
+  msys2-libexpat.mk \
+  msys2-libffi.mk \
+  msys2-libgnutls.mk \
+  msys2-libgpg-error.mk \
+  msys2-libgpgme.mk \
+  msys2-libhogweed.mk \
+  msys2-libiconv.mk \
+  msys2-libidn2.mk \
+  msys2-libintl.mk \
+  msys2-libksba.mk \
+  msys2-liblzma.mk \
+  msys2-libmetalink.mk \
+  msys2-libnettle.mk \
+  msys2-libnpth.mk \
+  msys2-libopenssl.mk \
+  msys2-libp11-kit.mk \
+  msys2-libpcre.mk \
+  msys2-libpsl.mk \
+  msys2-libreadline.mk \
+  msys2-libsqlite.mk \
+  msys2-libtasn1.mk \
+  msys2-libunistring.mk \
+  msys2-libutil-linux.mk \
+  msys2-libxml2.mk \
+  msys2-make.mk \
+  msys2-mintty.mk \
+  msys2-mpfr.mk \
+  msys2-ncurses.mk \
+  msys2-pacman-mirrors.mk \
+  msys2-pacman.mk \
+  msys2-patch.mk \
+  msys2-runtime.mk \
+  msys2-sed.mk \
+  msys2-tar.mk \
+  msys2-unzip.mk \
+  msys2-wget.mk \
+  msys2-zip.mk \
+  msys2-zlib.mk
+
 TOOLS_FILES_1 := \
   build-make.sh \
   config.guess \
@@ -924,6 +982,7 @@
 
 INSTALL_FILES_1 := \
   cmdshell.bat \
+  post-install.bat \
   fc_update.bat \
   gpl-3.0.txt \
   octave.bat \
@@ -937,9 +996,12 @@
 
 DIST_FILES := \
   $(SRC_FILES) \
+  $(SRC_MSYS2_FILES) \
   $(SRC_MSVCTOOLS_FILES) \
   $(SRC_MSVCTOOLS_COMPAT_FILES) \
   $(SRC_MSVCTOOLS_MATH_FILES) \
   $(TOOLS_FILES) \
   $(FILES) \
   $(INSTALL_FILES)
+
+
diff -r 0c6d7d14a615 -r d9d2a89d1df7 index.html
--- a/index.html	Wed Aug 08 13:57:32 2018 -0400
+++ b/index.html	Mon Aug 13 13:49:41 2018 -0400
@@ -1874,6 +1874,234 @@
         <td class="website"><a href="http://www.mingw.org/">MinGW zlib</a></td>
     </tr>
     <tr>
+        <td class="package">msys2-bash</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 bash</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-coreutils</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 coreutils</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-diffutils</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 diffutils</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-dos2unix</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 dos2unix</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-filesystem</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 filesystem</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-findutils</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 findutils</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-gawk</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 gawk</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-gcc-libs</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 gcc libs</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-gmp</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 gmp</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-gnupg</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 gngpg</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-grep</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 grep</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-gzip</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 gzip</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-icu</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 icu</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-info</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 info</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-keyring</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 keyring</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-less</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 less</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libassuan</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libassuan</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libbz2</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libbz2</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libexpat</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libexpat</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libffi</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libffi</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libgpg-error</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libgpg-error</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libgcrypt</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libgcrypt</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libgnutls</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libgnutls</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libgpgme</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libgpgme</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libhogweed</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libhogweed</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libiconv</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libiconv</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libidn2</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libidn2</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libintl</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libintl</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libksba</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libksba</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-liblzma</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 liblzma</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libmetalink</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libmetalink</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libnettle</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libnettle</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libnpth</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libnpth</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libopenssl</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libopenssl</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libp11-kit</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libp11-kit</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libpcre</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libpcre</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libpsl</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libpsl</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libreadline</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libreadline</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libsqlite</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libsqlite</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libtasn1</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libtasn1</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libunistring</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libunistring</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libutil-linux</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libutil-linux</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-libxml2</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 libxm2</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-make</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 make</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-mintty</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 mintty</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-mpfr</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 mpfr</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-ncurses</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 ncurses</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-pacman-mirrors</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 pacman mirrors</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-pacman</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 pacman</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-patch</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 patch</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-runtime</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 runtime</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-sed</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 sed</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-tar</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 tar</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-unzip</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 unzip</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-wget</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 wget</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-zip</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 zip</a></td>
+    </tr>
+    <tr>
+        <td class="package">msys2-zlib</td>
+        <td class="website"><a href="https://www.msys2.org/">MSYS2 zlib</a></td>
+    </tr>
+    <tr>
         <td class="package">muparser</td>
         <td class="website"><a href="http://muparser.sourceforge.net/">muParser</a></td>
     </tr>
@@ -3779,3 +4007,4 @@
 
 </body>
 </html>
+
diff -r 0c6d7d14a615 -r d9d2a89d1df7 installer-files/cmdshell.bat
--- a/installer-files/cmdshell.bat	Wed Aug 08 13:57:32 2018 -0400
+++ b/installer-files/cmdshell.bat	Mon Aug 13 13:49:41 2018 -0400
@@ -19,5 +19,15 @@
 Rem set HOME to 8.3 format
 for %%I in ("%HOME%") do set HOME=%%~sI
 
-%OCTAVE_HOME%\bin\bash.exe --login -i
+set MSYSDIR=%OCTAVE_HOME%
+set MSYSTEM=MSYS
+
+Rem if no msys-1.0, must be msys2
+if NOT EXIST %OCTAVE_HOME%\bin\msys-1.0.dll set MSYSDIR=%OCTAVE_HOME%\usr
 
+Rem 32 or 64 bit
+if EXIST %OCTAVE_HOME%\mingw32\bin\octave-cli.exe set MSYSTEM=MINGW32
+if EXIST %OCTAVE_HOME%\mingw64\bin\octave-cli.exe set MSYSTEM=MINGW64
+
+%MSYSDIR%\bin\bash.exe --login -i
+
diff -r 0c6d7d14a615 -r d9d2a89d1df7 installer-files/fc_update.bat
--- a/installer-files/fc_update.bat	Wed Aug 08 13:57:32 2018 -0400
+++ b/installer-files/fc_update.bat	Mon Aug 13 13:49:41 2018 -0400
@@ -1,6 +1,8 @@
 @echo off
 
 set ROOT_DIR=%~dp0
+if EXIST %ROOT_DIR%\mingw32\bin\octave-cli.exe set ROOT_DIR=%ROOT_DIR%\mingw32
+if EXIST %ROOT_DIR%\mingw64\bin\octave-cli.exe set ROOT_DIR=%ROOT_DIR%\mingw64
 echo "Updating fc-cache (may take a while) ..."
 %ROOT_DIR%\bin\fc-cache.exe -v
 echo "Done."
diff -r 0c6d7d14a615 -r d9d2a89d1df7 installer-files/octave-firsttime.vbs
--- a/installer-files/octave-firsttime.vbs	Wed Aug 08 13:57:32 2018 -0400
+++ b/installer-files/octave-firsttime.vbs	Mon Aug 13 13:49:41 2018 -0400
@@ -5,6 +5,22 @@
 ' get the directory that script resides in
 Set fso = CreateObject("Scripting.FileSystemObject")
 OctavePath = fso.GetParentFolderName(WScript.ScriptFullName)
+
+' ctavePath is now the root of the install folder, but for msys2,
+' OctavePath should be OctavePath/mingw64 or OctavePath/ming32
+MSysType = "MSYS"
+MSysPath = OctavePath
+Set objFSO = CreateObject("Scripting.FileSystemObject")
+If objFSO.FileExists(OctavePath & "\mingw64\bin\octave-cli.exe") Then
+  MSysPath = OctavePath & "\usr"
+  MSysType = "MINGW64"
+  OctavePath = OctavePath & "\mingw64" 
+ ElseIf objFSO.FileExists(OctavePath & "\mingw32\bin\octave-cli.exe") Then
+  MSysPath = OctavePath & "\usr"
+  MSysType = "MINGW32"
+  OctavePath = OctavePath & "\mingw32" 
+End If
+
 ' get path as a 8.3 path
 Set fo = fso.GetFolder(OctavePath)
 OctavePath = fo.ShortPath
@@ -12,8 +28,12 @@
 
 ' set up path to ensure octave bin comes first
 Set wshSystemEnv = wshShell.Environment( "PROCESS" )
+if OctavePath <> MSysPath Then
+  wshSystemEnv("PATH") = MSysPath  & "\bin;" & wshSystemEnv("PATH")
+End If
 wshSystemEnv("PATH") = OctavePath & "\bin;" & wshSystemEnv("PATH")
 
+wshSystemEnv("MSYSTEM") = MSysType
 ' set terminal type
 wshSystemEnv("TERM") = "cygwin"
 wshSystemEnv("GNUTERM") = "wxt"
@@ -28,7 +48,6 @@
 End If
 
 ' set Qt plugin directory and path 
-Set objFSO = CreateObject("Scripting.FileSystemObject")
 If objFSO.FolderExists(OctavePath & "\qt5\bin") Then
   wshSystemEnv("PATH") = OctavePath & "\qt5\bin;" & wshSystemEnv("PATH")
   wshSystemEnv("QT_PLUGIN_PATH") = OctavePath & "\qt5\plugins"
diff -r 0c6d7d14a615 -r d9d2a89d1df7 installer-files/octave.vbs
--- a/installer-files/octave.vbs	Wed Aug 08 13:57:32 2018 -0400
+++ b/installer-files/octave.vbs	Mon Aug 13 13:49:41 2018 -0400
@@ -5,6 +5,22 @@
 ' get the directory that script resides in
 Set fso = CreateObject("Scripting.FileSystemObject")
 OctavePath = fso.GetParentFolderName(WScript.ScriptFullName)
+
+' ctavePath is now the root of the install folder, but for msys2,
+' OctavePath should be OctavePath/mingw64 or OctavePath/ming32
+MSysType = "MSYS"
+MSysPath = OctavePath
+Set objFSO = CreateObject("Scripting.FileSystemObject")
+If objFSO.FileExists(OctavePath & "\mingw64\bin\octave-cli.exe") Then
+  MSysPath = OctavePath & "\usr"
+  MSysType = "MINGW64"
+  OctavePath = OctavePath & "\mingw64" 
+ ElseIf objFSO.FileExists(OctavePath & "\mingw32\bin\octave-cli.exe") Then
+  MSysPath = OctavePath & "\usr"
+  MSysType = "MINGW32"
+  OctavePath = OctavePath & "\mingw32" 
+End If
+
 ' get path as a 8.3 path
 Set fo = fso.GetFolder(OctavePath)
 OctavePath = fo.ShortPath
@@ -12,8 +28,13 @@
 
 ' set up path to ensure octave bin comes first
 Set wshSystemEnv = wshShell.Environment( "PROCESS" )
+if OctavePath <> MSysPath Then
+  wshSystemEnv("PATH") = MSysPath  & "\bin;" & wshSystemEnv("PATH")
+End If
 wshSystemEnv("PATH") = OctavePath & "\bin;" & wshSystemEnv("PATH")
 
+wshSystemEnv("MSYSTEM") = MSysType
+
 ' set terminal type
 wshSystemEnv("TERM") = "cygwin"
 wshSystemEnv("GNUTERM") = "wxt"
@@ -28,7 +49,6 @@
 End If
 
 ' set Qt plugin directory and path 
-Set objFSO = CreateObject("Scripting.FileSystemObject")
 If objFSO.FolderExists(OctavePath & "\qt5\bin") Then
   wshSystemEnv("PATH") = OctavePath & "\qt5\bin;" & wshSystemEnv("PATH")
   wshSystemEnv("QT_PLUGIN_PATH") = OctavePath & "\qt5\plugins"
diff -r 0c6d7d14a615 -r d9d2a89d1df7 installer-files/post-install.bat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/installer-files/post-install.bat	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,31 @@
+@echo off
+Rem   Run on initial install /update
+set ROOT_DIR=%~dp0
+Rem Convert to 8.3 format so we don't have to worry about spaces.
+for %%I in ("%ROOT_DIR%") do set ROOT_DIR=%%~sI
+
+set MSYSDIR=%ROOT_DIR%
+set MSYSTEM=MSYS
+
+if NOT EXIST %ROOT_DIR%\bin\msys-1.0.dll set MSYSDIR=%ROOT_DIR%\usr
+if EXIST %ROOT_DIR%\mingw32\bin\octave.bat set MSYSTEM=MINGW32
+if EXIST %ROOT_DIR%\mingw64\bin\octave.bat set MSYSTEM=MINGW64
+
+if %MSYSTEM%==MSYS (
+ set OCTAVE_HOME=%ROOT_DIR%
+) else (
+ if %MSYSTEM%==MINGW32 (
+ set OCTAVE_HOME=%ROOT_DIR%\mingw32
+) else (
+ set OCTAVE_HOME=%ROOT_DIR%\mingw64
+))
+
+
+Rem run bash to to regitser the initial envorinment
+echo "Setting up MSYS system ..."
+%MSYSDIR%\bin\bash.exe --login -c echo
+echo "Updating fc-cache (may take a while) ..."
+%OCTAVE_HOME%\bin\fc-cache.exe -v
+echo "Updating octave packages ..."
+%OCTAVE_HOME%\bin\octave.bat --no-gui -W -H -f -q --eval "pkg rebuild"
+
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-bash.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-bash.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-bash
+$(PKG)_NAME     := bash
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 4.4.019-3
+$(PKG)_x86_64_CS := a22137b136015d5642ba80d2f552386750bdf4b9
+$(PKG)_i686_CS  := 598ba46d01df7841f3378bd1768019633a3af395
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-coreutils.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-coreutils.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-coreutils
+$(PKG)_NAME     := coreutils
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 8.26-3
+$(PKG)_x86_64_CS := bdf91e69fa0e0a53b108e62f46014e21605840f6
+$(PKG)_i686_CS  := 2e826f5bb4ab527fbb1306f8e5e513cd37d2263b
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-diffutils.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-diffutils.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-diffutils
+$(PKG)_NAME     := diffutils
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 3.6-1
+$(PKG)_x86_64_CS := fb785a2c68a90424b59168cadc88cb206e98a085
+$(PKG)_i686_CS  := a982f33dfafd3b35d79fd8b1f720a70a15bd1d02
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-dos2unix.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-dos2unix.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-dos2unix
+$(PKG)_NAME     := dos2unix
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 7.4.0-1
+$(PKG)_x86_64_CS := 3e677ed0a45d01960364eecec140df1d352a0ab4
+$(PKG)_i686_CS  := 878565ea17f9e367d38bde3d467a37aa239f3718
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-filesystem.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-filesystem.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-filesystem
+$(PKG)_NAME     := filesystem
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 2018.06-1
+$(PKG)_x86_64_CS := 3a44ceb33f5adf5c3650b3126ee76e2d385b1ac5
+$(PKG)_i686_CS  := 7be5470286395b2566b0181659d1d6a3f47a9b0e
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-findutils.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-findutils.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-findutils
+$(PKG)_NAME     := findutils
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 4.6.0-1
+$(PKG)_x86_64_CS := d35790bd9085c19b4dabd7088ba6fbc24aa03e58
+$(PKG)_i686_CS  := 1b81dcc5b42fbbc0d1fae9963f1e4cc9f16e544d
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-gawk.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-gawk.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-gawk
+$(PKG)_NAME     := gawk
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 4.2.1-1
+$(PKG)_x86_64_CS := 229c0d55cdb229dfc875a8ce016ecb5a5c79ba6f
+$(PKG)_i686_CS  := 0baab3a09e43d2900d35bb96f1dc1743a81de644
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-gcc-libs.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-gcc-libs.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-gcc-libs
+$(PKG)_NAME     := gcc-libs
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 7.3.0-3
+$(PKG)_x86_64_CS := 88ef408d6856371de8da2a2ed616bebc243e0081
+$(PKG)_i686_CS  := 57ad947250d9824f5707a323612d18c2ef762e5d
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-gmp.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-gmp.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-gmp
+$(PKG)_NAME     := gmp
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 6.1.2-1
+$(PKG)_x86_64_CS := c5c93a0ca78c4d7d8380ec849a060e9fc6f0fb1c
+$(PKG)_i686_CS  := f4e5ccfd24dfd22bd8a1938b2923ac07ca59dfad
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-gnupg.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-gnupg.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-gnupg
+$(PKG)_NAME     := gnupg
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 2.2.9-1
+$(PKG)_x86_64_CS := 666c42be31db07832ca8559ec72c5cefbfc0bc80
+$(PKG)_i686_CS  := 9a4e66c72833c804eaf6dbad7f0f59d118700215
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-grep.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-grep.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-grep
+$(PKG)_NAME     := grep
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 3.1-1
+$(PKG)_x86_64_CS := 829a127bad77745fb2f742b97e5df33befd5c19f
+$(PKG)_i686_CS  := 5f77829c93755967ea5e978e56ca137155e032c6
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-gzip.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-gzip.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-gzip
+$(PKG)_NAME     := gzip
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 1.9-1
+$(PKG)_x86_64_CS := fa75e97a7ae1202f6559d9248b6ea2454d0ef371
+$(PKG)_i686_CS  := 6dbfd09f28b09c91c429afb5c05fa24688dfd029
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-icu.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-icu.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-icu
+$(PKG)_NAME     := icu
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 62.1-1
+$(PKG)_x86_64_CS := a6a31d886ce03757e195aa4634d8ae235d68ec19
+$(PKG)_i686_CS  := 5ac2d3d0f9f1a358cd4f0e01681d267095d0c244
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-info.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-info.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-info
+$(PKG)_NAME     := info
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 6.3-1
+$(PKG)_x86_64_CS := 2baad148563b90cb3c54c2689ec5698b468d9cbb
+$(PKG)_i686_CS  := bf54d8fbeb20aa59649a361664486897ecb3cbcd
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-keyring.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-keyring.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,23 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-keyring
+$(PKG)_NAME     := msys2-keyring
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := r9.397a52e-1
+$(PKG)_CHECKSUM := 846109181a3d49def1da5a422be5d80c4ecb14df
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-any.pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-less.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-less.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-less
+$(PKG)_NAME     := less
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 530-1
+$(PKG)_x86_64_CS := 229e06ab3e390eafaa1278273fffe8bab34b565d
+$(PKG)_i686_CS  := 07e5b0280fb0e447ea7c2169e6b6bbaddd9aae6b
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libassuan.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libassuan.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libassuan
+$(PKG)_NAME     := libassuan
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 2.5.1-1
+$(PKG)_x86_64_CS := 0d38ff6961a743c933d28c88daa9a0f05ed8327b
+$(PKG)_i686_CS  := c5b956eab94dae8a5ff7eb3ad78eda9ee911a9bd
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libbz2.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libbz2.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libbz2
+$(PKG)_NAME     := libbz2
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 1.0.6-2
+$(PKG)_x86_64_CS := 554c55e308bbfb4eacf7722a8563c944ab8832d3
+$(PKG)_i686_CS  := 3084d33106e19ad5436bbcfded36874829ffa01f
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libexpat.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libexpat.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libexpat
+$(PKG)_NAME     := libexpat
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 2.2.5-1
+$(PKG)_x86_64_CS := 77361c31eb83f178af1914f4b767309faf83bd70
+$(PKG)_i686_CS  := 7a10f9976a807851d30fc450d6ace9a45697770f
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libffi.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libffi.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libffi
+$(PKG)_NAME     := libffi
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 3.2.1-3
+$(PKG)_x86_64_CS := 6c874a3d2d67adb68a2e9798f038b555f838dc17
+$(PKG)_i686_CS  := fe7592754aa2949e36716868c5ca66f6e413592a
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libgcrypt.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libgcrypt.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libgcrypt
+$(PKG)_NAME     := libgcrypt
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 1.8.3-2
+$(PKG)_x86_64_CS := 5e8832ac5171d2b2309c2ec87712017264e20292
+$(PKG)_i686_CS  := 278d92efa1db80588ca88e37ee7ddc77da645dd5
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libgnutls.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libgnutls.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libgnutls
+$(PKG)_NAME     := libgnutls
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 3.6.3-1
+$(PKG)_x86_64_CS := c789cedde51dee98e9f7ed19451560d6e2085fa8
+$(PKG)_i686_CS  := 13f23dc90700373f69b1d123902b05d19375e6ed
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libgpg-error.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libgpg-error.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libgpg-error
+$(PKG)_NAME     := libgpg-error
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 1.32-1
+$(PKG)_x86_64_CS := 0a3c859ffae677def22613fb35c74c881f1fcbaa
+$(PKG)_i686_CS  := 8de25f808fd1f04ec62cbcd0c40cffe0b3b605b4
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libgpgme.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libgpgme.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libgpgme
+$(PKG)_NAME     := libgpgme
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 1.11.1-1
+$(PKG)_x86_64_CS := 7b741d663b84d191899f2e3c36552a5f8617efac
+$(PKG)_i686_CS  := b30ebd4376a72d01117c3b96a5dfde99e7f2ac5f
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libhogweed.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libhogweed.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libhogweed
+$(PKG)_NAME     := libhogweed
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 3.4-1
+$(PKG)_x86_64_CS := 783b8bfc1e2721c616b30c82e83372d19a472cae
+$(PKG)_i686_CS  := 2352f37afa3de71fe0d4a03d95748f44ea986cbb
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libiconv.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libiconv.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libiconv
+$(PKG)_NAME     := libiconv
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 1.15-1
+$(PKG)_x86_64_CS := 0bb31402720ec5558c3ef4616d7f9303ed650a15
+$(PKG)_i686_CS  := 0d556ea6cc7c51ac78003785e5ada0ef3d97eda1
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libidn2.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libidn2.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,28 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libidn2
+$(PKG)_NAME     := libidn2
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 2.0.5-1
+$(PKG)_x86_64_CS := 9f7a52fc06e18b320ae4b17c7b587b7731cbb145
+$(PKG)_i686_CS  := 5b6ff3f5cc48db72168fa2847efa1ab9fd13469e
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+#https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/x86_64/bash-4.4.019-3-x86_64.pkg.tar.xz/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libintl.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libintl.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libintl
+$(PKG)_NAME     := libintl
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 0.19.8.1-1
+$(PKG)_x86_64_CS := 9bbb508976ac355b2a6b5afbd4a2ab3d96f61fe2
+$(PKG)_i686_CS  := 3012f6f95f6fd5916a14e18060bb10feb237d8ff
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libksba.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libksba.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libksba
+$(PKG)_NAME     := libksba
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 1.3.5-1
+$(PKG)_x86_64_CS := d4af71da2553d81b172a7c59ce0dec07edd8189e
+$(PKG)_i686_CS  := 36fd428bd5e74d634114ae606dfa33949c1f5a9e
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-liblzma.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-liblzma.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-liblzma
+$(PKG)_NAME     := liblzma
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 5.2.4-1
+$(PKG)_x86_64_CS := a396825a0b8b6e4956160a1dd84a090794f78a7f
+$(PKG)_i686_CS  := 7c60375b328a230f54fe2f35ca750614b8f281b5
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libmetalink.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libmetalink.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libmetalink
+$(PKG)_NAME     := libmetalink
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 0.1.3-2
+$(PKG)_x86_64_CS := f7abd405c888b5c5cd2a668cfb147cb771b35873
+$(PKG)_i686_CS  := e52a76c44404fd8242cdb397e3b2dd46f9a818ce
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libnettle.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libnettle.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libnettle
+$(PKG)_NAME     := libnettle
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 3.4-1
+$(PKG)_x86_64_CS := eb6610142c076311e218b57190c01d08200b9b0b
+$(PKG)_i686_CS  := 95208cff80fb26758f9f56a93afce5eed5f07700
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libnpth.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libnpth.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libnpth
+$(PKG)_NAME     := libnpth
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 1.5-1
+$(PKG)_x86_64_CS := a376962e506ffa05e057726a9521f2be35693c76
+$(PKG)_i686_CS  := d6e6c94c198da9efc0d230ead2dde6ea8fc2d1f3
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libopenssl.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libopenssl.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libopenssl
+$(PKG)_NAME     := libopenssl
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 1.0.2.o-1
+$(PKG)_x86_64_CS := d857c581d468d3ced94e9d8c2b523c584df40a70
+$(PKG)_i686_CS  := 1c54ba569b520c71085055f9fe38316cf222624f
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libp11-kit.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libp11-kit.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libp11-kit
+$(PKG)_NAME     := libp11-kit
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 0.23.9-1
+$(PKG)_x86_64_CS := ba8eb406f0c9c5d24cefe0d5ca59175a5b22fa7a
+$(PKG)_i686_CS  := 4ff1c260cba837be9477544c3adbf880e7b987cf
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libpcre.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libpcre.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libpcre
+$(PKG)_NAME     := libpcre
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 8.42-1
+$(PKG)_x86_64_CS := 87482668ef721bf33c1ab34bba8d31af13fcc2f4
+$(PKG)_i686_CS  := d64e4a86813dbcc22c2dba7e3e0b9dbc4dd53082
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libpsl.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libpsl.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libpsl
+$(PKG)_NAME     := libpsl
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 0.19.1-1
+$(PKG)_x86_64_CS := 80d6a29298683ca136d41eea52015b343530ab28
+$(PKG)_i686_CS  := 6cd46110f3a3e6baeb6cdd32bc2c47fd244bc5c2
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libreadline.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libreadline.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libreadline
+$(PKG)_NAME     := libreadline
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 7.0.005-1
+$(PKG)_x86_64_CS := 1c0a38fc087a71894475e18a204d893f169d5565
+$(PKG)_i686_CS  := 04f47a00672b7208e3e60a8171ebcbdac73b747f
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libsqlite.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libsqlite.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libsqlite
+$(PKG)_NAME     := libsqlite
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 3.21.0-4
+$(PKG)_x86_64_CS := f3b13910f3ecf590d9ba0415afe96bef70816986
+$(PKG)_i686_CS  := cfbcd80b3ffcdc88acf4da36c4541e849debc2ee
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libtasn1.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libtasn1.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libtasn1
+$(PKG)_NAME     := libtasn1
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 4.13-1
+$(PKG)_x86_64_CS := e297bd02a6ed80cd8f8ea7aeff1aaa49e197cd67
+$(PKG)_i686_CS  := a570c21550f4ea498ec550d67e89e4586d3cfaf4
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libunistring.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libunistring.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libunistring
+$(PKG)_NAME     := libunistring
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 0.9.10-1
+$(PKG)_x86_64_CS := 9e0f52dbef4127cd94e6d4ba978b8177f3c1e291
+$(PKG)_i686_CS  := a291d33ba496555f17f1da651228ba9448c1f96b
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libutil-linux.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libutil-linux.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libutil-linux
+$(PKG)_NAME     := libutil-linux
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 2.26.2-1
+$(PKG)_x86_64_CS := 720800a433548bd6d24951497bb97784d91ef1f4
+$(PKG)_i686_CS  := 55d9f6c1681fb3eb6244d929b1a78f1aac23caf7
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-libxml2.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-libxml2.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,28 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-libxml2
+$(PKG)_NAME     := libxml2
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 2.9.8-1
+$(PKG)_x86_64_CS := 42cda2755d8cd0ec978c6df8ecddb532128fd824
+$(PKG)_i686_CS  := d0c4fd65443d9d67f9f4ccb92072f6b6492ec428
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+#https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/x86_64/bash-4.4.019-3-x86_64.pkg.tar.xz/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-make.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-make.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-make
+$(PKG)_NAME     := make
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 4.2.1-1
+$(PKG)_x86_64_CS := 5114643c2fc3abc5782e5810755633a65a070d9a
+$(PKG)_i686_CS  := 78bdbf557d3d925a345257f1857d7be9bb6feeb7
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-mintty.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-mintty.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-mintty
+$(PKG)_NAME     := mintty
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 1~2.8.5-1
+$(PKG)_x86_64_CS := 83eba343a591daf1d607b906127bf7dc3cf60e4b
+$(PKG)_i686_CS  := fd7761df021daf6cc58bbb032ef7fd2e810eb765
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-mpfr.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-mpfr.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-mpfr
+$(PKG)_NAME     := mpfr
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 4.0.1-1
+$(PKG)_x86_64_CS := 15df1a6b698999b01e7cdb18ab20b2579904c8d7
+$(PKG)_i686_CS  := 47951e6f2df03f3456efd3f5a3c40e7604763843
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-ncurses.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-ncurses.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-ncurses
+$(PKG)_NAME     := ncurses
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 6.1.20180526-1
+$(PKG)_x86_64_CS := 0f1e9af60acd73c99319c576aafc4930b95606f9
+$(PKG)_i686_CS  := f6218c0000353691c1519400cca8290fc24335ed
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-pacman-mirrors.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-pacman-mirrors.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,23 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-pacman-mirrors
+$(PKG)_NAME     := pacman-mirrors
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 20180604-2
+$(PKG)_CHECKSUM := 88fd9e29f5b27015083a9c8cb3190e2b34063f79
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-any.pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-pacman.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-pacman.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,27 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-pacman
+$(PKG)_NAME     := pacman
+$(PKG)_IGNORE   :=
+# NOTE: currently 5.X versions not compatible with our format
+$(PKG)_VERSION  := 4.2.1.6186.3f17679-1
+$(PKG)_x86_64_CS := 57fdaaf48e666ff3d89510ea4ff4da16e2f511ba
+$(PKG)_i686_CS  := a59742197dcaa7701d6b033934d0fa9a71f5857d
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-patch.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-patch.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-patch
+$(PKG)_NAME     := patch
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 2.7.6-1
+$(PKG)_x86_64_CS := 6429c36b3116948d5268df98cbab6fce8b3dca99
+$(PKG)_i686_CS  := 0da1fac9e66d5582f028aa50eb675d33eb5e0ba4
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-runtime.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-runtime.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-runtime
+$(PKG)_NAME     := msys2-runtime
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 2.10.0-2
+$(PKG)_x86_64_CS := 3114f4827aa9d3d0a90f9d958c4d657a2f944972
+$(PKG)_i686_CS  := 146e6c76dcfddedc2fe1f9926dd7061e64544fd6
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-sed.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-sed.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-sed
+$(PKG)_NAME     := sed
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 4.4-2
+$(PKG)_x86_64_CS := 9cc6195804439ef141fd36740e945602efa170c5
+$(PKG)_i686_CS  := 4f677ac7535896266e81cac3ebf4079e03e83627
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-tar.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-tar.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-tar
+$(PKG)_NAME     := tar
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 1.30-1
+$(PKG)_x86_64_CS := 153725b6a9f4b87b347a8241907381ae9e80ccf4
+$(PKG)_i686_CS  := 387043166ef86ab0d4bec13e0ff19a9709660cbc
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-unzip.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-unzip.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-unzip
+$(PKG)_NAME     := unzip
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 6.0-2
+$(PKG)_x86_64_CS := 703b6727f8c516a9a37eb0ef73cb2f097ca45979
+$(PKG)_i686_CS  := f985cc6b17eff01c79390cdc9a2f88074d7d0899
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-wget.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-wget.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-wget
+$(PKG)_NAME     := wget
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 1.19.4-1
+$(PKG)_x86_64_CS := 215dc214e3ce1ac0326eeb616eb39fa28ca73905
+$(PKG)_i686_CS  := eacb3393d6b2de90822db4714af655b65ab4b899
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-zip.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-zip.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-zip
+$(PKG)_NAME     := zip
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 3.0-3
+$(PKG)_x86_64_CS := 4e012405277ad5b3f85d946cff5bebf4bc18c018
+$(PKG)_i686_CS  := 31d9ff6d2d4d8e052899fa4dc2aafdfaf9a3c1b8
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 src/msys2-zlib.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/msys2-zlib.mk	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,26 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG             := msys2-zlib
+$(PKG)_NAME     := zlib
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 1.2.11-1
+$(PKG)_x86_64_CS := 37e185e5ae7d42c8c045d82c31dda58affb8bb5f
+$(PKG)_i686_CS  := 27fcb9cd872dcc466ce2debcd3c5ebf9e2d82e44
+$(PKG)_CS       := $($(PKG)_$(MSYS2_ARCH)_CS)
+$(PKG)_CHECKSUM := $($(PKG)_CS)
+$(PKG)_SUBDIR   := 
+$(PKG)_FILE     := $($(PKG)_NAME)-$($(PKG)_VERSION)-$(MSYS2_ARCH).pkg.tar.xz
+$(PKG)_URL      := $(MSYS2_URL)/$($(PKG)_FILE)/download
+
+$(PKG)_DEPS     := 
+
+define $(PKG)_UPDATE
+    $(WGET) -q -O- '$(MSYS2_BASE_URL)/' | \
+    $(SED) -n 's,.*title="$($(PKG)_NAME)-\([0-9][^"]*\)".*,\1,p' | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    $(MSYS2_PKG_BUILD)
+endef
diff -r 0c6d7d14a615 -r d9d2a89d1df7 tools/makeinst-script.sh.in
--- a/tools/makeinst-script.sh.in	Wed Aug 08 13:57:32 2018 -0400
+++ b/tools/makeinst-script.sh.in	Mon Aug 13 13:49:41 2018 -0400
@@ -16,13 +16,23 @@
 cd `dirname $1`
 MXEDIR=`cd ..; pwd`
 
-if [ -e $OCTAVE_SOURCE/bin/libopenblas.dll ]; then
+if [ "@USE_MSYS2@" == "yes" ]; then
+  if [ "@ENABLE_WINDOWS_64@" == "yes" ]; then
+    OCTAVE_SUBDIR=mingw64
+  else
+    OCTAVE_SUBDIR=mingw32
+  fi
+else
+  OCTAVE_SUBDIR=
+fi
+
+
+if [ -e $OCTAVE_SOURCE/$OCTAVE_SUBDIR/bin/libopenblas.dll ]; then
   DEFAULT_BLAS="OpenBLAS"
 else
   DEFAULT_BLAS="Reference BLAS"
 fi
 
-
 # find octave shortcut icon
 ICON=`find $OCTAVE_SOURCE -name octave-logo.ico -printf "%P\n" | head -1 | sed 's,/,\\\\,g'`
 
@@ -180,7 +190,7 @@
   Pop \$InstallBlasLibCtrl
 EOF
    # add option to install libopenblas if we have the dll present
-   if [ -e $OCTAVE_SOURCE/bin/libopenblas.dll ]; then
+   if [ -e $OCTAVE_SOURCE/$OCTAVE_SUBDIR/bin/libopenblas.dll ]; then
      cat >> $OUTFILE << EOF
   \${NSD_CB_AddString} \$InstallBlasLibCtrl "OpenBLAS"
 EOF
@@ -239,6 +249,7 @@
   File "$OCTAVE_SOURCE/octave.vbs"
   File "$OCTAVE_SOURCE/octave-firsttime.vbs"
   File "$OCTAVE_SOURCE/fc_update.bat"
+  File "$OCTAVE_SOURCE/post-install.bat"
 
   File "$OCTAVE_SOURCE/HG-ID"
 
@@ -263,14 +274,17 @@
  ; add qt.conf
  Push \$0
  \${StrRep} '\$0' '\$INSTDIR' '\\' '/'
- WriteINIStr "\$INSTDIR\\bin\\qt.conf" "Paths" "Prefix" "\$0"
- WriteINIStr "\$INSTDIR\\bin\\qt.conf" "Paths" "Translations" "translations"
+ WriteINIStr "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\qt.conf" "Paths" "Prefix" "\$0"
+ WriteINIStr "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\qt.conf" "Paths" "Translations" "translations"
  Pop \$0
 
- ; run fc-cache updater
+ ; run post-install script
  GetFullPathName /SHORT \$1 \$INSTDIR
- DetailPrint "Building font cache (may take a while)"
- ExecWait "\$1\\fc_update.bat"
+ DetailPrint "Running post install script (May take a while) ..."
+ ;ExecWait "\$1\\post-install.bat"
+ ; run in hidden console window
+ nsExec::Exec /TIMEOUT=30000 '"\$1\\post-install.bat"'
+ Pop \$0
 SectionEnd
 
 Section make_uninstaller
@@ -301,7 +315,9 @@
  SetOutPath "\$INSTDIR"
 
  ; fix the shortcuts for appid
- ExecWait '"\$INSTDIR\\bin\\win7appid.exe" "\$SMPROGRAMS\\GNU Octave $VERSION\\Octave-$VERSION (GUI).lnk" "gnu.octave.$VERSION"'
+ ; run in hidden console window
+ nsExec::Exec /TIMEOUT=30000 '"\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\win7appid.exe" "\$SMPROGRAMS\\GNU Octave $VERSION\\Octave-$VERSION (GUI).lnk" "gnu.octave.$VERSION"'
+ Pop \$0
 EOF
   # shortcut for cmd win
   if [ -f $OCTAVE_SOURCE/cmdshell.bat ]; then 
@@ -348,7 +364,8 @@
     CreateShortCut "\$desktop\\GNU Octave (CLI).lnk" "\$R0\\octave.vbs" "--no-gui" "\$R2" 0 SW_SHOWMINIMIZED
     CreateShortCut "\$desktop\\GNU Octave (GUI).lnk" "\$R0\\octave.vbs" "--force-gui" "\$R2" 0 SW_SHOWMINIMIZED
 
-    ExecWait '"\$INSTDIR\\bin\\win7appid.exe" "\$desktop\\GNU Octave (GUI).lnk" "gnu.octave.\$R1"'
+    nsExec::Exec /TIMEOUT=30000 '"\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\win7appid.exe" "\$desktop\\GNU Octave (GUI).lnk" "gnu.octave.\$R1"'
+    Pop \$0
 
     Pop \$R2
     Pop \$R1
@@ -358,10 +375,10 @@
   ; BLAS set up
   \${If} \$InstallBlasLib == 1
     ; Reference BLAS
-    CopyFiles /SILENT "\$INSTDIR\\bin\\librefblas.dll" "\$INSTDIR\\bin\\libblas.dll"
+    CopyFiles /SILENT "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\librefblas.dll" "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\libblas.dll"
   \${Else}
     ; OpenBLAS
-    CopyFiles /SILENT "\$INSTDIR\\bin\\libopenblas.dll" "\$INSTDIR\\bin\\libblas.dll"
+    CopyFiles /SILENT "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\libopenblas.dll" "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\libblas.dll"
   \${EndIf}
 
 SectionEnd
@@ -383,13 +400,6 @@
   \${EndIf}
 SectionEnd
 
-Section "InstallPackages"
-  ; fix the installed packages (if any)
-  GetFullPathName /SHORT \$1 \$INSTDIR
-  SetOutPath "\$1"
-  ExecWait '"\$1\\bin\\octave-cli.exe" --no-gui -W -H -f -q --eval "pkg rebuild"' \$0
-SectionEnd
-
 Section "Uninstall"
 
   ReadRegDWORD \$0 HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave-$VERSION" "AllUsers"
@@ -458,7 +468,8 @@
  IfFileExists "\$desktop\\GNU Octave (GUI).lnk" 0 done_remove_desktop_shortcuts
  SetOutPath "%USERPROFILE%"
  CreateShortCut "\$desktop\\GNU Octave (GUI).lnk" "\$R0\\octave.vbs" "--force-gui" "\$R2" 0 SW_SHOWMINIMIZED
- ExecWait '"\$INSTDIR\\bin\\win7appid.exe" "\$desktop\\GNU Octave (GUI).lnk" "gnu.octave.\$R1"'
+ nsExec::Exec /TIMEOUT=30000 '"\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\win7appid.exe" "\$desktop\\GNU Octave (GUI).lnk" "gnu.octave.\$R1"'
+ Pop \$0
 
  GoTo done_remove_desktop_shortcuts
 
@@ -472,7 +483,7 @@
  Pop \$R0
 
  ; delete generated qt.conf file
- Delete "\$INSTDIR\\bin\\qt.conf"
+ Delete "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\qt.conf"
 EOF
 
 # insert dir list (backwards order) for uninstall files
@@ -617,7 +628,8 @@
 
 ; Check whether prev install is here and no spaces in dest name
 Function CheckPrevInstallAndDest
-  IfFileExists "\$INSTDIR\\bin\\octave-cli.exe" inst_exists  inst_none
+  IfFileExists "\$INSTDIR\\bin\\octave-cli.exe" inst_exists  0
+  IfFileExists "\$INSTDIR\\$OCTAVE_SUBDIR\\bin\\octave-cli.exe" inst_exists  inst_none
 inst_exists:
   MessageBox MB_YESNO|MB_ICONEXCLAMATION "Another Octave installation has been detected at that destination. It is recommended to uninstall it if you intend to use the same installation directory. Do you want to proceed with the installation anyway?" /SD IDYES IDYES inst_none IDNO 0
   Abort 
diff -r 0c6d7d14a615 -r d9d2a89d1df7 tools/msys2-install.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/msys2-install.py	Mon Aug 13 13:49:41 2018 -0400
@@ -0,0 +1,285 @@
+#!/usr/bin/python
+
+import sys
+import os
+import re
+import tempfile
+import shutil
+import fnmatch
+import subprocess
+import glob
+import calendar;
+import time;
+
+
+class Env:
+  verbose = True;
+  tmp = "/tmp";
+  msysdir = "/tmp/msys3";
+  tar = "tar";
+  cleanup = False;
+
+def read_options_file(optfile):
+  with open(optfile, 'r') as f:
+    lines = f.read().splitlines()
+    #d = dict(s.split(' = ',1) for s in lines if s.find(' = ') != -1)
+
+    x = {}
+    for  s in lines:
+      if s.find(' = ') != -1:
+        v = s.split(' = ',1)
+        if not v[0] in x:
+          x[v[0]] = []
+        
+        x[v[0]].append(v[1])
+
+    return x
+
+def save_list_file(listfile, values, hdr):
+  with open(listfile, 'wt') as f:
+    if hdr:
+      f.write(hdr + "\n")
+    for v in values:
+      f.write(v + "\n")
+
+pkg= {'license': 'GPL', 'replaces': 'pacman-contrib', 'pkgname': 'pacman', 'builddate': '1532933269', 'pkgdesc': 'A library-based package manager with dependency support (MSYS2 port)', 'checkdepend': 'python2', 'url': 'https://www.archlinux.org/pacman/', 'backup': 'etc/makepkg_mingw64.conf', 'makedepend': 'libunistring-devel', 'depend': 'xz', 'pkgbase': 'pacman', 'optdepend': 'vim', 'provides': 'pacman-contrib', 'group': 'base-devel', 'packager': 'Alexey Pavlov <alexpux@gmail.com>', 'size': '47739904', 'arch': 'i686', 'conflict': 'pacman-contrib', 'pkgver': '5.1.1-2'}
+
+def save_desc_file(descfile, pkginfo):
+  with open(descfile, 'wt') as f:
+
+   f.write("%NAME%\n")
+   v = pkginfo.get('pkgname',[])
+   for l in v:
+     f.write(l+"\n")
+   f.write("\n")
+
+   f.write("%VERSION%\n")
+   v = pkginfo.get('pkgver',[])
+   for l in v:
+     f.write(l+"\n")
+   f.write("\n")
+
+   f.write("%DESC%\n")
+   v = pkginfo.get('pkgdesc',[])
+   for l in v:
+     f.write(l+"\n")
+   f.write("\n")
+
+   f.write("%ARCH%\n")
+   v = pkginfo.get('arch',[])
+   for l in v:
+     f.write(l+"\n")
+   f.write("\n")
+
+   f.write("%BUILDDATE%\n")
+   v = pkginfo.get('builddate',[])
+   for l in v:
+     f.write(l+"\n")
+   f.write("\n")
+
+   t = calendar.timegm(time.gmtime())
+   f.write("%INSTALLDATE%\n")
+   f.write(str(t) + "\n\n")
+
+   f.write("%PACKAGER%\n")
+   v = pkginfo.get('packager', [])
+   for l in v:
+     f.write(l+"\n")
+   f.write("\n")
+
+   f.write("%SIZE%\n")
+   v = pkginfo.get('size',[])
+   for l in v:
+     f.write(l+"\n")
+   f.write("\n")
+
+   f.write("%GROUPS%\n")
+   v = pkginfo.get('group',[])
+   for l in v:
+     f.write(l+"\n")
+   f.write("\n")
+
+   f.write("%LICENSE%\n")
+   v = pkginfo.get('license',[])
+   for l in v:
+     f.write(l+"\n")
+   f.write("\n")
+
+   f.write("%VALIDATION%\n")
+   v = pkginfo.get('validation',['pgp'])
+   for l in v:
+     f.write(l+"\n")
+   f.write("\n")
+
+   f.write("%REPLACES%\n")
+   v = pkginfo.get('replaces',[])
+   for l in v:
+     f.write(l+"\n")
+   f.write("\n")
+
+   f.write("%DEPENDS%\n")
+   v = pkginfo.get('depend', [])
+   for l in v:
+     f.write(l+"\n")
+   f.write("\n")
+
+   f.write("%OPTDEPENDS%\n")
+   v = pkginfo.get('optdepend',[])
+   for l in v:
+     f.write(l+"\n")
+   f.write("\n")
+
+   f.write("%CONFLICTS%\n")
+   v = pkginfo.get('conflict',[])
+   for l in v:
+     f.write(l+"\n")
+   f.write("\n")
+
+   f.write("%PROVIDES%\n")
+   v = pkginfo.get('provides', [])
+   for l in v:
+     f.write(l+"\n")
+   f.write("\n")
+
+def create_msys_dirs(sysdir):
+  if os.path.exists(sysdir) == False:
+    os.makedirs(sysdir)
+  if os.path.exists(sysdir + "/var/lib/pacman/local") == False:
+    os.makedirs(sysdir + "/var/lib/pacman/local")
+  # db file
+  if os.path.exists(sysdir + "/var/lib/pacman/local/ALPM_DB_VERSION") == False:
+    with open(sysdir + "/var/lib/pacman/local/ALPM_DB_VERSION", 'wt') as f:
+      f.write("9\n")
+
+def uninstall_pkg(pkgname, env):
+  pkgpath = env.msysdir + "/var/lib/pacman/local/"
+  files=glob.glob(pkgpath + pkgname + "-" + "*")
+  for f in files:
+    if env.verbose:
+      print "uninstalling " + f
+    shutil.rmtree(f)
+
+def install_pkg(pkg, env):
+  pkg = os.path.abspath(pkg)
+  currdir = os.getcwd()
+  status = 0
+
+  try:
+    ## Check that the directory in prefix exist. If it doesn't: create it!
+    tmpdir = tempfile.mkdtemp("-pkg","tmp", env.tmp)
+    if env.verbose:
+      print "using tempdir ", tmpdir
+    os.chdir(tmpdir)
+
+    # unpack dir
+    if env.verbose:
+      os.system(env.tar + " xvpf '" + pkg + "'") 
+    else:
+      os.system(env.tar + " xpf '" + pkg + "'") 
+
+    pkginfo = read_options_file(tmpdir + '/.PKGINFO')
+
+    # uninstall prev versions
+    uninstall_pkg(pkginfo.get('pkgname')[0], env)
+
+    # copy files to dest
+    filelist = []
+    tmplen = len(tmpdir)
+    if not tmpdir.endswith('/'):
+      tmplen = tmplen + 1
+
+    for root, dirs, files in os.walk(tmpdir):
+      for dir in dirs:
+          fullpath = os.path.join(root, dir)
+          fullpath = fullpath[tmplen:] + "/"
+          filelist.append(fullpath)
+          if os.path.exists(env.msysdir + "/" + fullpath) == False:
+            os.makedirs(env.msysdir + "/" + fullpath)
+
+      for file in files:
+        if not file.startswith('.'):
+          fullpath = os.path.join(root, file)
+          fullpath = fullpath[tmplen:]
+          filelist.append(fullpath)
+          if env.verbose:
+            print "installing " + fullpath
+
+          # dele old file fo can copy new with perms (if ld file would allow write)
+          if os.path.isfile(env.msysdir + "/" + fullpath):
+            os.remove(env.msysdir + "/" + fullpath)
+
+          shutil.copy2(os.path.join(root, file), env.msysdir + "/" + fullpath)
+
+    if env.verbose:
+      print "creating package files"
+
+    # create pkg files needed
+    pkg_name_ver = pkginfo.get('pkgname', [''])[0] + "-" + pkginfo.get('pkgver',[''])[0]
+    pkg_info_dir = env.msysdir + "/var/lib/pacman/local/" + pkg_name_ver
+    if os.path.exists(pkg_info_dir) == False:
+      os.makedirs(pkg_info_dir)
+
+    save_list_file (pkg_info_dir + "/files", filelist, "%FILES%")
+    save_desc_file (pkg_info_dir + "/desc", pkginfo)
+    shutil.copy2(tmpdir + "/.MTREE", pkg_info_dir + "/mtree")
+
+  finally:
+    if env.verbose:
+      print "cleaning up"
+    os.chdir(currdir)
+
+    if env.cleanup:
+      shutil.rmtree(tmpdir)
+ 
+  return status
+
+def install (args):
+  env = Env()
+
+  files = []
+ 
+  for a in args:
+    print a
+    c=a.split("=")
+    key=c[0]
+    if len(c) > 1:
+      val=c[1]
+    else:
+      val=""
+
+    if key == "--verbose":
+      env.verbose = True;
+    elif key == "-no-cleanup":
+      env.cleanup = False;
+    elif key == "--msys-dir":
+      if val:
+        env.msysdir = val;
+    elif val == "":
+      files.append(key)
+
+  # set up env
+  if os.environ.get("TMP") != None:
+    env.tmp = os.environ["TMP"]
+  os.environ['TMP'] = env.tmp;
+  if os.environ.get("TAR") != None:
+    env.tar = os.environ["TAR"]
+
+  create_msys_dirs(env.msysdir)
+
+  status = 0
+  for a in files:
+    status = install_pkg(a, env)
+    if status != 0:
+      break
+
+  return status
+
+def show_usage():
+  print sys.argv[0], "[options] pkg1 [pkg2]"
+
+if __name__ == "__main__":
+  if len(sys.argv) > 1:
+    status = install(sys.argv[1:])
+    sys.exit(status)
+  else:
+    show_usage()
