How to make subpackage to require parent package?

I have created this spec file:


Name:           libsell
Version:    0.0.1
Release:    1
License:    LGPL-3.0
BuildRoot:      %{_tmppath}/libsell
Summary:    Simple extensible log library
Source:        libsell.tar.gz    

%description
Simple and extensible log library. Application can configure this library or order this library to read configuration variable called SELL_RULES. By setting SELL_RULES variable, user can filter messages, selecting output files, etc.

%prep
%setup -q

%build
make %{?_smp_mflags} 

%install
mkdir -p $RPM_BUILD_ROOT/usr/%_lib 
mkdir -p $RPM_BUILD_ROOT/usr/include/
install -m755 $RPM_BUILD_DIR/libsell-0.0.1/libsell.so.1.0 $RPM_BUILD_ROOT/usr/%_lib/libsell.so.1.0
install -m755 $RPM_BUILD_DIR/libsell-0.0.1/libsell.so.1 $RPM_BUILD_ROOT/usr/%_lib/libsell.so.1
install -m755 $RPM_BUILD_DIR/libsell-0.0.1/libsell.so.1.0.0 $RPM_BUILD_ROOT/usr/%_lib/libsell.so.1.0.0
install -m755 $RPM_BUILD_DIR/libsell-0.0.1/sell.h $RPM_BUILD_ROOT/usr/include/sell.h

%files
%defattr(-,root,root)
%doc LICENSE
/usr/%_lib/libsell.so.1.0
/usr/%_lib/libsell.so.1
/usr/%_lib/libsell.so.1.0.0

%post
/sbin/ldconfig

%postun
/sbin/ldconfig

%package devel
Summary:    Simple extensible log library development files
Requires:  libsell

%description devel
Development files for libsell

%files devel
/usr/include/sell.h

But libsell-devel doesn’t requires libsell. How to fix it?

On Tue 30 Jun 2015 02:06:01 PM CDT, Lachu wrote:

I have created this spec file:

Code:

Name: libsell
Version: 0.0.1
Release: 1
License: LGPL-3.0
BuildRoot: %{_tmppath}/libsell
Summary: Simple extensible log library
Source: libsell.tar.gz

%description
Simple and extensible log library. Application can configure this
library or order this library to read configuration variable called
SELL_RULES. By setting SELL_RULES variable, user can filter messages,
selecting output files, etc. %prep %setup -q

%build
make %{?_smp_mflags}

%install
mkdir -p $RPM_BUILD_ROOT/usr/%_lib
mkdir -p $RPM_BUILD_ROOT/usr/include/
install -m755 $RPM_BUILD_DIR/libsell-0.0.1/libsell.so.1.0
$RPM_BUILD_ROOT/usr/%_lib/libsell.so.1.0 install -m755
$RPM_BUILD_DIR/libsell-0.0.1/libsell.so.1
$RPM_BUILD_ROOT/usr/%_lib/libsell.so.1 install -m755
$RPM_BUILD_DIR/libsell-0.0.1/libsell.so.1.0.0
$RPM_BUILD_ROOT/usr/%_lib/libsell.so.1.0.0 install -m755
$RPM_BUILD_DIR/libsell-0.0.1/sell.h $RPM_BUILD_ROOT/usr/include/sell.h
%files %defattr(-,root,root) %doc LICENSE
/usr/%_lib/libsell.so.1.0
/usr/%_lib/libsell.so.1
/usr/%_lib/libsell.so.1.0.0

%post
/sbin/ldconfig

%postun
/sbin/ldconfig

%package devel
Summary: Simple extensible log library development files
Requires: libsell

%description devel
Development files for libsell

%files devel
/usr/include/sell.h


But libsell-devel doesn’t requires libsell. How to fix it?

Hi
In the sub package %package devel add;


Requires:       %{name} = %{version}

--
Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
SUSE Linux Enterprise Desktop 12 GNOME 3.10.1 Kernel
3.12.43-52.6-default If you find this post helpful and are logged into
the web interface, please show your appreciation and click on the star
below... Thanks!

Thanks! This topic can be closed.