带有空的 require 部分的子包?

带有空的 require 部分的子包?

我有一个 RPM 版本,如下所示:

Summary: LAME Ain't an MP3 Encoder.
Name: lame
Version: 3.99.5
Release: 1
License: LGPL
Vendor: The LAME Project
Packager: Naftuli Tzvi Kay <--->
URL: http://www.mp3dev.org
Group: Applications/Multimedia
Source: lame-%{version}.tar.gz
Requires: ncurses >= 5.0, libmp3lame >= %{_version}
BuildRequires: gcc => 3.0.1, /usr/bin/find, ncurses-devel, nasm

%global _hardened_build 1

%description
LAME Ain't an MP3 Encoder.

%package -n libmp3lame
Summary: Shared libraries for LAME.
Requires: %{nil}
%description -n libmp3lame
Shared libraries for LAME.

%package -n libmp3lame-devel
Summary: Shared libraries for LAME (development files).
Requires: libmp3lame = %{_version}
%description -n libmp3lame-devel
Shared libraries for LAME (development files).

%prep
%setup

%build

# configuration swiped from debian
%configure \
    --enable-nasm \
    --disable-rpath \
    --enable-dynamic-frontends \
    --enable-expopt=full \
    --enable-nasm \
    --with-fileio=lame
%{__make} %{?_smp_mflags} test CFLAGS="%{optflags}"

%install

%makeinstall
%{__ln_s} -f lame/lame.h %{buildroot}%{_includedir}/lame.h

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%clean
%{__rm} -rf %{buildroot}

%files
%defattr (-,root,root)
%{_bindir}/lame
%{_prefix}/share/man/man1/lame.1.gz

%files -n libmp3lame
%{_libdir}/libmp3lame.so.*
%{_libdir}/libmp3lame.so
%exclude %{_prefix}/share/doc/lame/html/*.html
%exclude %{_libdir}/libmp3lame.a
%exclude %{_libdir}/libmp3lame.la
%exclude %{_bindir}/lame
%exclude %{_prefix}/share/man/man1/lame.1.gz

%files -n libmp3lame-devel
%defattr (-, root, root)
%doc API HACKING STYLEGUIDE
%{_includedir}/*
%{_prefix}/share/doc/lame/html/*.html
%exclude %{_libdir}/libmp3lame.a
%exclude %{_libdir}/libmp3lame.la
%exclude %{_bindir}/lame
%exclude %{_prefix}/share/man/man1/lame.1.gz

%changelog

* Mon Jan 11 2016 Naftuli Tzvi Kay <---> - 3.99.5-1
- Repackaged for reasons.

我正在根据这个规范文件构建三个包:

  1. lame:二进制/usr/bin/lame, 需要ncurseslibmp3lame,
  2. libmp3lame:共享对象/usr/lib64/libmp3lame.so,不需要任何东西。
  3. libmp3lame-devel:标头,需要libmp3lame.

我的构建当前失败,因为该Requires部分对于libmp3lame.如果我不定义它,它继承lame并依赖于ncurses,这实际上并不适用于此。

如何为我的libmp3lame子包设置空的 require 子句?

答案1

Requires 不会继承到子包。只需删除该线

Requires: %{nil}

它会起作用的。

相关内容