![Fedora 33 RPM 软件包提供了自己的库,无法安装,提示“没有提供任何内容”](https://linux22.com/image/184279/Fedora%2033%20RPM%20%E8%BD%AF%E4%BB%B6%E5%8C%85%E6%8F%90%E4%BE%9B%E4%BA%86%E8%87%AA%E5%B7%B1%E7%9A%84%E5%BA%93%EF%BC%8C%E6%97%A0%E6%B3%95%E5%AE%89%E8%A3%85%EF%BC%8C%E6%8F%90%E7%A4%BA%E2%80%9C%E6%B2%A1%E6%9C%89%E6%8F%90%E4%BE%9B%E4%BB%BB%E4%BD%95%E5%86%85%E5%AE%B9%E2%80%9D.png)
这应该是看着冰融化简单,但事实并非如此。我正在使用 Fedora 33 并为 Diamond 文本编辑器创建 RPM。我已经把 Debian 的东西全部搞定了并且工作得很好。 Diamond 使用 CopperSpice 库,该库当前没有任何 RPM 或 Debian 软件包。这不是问题,因为开发版本将所需的库放在与可执行文件相同的目录中。作为创建这些包时的解决方法,我采用了在 /opt/diamond 下构建树的老式方法。超级简单而且效果很好。您甚至可以告诉构建过程安装到 /opt/diamond ,一切都很好。
我现在已经花了两天时间来追踪这个问题。令人气愤的是,它只对其中 3 个库进行了限制。无论我把 libCsXcbSupport1.7.so 放在哪里,似乎都能找到。
[sudo] password for roland:
Last metadata expiration check: 0:29:24 ago on Mon 30 Nov 2020 06:01:12 PM CST.
Error:
Problem: conflicting requests
- nothing provides libCsCore1.7.so()(64bit) needed by diamond-2.0-1.x86_64
- nothing provides libCsGui1.7.so()(64bit) needed by diamond-2.0-1.x86_64
- nothing provides libCsNetwork1.7.so()(64bit) needed by diamond-2.0-1.x86_64
(try to add '--skip-broken' to skip uninstallable packages)
[roland@localhost share]$ sudo yum install diamond-2.0-1.x86_64.rpm --skip-broken
Last metadata expiration check: 0:29:57 ago on Mon 30 Nov 2020 06:01:12 PM CST.
Dependencies resolved.
Problem: conflicting requests
- nothing provides libCsCore1.7.so()(64bit) needed by diamond-2.0-1.x86_64
- nothing provides libCsGui1.7.so()(64bit) needed by diamond-2.0-1.x86_64
- nothing provides libCsNetwork1.7.so()(64bit) needed by diamond-2.0-1.x86_64
================================================================================
Package Architecture Version Repository Size
================================================================================
Skipping packages with broken dependencies:
diamond x86_64 2.0-1 @commandline 23 M
Transaction Summary
================================================================================
Skip 1 Package
Nothing to do.
Complete!
[roland@localhost share]$ rpm -qp diamond-2.0-1.x86_64.rpm --provides
diamond = 2.0-1
diamond(x86-64) = 2.0-1
libCsCore1.7.so
libCsGui1.7.so
libCsNetwork1.7.so
libCsXcbSupport1.7.so
[roland@localhost share]$
我尝试过输入完整路径。我尝试过在名字之间只加空格。我尝试添加多个 Provides: 标签,以便每个标签都有自己的行。我什至让 SPEC 文件将所需的库移动到 /usr/lib/cs_lib/lib64。不管怎样,都找不到相同的3个库。
一定有一些我忽略的相当明显的东西。
Name: @PACKAGE@
Version: @RPM_VERSION@
Release: @RPM_RELEASE@
Summary: Diamond text editor
License: GPL V2
Group: Applications/Editors
URL: https://www.copperspice.com/documentation-diamond.html
Vendor: @CPACK_PACKAGE_VENDOR@
Packager: Roland Hughes <[email protected]>
Provides: libCsXcbSupport1.7.so, libCsCore1.7.so, libCsGui1.7.so, libCsNetwork1.7.so
%description
@DIAMOND_DESCRIPTION@
%prep
# Cleanup any left over build files
#
rm -rf *
# Populate the build directory
#
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="%{buildroot}/opt/diamond" -DCMAKE_PREFIX_PATH=/usr/lib/cs_lib/lib64/cmake/CopperSpice "@CMAKE_SOURCE_DIR@"
%build
ninja
%install
rm -rf %{buildroot}/opt/diamond
mkdir -p %{buildroot}/opt/diamond
mkdir -p %{buildroot}/usr/lib/cs_lib/lib64
ninja install
#cp %{buildroot}/opt/diamond/libCsCore1.7.so %{buildroot}/usr/lib/cs_lib/lib64
#cp %{buildroot}/opt/diamond/libCsGui1.7.so %{buildroot}/usr/lib/cs_lib/lib64
#cp %{buildroot}/opt/diamond/libCsNetwork1.7.so %{buildroot}/usr/lib/cs_lib/lib64
#cp %{buildroot}/opt/diamond/libCsXcbSupport1.7.so %{buildroot}/usr/lib/cs_lib/lib64
#rm %{buildroot}/opt/diamond/libCsCore1.7.so
#rm %{buildroot}/opt/diamond/libCsGui1.7.so
#rm %{buildroot}/opt/diamond/libCsNetwork1.7.so
#rm %{buildroot}/opt/diamond/libCsXcbSupport1.7.so
%files
#/usr/lib/cs_lib/lib64/libCsCore1.7.so
#/usr/lib/cs_lib/lib64/libCsGui1.7.so
#/usr/lib/cs_lib/lib64/libCsNetwork1.7.so
#/usr/lib/cs_lib/lib64/libCsXcbSupport1.7.so
/opt/diamond/diamond
/opt/diamond/diamond.desktop
/opt/diamond/diamond.png
/opt/diamond/libCsCore1.7.so
/opt/diamond/libCsGui1.7.so
/opt/diamond/libCsNetwork1.7.so
/opt/diamond/libCsXcbSupport1.7.so
/opt/diamond/dictionary/de_DE.dic
/opt/diamond/dictionary/de_DE.aff
/opt/diamond/dictionary/de_DE_frami.aff
/opt/diamond/dictionary/de_DE_frami.dic
/opt/diamond/dictionary/en_US.aff
/opt/diamond/dictionary/en_US.dic
/opt/diamond/dictionary/es.aff
/opt/diamond/dictionary/es.dic
/opt/diamond/dictionary/fr.aff
/opt/diamond/dictionary/fr.dic
/opt/diamond/dictionary/it_IT.aff
/opt/diamond/dictionary/it_IT.dic
/opt/diamond/dictionary/pt.aff
/opt/diamond/dictionary/pt_BR.aff
/opt/diamond/dictionary/pt_BR.dic
/opt/diamond/dictionary/pt.dic
/opt/diamond/dictionary/userDict.txt
/opt/diamond/platforms/CsGuiXcb1.7.so
/opt/diamond/syntax/syn_clipper.json
/opt/diamond/syntax/syn_cmake.json
/opt/diamond/syntax/syn_cpp.json
/opt/diamond/syntax/syn_css.json
/opt/diamond/syntax/syn_doxy.json
/opt/diamond/syntax/syn_errlog.json
/opt/diamond/syntax/syn_html.json
/opt/diamond/syntax/syn_java.json
/opt/diamond/syntax/syn_js.json
/opt/diamond/syntax/syn_json.json
/opt/diamond/syntax/syn_make.json
/opt/diamond/syntax/syn_none.json
/opt/diamond/syntax/syn_nsi.json
/opt/diamond/syntax/syn_php.json
/opt/diamond/syntax/syn_pl.json
/opt/diamond/syntax/syn_py.json
/opt/diamond/syntax/syn_sh.json
/opt/diamond/syntax/syn_txt.json
/opt/diamond/syntax/syn_xml.json
/opt/diamond/printerdrivers/CsPrinterDriverCups1.7.so
%post
echo "called post install script section"
if [ $1 == 1] ; then
echo "we are in install"
ln -s /opt/diamond/diamond /usr/local/bin
cp /opt/diamond/diamond.desktop /usr/share/applications
fi
%postun
if [ $1 == 1 ] ; then
# upgrading
rm /usr/local/bin/diamond
else if [ $1 == 0 ] ; then
# removing
rm /usr/local/bin/diamond
rm /usr/share/applications/diamond.desktop
fi
fi
%changelog
# let's skip this for now
欣赏任何见解。
答案1
鉴于大量的回复,我想我必须发布自己的答案。这才是真正有效的。
=======
Name: @PACKAGE@
Version: @RPM_VERSION@
Release: @RPM_RELEASE@
Summary: Diamond text editor
License: GPL V2
Group: Applications/Editors
URL: https://www.copperspice.com/documentation-diamond.html
Vendor: @CPACK_PACKAGE_VENDOR@
Packager: Roland Hughes <[email protected]>
Provides: libCsCore1.7.so()(64bit), libCsGui1.7.so()(64bit), libCsNetwork1.7.so()(64bit)
%description
@DIAMOND_DESCRIPTION@
%prep
# Cleanup any left over build files
#
rm -rf *
# Populate the build directory
#
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="%{buildroot}/opt/diamond" -DCMAKE_PREFIX_PATH=/usr/lib/cs_lib/lib64/cmake/CopperSpice "@CMAKE_SOURCE_DIR@"
%build
ninja
%install
rm -rf %{buildroot}/opt/diamond
mkdir -p %{buildroot}/opt/diamond
mkdir -p %{buildroot}/usr/lib64/cs_lib/lib64
ninja install
%files
/opt/diamond/diamond
/opt/diamond/diamond.desktop
/opt/diamond/diamond.png
/opt/diamond/libCsCore1.7.so
/opt/diamond/libCsGui1.7.so
/opt/diamond/libCsNetwork1.7.so
/opt/diamond/libCsXcbSupport1.7.so
/opt/diamond/dictionary/de_DE.dic
/opt/diamond/dictionary/de_DE.aff
/opt/diamond/dictionary/de_DE_frami.aff
/opt/diamond/dictionary/de_DE_frami.dic
/opt/diamond/dictionary/en_US.aff
/opt/diamond/dictionary/en_US.dic
/opt/diamond/dictionary/es.aff
/opt/diamond/dictionary/es.dic
/opt/diamond/dictionary/fr.aff
/opt/diamond/dictionary/fr.dic
/opt/diamond/dictionary/it_IT.aff
/opt/diamond/dictionary/it_IT.dic
/opt/diamond/dictionary/pt.aff
/opt/diamond/dictionary/pt_BR.aff
/opt/diamond/dictionary/pt_BR.dic
/opt/diamond/dictionary/pt.dic
/opt/diamond/dictionary/userDict.txt
/opt/diamond/platforms/CsGuiXcb1.7.so
/opt/diamond/syntax/syn_clipper.json
/opt/diamond/syntax/syn_cmake.json
/opt/diamond/syntax/syn_cpp.json
/opt/diamond/syntax/syn_css.json
/opt/diamond/syntax/syn_doxy.json
/opt/diamond/syntax/syn_errlog.json
/opt/diamond/syntax/syn_html.json
/opt/diamond/syntax/syn_java.json
/opt/diamond/syntax/syn_js.json
/opt/diamond/syntax/syn_json.json
/opt/diamond/syntax/syn_make.json
/opt/diamond/syntax/syn_none.json
/opt/diamond/syntax/syn_nsi.json
/opt/diamond/syntax/syn_php.json
/opt/diamond/syntax/syn_pl.json
/opt/diamond/syntax/syn_py.json
/opt/diamond/syntax/syn_sh.json
/opt/diamond/syntax/syn_txt.json
/opt/diamond/syntax/syn_xml.json
/opt/diamond/printerdrivers/CsPrinterDriverCups1.7.so
%post
# no matter install or upgrade, create and copy
#
ln -s /opt/diamond/diamond /usr/local/bin
cp /opt/diamond/diamond.desktop /usr/share/applications
%postun
# No difference between upgrade and uninstall for these
#
rm /usr/local/bin/diamond
rm /usr/share/applications/diamond.desktop
if [ $1 -gt 0 ] ; then
# removing - need to completely remove the directory
rm -rf /opt/diamond
fi
%changelog
# let's skip this for now
=======
不管你信不信,必须列出 Provides 行确切地像这样:
Provides: libCsCore1.7.so()(64bit), libCsGui1.7.so()(64bit), libCsNetwork1.7.so()(64bit)