Hi, thanks for your answer, my goal just to add snmp library and snmp perl module into rh-perl524 collection (not a separate one). I realized my first mistake -- I was trying to build without specifying collection name, the correct commands to build seems to be "scl enable rh-perl524 bash" then "rpmbuild -bb net-snmp.spec --define 'scl rh-perl524'" I have corrected scl_prefix a you said, and additionally some small mistakes. I prepared my system in the way I could successfully compile any of rh-perl524 SCL packages. Then I tried to compile net-snmp package agin, now it seems that all path are correct and have valid collection prefix without hard-coding it. But compilation is falling on the last stage (Processing files: rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64) : error: File not found: /home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/opt/rh/rh-perl524/enable error: File not found: /home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/etc/scl/prefixes/rh-perl524 error: File not found: /home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/opt/rh/rh-perl524/root/bin error: File not found: /home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/opt/rh/rh-perl524/root/boot error: File not found: /home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/opt/rh/rh-perl524/root/dev error: File not found: /home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/etc/opt/rh/rh-perl524/X11 etc...
It seems that rpmbuild is trying to build all system root directories structure an insert it into package. I understand that there is some error in my spec but I can't find it, could you, please, help? Modified spec-file with needed patches for perl 5.24 in attachment. -- Thanks to all for help, especially Petr. Best regards, Alexander ________________________________________ От: sclorg-boun...@redhat.com [sclorg-boun...@redhat.com] от имени Petr Pisar [ppi...@redhat.com] Отправлено: 18 октября 2021 г. 15:52 Кому: sclorg@redhat.com Тема: Re: [scl.org] scl bin path into package V Fri, Oct 15, 2021 at 05:36:19PM +0300, Alexander Chernovich napsal(a): > Hi all, I am trying to import net-snmp into rh-perl524 SCL(RHEL-7), I need > perl SNMP module into SCL, but it need snmp-package recompilation, so I am > trying to rewrite spec file, all seems to be OK, but no scl-based path both > to bin and lib are used(only system path). > > I was trying to get path via `%{?scl:PREFIX=%{_scl_root}}`? but it is emty, > what I am doing wrong? spec-file in attachment > Have you read <https://www.softwarecollections.org/en/docs/guide/#sect-Extending_the_perl_Software_Collection>? It describes how to create a new collection with depends on rh-perl524 collection. It's maybe too complicated for your use case, but it explains all the macros and dependencies. If you only want to add net-snmp package into rh-perl524 collection, then I would recommend you first to find any existing source package from the collection and then get your system to a state in which rebuilding that source package will produce the same binary packages as provided by the collection. Achieving that state usually means installing rh-perl524-build package which you first need to build from rh-perl524 source package. Finally you can edit net-snmp pakage in a similar way as the collection package you chose at the beginning. > %{?scl:Requires: %{scl}-runtime} > %{?scl:BuildRequires: %{scl}-runtime} > BuildRequires: openssl-devel, bzip2-devel, elfutils-devel > BuildRequires: libselinux-devel, elfutils-libelf-devel, rpm-devel > BuildRequires: %{?scl_prefix}perl-devel, perl(ExtUtils::Embed)%{?scl_prefix}, > gawk, procps perl(ExtUtils::Embed) has bad prefix. > %build > %{?scl:scl enable %{scl} - << \EOF} > %{?scl:PREFIX=%{_scl_root}} > set -e > MIBS="host agentx smux \ > ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \ > ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \ > ip-mib/ipAddressPrefixTable/ipAddressPrefixTable \ > ip-mib/ipDefaultRouterTable/ipDefaultRouterTable \ > ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \ > sctp-mib rmon-mib etherlike-mib" > > %ifnarch s390 s390x > # there are no lm_sensors on s390 > MIBS="$MIBS ucd-snmp/lmsensorsMib" > %endif > > > %configure \ > --prefix="$PREFIX" You don't need to change --prefix=%{__prefix}. %{__prefix} will be automatically redefined if rh-perl524-build is installed. However, if your goal is to build net-snmp while keeping it installed into /usr prefix and only use rh-perl524 Perl for linking and installing its Perl modules, then basically you need to prepend rh-perl524 to Perl dependencies, change %files entries for Perl modules to point deep into /opt/rh/perl524/..., do "scl enable rh-perl524", and then build the package. Crafting the spec file have half of files and dependencies from system, and another half from collection is possible, but requires a high level of knowledge of build process of the given software (net-snmp) and I'm not going to explain it here. I'd recommend you simply building the package as part of the collection. -- Petr
net-snmp.tar.gz
Description: net-snmp.tar.gz
_______________________________________________ SCLorg mailing list SCLorg@redhat.com https://listman.redhat.com/mailman/listinfo/sclorg