ports/119385: [patch] lang/fpc: refine dealing with configuration file
Boris Samorodov
bsam at FreeBSD.org
Sun Jan 6 15:10:02 UTC 2008
>Number: 119385
>Category: ports
>Synopsis: [patch] lang/fpc: refine dealing with configuration file
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Sun Jan 06 15:10:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Boris Samorodov
>Release: FreeBSD 7.0-PRERELEASE i386
>Organization:
InPharmTech, Co.
>Environment:
System: FreeBSD bb.ipt.ru 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #1: Sat Dec 29 18:52:25 MSK 2007 root at bb.ipt.ru:/usr/obj/usr/src/sys/BB i386
>Description:
Well, actually I was trying to build editors/lazarus which
failed. Pointyhat shows the same as well. The main reason
is that the port lang/fpc does not install a sample configuration
file while installing from a package. Thus the compiler (fpc)
does not find the needed (paths to) libraries.
One minor bug was found at the lang/fpc port: it removes the
configuration file unconditionally when the port/pachage is
deletted.
I propose to patch the script from the distribution so that
a sample configuration file is installed (not the configuration
file itself). Then the whole remaining logic becomes standard.
>How-To-Repeat:
Try to compile editors/lazarus.
>Fix:
. patch the samplecfg script (a new file files/patch-compiler_utils_samplecfg);
. fix Makefile and pkg-plist to deal with a configuration file;
. bump PORTREVISION.
--- fpc.diff begins here ---
? files/patch-compiler_utils_samplecfg
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/fpc/Makefile,v
retrieving revision 1.26
diff -u -r1.26 Makefile
--- Makefile 18 Sep 2007 06:53:23 -0000 1.26
+++ Makefile 6 Jan 2008 14:41:40 -0000
@@ -7,7 +7,7 @@
PORTNAME= fpc
PORTVERSION= 2.2.0
-PORTREVISION?= 0
+PORTREVISION?= 1
CATEGORIES?= lang
MASTER_SITES= ftp://ftp.freepascal.org/pub/fpc/dist/source-${PORTVERSION}/:source \
ftp://planetmirror.com/pub/fpc/dist/source-${PORTVERSION}/:source \
@@ -107,6 +107,9 @@
if [ -e "${PREFIX}/bin/ppc386" ]; then ${RM} -f "${PREFIX}/bin/ppc386"; fi
${LN} -s "${PREFIX}/lib/fpc/${PORTVERSION}/ppc386" "${PREFIX}/bin"
${SH} "${PREFIX}/lib/fpc/${PORTVERSION}/samplecfg" "${PREFIX}/lib/fpc/${PORTVERSION}" "${PREFIX}/etc"
+ @if [ ! -f ${PREFIX}/etc/fpc.cfg ]; then \
+ ${CP} ${PREFIX}/etc/fpc.cfg.sample ${PREFIX}/etc/fpc.cfg; \
+ fi
@${CAT} ${PKGMESSAGE}
.else
Index: pkg-plist
===================================================================
RCS file: /home/pcvs/ports/lang/fpc/pkg-plist,v
retrieving revision 1.8
diff -u -r1.8 pkg-plist
--- pkg-plist 18 Sep 2007 06:53:23 -0000 1.8
+++ pkg-plist 6 Jan 2008 14:41:40 -0000
@@ -1,6 +1,8 @@
@comment $FreeBSD: ports/lang/fpc/pkg-plist,v 1.8 2007/09/18 06:53:23 acm Exp $
- at unexec rm -f %D/etc/fpc.cfg > /dev/null 2>&1 || true
+ at unexec if cmp -s %D/etc/fpc.cfg.sample %D/etc/fpc.cfg; then rm -f %D/etc/fpc.cfg; fi
+etc/fpc.cfg.sample
+ at exec if [ ! -f %D/etc/fpc.cfg ] ; then cp -p %D/%F %B/fpc.cfg; fi
bin/fpc
bin/fpcmkcfg
bin/fpcsubst
--- fpc.diff ends here ---
--- patch-compiler_utils_samplecfg begins here ---
--- compiler/utils/samplecfg.orig 2008-01-06 01:17:24.468239657 +0300
+++ compiler/utils/samplecfg 2008-01-06 01:36:20.388869514 +0300
@@ -72,7 +72,7 @@
# Detect if we have write permission in root.
if [ -w $sysdir ] ; then
echo Write permission in $sysdir.
- thefile=$sysdir/fpc.cfg
+ thefile=$sysdir/fpc.cfg.sample
else
echo No write premission in $sysdir.
thefile=$HOME/.fpc.cfg
--- patch-compiler_utils_samplecfg ends here ---
WBR
--
bsam
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list