--- Portfile.orig	2016-03-23 05:30:27.000000000 -0500
+++ Portfile	2016-04-15 22:47:01.000000000 -0500
@@ -5,7 +5,7 @@
 PortGroup           github 1.0
 PortGroup           python 1.0
 
-github.setup        saltstack salt 2015.8.5 v
+github.setup        saltstack salt 2015.8.8.2 v
 name                salt
 categories          sysutils
 platforms           darwin
@@ -13,9 +13,6 @@
 license             Apache-2
 supported_archs     noarch
 
-# Remove this line when the port's version is next updated.
-distname            v${version}
-
 description         Salt is a Python-based remote execution, automation, \
                     configuration, and orchestration engine.
 
@@ -27,8 +24,8 @@
 
 python.default_version 27
 
-checksums           rmd160 dc656a433c88e42e932e1f204a861752bb225b11\
-                    sha256 3f8f013e90328ded27e06c80a698c7436d121461e50f7ae23438d8abedc56ad7
+checksums           rmd160 0ffc4b342fc83a1cdf62eb0871a25cf573dad91d\
+                    sha256 510d17f9f0a99f10ba46b73edaa5ee20a8176111d791625b0c58a6b1f8b3648c
 
 depends_build       port:py${python.version}-setuptools
 
@@ -38,6 +35,7 @@
                     port:py${python.version}-pip \
                     port:py${python.version}-yaml \
                     port:py${python.version}-tornado \
+                    port:py${python.version}-zmq \
                     port:swig-python
 
 startupitem.create        yes
@@ -71,8 +69,24 @@
     if ![file exists ${destroot}/Library/LaunchDaemons] {
         file mkdir ${destroot}/Library/LaunchDaemons
     }
-    copy ${worksrcpath}/pkg/darwin/com.saltstack.salt.master.plist ${destroot}/Library/LaunchDaemons
-    copy ${worksrcpath}/pkg/darwin/com.saltstack.salt.syndic.plist ${destroot}/Library/LaunchDaemons
+    copy ${worksrcpath}/pkg/osx/scripts/com.saltstack.salt.master.plist \
+    	${destroot}/Library/LaunchDaemons/org.macports.salt-master.plist
+    reinplace -W ${destroot}/Library/LaunchDaemons \
+    	"s|/opt/salt/bin/start-salt-master.sh|${prefix}/bin/salt-master|g" org.macports.salt-master.plist
+    reinplace -W ${destroot}/Library/LaunchDaemons \
+    	"s|com.saltstack.salt.master|org.macports.salt-master|g" org.macports.salt-master.plist
+    copy ${worksrcpath}/pkg/osx/scripts/com.saltstack.salt.api.plist \
+    	${destroot}/Library/LaunchDaemons/org.macports.salt-api.plist
+    reinplace -W ${destroot}/Library/LaunchDaemons \
+    	"s|/opt/salt/bin/start-salt-api.sh|${prefix}/bin/salt-api|g" org.macports.salt-api.plist
+    reinplace -W ${destroot}/Library/LaunchDaemons \
+    	"s|com.saltstack.salt.api|org.macports.salt-api|g" org.macports.salt-api.plist
+    copy ${worksrcpath}/pkg/osx/scripts/com.saltstack.salt.syndic.plist \
+    	${destroot}/Library/LaunchDaemons/org.macports.salt-syndic.plist
+    reinplace -W ${destroot}/Library/LaunchDaemons \
+    	"s|/opt/salt/bin/start-salt-syndic.sh|${prefix}/bin/salt-syndic|g" org.macports.salt-syndic.plist
+    reinplace -W ${destroot}/Library/LaunchDaemons \
+    	"s|com.saltstack.salt.syndic|org.macports.salt-syndic|g" org.macports.salt-syndic.plist
 
 }
 
@@ -87,22 +101,38 @@
 notes "
 This port configures a LaunchItem for salt-minion.
 
-It also installs LaunchItems for the salt-master and the salt-syndic.
+It also installs LaunchItems for the salt-master, api, and the salt-syndic.
 
-To start the salt-master via launchd, run
+To start the salt-master, api, or syndic via launchd, run
     
-sudo launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.master.plist
-
-To start the salt-syndic via launchd, run
-
-sudo launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.syndic.plist
+sudo launchctl load -w /Library/LaunchDaemons/org.macports.salt-master.plist
+sudo launchctl load -w /Library/LaunchDaemons/org.macports.salt-api.plist
+sudo launchctl load -w /Library/LaunchDaemons/org.macports.salt-syndic.plist
+
+or to start on El Capitan (10.11) or later system
+
+sudo launchctl enable system/org.macports.salt-master
+sudo launchctl bootstrap system /Library/LaunchDaemons/org.macports.salt-master.plist
+sudo launchctl enable system/org.macports.salt-api
+sudo launchctl bootstrap system /Library/LaunchDaemons/org.macports.salt-api.plist
+sudo launchctl enable system/org.macports.salt-syndic
+sudo launchctl bootstrap system /Library/LaunchDaemons/org.macports.salt-syndic.plist
 
 To disable launchd management for the master or syndic, run the appropriate
 unload command:
 
-sudo launchctl unload -w /Library/LaunchDaemons/com.saltstack.salt.master.plist
-or
-sudo launchctl unload -w /Library/LaunchDaemons/com.saltstack.salt.syndic.plist
+sudo launchctl unload -w /Library/LaunchDaemons/org.macports.salt-master.plist
+sudo launchctl unload -w /Library/LaunchDaemons/org.macports.salt-api.plist
+sudo launchctl unload -w /Library/LaunchDaemons/org.macports.salt-syndic.plist
+
+or to disable on El Capitan (10.11) or later system
+
+sudo launchctl disable system/org.macports.salt-master
+sudo launchctl bootout system /Library/LaunchDaemons/org.macports.salt-master.plist
+sudo launchctl disable system/org.macports.salt-api
+sudo launchctl bootout system /Library/LaunchDaemons/org.macports.salt-api.plist
+sudo launchctl disable system/org.macports.salt-syndic
+sudo launchctl bootout system /Library/LaunchDaemons/org.macports.salt-syndic.plist
 
 "
 
