ports/185572: [PATCH] mail/fetchmail: fix StageDir
Corey Halpin
chalpin at cs.wisc.edu
Mon Feb 10 12:40:02 UTC 2014
The following reply was made to PR ports/185572; it has been noted by GNATS.
From: Corey Halpin <chalpin at cs.wisc.edu>
To: Takefu <takefu at airport.fm>
Cc: bug-followup at FreeBSD.ORG
Subject: Re: ports/185572: [PATCH] mail/fetchmail: fix StageDir
Date: Mon, 10 Feb 2014 06:31:34 -0600
--ftEhullJWpWg/VHq
Content-Type: multipart/mixed; boundary="KsGdsel6WgEHnImy"
Content-Disposition: inline
--KsGdsel6WgEHnImy
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Thank you for these improvements.
It looks like something mangled your patchfile. It had "- -" at the=20
beginning of the line where it should be "-". After fixing that problem, I=
=20
was able to apply and test it. It still fails poudriere testport. This is=
=20
because the Makefile contained:
${MKDIR} -m 0755 "${STAGEDIR}/var/run/${PORTNAME}"
but the pkg-plist tried to remove /var/run/fetchmail.
In the attached revision, I've put all of the manipulation of=20
/var/run/fetchmail into the pkg-(de)install scripts. Poudriere testport st=
ill=20
complains about %%ETCDIR%%rc and $$ETCDIR%%rc.sample -- but I believe these=
to=20
be false positives.
~crh
On 2014-01-24, Takefu wrote:
> It was not possible to correct it with 8.4-RELEASE though the patch was t=
ried.
> I want you to try because it made the patch improved a little.
>=20
>=20
> Pkg-install pkg-deinstall operates correctly.
> NLS option reform.
> shebangfix fetchmailconf.py
--KsGdsel6WgEHnImy
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="fm2_crh.patch"
Content-Transfer-Encoding: quoted-printable
diff -ruN fetchmail/Makefile fetchmail_new/Makefile
--- fetchmail/Makefile 2013-09-20 14:59:12.000000000 -0500
+++ fetchmail_new/Makefile 2014-02-07 14:37:53.256667040 -0600
@@ -10,17 +10,25 @@
MAINTAINER=3D chalpin at cs.wisc.edu
COMMENT=3D Batch mail retrieval utility for IMAP/POP3/ETRN/ODMR
=20
+LICENSE=3D GPLv2 LGPL21
+LICENSE_COMB=3D dual
+
RUN_DEPENDS=3D ${LOCALBASE}/share/certs/ca-root-nss.crt:${PORTSDIR}/securi=
ty/ca_root_nss
=20
# Note USERS can only contain a single word as parts below rely on that.
-USERS=3D ${PORTNAME}
-GROUPS=3D ${USERS}
+USERS=3D ${PORTNAME}
+GROUPS=3D ${USERS}
+NULLDIR?=3D # None. portlint compliance
+
+USES=3D shebangfix
+SHEBANG_FILES=3D fetchmailconf.py
+python_OLD_CMD=3D /usr/bin/env python
=20
USE_RC_SUBR=3D fetchmail
-FETCHMAILRC=3D ${PREFIX}/etc/fetchmailrc
-SUB_FILES=3D pkg-message
+SUB_FILES=3D pkg-message pkg-install pkg-deinstall
+SUB_LIST+=3D USERS=3D${USERS} GROUPS=3D${GROUPS} PORTNAME=3D${PORTNAME}
=20
-USE_XZ=3D yes
+USE_XZ=3D yes
USE_GMAKE=3D yes
GNU_CONFIGURE=3D yes
USE_OPENSSL=3D yes
@@ -29,44 +37,37 @@
--with-ssl=3D${OPENSSLBASE}
=20
LDFLAGS+=3D -L${LOCALBASE}/lib
-MAN1=3D fetchmail.1
-MLINKS=3D fetchmail.1 fetchmailconf.1
=20
-OPTIONS_DEFINE=3D X11 NLS NTLM GSSAPI
+OPTIONS_DEFINE=3D X11 NLS NTLM GSSAPI POP2
OPTIONS_DEFAULT=3D GSSAPI
+OPTIONS_SUB=3D yes
X11_DESC=3D Python/Tkinter dependencies for ``fetchmailconf''
-NTLM_DESC=3D Build in support for NTLM/MSN authentication
-GSSAPI_DESC=3D Build GSSAPI/Kerberos 5 support
+POP2_DESC=3D POP2 Protocol support[obsolete]
+
+NLS_USES=3D gettext
+NLS_CONFIGURE_ENABLE=3D nls
+NLS_CONFIGURE_ON=3D --enable-nls
+NLS_CONFIGURE_OFF=3D --disable-nls
=20
PORTDOCS=3D FAQ FEATURES NEWS NOTES README README.SSL \
design-notes.html fetchmail-FAQ.html fetchmail-features.html \
esrs-design-notes.html
=20
-NO_STAGE=3D yes
.include <bsd.port.options.mk>
=20
# Pop2 is obsolete
-.if defined(WITH_POP2)
+.if ${PORT_OPTIONS:MPOP2}
CONFIGURE_ARGS+=3D --enable-POP2
.endif
=20
.if ${PORT_OPTIONS:MX11}
USE_PYTHON_RUN=3D yes
RUN_DEPENDS+=3D ${PYTHON_PKGNAMEPREFIX}tkinter>=3D0:${PORTSDIR}/x11-toolki=
ts/py-tkinter
-PLIST_SUB+=3D X11=3D"" NOX11=3D"@comment "
+PLIST_SUB+=3D NOX11=3D"@comment "
.else
CONFIGURE_ARGS+=3D PYTHON=3D:
SUB_FILES+=3D fetchmailconf
-PLIST_SUB+=3D X11=3D"@comment " NOX11=3D""
-.endif
-
-.if ${PORT_OPTIONS:MNLS}
-CONFIGURE_ARGS+=3D --enable-nls
-PLIST_SUB+=3D NLS=3D""
-USES+=3D gettext
-.else
-CONFIGURE_ARGS+=3D --disable-nls
-PLIST_SUB+=3D NLS=3D"@comment "
+PLIST_SUB+=3D NOX11=3D""
.endif
=20
.if ${PORT_OPTIONS:MGSSAPI}
@@ -74,7 +75,7 @@
.if exists(${LOCALBASE}/lib/libkrb5.a)
KRB5_HOME=3D ${LOCALBASE}
.elif exists(/usr/lib/libkrb5.a)
-KRB5_HOME=3D /usr
+KRB5_HOME=3D ${NULLDIR}/usr
.endif
.endif
=20
@@ -92,29 +93,25 @@
PORTDOCS+=3D README.NTLM
.endif
=20
-pre-patch:
- @${REINPLACE_CMD} -e "s,^#!/usr/bin/env python,#!${LOCALBASE}/bin/python,=
g" \
- ${WRKSRC}/fetchmailconf.py
-
post-build:
@${MAKE} -C ${WRKSRC} check
=20
post-install:
.if ${PORT_OPTIONS:MDOCS}
- ${MKDIR} ${DOCSDIR}
- cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ @cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
.endif
=20
.if empty(PORT_OPTIONS:MX11)
- ${INSTALL_SCRIPT} ${WRKDIR}/fetchmailconf ${PREFIX}/bin
- ${INSTALL_SCRIPT} ${WRKSRC}/fetchmailconf.py ${PREFIX}/libexec
+ ${INSTALL_SCRIPT} ${WRKDIR}/fetchmailconf ${STAGEDIR}${PREFIX}/bin
+ ${INSTALL_SCRIPT} ${WRKSRC}/fetchmailconf.py ${STAGEDIR}${PREFIX}/libexec
.endif
- ${MKDIR} -m 0755 "/var/run/${PORTNAME}"
- ${CHOWN} "${USERS}:${GROUPS}" "/var/run/${PORTNAME}"
- ${INSTALL} -m 644 -o ${USERS} -g ${GROUPS} ${FILESDIR}/fetchmailrc.sample=
${PREFIX}/etc/fetchmailrc.sample
+ ${INSTALL} -m 644 ${FILESDIR}/fetchmailrc.sample\
+ ${STAGEDIR}${PREFIX}/etc/fetchmailrc.sample
if [ ! -f ${PREFIX}/etc/fetchmailrc ]; then \
- ${CP} -p ${PREFIX}/etc/fetchmailrc.sample ${PREFIX}/etc/fetchmailrc ; \
- ${CHMOD} 600 ${PREFIX}/etc/fetchmailrc ; \
+ ${CP} -p ${STAGEDIR}${PREFIX}/etc/fetchmailrc.sample\
+ ${STAGEDIR}${PREFIX}/etc/fetchmailrc ; \
+ ${CHMOD} 600 ${STAGEDIR}${PREFIX}/etc/fetchmailrc ; \
fi
=20
@${ECHO_CMD} ""
diff -ruN fetchmail/files/pkg-deinstall.in fetchmail_new/files/pkg-deinstal=
l.in
--- fetchmail/files/pkg-deinstall.in 1969-12-31 18:00:00.000000000 -0600
+++ fetchmail_new/files/pkg-deinstall.in 2014-02-07 14:38:25.169663806 -0600
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ x$2 !=3D xPOST-DEINSTALL ]; then
+ exit
+fi
+
+if [ -f /var/run/%%PORTNAME%%/fetchmail.pid ] ; then
+ /bin/rm -f /var/run/%%PORTNAME%%/fetchmail.pid
+fi
+
+/bin/rmdir /var/run/%%PORTNAME%%
+
+exit
diff -ruN fetchmail/files/pkg-install.in fetchmail_new/files/pkg-install.in
--- fetchmail/files/pkg-install.in 1969-12-31 18:00:00.000000000 -0600
+++ fetchmail_new/files/pkg-install.in 2014-02-07 14:38:40.988660181 -0600
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ x$2 !=3D xPOST-INSTALL ]; then
+ exit
+fi
+
+/bin/mkdir -m 0755 -p /var/run/%%PORTNAME%%
+/usr/sbin/chown "%%USERS%%:%%GROUPS%%" /var/run/%%PORTNAME%%
+/usr/sbin/chown "%%USERS%%:%%GROUPS%%" %%PREFIX%%/etc/fetchmailrc*
+
+exit
diff -ruN fetchmail/pkg-plist fetchmail_new/pkg-plist
--- fetchmail/pkg-plist 2014-01-21 17:40:21.000000000 -0600
+++ fetchmail_new/pkg-plist 2014-02-07 14:38:10.252664469 -0600
@@ -1,5 +1,8 @@
+ at comment $FreeBSD: mail/fetchmail/pkg-plist 315268 2013-03-26 08:56:28Z ma=
ndree $
bin/fetchmail
bin/fetchmailconf
+man/man1/fetchmail.1.gz
+man/man1/fetchmailconf.1.gz
%%NOX11%%libexec/fetchmailconf.py
%%NLS%%share/locale/ca/LC_MESSAGES/fetchmail.mo
%%NLS%%share/locale/cs/LC_MESSAGES/fetchmail.mo
@@ -32,6 +35,3 @@
@unexec if cmp -s %D/etc/fetchmailrc.sample %D/etc/fetchmailrc; then rm -f=
%D/etc/fetchmailrc; fi
etc/fetchmailrc.sample
@exec if [ ! -f %D/etc/fetchmailrc ] ; then cp -p %D/%F %B/fetchmailrc; fi
- at cwd /var/run
- at unexec rm -f %D/fetchmail/fetchmail.pid 2>/dev/null || true
- at dirrmtry fetchmail
--KsGdsel6WgEHnImy--
--ftEhullJWpWg/VHq
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
iF4EAREIAAYFAlL4xqUACgkQR8PgTIRJoTVzRgD+Pkowov0IKMSCmXZmTgBEhXOQ
q9b7d8TWcsr6ZtxLl5EA/2Mp8bqhOfzaIhJ1EohBEmGfkebCX/3YFtYhewCLzhZm
=3ETY
-----END PGP SIGNATURE-----
--ftEhullJWpWg/VHq--
More information about the freebsd-ports-bugs
mailing list