<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>202606</bug_id>
          
          <creation_ts>2007-12-17 18:47 0000</creation_ts>
          <short_desc>app-emulation/kqemu ~x86-fbsd keyword request (w/ patch)</short_desc>
          <delta_ts>2007-12-18 09:21:08 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>FreeBSD</op_sys>
          <bug_status>NEW</bug_status>
          
          
          
          <keywords>KEYWORDREQ</keywords>
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>f.mensik@tiscali.cz</reporter>
          <assigned_to>bsd@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>f.mensik@tiscali.cz</who>
            <bug_when>2007-12-17 18:47:47 0000</bug_when>
            <thetext>hi,
I&apos;ve updated kqemu-1.3.0_pre11.ebuild file to be built on Gentoo/FreeBSD x86.
Here are 2 patches:
1.patch is patched kqemu-1.3.0_pre11.ebuild file
2.patch is &apos;kqemu-1.3.0_pre11-Makefile.patch&apos; file which must be placed into app-emulation/kqemu/files directory:

--- kqemu-1.3.0_pre11.ebuild	2007-11-19 11:46:42 +0100
+++ kqemu-1.3.0_pre11.ebuild.new	2007-12-15 00:44:05 +0100
@@ -23,13 +23,16 @@
 
 pkg_setup() {
         MODULE_NAMES=&quot;kqemu(misc:${S})&quot;
-        linux-mod_pkg_setup
+        [ &quot;${KERNEL}&quot; = &quot;linux&quot; ] &amp;&amp; linux-mod_pkg_setup
 }
 
 src_unpack() {
         unpack ${A}
         cd ${S}
         epatch ${FILESDIR}/${P}-sched_h.patch
+        if [ &quot;${KERNEL}&quot; = &quot;FreeBSD&quot; ]; then
+                epatch ${FILESDIR}/${P}-Makefile.patch
+        fi
         sed -i &apos;s:MODULE_PARM(\([^,]*\),&quot;i&quot;);:module_param(\1, int, 0);:&apos; kqemu-linux.c
 }
 
@@ -43,27 +46,42 @@
         ./configure --kernel-path=&quot;${KV_DIR}&quot; \
                 || die &quot;could not configure&quot;
 
-        make
+        if [ &quot;${KERNEL}&quot; = &quot;FreeBSD&quot; ]; then
+                gmake -C common all
+                MAKE=make
+                emake -f Makefile.freebsd
+        else
+                make
+        fi
 }
 
 src_install() {
-        linux-mod_src_install
-
-        # udev rule
-        dodir /etc/udev/rules.d/
-        echo &apos;KERNEL==&quot;kqemu*&quot;, NAME=&quot;%k&quot;, GROUP=&quot;qemu&quot;, MODE=&quot;0660&quot;&apos; &gt; ${D}/etc/udev/rules.d/48-qemu.rules
+        if [ &quot;${KERNEL}&quot; = &quot;linux&quot; ]; then
+                linux-mod_src_install
+        else
+                insinto /boot/modules
+                doins &quot;${S}&quot;/kqemu.kld
+                exeinto /boot/modules
+                doexe &quot;${S}&quot;/kqemu.ko
+        fi
+
+        if [ &quot;${KERNEL}&quot; = &quot;linux&quot; ]; then
+                # udev rule
+                dodir /etc/udev/rules.d/
+                echo &apos;KERNEL==&quot;kqemu*&quot;, NAME=&quot;%k&quot;, GROUP=&quot;qemu&quot;, MODE=&quot;0660&quot;&apos; &gt; ${D}/etc/udev/rules.d/48-qemu.rules
+
+                # module params
+                dodir /etc/modules.d
+                echo &quot;options kqemu major=0&quot; &gt; ${D}/etc/modules.d/kqemu
+        fi
 
         # Module doc
         dodoc ${S}/README
         dohtml ${S}/kqemu-doc.html
-
-        # module params
-        dodir /etc/modules.d
-        echo &quot;options kqemu major=0&quot; &gt; ${D}/etc/modules.d/kqemu
 }
 
 pkg_postinst() {
-        linux-mod_pkg_postinst
+        [ &quot;${KERNEL}&quot; = &quot;linux&quot; ] &amp;&amp; linux-mod_pkg_postinst
         enewgroup qemu
         elog &quot;Make sure you have the kernel module loaded before running qemu&quot;
         elog &quot;and your user is in the &apos;qemu&apos; group&quot;


--- common/Makefile	2007-02-06 22:02:00 +0100
+++ common/Makefile.new	2007-12-15 00:05:00 +0100
@@ -41,7 +41,7 @@
 endif
 
 DEFINES=-D__KERNEL__
-INCLUDES=-nostdinc -iwithprefix include -I. -I..
+INCLUDES=-nostdinc -iwithprefix include -I. -I.. -I/usr/include
 TOOLS_CFLAGS=-Wall -O2 -Werror -g
 COMMON_CFLAGS=-Wall -O2 -fomit-frame-pointer -fno-strict-aliasing -Werror 
 ifeq ($(ARCH), x86_64)


Reproducible: Always</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2007-12-18 09:21:08 0000</bug_when>
            <thetext>Please don&apos;t paste patches inline next time, it kills formatting. We have attachments for this.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>