RPM构建正确设置提供openSUSE,但不提供Fedora

时间:2016-07-07 19:43:02

标签: rpm-spec

我有一个针对MakeMKV的RPM specfile,它被上传到OBS以构建Fedora和openSUSE的包。两个发行版之间的specfile是相同的,但只有openSUSE正确地将构建的库添加到构建包提供部分,导致Fedora上的包安装失败。

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

这是我的specfile:

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

1 个答案:

答案 0 :(得分:1)

未正确设置库的权限。运行

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

修复此问题,然后Fedora正确设置了提供字段。