From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Fri, 12 Sep 2008 06:40:42 +0000 (-0400)
Subject: tweaking installations of config files so that FreeBSD ports do not clobber local... 
X-Git-Tag: monkeysphere_0.16-1~69
X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=c4b4cdd87413598ba415ceebba35ed7d9dc0d979;p=monkeysphere.git

tweaking installations of config files so that FreeBSD ports do not clobber local sysadmin changes.
---

diff --git a/Makefile b/Makefile
index 98d265e..f64a504 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@ MONKEYSPHERE_VERSION = `head -n1 debian/changelog | sed 's/.*(\([^-]*\)-.*/\1/'`
 # these defaults are for debian.  porters should probably adjust them
 # before calling make install
 ETCPREFIX ?= 
+ETCSUFFIX ?= 
 PREFIX ?= /usr
 MANPREFIX ?= $(PREFIX)/share/man
 
@@ -40,7 +41,8 @@ install: all installman
 	install src/monkeysphere-server $(DESTDIR)$(PREFIX)/sbin
 	install -m 0644 src/common $(DESTDIR)$(PREFIX)/share/monkeysphere
 	install doc/* $(DESTDIR)$(PREFIX)/share/doc/monkeysphere
-	install -m 0644 etc/* $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere
+	install -m 0644 etc/monkeysphere.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere$(ETCSUFFIX)
+	install -m 0644 etc/monkeysphere-server.conf $(DESTDIR)$(ETCPREFIX)/etc/monkeysphere/monkeysphere-server.conf$(ETCSUFFIX)
 
 installman:
 	mkdir -p $(DESTDIR)$(MANPREFIX)/man1 $(DESTDIR)$(MANPREFIX)/man7 $(DESTDIR)$(MANPREFIX)/man8
diff --git a/packaging/freebsd/Makefile b/packaging/freebsd/Makefile
index 9d90b45..82e3bf8 100644
--- a/packaging/freebsd/Makefile
+++ b/packaging/freebsd/Makefile
@@ -29,6 +29,6 @@ MAN7=		monkeysphere.7
 MAN8=		monkeysphere-server.8
 MANCOMPRESSED= yes
 
-MAKE_ARGS= ETCPREFIX=/usr/local MANPREFIX=/usr/local/man
+MAKE_ARGS= ETCPREFIX=/usr/local MANPREFIX=/usr/local/man ETCSUFFIX=.sample
 
 .include <bsd.port.mk>
diff --git a/packaging/freebsd/TODO b/packaging/freebsd/TODO
index bb65ad7..f482457 100644
--- a/packaging/freebsd/TODO
+++ b/packaging/freebsd/TODO
@@ -14,11 +14,6 @@ http://www.freebsd.org/cgi/cvsweb.cgi/ports/net/cvsup-mirror/pkg-install
 or just look around the ports tree for pkg-install files, they are
 usually for adding users.
 
-There is also the usual crappy work involved with installing a .defaults
-file instead of straight files in /usr/local/etc:
-
-http://www.freebsd.org/doc/en/books/porters-handbook/plist-config.html
-
 Finally the pkg-plist needs to be checked. The package hasn't been
 installed at all once yet, it only patches and builds.
 
diff --git a/packaging/freebsd/distinfo b/packaging/freebsd/distinfo
index 9716554..23d57ea 100644
--- a/packaging/freebsd/distinfo
+++ b/packaging/freebsd/distinfo
@@ -1,3 +1,3 @@
-MD5 (monkeysphere_0.16~pre.orig.tar.gz) = cc02c34932b781bb2436f54d99fde2cc
-SHA256 (monkeysphere_0.16~pre.orig.tar.gz) = b54f66a2aed82864d22348800752e3881633af0aa4692beb367c88c8a4c4bc31
-SIZE (monkeysphere_0.16~pre.orig.tar.gz) = 58172
+MD5 (monkeysphere_0.16~pre.orig.tar.gz) = f96364b5938373787297e532270c1d27
+SHA256 (monkeysphere_0.16~pre.orig.tar.gz) = 4a1db42b4e0f6b05bf747a4e3aeeb88971c00deff752f58410e1ff646bcf350e
+SIZE (monkeysphere_0.16~pre.orig.tar.gz) = 58191
diff --git a/packaging/freebsd/pkg-plist b/packaging/freebsd/pkg-plist
index 70a9b11..43346c1 100644
--- a/packaging/freebsd/pkg-plist
+++ b/packaging/freebsd/pkg-plist
@@ -7,8 +7,12 @@ bin/openpgp2ssh
 bin/monkeysphere-ssh-proxycommand
 bin/monkeysphere
 share/monkeysphere/common
-etc/monkeysphere/monkeysphere-server.conf
-etc/monkeysphere/monkeysphere.conf
+@unexec if cmp -s %D/etc/monkeysphere/monkeysphere.conf.sample %D/etc/monkeysphere/monkeysphere.conf; then rm -f %D/etc/monkeysphere/monkeysphere.conf; fi
+etc/monkeysphere/monkeysphere.conf.sample
+@exec if [ ! -f %D/etc/monkeysphere/monkeysphere.conf ] ; then cp -p %D/%F %B/monkeysphere.conf; fi
+@unexec if cmp -s %D/etc/monkeysphere/monkeysphere-server.conf.sample %D/etc/monkeysphere/monkeysphere-server.conf; then rm -f %D/etc/monkeysphere/monkeysphere-server.conf; fi
+etc/monkeysphere/monkeysphere-server.conf.sample
+@exec if [ ! -f %D/etc/monkeysphere/monkeysphere-server.conf ] ; then cp -p %D/%F %B/monkeysphere-server.conf; fi
 @dirrm share/doc/monkeysphere
 @dirrm share/monkeysphere
 @dirrm etc/monkeysphere