From owner-freebsd-emulation@FreeBSD.ORG Wed Mar 15 23:37:15 2006 Return-Path: X-Original-To: freebsd-emulation@FreeBSD.org Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 65F8016A422 for ; Wed, 15 Mar 2006 23:37:15 +0000 (UTC) (envelope-from bsam@ipt.ru) Received: from mail.ipt.ru (mail.ipt.ru [80.253.10.82]) by mx1.FreeBSD.org (Postfix) with ESMTP id 13EAD43D6D for ; Wed, 15 Mar 2006 23:37:12 +0000 (GMT) (envelope-from bsam@ipt.ru) Received: from bsam by ipt.ru with local (Exim 4.60 (FreeBSD)) (envelope-from ) id 1FJfHx-0003TO-Jz for freebsd-emulation@FreeBSD.org; Thu, 16 Mar 2006 02:20:21 +0300 To: freebsd-emulation@FreeBSD.org From: Boris Samorodov Date: Thu, 16 Mar 2006 02:20:21 +0300 Message-ID: <93516938@ho.ipt.ru> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: Subject: [patch] for bsd.linux-rpm.mk (BRANDELF_XXX and DIST_SUBDIR) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Mar 2006 23:37:15 -0000 --=-=-= 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 --=-=-=--