--- DirectoryServices/dshelper/GNUmakefile.orig
+++ DirectoryServices/dshelper/GNUmakefile
@@ -19,9 +19,9 @@
 
 # Install service files (platform-specific)
 after-install::
-ifeq ($(findstring freebsd,$(GNUSTEP_HOST_OS)),freebsd)
-	$(MKINSTALLDIRS) /usr/local/etc/rc.d
-	$(INSTALL) -m 555 dshelper.rc /usr/local/etc/rc.d/dshelper
+ifneq ($(filter freebsd% midnightbsd%,$(GNUSTEP_HOST_OS)),)
+	$(MKINSTALLDIRS) $(DESTDIR)/usr/local/etc/rc.d
+	$(INSTALL) -m 555 dshelper.rc $(DESTDIR)/usr/local/etc/rc.d/dshelper
 endif
 ifeq ($(findstring linux,$(GNUSTEP_HOST_OS)),linux)
 	@if [ -d /etc/init.d ] && [ ! -d /run/systemd/system ]; then \
