ports/81168: [PATCH] Add flexible FAM support to bsd.port.mk

Jose M Rodriguez josemi at freebsd.jazztel.es
Wed May 18 16:05:34 UTC 2005


El Martes, 17 de Mayo de 2005 23:49, Joe Marcus Clarke escribió:
> Here is a new version of the bsd.port.mk patch that simplifies the
> dependency (along the lines of the OpenLDAP dependencies).
>
> Joe

Allthough this is working well, this can't be merged on ports like 
courier-imap.

This is what I'm testing now, that also uses gamin as fam default.

courier-imap (IDLE) / gnome 2.10 / kde 3.4 workiing well.

But there are things that must be polited.

--
  josemi

Index: Mk/bsd.port.mk
===================================================================
RCS file: /home/cvs/freebsd/ports/Mk/bsd.port.mk,v
retrieving revision 1.511
diff -u -r1.511 bsd.port.mk
--- Mk/bsd.port.mk	17 Mar 2005 23:22:07 -0000	1.511
+++ Mk/bsd.port.mk	18 May 2005 15:49:22 -0000
@@ -304,11 +304,20 @@
 #				  Implies: WANT_OPENLDAP_VER?=22
 # WANT_OPENLDAP_VER
 #				- Legal values are: 21, 22
-#				  If set to an unkown value, the port is marked BROKEN.
+#				  If set to an unknown value, the port is marked BROKEN.
 # WANT_OPENLDAP_SASL
 #				- If set, the system should use OpenLDAP libraries
 #				  with SASL support.
 ##
+# USE_FAM		- If set, this port uses the File Alteration Monitor
+# 				  libray.
+# WANT_FAM_SYSTEM
+# 				- Legal values are: fam, gamin
+# 				  Default value is gamin
+# 				  If set to an unknown value, the port is marked as BROKEN
+# FAM_PORT		- fam port to be used, mainly a test aid.
+# FAM_LIB		- fam lib to be used, mainly a test aid.
+##
 # USE_AUTOTOOLS	- If set, this port uses various GNU autotools
 #				  (libtool, autoconf, autoheader, automake et al.)
 #				  See bsd.autotools.mk for more details.
@@ -1085,11 +1094,10 @@
 .endif
 OPTIONSFILE?=	${PORT_DBDIR}/${UNIQUENAME}/options
 _OPTIONSFILE!=	${ECHO_CMD} "${OPTIONSFILE}"
-.if defined(OPTIONS)
+.if !defined(NO_OPTIONS) && defined(OPTIONS)
 .	if defined(PACKAGE_BUILDING) || (defined(BATCH) 
&& !exists(${_OPTIONSFILE}))
 WITHOUT:=
 WITH:=
