svn commit: r332560 - head/astro/ephem
Tijl Coosemans
tijl at FreeBSD.org
Sun Nov 3 18:31:44 UTC 2013
On Sat, 2 Nov 2013 23:37:14 +0000 (UTC) Mark Felder wrote:
> Author: feld
> Date: Sat Nov 2 23:37:13 2013
> New Revision: 332560
> URL: http://svnweb.freebsd.org/changeset/ports/332560
>
> Log:
> Reverting STAGE support. Just realized the way the .db and .cfg files
> are being installed needs to be reworked for STAGE or we will always
> overwrite them, breaking POLA
>
> Approved by: swills (mentor, implicit), my guilty conscience
>
> Modified:
> head/astro/ephem/Makefile
>
> Modified: head/astro/ephem/Makefile
> ==============================================================================
> --- head/astro/ephem/Makefile Sat Nov 2 23:29:18 2013 (r332559)
> +++ head/astro/ephem/Makefile Sat Nov 2 23:37:13 2013 (r332560)
> @@ -21,11 +21,11 @@ USE_GCC= any
>
> do-install:
> -cd ${WRKSRC}; \
> - ${INSTALL_PROGRAM} ephem ${STAGEDIR}${PREFIX}/bin; \
> - ${MKDIR} ${STAGEDIR}${PREFIX}/share/ephem; \
> - ${INSTALL_DATA} Man.txt ${STAGEDIR}${PREFIX}/share/ephem/; \
> - [ ! -f ${STAGEDIR}${PREFIX}/share/ephem/ephem.db ] && ${INSTALL_DATA} ephem.db ${STAGEDIR}${PREFIX}/share/ephem/; \
> - [ ! -f ${STAGEDIR}${PREFIX}/share/ephem/ephem.cfg ] && ${INSTALL_DATA} ephem.cfg ${STAGEDIR}${PREFIX}/share/ephem/
> + ${INSTALL_PROGRAM} ephem ${PREFIX}/bin; \
> + ${MKDIR} ${PREFIX}/share/ephem; \
> + ${INSTALL_DATA} Man.txt ${PREFIX}/share/ephem/; \
> + [ ! -f ${PREFIX}/share/ephem/ephem.db ] && ${INSTALL_DATA} ephem.db ${PREFIX}/share/ephem/; \
> + [ ! -f ${PREFIX}/share/ephem/ephem.cfg ] && ${INSTALL_DATA} ephem.cfg ${PREFIX}/share/ephem/
>
> post-install:
> @${ECHO_MSG} Don\'t forget to edit ${PREFIX}/share/ephem/ephem.cfg!
Hmm, this post-install message suggests modifying an installed file
which means when the package is deleted the file stays because of a
checksum failure and that's why you need the existence test in
do-install.
The correct way to deal with this situation is to install those files
as *.sample and then put the following in pkg-plist for each file:
@unexec if cmp -s %D/%%DATADIR%%/ephem.cfg %D/%%DATADIR%%/ephem.cfg.sample; then rm -f %D/%%DATADIR%%/ephem.cfg; fi
%%DATADIR%%/ephem.cfg.sample
@exec if [ ! -f %B/ephem.cfg ]; then cp -p %D/%F %B/ephem.cfg; fi
Also, I think you can remove the USE_GCC=any if you add -Wno-return-type
to CFLAGS.
More information about the svn-ports-head
mailing list