Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Mar 2006 18:25:23 +0300
From:      Boris Samorodov <bsam@ipt.ru>
To:        freebsd-emulation@FreeBSD.org
Subject:   [patch] for bsd.linux-rpm.mk (add auto sources fetching)
Message-ID:  <39907788@serv3.int.kfs.ru>

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

Hi!


Many of the linux ports doesn't deal with the source files. The
proposed patch to bsd.linux-rpm.mk resolve this problem. Only the
source distname must be added to the port's distfile. All fetching is
made automagically at FreeBSD portbuilding server farm.

Note: the patch may fetch only single source file. Well, the majority
of the linux ports match this rule...

Comments are welcome.


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

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=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 17:30:47 2006
@@ -12,6 +12,7 @@
 RPM2CPIO?=			${LOCALBASE}/bin/rpm2cpio
 
 EXTRACT_SUFX?=		.${LINUX_RPM_ARCH}.rpm
+SRC_SUFX?=		.src.rpm
 
 USE_LINUX?=			yes
 USE_LINUX_PREFIX=	yes
@@ -36,6 +37,8 @@
 MASTER_SITES?=			${MASTER_SITE_FEDORA_LINUX}
 MASTER_SITE_SUBDIR?=	3/${LINUX_RPM_ARCH}/os/Fedora/RPMS/
 PKGNAMEPREFIX?=			linux-
+DISTFILES?=		${DISTNAME}${EXTRACT_SUFX}
+DIST_SUBDIR?=		rpm
 
 EXTRACT_DEPENDS+=		${RPM2CPIO}:${PORTSDIR}/archivers/rpm
 
@@ -85,6 +108,24 @@
 		${FIND} * ! type d | ${SORT} > ${PLIST}.new; \
 		${FIND} -d * -type d | ${SED} -e 's|^|@dirrm |' >> ${PLIST}.new; \
 	done
+.  endif
+
+# GPL insists on having sources along with binary packages
+# Source distribution files *must* be defined at the port's distfile
+# to build package at FreeBSD build package servers
+#
+# XXX Change me:
+#     this code works only for ports with single src file!
+#     For multiple src files one should use the same technique,
+#     define DISTFILES at the port's Makefile and define
+#     AUTO_LINUX_SRC= no
+
+AUTO_LINUX_SRC?=	yes
+
+.  if defined(PACKAGE_BUILDING) && ${AUTO_LINUX_SRC} == "yes"
+DISTFILES+=		${DISTNAME}${SRC_SUFX}
+MASTER_SITE_SUBDIR+=	3/SRPMS
+ALWAYS_KEEP_DISTFILES=	yes
 .  endif
 
 .endif

--=-=-=--



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