Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Mar 2006 02:20:21 +0300
From:      Boris Samorodov <bsam@ipt.ru>
To:        freebsd-emulation@FreeBSD.org
Subject:   [patch] for bsd.linux-rpm.mk (BRANDELF_XXX and DIST_SUBDIR)
Message-ID:  <93516938@ho.ipt.ru>

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

Hi!


The patch may help a lot to transfer linux ports to use USE_LINUX_RPM:

1. Most of the ports use distfiles/rpm directory for distfiles. So line
   "DIST_SUBDIR?= rpm" may be useful.

2. Many ports install linux binaries. BRANDELF_DIRS and BRANDELF_FILES
   may be used to simplify the task. Branding is done relative to
   WRKSRC and then files are installed. For example for
   graphics/linux-tiff we may use BRANDELF_DIRS=
   usr/bin. BRANDELF_FILES may be useful to select exact files
   (i.e. from library directories).


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=linux-rpm.patch
Content-Description: patch for bsd.linux-rpm.mk

--- bsd.linux-rpm.mk.orig	Wed Jan 25 20:41:34 2006
+++ bsd.linux-rpm.mk	Thu Mar 16 00:52:40 2006
@@ -36,6 +36,7 @@
 MASTER_SITES?=			${MASTER_SITE_FEDORA_LINUX}
 MASTER_SITE_SUBDIR?=	3/${LINUX_RPM_ARCH}/os/Fedora/RPMS/
 PKGNAMEPREFIX?=			linux-
+DIST_SUBDIR?=		rpm
 
 EXTRACT_DEPENDS+=		${RPM2CPIO}:${PORTSDIR}/archivers/rpm
 
@@ -45,6 +46,9 @@
 
 MD5_FILE?=				${MASTERDIR}/distinfo.${LINUX_RPM_ARCH}
 
+BRANDELF_DIRS?=
+BRANDELF_FILES?=
+
 .  if defined(AUTOMATIC_PLIST)
 
 .    if ${USE_LINUX} == "8" || ${USE_LINUX:L} == "yes"
@@ -71,6 +75,14 @@
 
 .  if !target(do-install)
 do-install:
+.	if ${BRANDELF_DIRS}
+		@cd ${WRKSRC} && ${FIND} ${BRANDELF_DIRS} -type f -print0 \
+		| ${XARGS} -0 ${FILE} | ${GREP} ELF | ${CUT} -d : -f 1 \
+		| ${XARGS} ${BRANDELF} -t Linux
+.	endif
+.	if ${BRANDELF_FILES}
+		@cd ${WRKSRC} && ${BRANDELF} -t Linux ${BRANDELF_FILES}
+.	endif
 	cd ${WRKSRC} && ${FIND} * -type d -exec ${MKDIR} "${PREFIX}/{}" \;
 	cd ${WRKSRC} && ${FIND} * ! -type d | ${CPIO} -pm -R root:wheel ${PREFIX}
 .  endif

--=-=-=


Comments are welcome.


WBR
-- 
Boris B. Samorodov, Research Engineer
InPharmTech Co,     http://www.ipt.ru
Telephone & Internet Service Provider

--=-=-=--



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