【发布时间】:2016-11-10 22:37:59
【问题描述】:
我已经(在 CentOS 7 中)安装了一个名为 Rational Software Architect (RSA 9.5) 的程序,它是一个富客户端平台,其作用类似于 Eclipse,但实际上并未安装 RPM。 RSA 附带了一个安装 bash 脚本,它几乎只是将 eclipse 文件放到了文件系统中。我的 Eclipse 可执行文件位于 /opt/IBM/SDP/eclipse,与普通 Eclipse 文件夹(如“plugins”、“features”和“dropins”)位于同一级别。
我为“真实”Eclipse 的早期版本编写了一个规范文件,该文件只是安装了一些我编写为 jar 文件的 java 插件,将它们放在“dropins”文件夹中,然后调用 eclipse -clean -initialize 将 Eclipse 与我的新插件。这仍然适用于 RSA。
我的问题归结为这样一个事实,在此之前,我只需在规范文件中有一行类似于Requires: eclipse >= 4.4.2
因为 Eclipse 是作为 RPM 安装的。现在 RSA 已安装,取代了 Eclipse,并且没有与之关联的 RPM,我需要找到一种方法来告诉规范文件在安装 RPM 之前要求“dropins”文件夹存在。也许是这样的:Requires: /opt/IBM/SDP/eclipse
我对上述方法没有任何成功,想知道是否甚至可以基于文件而不是包来设置 RPM 要求?我找不到有关该主题的任何文档,希望大家能提供帮助!提前致谢。
仅供参考...我正在使用 rpm-build-4.11.3 和 rpmdevtools-8.3 在 CentOS 7.2 中工作。
编辑:添加在规范中使用绝对路径时从 yum 返回的错误消息[root@localhost trunk]# yum localinstall myplugin-1.1.6-rev1255.x86_64.rpm
Loaded plugins: fastestmirror, langpacks, rhnplugin
This system is receiving updates from 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 to be installed
Resolving Dependencies
--> Running transaction check
---> Package myplugin.x86_64 0:1.1.6-rev1255 will be installed
--> Processing Dependency: /opt/IBM/SDP/eclipse for package: myplugin-1.1.6-rev1255.x86_64
Loading mirror speeds from cached hostfile
--> Processing Dependency: /opt/IBM/SDP/eclipse for 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
You could try using --skip-broken to work around the problem
You could 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
【问题讨论】:
-
我很确定你可以有一个绝对路径。它应该会阻止您在没有它的情况下进行安装,但由于在任何 RPM 中都找不到它,
yum/dnf将无法帮助您找到它。我之前已经这样做了,以强制 glibc 32 位库作为 RPM 的要求。 -
@AaronD.Marasco 见上面的编辑。使用绝对路径时(在文件上运行
ls -al时可以看到存在)我仍然有问题。 -
在使用 mock 构建 rpm 时可能会自动满足该要求。
标签: linux eclipse rpm centos7 rpm-spec