1

I have an RPM build which looks like this:

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.

I'm building three packages out of this spec file:

  1. lame: the binary /usr/bin/lame, requires ncurses and libmp3lame,
  2. libmp3lame: the shared object /usr/lib64/libmp3lame.so, requires nothing.
  3. libmp3lame-devel: the headers, requires libmp3lame.

My build is currently failing because the Requires section is empty for libmp3lame. If I don't define it, it inherits from lame and depends on ncurses, which doesn't actually apply here.

How can I set an empty requires clause to my libmp3lame subpackage?

0

Requires are not inherited to subpackages. Just remove the line

Requires: %{nil}

and it will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.