aboutsummaryrefslogtreecommitdiff
path: root/mail/alpine
diff options
context:
space:
mode:
authorDoug Barton <dougb@FreeBSD.org>2010-12-05 07:51:49 +0000
committerDoug Barton <dougb@FreeBSD.org>2010-12-05 07:51:49 +0000
commitc972c1974eeec460a4c51ca91bef5a2db2a284f4 (patch)
treef4d35862d713be2dc8a03ace5bcf6b99d66cfe54 /mail/alpine
parent2cf93a8581a22e329a6e27c85becb8b4d95adb80 (diff)
downloadports-c972c1974eeec460a4c51ca91bef5a2db2a284f4.tar.gz
ports-c972c1974eeec460a4c51ca91bef5a2db2a284f4.zip
Remove CONFLICTS for the old pine stuff, it's been long enough
Fix the problem mentioned in the PR related to a feature of the port that is useful, or dangerous depending on how you look at it. :) If you run 'alpine -conf > file' it will merge in values from your existing global conf file (/usr/local/etc/alpine.conf) and spit out a new file with any new features added. The port used this feature when I took it over, and I maintained that behavior because it is useful. However, it is different from the traditional behavior of installing a clean foo.conf.sample file, and maintaining foo.conf only if it differs from the sample. My solution to this problem is different than the PR's, but does not involve patching the source. Using the pkg-install file and taking advantage of the default behavior of the alpine -conf feature I have created the best of both worlds, a clean .sample, and merging in local changes if they exist. Since I'm changing stuff anyway, do both sides of the process in a more security-conscious way. Bump PORTREVISION since the package is now different PR: ports/148859 Submitted by: Ganael Laplanche <ganael.laplanche@martymac.com>
Notes
Notes: svn path=/head/; revision=265702
Diffstat (limited to 'mail/alpine')
-rw-r--r--mail/alpine/Makefile7
-rw-r--r--mail/alpine/pkg-install32
-rw-r--r--mail/alpine/pkg-plist7
3 files changed, 36 insertions, 10 deletions
diff --git a/mail/alpine/Makefile b/mail/alpine/Makefile
index 15fb53e65946..2262189ae554 100644
--- a/mail/alpine/Makefile
+++ b/mail/alpine/Makefile
@@ -7,7 +7,7 @@
PORTNAME?= alpine
PORTVERSION= 2.00
-PORTREVISION?= 1
+PORTREVISION?= 2
CATEGORIES?= mail news ipv6
MASTER_SITES= ftp://ftp.cac.washington.edu/alpine/ \
http://dougbarton.us/Downloads/alpine-${PORTVERSION}/
@@ -48,8 +48,6 @@ CONFIGURE_ARGS+=--with-system-pinerc=${PREFIX}/etc/alpine.conf \
.endif
CONFIGURE_ARGS+=--with-debug-level=2
-CONFLICTS= pico-4* pine4-4*
-
USE_OPENSSL= yes
.include <bsd.port.pre.mk>
@@ -182,8 +180,7 @@ post-install:
${INSTALL_DATA} ${WRKSRC}/doc/tech-notes.txt ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/doc/tech-notes/*.html ${DOCSDIR}/tech-notes
.endif
- ${PREFIX}/bin/alpine -P ${PREFIX}/etc/alpine.conf -conf >${WRKSRC}/alpine.conf
- ${INSTALL_DATA} ${WRKSRC}/alpine.conf ${PREFIX}/etc/alpine.conf
+ PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${CAT} ${PKGMESSAGE}
.endif # !defined(PICO_ALPINE_SLAVE)
diff --git a/mail/alpine/pkg-install b/mail/alpine/pkg-install
new file mode 100644
index 000000000000..c7e0a18d5aed
--- /dev/null
+++ b/mail/alpine/pkg-install
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+[ "$2" = 'POST-INSTALL' ] || exit 0
+
+PATH=/bin:/usr/bin
+export PATH
+
+TDIR=`mktemp -d ${TMPDIR:-/tmp}/alpine-conf.XXXXXXXX`
+
+if [ -s "${PKG_PREFIX}/etc/alpine.conf" ]; then
+ mv ${PKG_PREFIX}/etc/alpine.conf ${TDIR}/alpine.conf.installed
+fi
+
+${PKG_PREFIX}/bin/alpine -conf > ${TDIR}/alpine.conf.sample
+install -o root -g wheel -m 444 ${TDIR}/alpine.conf.sample ${PKG_PREFIX}/etc/alpine.conf.sample
+
+[ -s "${TDIR}/alpine.conf.installed" ] && mv ${TDIR}/alpine.conf.installed ${PKG_PREFIX}/etc/alpine.conf
+
+${PKG_PREFIX}/bin/alpine -conf > ${TDIR}/alpine.conf
+
+if [ -e "${PKG_PREFIX}/etc/alpine.conf" ]; then
+ if ! cmp -s ${TDIR}/alpine.conf ${PKG_PREFIX}/etc/alpine.conf; then
+ unlink ${PKG_PREFIX}/etc/alpine.conf
+ install -o root -g wheel -m 444 ${TDIR}/alpine.conf ${PKG_PREFIX}/etc/alpine.conf
+ fi
+else
+ cp -p ${PKG_PREFIX}/etc/alpine.conf.sample ${PKG_PREFIX}/etc/alpine.conf
+fi
+
+rm -rf $TDIR
+
+exit 0
diff --git a/mail/alpine/pkg-plist b/mail/alpine/pkg-plist
index 400015b10245..b28fcd400048 100644
--- a/mail/alpine/pkg-plist
+++ b/mail/alpine/pkg-plist
@@ -1,11 +1,8 @@
-@unexec %D/bin/alpine -conf >%D/etc/alpine.conf.tmp
-@unexec if cmp -s %D/etc/alpine.conf %D/etc/alpine.conf.tmp; then rm -f %D/etc/alpine.conf; fi
-@unexec rm -f %D/etc/alpine.conf.tmp
+@unexec /usr/bin/cmp -s %D/etc/alpine.conf %D/etc/alpine.conf.sample && /bin/unlink %D/etc/alpine.conf || true
bin/alpine
bin/rpdump
bin/rpload
-@exec %D/bin/alpine -P %D/etc/alpine.conf -conf >%D/etc/alpine.conf.tmp
-@exec /bin/mv %D/etc/alpine.conf.tmp %D/etc/alpine.conf
+etc/alpine.conf.sample
%%PORTDOCS%%%%DOCSDIR%%/LICENSE
%%PORTDOCS%%%%DOCSDIR%%/NOTICE
%%PORTDOCS%%%%DOCSDIR%%/README