[Sysadmins] Особенная сборка net-snmp в ALT
Alexei Takaseev
alexei на taf.ru
Чт Сен 29 07:43:18 MSK 2016
Добрый день!
Требуется помощь зала в таком вопросе:
Имеется пакет net-snmp, который входит в состав монтроидального комбайна Zimbra.
Встала задача собрать пакет в ALT p8 именно с теми параметрами, какие нужны для зимбры
и никак иначе (пути расположения, библиотеки и тому подобное). Дело заткнулось вот на
вот таком:
==================
Executing: /bin/sh -e /usr/src/tmp/rpm-tmp.ngVneo
find-requires: running scripts (cpp,debuginfo,files,lib,pam,perl,pkgconfig,pkgconfiglib,python,rpmlib,shebang,shell,static,symlinks)
/usr/src/tmp/zimbra-net-snmp-buildroot/opt/zimbra/common/bin/fixproc syntax OK
/usr/src/tmp/zimbra-net-snmp-buildroot/opt/zimbra/common/bin/ipf-mod.pl syntax OK
# perl(SNMP.pm) at line 20 (depth 4) inside eval SKIP
# perl(NetSNMP/OID.pm) at line 21 (depth 4) inside eval SKIP
# perl(Term/ReadLine.pm) at line 1023 (depth 81) inside eval SKIP
/usr/src/tmp/zimbra-net-snmp-buildroot/opt/zimbra/common/bin/mib2c syntax OK
/usr/src/tmp/zimbra-net-snmp-buildroot/opt/zimbra/common/bin/net-snmp-cert syntax OK
Can't load '/usr/src/tmp/zimbra-net-snmp-buildroot/opt/zimbra/common/lib/perl5/x86_64-linux-thread-multi/auto/NetSNMP/default_store/default_store.so' for module NetSNMP::default_store: libnetsnmp.so.30: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 193.
at /usr/src/tmp/zimbra-net-snmp-buildroot/opt/zimbra/common/lib/perl5/x86_64-linux-thread-multi/SNMP.pm line 19.
Compilation failed in require at /usr/src/tmp/zimbra-net-snmp-buildroot/opt/zimbra/common/lib/perl5/x86_64-linux-thread-multi/SNMP.pm line 19.
BEGIN failed--compilation aborted at /usr/src/tmp/zimbra-net-snmp-buildroot/opt/zimbra/common/lib/perl5/x86_64-linux-thread-multi/SNMP.pm line 19.
Compilation failed in require at /usr/src/tmp/zimbra-net-snmp-buildroot/opt/zimbra/common/lib/perl5/x86_64-linux-thread-multi/NetSNMP/OID.pm line 20.
BEGIN failed--compilation aborted at /usr/src/tmp/zimbra-net-snmp-buildroot/opt/zimbra/common/lib/perl5/x86_64-linux-thread-multi/NetSNMP/OID.pm line 20.
Compilation failed in require at /usr/src/tmp/zimbra-net-snmp-buildroot/opt/zimbra/common/bin/snmp-bridge-mib line 28.
BEGIN failed--compilation aborted at /usr/src/tmp/zimbra-net-snmp-buildroot/opt/zimbra/common/bin/snmp-bridge-mib line 28.
# perl(NetSNMP/OID.pm) at line 28 (depth 3) not loaded at BEGIN SKIP
# /usr/src/tmp/zimbra-net-snmp-buildroot/opt/zimbra/common/bin/snmp-bridge-mib: deparse failed. isPerl=0.0649850084734715.
find-requires: ERROR: /usr/lib/rpm/perl.req failed
error: /bin/sh failed
error: Failed to find Requires
RPM build errors:
/bin/sh failed
Failed to find Requires
=================
Сборка пакета производится в хэшере вот таким спеком:
===
%define perl_archname %(perl -MConfig -e 'print $Config{archname}')
Summary: Zimbra's NetSNMP build
Name: zimbra-net-snmp
Version: 5.7.3
Release: alt0.M80P.1
License: BSD
Source: %{name}-%{version}.tar.gz
BuildRequires: libssl-devel
BuildRequires: perl-devel
Requires: perl
Requires: zimbra-net-snmp-libs = %{version}-%{release}
#AutoReqProv: no
URL: http://www.net-snmp.org/
Group: Zimbra
%set_verify_elf_method rpath=relaxed
%add_findprov_lib_path /opt/zimbra/common/lib
%add_perl_lib_path /opt/zimbra/common/lib/perl5
%description
The Zimbra NetSNMP build
%package libs
Summary: NetSNMP Libaries
Requires: zimbra-snmp-base
#AutoReqProv: no
Group: Zimbra
%add_findprov_lib_path /opt/zimbra/common/lib
%add_perl_lib_path /opt/zimbra/common/lib/perl5
%description libs
The zimbra-net-snmp-libs package contains the net-snmp libraries
%package devel
Summary: NetSNMP Development
Requires: zimbra-net-snmp-libs = %{version}-%{release}
#AutoReqProv: no
Group: Zimbra
%description devel
The zimbra-net-snmp-devel package contains the linking libraries and include files
%prep
%setup -n net-snmp-%{version}
%build
LDFLAGS="-Wl,-rpath,/opt/zimbra/common/lib"; export LDFLAGS; \
CFLAGS="-O2 -g"; export CFLAGS; \
./configure --prefix=/opt/zimbra/common \
--with-openssl \
--enable-shared \
--with-default-snmp-version=3 --with-sys-contact="admin" \
--with-sys-location="unknown" --with-logfile="/opt/zimbra/log/snmpd.log" \
--disable-embedded-perl \
--with-perl-modules="INSTALL_BASE=/opt/zimbra/common LIB=/opt/zimbra/common/lib/perl5 INSTALLSITEMAN3DIR=/opt/zimbra/common/share/man/man3" \
--with-persistent-directory="/opt/zimbra/data/snmp/persist" \
--localstatedir="/opt/zimbra/data/snmp/state"
make
%install
export PERL5LIB="/opt/zimbra/common/lib/perl5:/opt/zimbra/common/lib"
make install DESTDIR=${RPM_BUILD_ROOT}
rm -f %{buildroot}/opt/zimbra/common/lib/perl5/%{perl_archname}/perllocal.pod
rm -f %{buildroot}/opt/zimbra/common/lib/perl5/%{perl_archname}/auto/*/*/.packlist
%files
%defattr(-,root,root)
/opt/zimbra/common/bin/*
/opt/zimbra/common/share/*
%exclude /opt/zimbra/common/sbin
%files libs
%defattr(-,root,root)
/opt/zimbra/common/lib/*.so.*
/opt/zimbra/common/lib/perl5/*
%files devel
%defattr(-,root,root)
/opt/zimbra/common/include/*
/opt/zimbra/common/lib/*.a
/opt/zimbra/common/lib/*.la
/opt/zimbra/common/lib/*.so
===
Может кто подскажет незамыленным взглядом, где косяк? Да, спек ужасный, ибо генерится автоматически.
Подробная информация о списке рассылки Sysadmins