dma(8): install default conf files with installworld
authorJohn Marino <draco@marino.st>
Mon, 2 Mar 2015 13:45:55 +0000 (14:45 +0100)
committerJohn Marino <draco@marino.st>
Mon, 2 Mar 2015 14:59:46 +0000 (15:59 +0100)
Previously dma configure files were only installed with the
"make distribution" command.  Additionally, the user was expected to
modify them as opposed to copies of them.  This is probably why there
were part of distribution, in order to avoid overwriting the dma.conf
and auth.conf.

The negative side to this approach is that updated *.conf sample files
would never be installed.  Since the dma.conf is actually completely
commented out, and since it doesn't fail in the absence of dma.conf,
these files aren't actually needed.

This commit installs /etc/dma/dma.conf.sample and /etc/dma/auth.conf.sample
files during installworld instead.  Future updates to the *.conf.sample
files will overwrite them, but obviously /etc/dma/*.conf will not be
touched. Some of the sendfile conf files are provided as .sample, so the
concept is not new for DragonFly.

etc/Makefile
libexec/dma/Makefile
libexec/dma/Makefile.etc [deleted file]
libexec/dma/default-conf/Makefile [new file with mode: 0644]

index a86b121..4737b7b 100644 (file)
@@ -49,7 +49,6 @@ DIRS+=        secure/lib/libssh \
 .endif
 DIRS+= secure/usr.bin/openssl
 .endif
-DIRS+= libexec/dma
 
 # Files that should be installed read-only-executable (555) root:wheel
 #
index 0bf83b6..014fd07 100644 (file)
@@ -1,3 +1,3 @@
-SUBDIR=        dma dma-mbox-create
+SUBDIR=        dma dma-mbox-create default-conf
 
 .include <bsd.subdir.mk>
diff --git a/libexec/dma/Makefile.etc b/libexec/dma/Makefile.etc
deleted file mode 100644 (file)
index fca23b9..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# $DragonFly: src/etc/dma/Makefile,v 1.3 2008/02/12 22:10:20 matthias Exp $
-
-FILESDIR=      /etc/dma
-SHAREOWN=      root
-SHAREGRP=      mail
-FILESMODE=     640
-
-.if !exists(${DESTDIR}/etc/dma/auth.conf)
-FILES+=                auth.conf
-.endif
-.if !exists(${DESTDIR}/etc/dma/dma.conf)
-FILES+=                dma.conf
-.endif
-
-.include <bsd.prog.mk>
diff --git a/libexec/dma/default-conf/Makefile b/libexec/dma/default-conf/Makefile
new file mode 100644 (file)
index 0000000..0e8aa68
--- /dev/null
@@ -0,0 +1,18 @@
+FILESDIR=      /etc/dma
+SHAREOWN=      root
+SHAREGRP=      mail
+FILESMODE=     640
+
+GENFILES=      auth.conf.sample dma.conf.sample
+CLEANFILES=    ${GENFILES}
+FILES+=                ${GENFILES}
+
+auth.conf.sample: ../auth.conf
+       cp ${.ALLSRC} ${.TARGET}
+
+dma.conf.sample: ../dma.conf
+       cp ${.ALLSRC} ${.TARGET}
+
+beforedepend: ${GENFILES}
+
+.include <bsd.prog.mk>