-.	if defined(OPTIONS)
 REALOPTIONS=${OPTIONS:C/".*"//g}
 .	for O in ${REALOPTIONS}
 RO:=${O}
@@ -1101,7 +1109,6 @@
 .	endif
 OPT:=${RO}
 .	endfor
-.	endif
 .	for W in ${WITH}
 WITH_${W}:=	true
 .	endfor
@@ -1347,6 +1354,21 @@
 
 WANT_OPENLDAP_VER?=	22
 
+# default File Alteration Monitor system
+# there are ports like courier-imap that need some special handling
+.if exists(${LOCALBASE}/lib/libfam.so) && ! 
exists(${LOCALBASE}/lib/libgamin-1.so)
+WANT_FAM_SYSTEM=	fam
+.else
+WANT_FAM_SYSTEM?=	gamin
+.endif
+
+.if ${WANT_FAM_SYSTEM} == fam
+FAM_PORT?=			${PORTSDIR}/devel/fam
+.else
+FAM_PORT?=			${PORTSDIR}/devel/gamin
+.endif
+FAM_LIB?=			fam.0
+
 # Owner and group of the WWW user
 WWWOWN?=	www
 WWWGRP?=	www
@@ -1462,6 +1484,18 @@
 .endif
 .endif
 
+.if defined(USE_FAM)
+.if ${WANT_FAM_SYSTEM} == fam
+FAM_PORT?=	${PORTSDIR}/devel/fam
+.elif ${WANT_FAM_SYSTEM} == gamin
+FAM_PORT?=	${PORTSDIR}/devel/gamin
+.elif ! defined(FAM_PORT)
+BROKEN=				"unknown FAM system: ${WANT_FAM_SYSTEM}"
+.endif
+FAM_LIB?=			fam.0
+LIB_DEPENDS+=		${FAM_LIB}:${FAM_PORT}
+.endif
+
 .if defined(USE_GETOPT_LONG)
 .if ${OSVERSION} < 500041
 LIB_DEPENDS+=	gnugetopt.1:${PORTSDIR}/devel/libgnugetopt
@@ -1786,23 +1820,19 @@
 # compatible functionality.
 .if !defined(WITHOUT_X11)
 .if defined(WITH_GHOSTSCRIPT_AFPL)
-.if ${WITH_GHOSTSCRIPT_AFPL} == yes
 GHOSTSCRIPT_PORT?=	print/ghostscript-afpl
-.else
+.elif defined(WITH_GHOSTSCRIPT_GNU)
 GHOSTSCRIPT_PORT?=	print/ghostscript-gnu
-.endif
 .else
-GHOSTSCRIPT_PORT?=	print/ghostscript-gnu
+GHOSTSCRIPT_PORT?=	print/ghostscript-gpl
 .endif
 .else
 .if defined(WITH_GHOSTSCRIPT_AFPL)
-.if ${WITH_GHOSTSCRIPT_AFPL} == yes
 GHOSTSCRIPT_PORT?=	print/ghostscript-afpl-nox11
-.else
+.elif defined(WITH_GHOSTSCRIPT_GNU)
 GHOSTSCRIPT_PORT?=	print/ghostscript-gnu-nox11
-.endif
 .else
-GHOSTSCRIPT_PORT?=	print/ghostscript-gnu-nox11
+GHOSTSCRIPT_PORT?=	print/ghostscript-gpl-nox11
 .endif
 .endif
 
@@ -2898,6 +2928,7 @@
 ################################################################
 .if (!defined(OPTIONS) || defined(CONFIG_DONE) || \
 	defined(PACKAGE_BUILDING) || defined(BATCH) || \
+	defined(NO_OPTIONS) || \
 	exists(${_OPTIONSFILE}) || exists(${_OPTIONSFILE}.local))
 _OPTIONS_OK=yes
 .endif
@@ -4991,7 +5022,7 @@
 
 .if !target(config)
 config:
-.if !defined(OPTIONS)
+.if defined(NO_OPTIONS) || !defined(OPTIONS)
 	@${ECHO_MSG} "===> No options to configure"
 .else
 .if ${OPTIONSFILE} != ${_OPTIONSFILE}
@@ -5078,14 +5109,14 @@
 
 .if !target(config-conditional)
 config-conditional:
-.if defined(OPTIONS) && !exists(${_OPTIONSFILE})
+.if !defined(NO_OPTIONS) && defined(OPTIONS) 
&& !exists(${_OPTIONSFILE})
 	cd ${.CURDIR} && ${MAKE} config;
 .endif
 .endif
 
 .if !target(showconfig)
 showconfig:
-.if defined(OPTIONS) && exists(${_OPTIONSFILE})
+.if !defined(NO_OPTIONS) && defined(OPTIONS) && exists(${_OPTIONSFILE})
 	@${ECHO_MSG} "===> The following configuration options are set for 
${PKGNAME}:"
 	- at if [ -e ${_OPTIONSFILE} ]; then \
 		. ${_OPTIONSFILE}; \
@@ -5117,7 +5148,7 @@
 
 .if !target(rmconfig)
 rmconfig:
-.if defined(OPTIONS) && exists(${_OPTIONSFILE})
+.if !defined(NO_OPTIONS) && defined(OPTIONS) && exists(${_OPTIONSFILE})
 	-@${ECHO_MSG} "===> Removing user-configured options for ${PKGNAME}"; 
\
 	if [ `${ID} -u` != 0 -a "x${INSTALL_AS_USER}" = "x" ]; then \
 		${ECHO_MSG} "===> Switching to root credentials to remove 
${_OPTIONSFILE} and `${DIRNAME} ${_OPTIONSFILE}`"; \
Index: mail/courier-imap/Makefile
===================================================================
RCS file: /home/cvs/freebsd/ports/mail/courier-imap/Makefile,v
retrieving revision 1.98
diff -u -r1.98 Makefile
--- mail/courier-imap/Makefile	16 May 2005 17:20:34 -0000	1.98
+++ mail/courier-imap/Makefile	18 May 2005 15:52:51 -0000
@@ -115,7 +115,7 @@
 CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" \
 		LDFLAGS="${LDFLAGS}"
 LDFLAGS+=	-L${LOCALBASE}/lib
-LIB_DEPENDS+=	fam.0:${PORTSDIR}/devel/fam
+LIB_DEPENDS+=	${FAM_LIB}:${FAM_PORT}
 .endif
 
 .if defined(WITH_DRAC)



More information about the freebsd-ports-bugs mailing list