--- platforms/darwin/Makefile.orig	2023-07-02 17:48:52
+++ platforms/darwin/Makefile	2023-07-02 20:47:00
@@ -8,9 +8,6 @@
 
 install-darwin:
 	$(call DISTINST,Darwin Mac OS X)
-	$(call MKDIR,/Library/LaunchDaemons)
-	$(call INSTDATA,644,org.apcupsd.apcupsd.plist,/Library/LaunchDaemons)
-	-$(V)chown root:wheel $(DESTDIR)/Library/LaunchDaemons/org.apcupsd.apcupsd.plist
 	$(call INSTDATA,755,apcupsd-uninstall,$(sbindir))
 	$(call INSTDATA,755,apcupsd-start,$(sbindir))
 	@echo "================================================="
@@ -38,18 +35,18 @@
 	@echo "================================================="
 
 install-usb:
-	$(call MKDIR,/System/Library/Extensions/ApcupsdDummy.kext/Contents/_CodeSignature)
-	-$(V)$(call INSTDATA,644,ApcupsdDummy.kext/Contents/Info.plist,/System/Library/Extensions/ApcupsdDummy.kext/Contents/Info.plist)
-	-$(V)$(call INSTDATA,644,ApcupsdDummy.kext/Contents/_CodeSignature/CodeDirectory,/System/Library/Extensions/ApcupsdDummy.kext/Contents/_CodeSignature/CodeDirectory)
-	-$(V)$(call INSTDATA,644,ApcupsdDummy.kext/Contents/_CodeSignature/CodeRequirements,/System/Library/Extensions/ApcupsdDummy.kext/Contents/_CodeSignature/CodeRequirements)
-	-$(V)$(call INSTDATA,644,ApcupsdDummy.kext/Contents/_CodeSignature/CodeResources,/System/Library/Extensions/ApcupsdDummy.kext/Contents/_CodeSignature/CodeResources)
-	-$(V)$(call INSTDATA,644,ApcupsdDummy.kext/Contents/_CodeSignature/CodeSignature,/System/Library/Extensions/ApcupsdDummy.kext/Contents/_CodeSignature/CodeSignature)
-	-$(V)chmod 755 $(DESTDIR)/System/Library/Extensions/ApcupsdDummy.kext
-	-$(V)chmod 755 $(DESTDIR)/System/Library/Extensions/ApcupsdDummy.kext/Contents
-	-$(V)chmod 755 $(DESTDIR)/System/Library/Extensions/ApcupsdDummy.kext/Contents/_CodeSignature
-	-$(V)chown -R root:wheel $(DESTDIR)/System/Library/Extensions/ApcupsdDummy.kext
-	$(call UNINST,/System/Library/Extensions.mkext)
-	$(call UNINST,/System/Library/Extensions.kextcache)
+	$(call MKDIR,$(prefix)/Library/Extensions/ApcupsdDummy.kext/Contents/_CodeSignature)
+	-$(V)$(call INSTDATA,644,ApcupsdDummy.kext/Contents/Info.plist,$(prefix)/Library/Extensions/ApcupsdDummy.kext/Contents/Info.plist)
+	-$(V)$(call INSTDATA,644,ApcupsdDummy.kext/Contents/_CodeSignature/CodeDirectory,$(prefix)/Library/Extensions/ApcupsdDummy.kext/Contents/_CodeSignature/CodeDirectory)
+	-$(V)$(call INSTDATA,644,ApcupsdDummy.kext/Contents/_CodeSignature/CodeRequirements,$(prefix)/Library/Extensions/ApcupsdDummy.kext/Contents/_CodeSignature/CodeRequirements)
+	-$(V)$(call INSTDATA,644,ApcupsdDummy.kext/Contents/_CodeSignature/CodeResources,$(prefix)/Library/Extensions/ApcupsdDummy.kext/Contents/_CodeSignature/CodeResources)
+	-$(V)$(call INSTDATA,644,ApcupsdDummy.kext/Contents/_CodeSignature/CodeSignature,$(prefix)/Library/Extensions/ApcupsdDummy.kext/Contents/_CodeSignature/CodeSignature)
+	-$(V)chmod 755 $(DESTDIR)$(prefix)/Library/Extensions/ApcupsdDummy.kext
+	-$(V)chmod 755 $(DESTDIR)$(prefix)/Library/Extensions/ApcupsdDummy.kext/Contents
+	-$(V)chmod 755 $(DESTDIR)$(prefix)/Library/Extensions/ApcupsdDummy.kext/Contents/_CodeSignature
+	-$(V)chown -R root:wheel $(DESTDIR)$(prefix)/Library/Extensions/ApcupsdDummy.kext
+
+
 	@echo "================================================="
 	@echo " "
 	@echo "Driver installation complete."
@@ -59,13 +56,10 @@
 
 uninstall-darwin:
 	$(call DISTUNINST,Darwin Mac OS X)
-	-$(V)launchctl remove org.apcupsd.apcupsd
-	-$(call UNINST,/System/Library/Extensions/ApcupsdDummy.kext)
-	-$(call UNINST,/System/Library/Extensions.mkext)
-	-$(call UNINST,/System/Library/Extensions.kextcache)
+	-$(call UNINST,/Library/Extensions/ApcupsdDummy.kext)
+	-$(call UNINST,$(prefix)/Library/Extensions/ApcupsdDummy.kext)
 	-$(call UNINST,$(sbindir)/apcupsd-uninstall)
 	-$(call UNINST,$(sbindir)/apcupsd-start)
-	-$(call UNINST,/Library/LaunchDaemons/org.apcupsd.apcupsd.plist)
 	@echo "================================================="
 	@echo " "
 	@echo "Please REBOOT to complete uninstall."
