Skip site navigation (1)Skip section navigation (2)
Date:      Wed,  4 Aug 2004 14:22:54 +0100 (IST)
From:      Conor McDermottroe <ports@mcdermottroe.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/69997: [PATCH] Change USE_LINUX in bsd.port.mk to allow choice between linux_base ports
Message-ID:  <20040804132254.346D02259@mcdermc.mcdermottroe.com>
Resent-Message-ID: <200408041330.i74DUMAB015512@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         69997
>Category:       ports
>Synopsis:       [PATCH] Change USE_LINUX in bsd.port.mk to allow choice between linux_base ports
>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:   Wed Aug 04 13:30:22 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Conor McDermottroe
>Release:        FreeBSD 5.2.1-RELEASE-p9 i386
>Organization:
>Environment:
System: FreeBSD mcdermc 5.2.1-RELEASE-p9 FreeBSD 5.2.1-RELEASE-p9 #2: Fri Jul 23 01:05:07 IST 2004 root@mcdermc:/usr/obj/usr/src/sys/MCDERMC i386


	
>Description:
	Any port which defines USE_LINUX depends on emulators/linux_base, and does so by depending on a file ${LINUXBASE}/etc/redhat-release. This file is not in emulators/linux_base-debian or emulators/linux_base-gentoo-stage1 and hence these ports can't be used to fulfill the dependency. The following patch aims to fix this. This patch also allows ports to depend on particular flavours of linux (USE_LINUX=redhat depends on any of the redhat-based ones, defaulting to emulators/linux_base, USE_LINUX=redhat8 depends on emulators/linux_base-8, etc).

	Since this patch has the potential to break lots of ports if I've screwed up, I'd appreciate any feedback/comments/abuse that anyone can give. The only immediate problem I can see is for ports that specifically require RedHat stuff and will need to be changed from USE_LINUX=yes to USE_LINUX=redhat. Is there any useful automatic way of finding most of these?
>How-To-Repeat:
	cd /usr/ports/emulators/linux_base-debian ; make install
	cd /usr/ports/www/linux-flashplugin6; make install
>Fix:

--- bsd.port.mk	Fri Jul 30 09:35:54 2004
+++ bsd.port.mk.new	Mon Aug  2 02:55:49 2004
@@ -324,7 +324,20 @@
 #					  (Only 3 is currently supported).  Implies inclusion
 #					  of bsd.kde.mk.  Default: not set.
 #
-# USE_LINUX			- Set to yes to say the port needs emulators/linux_base.
+# USE_LINUX			- Define to say that the port requires one of
+#					  emulators/linux_base*.
+#
+#					  redhat6			emulators/linux_base-6
+#					  redhat7			emulators/linux_base
+#					  redhat8			emulators/linux_base-8
+#					  redhat			Tries to autodetect redhat{6,7,8},
+#										defaults to redhat7
+#					  debian			emulators/linux_base-debian
+#					  gentoo			emulators/linux_base-gentoo-stage1
+#					  <anything else>	Tries to autodetect the currently
+#										installed linux base. Defaults to
+#										emulators/linux_base
+#
 #					  Default: not set.
 # USE_LINUX_PREFIX	- controls the action of PREFIX (see above).
 #
@@ -1038,7 +1051,7 @@
 USE_XLIB=		yes
 .endif
 .if defined(USE_LINUX_PREFIX)
-USE_LINUX=		yes
+USE_LINUX?=		yes
 .endif
 .if defined(USE_X_PREFIX)
 PREFIX?=		${X11BASE}
@@ -1380,7 +1393,51 @@
 .endif
 
 .if defined(USE_LINUX)
-RUN_DEPENDS+=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base
+.	if ${USE_LINUX} == "redhat6"
+		RUN_DEPENDS+=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base-6
+.	elif ${USE_LINUX} == "redhat7"
+		RUN_DEPENDS+=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base
+.	elif ${USE_LINUX} == "redhat8"
+		RUN_DEPENDS+=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base-8
+.	elif ${USE_LINUX} == "debian"
+		RUN_DEPENDS+=	${LINUXBASE}/etc/debian_version:${PORTSDIR}/emulators/linux_base-debian
+.	elif ${USE_LINUX} == "gentoo"
+		RUN_DEPENDS+=	${LINUXBASE}/etc/gentoo-release:${PORTSDIR}/emulators/linux_base-gentoo-stage1
+.	elif ${USE_LINUX} == "redhat"
+.		if exists(${LINUXBASE}/etc/redhat-release)
+			USE_LINUX_REDHAT_VERSION!=	cut -d" " -f5 ${LINUXBASE}/etc/redhat-release
+.			if ${USE_LINUX_REDHAT_VERSION} == "6.1"
+				RUN_DEPENDS+=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base-6
+.			elif ${USE_LINUX_REDHAT_VERSION} == "7.1"
+				RUN_DEPENDS+=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base
+.			elif ${USE_LINUX_REDHAT_VERSION} == "8.0"
+				RUN_DEPENDS+=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base-8
+.			else
+				RUN_DEPENDS+=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base
+.			endif
+.		else
+			RUN_DEPENDS+=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base
+.		endif
+.	else
+.		if exists(${LINUXBASE}/etc/redhat-release)
+			USE_LINUX_REDHAT_VERSION!=	cut -d" " -f5 ${LINUXBASE}/etc/redhat-release
+.			if ${USE_LINUX_REDHAT_VERSION} == "6.1"
+				RUN_DEPENDS+=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base-6
+.			elif ${USE_LINUX_REDHAT_VERSION} == "7.1"
+				RUN_DEPENDS+=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base
+.			elif ${USE_LINUX_REDHAT_VERSION} == "8.0"
+				RUN_DEPENDS+=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base-8
+.			else
+				RUN_DEPENDS+=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base
+.			endif
+.		elif exists(${LINUXBASE}/etc/debian_version)
+			RUN_DEPENDS+=	${LINUXBASE}/etc/debian_version:${PORTSDIR}/emulators/linux_base-debian
+.		elif exists(${LINUXBASE}/etc/gentoo-release)
+			RUN_DEPENDS+=	${LINUXBASE}/etc/gentoo-release:${PORTSDIR}/emulators/linux_base-gentoo-stage1
+.		else
+			RUN_DEPENDS+=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base
+.		endif
+.	endif
 .endif
 
 .if defined(USE_MOTIF)
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040804132254.346D02259>