- another attempt to fix multilib issue. Generate dummy net-snmp-config.h

file
This commit is contained in:
Radek Vokál 2006-05-24 14:18:43 +00:00
parent 602b517d7f
commit 3daa611e5b
2 changed files with 57 additions and 10 deletions

30
net-snmp-config.h Normal file
View File

@ -0,0 +1,30 @@
/* This file is here to prevent a file conflict on multiarch systems. A
* conflict will frequently occur because arch-specific build-time
* configuration options are stored (and used, so they can't just be stripped
* out) in net-snmp-config.h. The original net-snmp-config.h has been renamed.
* DO NOT INCLUDE THE NEW FILE DIRECTLY -- ALWAYS INCLUDE THIS ONE INSTEAD. */
#ifdef net-snmp-config_multilib_redirection_h
#error "Do not define net-snmp-config_multilib_redirection_h!"
#endif
#define net-snmp-config_multilib_redirection_h
#if defined(__i386__)
#include "net-snmp-config-i386.h"
#elif defined(__ia64__)
#include "net-snmp-config-ia64.h"
#elif defined(__powerpc64__)
#include "net-snmp-config-ppc64.h"
#elif defined(__powerpc__)
#include "net-snmp-config-ppc.h"
#elif defined(__s390x__)
#include "net-snmp-config-s390x.h"
#elif defined(__s390__)
#include "net-snmp-config-s390.h"
#elif defined(__x86_64__)
#include "net-snmp-config-x86_64.h"
#else
#error "This net-snmp-devel package does not work your architecture?"
#endif
#undef net-snmp-config_multilib_redirection_h

View File

@ -1,9 +1,12 @@
%{!?tcp_wrappers:%define tcp_wrappers 1} %{!?tcp_wrappers:%define tcp_wrappers 1}
# Arches on which we need to prevent arch conflicts on net-snmp-config.h
%define multilib_arches %{ix86} ia64 ppc ppc64 s390 s390x x86_64
Summary: A collection of SNMP protocol tools and libraries. Summary: A collection of SNMP protocol tools and libraries.
Name: net-snmp Name: net-snmp
Version: 5.3.1.pre2 Version: 5.3.1.pre2
Release: 1 Release: 2
License: BSDish License: BSDish
Group: System Environment/Daemons Group: System Environment/Daemons
@ -14,6 +17,7 @@ Source2: net-snmpd.init
Source3: net-snmptrapd.init Source3: net-snmptrapd.init
Source4: net-snmpd.logrotate Source4: net-snmpd.logrotate
Source5: ucd5820stat Source5: ucd5820stat
Source6: net-snmp-config.h
Patch1: ucd-snmp-4.2.4.pre3-mnttab.patch Patch1: ucd-snmp-4.2.4.pre3-mnttab.patch
Patch2: net-snmp-5.0.6-syslog.patch Patch2: net-snmp-5.0.6-syslog.patch
Patch4: net-snmp-5.0.6-libtool.patch Patch4: net-snmp-5.0.6-libtool.patch
@ -185,12 +189,26 @@ popd
rm -rf ${RPM_BUILD_ROOT} rm -rf ${RPM_BUILD_ROOT}
%makeinstall ucdincludedir=${RPM_BUILD_ROOT}/usr/include/ucd-snmp %makeinstall ucdincludedir=${RPM_BUILD_ROOT}/usr/include/ucd-snmp
# remove .la files
%ifarch x86_64 s390x # Determine which arch opensslconf.h is going to try to #include.
mv ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config64 basearch=%{_arch}
mv ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp-config.h ${RPM_BUILD_ROOT}/%{_includedir}/net-snmp-config64.h %ifarch %{ix86}
basearch=i386
%endif %endif
%ifnarch %{ix86}
mv ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config ${RPM_BUILD_ROOT}/%{_bindir}/net-snmp-config-${basearch}
%endif
%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}/%{_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
# remove .la files
rm ${RPM_BUILD_ROOT}%{_libdir}/*.la rm ${RPM_BUILD_ROOT}%{_libdir}/*.la
install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp install -d ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp
@ -311,11 +329,7 @@ rm -rf ${RPM_BUILD_ROOT}
%{_libdir}/lib*.so %{_libdir}/lib*.so
/usr/include/* /usr/include/*
%attr(0644,root,root) %{_mandir}/man3/*.3.* %attr(0644,root,root) %{_mandir}/man3/*.3.*
%ifarch x86_64 s390x %attr(0755,root,root) %{_bindir}/net-snmp-config*
%attr(0755,root,root) %{_bindir}/net-snmp-config64
%else
%attr(0755,root,root) %{_bindir}/net-snmp-config
%endif
%files perl -f perl.lst %files perl -f perl.lst
%defattr(-,root,root) %defattr(-,root,root)
@ -329,6 +343,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_libdir}/*.a %{_libdir}/*.a
%changelog %changelog
* Wed May 24 2006 Radek Vokal <rvokal@redhat.com> 5.3.1.pre2-2
- another attempt to fix multilib issue. Generate dummy net-snmp-config.h file
* Tue May 23 2006 Radek Vokal <rvokal@redhat.com> 5.3.1.pre2-1 * Tue May 23 2006 Radek Vokal <rvokal@redhat.com> 5.3.1.pre2-1
- update to 5.3.1.pre2 - update to 5.3.1.pre2
- fix multilib issues (#192736) - fix multilib issues (#192736)