If works fine on SUSE but on HeliOS also it is looking for libcurl4 instead of libcurl. What i am doing wrong here . Had also tried different approach as well for example
~> cat /etc/SuSE-release
openSUSE 13.2 (x86_64)
VERSION = 13.2
CODENAME = Harlequin
# /etc/SuSE-release is deprecated and will be removed in the future, use /etc/os-release instead
If works fine on SUSE but on HeliOS also it is looking for libcurl4
instead of libcurl. What i am doing wrong here . Had also tried
different approach as well for example
Does HELiOS use pkgconfig, if so use that, eg for openSUSE/SUSE it’s
BuildRequires: pkgconfig(libcurl)
Then it should in theory with rpm pull in any requires. You should see
that info in the build log at the end.
–
Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel
3.12.44-52.10-default If you find this post helpful and are logged into
the web interface, please show your appreciation and click on the star
below… Thanks!
Hi,
First thank you so much for your reply . The thing is Requires: pacs-plugins >= 1-1, libcurl4 works fine if it is out of if loop and even in if loop it works fine for SUSE the only problem is in HELiOS which also fall in SUSE condition and look for libcurl4 . this is the issue and i am new to all of these things so i am not sure what is missing here ,Actually i went through the link also and used suse_version check as well ,but i don’t know even in case of HELiOS it is going through SUSE condition, which make me more confused.This also didn’t worked for me.
it works fine for SUSE the only problem is in HELiOS which also fall in SUSE condition and look for libcurl4
And how/wher exactly are you building it for HELiOS?
If you build it on (open)SUSE, it will always detect (open)SUSE obviously.
IOW, the check you have is done during the build, not during installation. You cannot have dynamic Requires depending on which distribution you install the package. Package requirements are static.
Yeah that is mine requirement, i know if is not a loop it’s a conditional statement but you are right i am trying to do it at run time . is there any way i can perform this check during installation not the build.What i mean here, is there anyway that at run time i can check whether i am running in SUSE or HELiOS and based on it add some instruction to install the library or look for it.
No.
You cannot set/change the package dependencies at installation time.
What i mean here, is there anyway that at run time i can check whether i am running in SUSE or HELiOS and based on it add some instruction to install the library or look for it.
You could probably do that in a %postinstall scriptlet. That gets run when the package is installed.
But what’s your requirement exactly?
You can also specify files. So if you e.g. need the curl executable, specify this:
Requires: /usr/bin/curl
If you need the library, something like this should do:
Requires: libcurl.so.4()(64bit)
Then it should not matter how the package is named.
Yes you are right i think %postinstall is the right place , the requirement is while deploying the app on the target os i want to make sure whether that os contain the required version of libcurl or not and if yes then only proceed else fail with proper error.
Well, on second thought you are probably not able to use package management tools in the %postinstall script. The package management is locked, your package is being installed at the moment. A “rpm -q xxx” might still work though, no idea.
Maybe you could do your version check differently? E.g. call curl -v and parse the output? Then you would need curl as well though, not only libcurl).
Or maybe rethink your whole package creation/installation process. E.g. build your HeliOS packages on a HeliOS host, and you can use such conditionals.
AIUI, you copy some precompiled binaries to the system during installation, and those need libcurl, right?
In that case, the “Requires: libcurl.so.4()(64bit)” approach should work, on openSUSE at least. (I don’t know HeliOS)
Or write some custom installation script that checks the libcurl version/installs it if necessary, and then installs the RPM (or maybe don’t even use an RPM in the first place).
Btw, %postinstall is called after the package installation, as the name implies. In your case you probably want to use %preinstall instead.