Subject: suse_* packages support for more OSes.
To: None <>
From: Juan RP <>
List: tech-pkg
Date: 09/12/2003 02:41:23
Content-Type: text/plain; Format=Flowed; DelSp=Yes; charset=ISO-8859-15
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

Hi people, these days I've been playing with FreeBSD and pkgsrc, and I would  
like to add support of FreeBSD/OpenBSD for the suse_* packages. My fix
was really easy, we have to change on suse_base/Makefile, /emul/$emul to
/compat/$emul (INSTALL), and modify the Makefile.application of suse_linux.  
FreeBSD needs to use an utilitity to change the ELF OS ABI header "brandelf 
(1)", with this patch all that you need to do will be to add another variable  
to the Makefile of any linux package, i.e:

FIX_LINUX_BINS=	bin/quake3arena

Perhaps this patch is not very useful, but it can give some ideas, about what  
we need to add to these packages to make this work on more Operating Systems.

Comments ?

Juan RP
<juan AT xtraeme DOT UnixBSD DOT org>

Content-Type: text/x-patch; charset=unknown-8bit
Content-Disposition: attachment; filename="suse_linux.patch"

RCS file: /cvsroot/pkgsrc/mk/,v
retrieving revision 1.23
diff -b -u -r1.23
---	2003/09/02 06:59:45	1.23
+++	2003/09/12 00:23:23
@@ -147,6 +147,11 @@
 SERIAL_DEVICES?=	/dev/null
+# Linux compatibility values
+BRANDELF=		/usr/bin/brandelf
 # check for kqueue(2) support
 .if exists(/usr/include/sys/event.h)
 PKG_HAVE_KQUEUE=	# defined
Index: Makefile.application
RCS file: /cvsroot/pkgsrc/emulators/suse_linux/Makefile.application,v
retrieving revision 1.10
diff -b -u -r1.10 Makefile.application
--- Makefile.application	2003/09/04 08:21:52	1.10
+++ Makefile.application	2003/09/12 00:23:46
@@ -4,6 +4,15 @@
 .if ${OPSYS} == "NetBSD" && (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc")
 LINUX_KERNEL_OSRELEASE!=	(/sbin/sysctl -n emul.linux.kern.osrelease 2>/dev/null; ${ECHO} 2.0.38) | ${HEAD} -1
+.elif ${OPSYS} == "FreeBSD"
+LINUX_KERNEL_OSRELEASE!=        (/sbin/sysctl -n compat.linux.osrelease 2>/dev/null; ${ECHO} 2.0.38) | ${HEAD} -1
+.if !target(post-install)
+.for F in ${FIX_LINUX_BINS}
 .  if ${LINUX_KERNEL_OSRELEASE} == "2.0.38"