我有一个MakeMKV的RPM规范文件,该规范文件已上传到OBS,以构建Fedora和openSUSE的软件包。两个发行版之间的specfile是相同的,但是只有openSUSE正确地将构建的库添加到构建程序包的Provides部分,从而导致程序包安装在Fedora上失败。

我试图将所有文件放在一个软件包中,但这仍然不允许在Fedora上安装。如果将所有库都放在同一个程序包中或单独打包,则openSUSE会检测它们。

这是我的规格文件:

Name: makemkv
Version: 1.9.10
Release: 0
Summary: DVD and Blu-ray to MKV converter and network streamer
License: SUSE-NonFree
Group: Productivity/Multimedia/Other
Url: http://www.makemkv.com
Source0: %name-oss-%version.tar.gz
Source1: %name-bin-%version.tar.gz
BuildRequires: pkgconfig(zlib) pkgconfig(openssl) pkgconfig(expat) pkgconfig(libavcodec) pkgconfig(libavutil)
%if 0%{?centos} || 0%{?fedora} || 0%{?rhel} || 0%{?scientificlinux}
BuildRequires: pkgconfig
%endif
%if 0%{?centos} || 0%{?rhel} || 0%{?scientificlinux}
BuildRequires: libqt4-devel
%endif
%if 0%{?fedora}
BuildRequires: qt5-qtbase-devel
%endif
%if 0%{?suse_version}
BuildRequires: pkg-config libqt5-qtbase-devel update-desktop-files
%endif

%description
MakeMKV is your one-click solution to convert video that you own into free and patents-unencumbered format that can be played everywhere. MakeMKV is a format converter, otherwise called "transcoder". It converts the video clips from proprietary (and usually encrypted) disc into a set of MKV files, preserving most information but not changing it in any way. The MKV format can store multiple video/audio tracks with all meta-information and preserve chapters. There are many players that can play MKV files nearly on all platforms, and there are tools to convert MKV files to many formats, including DVD and Blu-ray discs.

Additionally MakeMKV can instantly stream decrypted video without intermediate conversion to wide range of players, so you may watch Blu-ray and DVD discs with your favorite player on your favorite OS or on your favorite device.

%package -n libdriveio0
Summary: DVD and Blu-ray to MKV converter and network streamer

%description -n libdriveio0
MakeMKV is your one-click solution to convert video that you own into free and patents-unencumbered format that can be played everywhere. MakeMKV is a format converter, otherwise called "transcoder". It converts the video clips from proprietary (and usually encrypted) disc into a set of MKV files, preserving most information but not changing it in any way. The MKV format can store multiple video/audio tracks with all meta-information and preserve chapters. There are many players that can play MKV files nearly on all platforms, and there are tools to convert MKV files to many formats, including DVD and Blu-ray discs.

Additionally MakeMKV can instantly stream decrypted video without intermediate conversion to wide range of players, so you may watch Blu-ray and DVD discs with your favorite player on your favorite OS or on your favorite device.

%package -n libmakemkv1
Summary: DVD and Blu-ray to MKV converter and network streamer

%description -n libmakemkv1
MakeMKV is your one-click solution to convert video that you own into free and patents-unencumbered format that can be played everywhere. MakeMKV is a format converter, otherwise called "transcoder". It converts the video clips from proprietary (and usually encrypted) disc into a set of MKV files, preserving most information but not changing it in any way. The MKV format can store multiple video/audio tracks with all meta-information and preserve chapters. There are many players that can play MKV files nearly on all platforms, and there are tools to convert MKV files to many formats, including DVD and Blu-ray discs.

Additionally MakeMKV can instantly stream decrypted video without intermediate conversion to wide range of players, so you may watch Blu-ray and DVD discs with your favorite player on your favorite OS or on your favorite device.

%package -n libmmbd0
Summary: DVD and Blu-ray to MKV converter and network streamer

%description -n libmmbd0
MakeMKV is your one-click solution to convert video that you own into free and patents-unencumbered format that can be played everywhere. MakeMKV is a format converter, otherwise called "transcoder". It converts the video clips from proprietary (and usually encrypted) disc into a set of MKV files, preserving most information but not changing it in any way. The MKV format can store multiple video/audio tracks with all meta-information and preserve chapters. There are many players that can play MKV files nearly on all platforms, and there are tools to convert MKV files to many formats, including DVD and Blu-ray discs.

Additionally MakeMKV can instantly stream decrypted video without intermediate conversion to wide range of players, so you may watch Blu-ray and DVD discs with your favorite player on your favorite OS or on your favorite device.

%prep
tar xf %{SOURCE0}
tar xf %{SOURCE1}

%build
cd %{name}-oss-%{version}
%configure
make %{?_smp_mflags}

%install
cd %{name}-oss-%{version}
make install DESTDIR=%buildroot
%if 0%{?suse_version}
%suse_update_desktop_file -r makemkv
%suse_update_desktop_file -c makemkv MakeMKV "DVD and Blu-ray to MKV converter and network streamer" makemkv makemkv AudioVideo AudioVideoEditing
%endif

cd ../%{name}-bin-%{version}
mkdir tmp
echo accepted > tmp/eula_accepted
make install DESTDIR=%buildroot

%if "/usr/lib" != "%_libdir"
mv %buildroot/usr/lib/ %buildroot/%_libdir
%endif

%post -n libdriveio0 -p /sbin/ldconfig
%postun -n libdriveio0 -p /sbin/ldconfig
%post -n libmakemkv1 -p /sbin/ldconfig
%postun -n libmakemkv1 -p /sbin/ldconfig
%post -n libmmbd0 -p /sbin/ldconfig
%postun -n libmmbd0 -p /sbin/ldconfig

%files
%defattr(-,root,root)
#oss
%dir /usr/share/icons/hicolor
%dir /usr/share/icons/hicolor/*
%dir /usr/share/icons/hicolor/*/apps
/%_bindir/makemkv
/usr/share/applications/makemkv.desktop
/usr/share/icons/hicolor/*/apps/makemkv.png
#bin
/%_bindir/makemkvcon
/%_bindir/mmdtsdec
/usr/share/MakeMKV/

%files -n libdriveio0
%defattr(-,root,root)
/%_libdir/libdriveio.so.0

%files -n libmakemkv1
%defattr(-,root,root)
/%_libdir/libmakemkv.so.1

%files -n libmmbd0
%defattr(-,root,root)
/%_libdir/libmmbd.so.0

最佳答案

对库的权限未正确设置。跑步

chmod 755 %buildroot/%_libdir/lib*.so*

解决此问题,然后Fedora正确设置Provides字段。

关于rpm-spec - RPM构建正确设置在openSUSE上提供,但在Fedora上不提供,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38254018/

10-12 17:31