Bug 442881

Summary: Add Super-H(sh3,sh4) to supported archs in net-snmp-config
Product: [Fedora] Fedora Reporter: CHIKAMA Masaki <masaki.chikama>
Component: net-snmpAssignee: Jan Safranek <jsafrane>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: sh4   
OS: Linux   
Whiteboard:
Fixed In Version: net-snmp-5_4_1-15_fc10 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-24 13:57:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description CHIKAMA Masaki 2008-04-17 11:49:18 UTC
Description of problem:

 Add suport sh3,sh4 archs in net-snmp-config and net-snmp-config.h .
Also include diff against net-snmp.spec file. Without this patch,
the package that needs net-snmp-devel,such as 'nut', fails to compile.
Please apply.

 Thanks.


--- net-snmp-config.h.org       2008-04-16 20:32:26.000000000 +0900
+++ net-snmp-config.h   2008-04-16 20:21:55.000000000 +0900
@@ -25,6 +25,8 @@
 #include "net-snmp-config-x86_64.h"
 #elif defined(__alpha__)
 #include "net-snmp-config-alpha.h"
+#elif defined(__sh__)
+#include "net-snmp-config-sh.h"
 #else
 #error "net-snmp-devel package does not work on your architecture"
 #endif
--- net-snmp-config.org 2008-04-16 20:32:20.000000000 +0900
+++ net-snmp-config     2008-04-16 20:21:42.000000000 +0900
@@ -47,5 +47,13 @@
     net-snmp-config-alpha $*
     exit 0
 fi
+if [ "$arch" = "sh3" ] ; then
+    net-snmp-config-sh $*
+    exit 0
+fi
+if [ "$arch" = "sh4" ] ; then
+    net-snmp-config-sh $*
+    exit 0
+fi
 
 echo "Cannot determine architecture"
--- net-snmp.spec.org   2008-04-16 20:16:22.000000000 +0900
+++ net-snmp.spec       2008-04-16 20:24:57.000000000 +0900
@@ -211,6 +211,9 @@
 %ifarch %{ix86}
 basearch=i386
 %endif
+%ifarch sh3 sh4
+basearch=sh
+%endif
 
 mv ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config-${basearch}
 install -m 755 %SOURCE7 ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config

Comment 1 Jan Safranek 2008-04-23 13:30:09 UTC
From time to time I get request to add new platform and I am pretty confused
what these changes do... I understand that on multilib architectures it's
necessary to distinguish these two archs. But is your sh3 and sh4 multilib? I
doubt so.

IMHO it's time to rework the multilib stuff to apply only on multilib arches and
let the usual architectures, like your sh3, work without any changes in .spec -
because in few months will somebody else come and want me to add another special
architecture for his/her fridge or whatever.

Could you please test .src.rpm at http://people.redhat.com/jsafrane/bugs/442881/
? It should create -devel package with default net-snmp-config and
net-snmp-config.h if it gets compiled on unknown architecture and create the
special one only on multilib arch.

I'll put it into rawhide if it works. Thanks

Comment 2 CHIKAMA Masaki 2008-04-23 14:04:04 UTC
>But is your sh3 and sh4 multilib? I doubt so.
No. It's a separate arch. 
It can be multilib, but it's verly rare case.

I'll try your new package, but super-H is embeded arch and it's very slow.
So please don't wait my result when you go ahead.

Thanks.

Comment 3 Jan Safranek 2008-04-23 14:09:03 UTC
I think there is no rush, I'll rather wait for your results and release good
solution than fix bad one later.

Comment 4 CHIKAMA Masaki 2008-04-24 12:54:07 UTC
I backported the changes of multilib's part from net-snmp-5.4.1-15 to
net-snmp-5.4.1-4 (Fedora8's release version) and confirmed that
net-snmp-devel package can compile 'nut' package. 
(I'm in the middle of mass build of dist-f8 packages using mock and koji,
so I thought backporting is faster way to check your change.)

Thank you.

@@ -234,13 +232,13 @@
 basearch=i386
 %endif
 
-mv ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config-${basearch}
-install -m 755 %SOURCE7 ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
 
 %ifarch %{multilib_arches}
 # Do an net-snmp-config.h switcheroo to avoid file conflicts on systems where you
 # can have both a 32- and 64-bit version of the library, and they each need
 # their own correct-but-different versions of net-snmp-config.h to be usable.
+mv ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config-${basearch}
+install -m 755 %SOURCE7 ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config
 mv ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp-config.h
${RPM_BUILD_ROOT}/%{_includedir}/net-snmp-config-${basearch}.h
 install -m644 %SOURCE6 ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp-config.h
 %endif


Comment 5 Jan Safranek 2008-04-24 13:57:53 UTC
Thanks for feedback!