Bug 119385

Summary: [patch] lang/fpc: refine dealing with configuration file
Product: Ports & Packages Reporter: Boris Samorodov <bsam>
Component: Individual Port(s)Assignee: Jose Alonso Cardenas Marquez <acm>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Boris Samorodov freebsd_committer freebsd_triage 2008-01-06 15:10:01 UTC
	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.

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.



WBR
-- 
bsam--o1ofjtQBwS04w6bsR27OGnzndmi9SXPqmpl5cS67ubDEXpdN
Content-Type: text/plain; name="fpc.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="fpc.diff"

? 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 $
 
-@unexec rm -f %D/etc/fpc.cfg > /dev/null 2>&1 || true
+@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
+@exec if [ ! -f %D/etc/fpc.cfg ] ; then cp -p %D/%F %B/fpc.cfg; fi
 bin/fpc
 bin/fpcmkcfg
 bin/fpcsubst
How-To-Repeat: 	Try to compile editors/lazarus.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2008-01-06 15:10:10 UTC
Responsible Changed
From-To: freebsd-ports-bugs->acm

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Jose Alonso Cardenas Marquez freebsd_committer freebsd_triage 2008-01-06 21:24:14 UTC
State Changed
From-To: open->closed

- Committed thanks, also i updated lazarus to 0.9.24