On Wed, Oct 28, 2015 at 3:50 AM, Mohammad-Hosein keshavarz
<[email protected]> wrote:
> Hi,
> i tried to add net-snmp support to Image with supplied ltib for freescale
> mpc8308 but by adding net-snmp in ltib --config the build will stop in
> compiling supplied net-snmp package.
> so i changed the package with latest version from net-snmp website and
> changed the name to match previous version and also changed the .md5 file so
> that ltib can compile net-snmp. in this case it succeeded but when executing
> snmpd in target it gives error:
>
> ./snmpd: error while loading shared libraries: /lib/libnetsnmpagent.so.30:
> invalid ELF header

Hi,

Try the attached v5.6.1.1 spec and patches I've used for for mpc837x.
I haven't up-streamed since I wanted to do some enhancements to the
build for multiple platforms (and time).

Though, looking at it, one difference that might be relevant is the
clearing the MAKEFLAGS in the install stage.

MAKEFLAGS=""; ...



> OR!
>
> snmpd: error while loading shared libraries: libnetsnmpagent.so.30: cannot
> open shared object file: No such file or directory
>
> then i cross-compiled the package in my host ubuntu14.04 with supplied cross
> toolchain and copied the library file to target to replace the bad file.
> result was another error:
>
> libnetsnmpmibs.so.30: undefined symbol: usmDESPrivProtocol
>
> so i copied all of net-snmp shared libraries and i faced another error:
>
> snmpd: /lib/libc.so.6: version `GLIBC_2.15' not found (required by
> /usr/lib/libnetsnmp.so.30)
> snmpd: /lib/libc.so.6: version `GLIBC_2.7' not found (required by
> /usr/lib/libnetsnmp.so.30)
> snmpd: /lib/libc.so.6: version `GLIBC_2.17' not found (required by
> /usr/lib/libnetsnmp.so.30)
>
> what should i do? is there anyway to add net-snmp support without such odd
> actions?! if not what is the correct way?
>
>
> _______________________________________________
> LTIB home page: http://ltib.org
>
> Ltib mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/ltib
>
%define pfx /opt/freescale/rootfs/%{_target_cpu}

Summary         : Net-SNMP
Name            : net-snmp
Version         : 5.6.1.1
Release         : 1
License         : BSD and BSD-like
Vendor          : Freescale
Packager        : Michael Barkowski
Group           : Networking
URL             : http://net-snmp.sourceforge.net
Source          : %{name}-%{version}.tar.gz
Patch1          : net-snmp-5.6.1.1-1313009928.patch
Patch2          : net-snmp-5.6.1.1-hist_disable_for_quote.patch
BuildRoot       : %{_tmppath}/%{name}
Prefix          : %{pfx}

%Description
%{summary}

%Prep
%setup
%patch1 -p1 
%patch2 -p1 

%Build

./configure --prefix=%{_prefix} --host=$CFGHOST --build=%{_build} --without-kmem-usage  \
--disable-scripts --disable-embedded-perl --disable-perl-cc-checks \
--without-perl-modules --with-transports=UDP --sysconfdir=/etc/ \
--localstatedir=/var/lib/ --without-rpm --with-endianness=big --with-persistent-directory=/var/lib/net-snmp \
[email protected] --with-logfile=/var/log/snmp.log --with-sys-location=Unknown \
--with-default-snmp-version=2 --with-mib-modules="agentx" --with-out-mib-modules="snmpv3mibs hardware host" \
--with-mibdirs=/usr/share/snmp/mibs

MAKEFLAGS=""; make

%Install
rm -rf $RPM_BUILD_ROOT
MAKEFLAGS=""; make install DESTDIR=$RPM_BUILD_ROOT/%{pfx}
find ./ -name "*.la" | xargs sed -i -e "s;%{_prefix};$RPM_BUILD_ROOT/%{pfx}%{_prefix};"
MAKEFLAGS=""; make install DESTDIR=$RPM_BUILD_ROOT/%{pfx}
find $RPM_BUILD_ROOT/%{pfx}/%{_prefix}/lib/ -name "*.la" | xargs rm -f

%Clean
rm -rf $RPM_BUILD_ROOT

%Files
%defattr(-,root,root)
%{pfx}/*
diff --exclude CVS -uNr net-snmp-5.6.1.1/man/Makefile.in net-snmp-5.6.1.1.modified/man/Makefile.in
--- net-snmp-5.6.1.1/man/Makefile.in	2010-10-11 13:58:15.000000000 -0400
+++ net-snmp-5.6.1.1.modified/man/Makefile.in	2011-08-10 16:58:29.000000000 -0400
@@ -269,7 +269,7 @@
 #	   if test `wc -l $$i | awk '{print $$1}'` != 1 ; then \
 		   base=`echo $$i | sed 's/.[0-9]$$//;'` ; \
 		   echo "<HTML><BODY bgcolor=\"#ffffff\" background=\"../ucd-snmp-bg3.gif\"><PRE>" > $$base.html; \
-		   man2html -r ./$$i | $(PERL) -p -e 's/HREF=\"..\/man.\//HREF=\"/g;s/\.[1-9]\.html/.html/g;' | grep -v 'Content-type:' >> $$base.html; \
+		   man2html -r ./$$i | $(PERL) -p -e 's/HREF=\"..\/man.\//HREF=\"/g;s/\.[1-9]\.html/.html/g;' | @EGREP@ -v 'Content-type:' >> $$base.html; \
 		   a="$$a $$i"; \
 #	   fi ; \
 	done ;\
%define pfx /opt/freescale/rootfs/%{_target_cpu}

Summary         : Net-SNMP
Name            : net-snmp
Version         : 5.6.1.1
Release         : 1
License         : BSD and BSD-like
Vendor          : Freescale
Packager        : Michael Barkowski
Group           : Networking
URL             : http://net-snmp.sourceforge.net
Source          : %{name}-%{version}.tar.gz
Patch1          : net-snmp-5.6.1.1-1313009928.patch
Patch2          : net-snmp-5.6.1.1-hist_disable_for_quote.patch
BuildRoot       : %{_tmppath}/%{name}
Prefix          : %{pfx}

%Description
%{summary}

%Prep
%setup
%patch1 -p1 
%patch2 -p1 

%Build

./configure --prefix=%{_prefix} --host=$CFGHOST --build=%{_build} --without-kmem-usage  \
--disable-scripts --disable-embedded-perl --disable-perl-cc-checks \
--without-perl-modules --with-transports=UDP --sysconfdir=/etc/ \
--localstatedir=/var/lib/ --without-rpm --with-endianness=big --with-persistent-directory=/var/lib/net-snmp \
[email protected] --with-logfile=/var/log/snmp.log --with-sys-location=Unknown \
--with-default-snmp-version=2 --with-mib-modules="agentx" --with-out-mib-modules="snmpv3mibs hardware host" \
--with-mibdirs=/usr/share/snmp/mibs

MAKEFLAGS=""; make

%Install
rm -rf $RPM_BUILD_ROOT
MAKEFLAGS=""; make install DESTDIR=$RPM_BUILD_ROOT/%{pfx}
find $RPM_BUILD_ROOT/%{pfx}/%{_prefix}/lib/ -name "*.la" | xargs rm -f

%Clean
rm -rf $RPM_BUILD_ROOT

%Files
%defattr(-,root,root)
%{pfx}/*
_______________________________________________
LTIB home page: http://ltib.org

Ltib mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/ltib

Reply via email to