linux - How to require a file not owned by an RPM in a spec file "Requires" line? -


i have installed (in centos 7) program called rational software architect (rsa 9.5) rich client platform acts eclipse, without installing rpm. rsa came installation bash script pretty dropped eclipse files onto file system. eclipse executable lives @ /opt/ibm/sdp/eclipse normal eclipse folders "plugins", "features", , "dropins" @ same level.

i had written spec file previous version of "real" eclipse installed java plugins wrote jar files, placing them in "dropins" folder , calling eclipse -clean -initialize afterwards sync eclipse new plugins. still works rsa.

my question comes down fact before, have line in spec file similar to

requires: eclipse >= 4.4.2

because eclipse installed rpm. rsa installed, taking place of eclipse, , has no rpm associated it, need find way tell spec file require "dropins" folder exists before installing rpm. perhaps this:

requires: /opt/ibm/sdp/eclipse

have not had success above approach , wonder if possible set rpm requirement based on file , not package? cannot find documentation on subject , hoping help! in advance.

fyi...i working in centos 7.2 rpm-build-4.11.3 , rpmdevtools-8.3.


edit: adding error message returned yum when using absolute path in spec

[root@localhost trunk]# yum localinstall myplugin-1.1.6-rev1255.x86_64.rpm loaded plugins: fastestmirror, langpacks, rhnplugin system receiving updates rhn classic or red hat satellite. examining myplugin-1.1.6-rev1255.x86_64.rpm: myplugin-1.1.6-rev1255.x86_64 marking myplugin-1.1.6-rev1255.x86_64.rpm installed resolving dependencies --> running transaction check ---> package myplugin.x86_64 0:1.1.6-rev1255 installed --> processing dependency: /opt/ibm/sdp/eclipse package: myplugin-1.1.6-rev1255.x86_64 loading mirror speeds cached hostfile --> processing dependency: /opt/ibm/sdp/eclipse package: myplugin-1.1.6-rev1255.x86_64 --> finished dependency resolution error: package: myplugin-1.1.6-rev1255.x86_64 (/myplugin-1.1.6-rev1255.x86_64) requires: /opt/ibm/sdp/eclipse try using --skip-broken work around problem try running: rpm -va --nofiles --nodigest

[root@localhost trunk]# ll /opt/ibm/sdp/eclipse -rwxr-xr-x. 1 root root 74675 jan 28 2015 /opt/ibm/sdp/eclipse

according fedora packaging guidelines:

... rpm file dependencies don't work according what's on filesystem, work according path specified in rpm %files section.

so, can't use requires: require file not owned rpm.

a possible alternative check existence of file in %pre section , exit non-zero status if not present. see paul rubel's reply failing rpm install programatically in spec step or ᴳᵁᴵᴰᴼ's reply how abort installation of rpm package if conditions not met in specfile? examples of how use technique.

note non-zero exit status %pre section cause rpm fail install, rpm transaction still appears succeed, can cause confusion. see how exit rpm install in case of error.


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -