$OpenBSD: patch-imap_mkpop3dcert_in,v 1.3 2006/11/03 16:19:56 mbalmer Exp $
--- imap/mkpop3dcert.in.orig	Mon Aug  1 00:30:56 2005
+++ imap/mkpop3dcert.in	Mon Aug  1 00:35:05 2005
@@ -12,27 +12,28 @@
 test -x @OPENSSL@ || exit 0
 
 prefix="@prefix@"
+SSLDIR=/etc/ssl/private
 
-if test -f @datadir@/pop3d.pem
+if test -f ${SSLDIR}/pop3d.pem
 then
-	echo "@datadir@/pop3d.pem already exists."
+	echo "${SSLDIR}/pop3d.pem already exists."
 	exit 1
 fi
 
 umask 077
-cp /dev/null @datadir@/pop3d.pem
-chmod 600 @datadir@/pop3d.pem
-chown @mailuser@ @datadir@/pop3d.pem
+cp /dev/null ${SSLDIR}/pop3d.pem
+chmod 600 ${SSLDIR}/pop3d.pem
+chown @mailuser@ ${SSLDIR}/pop3d.pem
 
 cleanup() {
-	rm -f @datadir@/pop3d.pem
-	rm -f @datadir@/pop3d.rand
+	rm -f ${SSLDIR}/pop3d.pem
+	rm -f ${SSLDIR}/pop3d.rand
 	exit 1
 }
 
-dd if=@RANDOMV@ of=@datadir@/pop3d.rand count=1 2>/dev/null
+dd if=@RANDOMV@ of=${SSLDIR}/pop3d.rand count=1 2>/dev/null
 @OPENSSL@ req -new -x509 -days 365 -nodes \
-	-config @sysconfdir@/pop3d.cnf -out @datadir@/pop3d.pem -keyout @datadir@/pop3d.pem || cleanup
-@OPENSSL@ gendh -rand @datadir@/pop3d.rand 512 >>@datadir@/pop3d.pem || cleanup
-@OPENSSL@ x509 -subject -dates -fingerprint -noout -in @datadir@/pop3d.pem || cleanup
-rm -f @datadir@/pop3d.rand
+	-config @sysconfdir@/pop3d.cnf -out ${SSLDIR}/pop3d.pem -keyout ${SSLDIR}/pop3d.pem || cleanup
+@OPENSSL@ gendh -rand ${SSLDIR}/pop3d.rand 512 >>${SSLDIR}/pop3d.pem || cleanup
+@OPENSSL@ x509 -subject -dates -fingerprint -noout -in ${SSLDIR}/pop3d.pem || cleanup
+rm -f ${SSLDIR}/pop3d.rand
