PDA

View Full Version : failed dependencies while installing


calanor
1st May 2011, 08:17 AM
Hi, this is my first attempt at making an RPM. In the software's install script it installs libs in /usr/lib when on fedora x86_64 it should be /usr/lib64 or it doesn't work. Is there a way I can mv the lib to correct location while installing ?


Also installing the package fails with this error:

Resolving Dependencies
--> Running transaction check
---> Package eiskaltdcpp.x86_64 0:2.2.2-1.fc15 will be installed
--> Processing Dependency: /usr/bin/php5 for package: eiskaltdcpp-2.2.2-1.fc15.x86_64
--> Processing Dependency: /usr/bin/php5 for package: eiskaltdcpp-2.2.2-1.fc15.x86_64
--> Finished Dependency Resolution
Error: Package: eiskaltdcpp-2.2.2-1.fc15.x86_64 (/eiskaltdcpp-2.2.2-1.fc15.x86_64)
Requires: /usr/bin/php5

But I have php-cli installed. The binary is called php and not php5 how do I tell it to use that ?

Spec file:
Name: eiskaltdcpp
Version: 2.2.2
Release: 1%{?dist}
Summary: Eiskaltdcpp Direct Connect protocol client
License: GPLv3
URL: http://code.google.com/p/eiskaltdc/
Source0: http://eiskaltdc.googlecode.com/files/eiskaltdcpp-2.2.2.tar.xz
BuildRequires: cmake, gcc, zlib-devel, bzip2-devel, lua-devel
BuildRequires: pkgconfig, boost-devel, aspell-devel, openssl-devel
BuildRequires: subversion, git, libidn-devel, qt-devel, gcc-c++
Requires: qt, qt-x11, bzip2, zlib, php-cli
Requires: gettext, openssl, lua, aspell

%description

%prep
%setup -q

%build
mkdir -p builddir && cd builddir
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$RPM_BUILD_ROOT/usr -DUSE_QT=ON -DUSE_GTK=OFF -DUSE_JS=ON -DUSE_ASPELL=ON -DFREE_SPACE_BAR_C=ON -DCREATE_MO=ON -DLUA_SCRIPT=ON -DWITH_SOUNDS=ON -DWITH_LUASCRIPTS=ON -DUSE_MINIUPNP=OFF ../
make -j2
make install

%files
%defattr(-,root,root)
%{_bindir}/eiskaltdcpp-qt
/usr/lib/libeiskaltdcpp.so.2.2
/usr/share/*

%doc

%changelog

leigh123linux
1st May 2011, 09:20 AM
Try this spec file as yours had some major errors, you never prefix using the buildroot in the path.
The error was caused because rpm will automatically find the requires for any executeable,



Name: eiskaltdcpp
Version: 2.2.2
Release: 1%{?dist}
Summary: Eiskaltdcpp Direct Connect protocol client
License: GPLv3
URL: http://code.google.com/p/eiskaltdc/
Source0: http://eiskaltdc.googlecode.com/files/eiskaltdcpp-2.2.2.tar.xz
BuildRequires: cmake, gcc, zlib-devel, bzip2-devel, lua-devel
BuildRequires: pkgconfig, boost-devel, aspell-devel, openssl-devel
BuildRequires: subversion, git, libidn-devel, qt-devel, gcc-c++
Requires: qt-x11, bzip2, zlib, php-cli
Requires: gettext, openssl, lua, aspell

%description

%prep
%setup -q

%build
mkdir build
pushd build
%cmake -DCMAKE_BUILD_TYPE=Release -DUSE_QT=ON -DUSE_GTK=OFF -DUSE_JS=ON -DUSE_ASPELL=ON -DFREE_SPACE_BAR_C=ON -DCREATE_MO=ON -DLUA_SCRIPT=ON -DWITH_SOUNDS=ON -DWITH_LUASCRIPTS=ON -DUSE_MINIUPNP=OFF ../
make %{?_smp_mflags}
popd

%install
pushd build
make DESTDIR=%{buildroot} install
popd

#fix php5 requirement error
sed -i -e 's,/usr/bin/php5,/usr/bin/php,g' %{buildroot}%{_datadir}/eiskaltdcpp/qt/qtscripts/gnome/commands.ru_RU.UTF-8.php \
%{buildroot}%{_datadir}/eiskaltdcpp/examples/xmms2_audacious2.ru_RU.UTF-8.php \
%{buildroot}%{_datadir}/eiskaltdcpp/examples/commands.ru_RU.UTF-8.php

%files
%defattr(-, root, root)
%{_bindir}/eiskaltdcpp-qt
%{_libdir}/libeiskaltdcpp.so.2.2
%{_datadir}/*

%doc

%changelog

calanor
1st May 2011, 10:07 AM

And I thought I will learn packaging easily :P

Thanks for your time leigh, I have some questions (I hope you don't mind)

1)what does this do?
#fix php5 requirement error
sed -i -e 's,/usr/bin/php5,/usr/bin/php,g' %{buildroot}%{_datadir}/eiskaltdcpp/qt/qtscripts/gnome/commands.ru_RU.UTF-8.php \
%{buildroot}%{_datadir}/eiskaltdcpp/examples/xmms2_audacious2.ru_RU.UTF-8.php \
%{buildroot}%{_datadir}/eiskaltdcpp/examples/commands.ru_RU.UTF-8.php

2)when the software itself contains the install script why do we need this ?
%install
pushd build
make DESTDIR=%{buildroot} install
popd

3) why use %cmake and not a simple cmake?

4)As I understand, the files are placed in exactly the same directories as the fake install. So if the install script is designed to put libs in /usr/lib, why putting %{_libdir} doesn't result in a file not found error as it tries to find lib64 in fake install ?

leigh123linux
1st May 2011, 10:18 AM
1. sed removes /usr/bin/php5 and replaces it with /usr/bin/php in the three file I listed
2. your building a rpm why rely on some dodgy install script.
3. using %cmake will use the fedora cmake macro.
4. as I said the install script isn't good for rpm's , not everyone runs 32bit and the software compiles on 64bit

on a 32bit sytem %{_libdir} =/usr/lib
on a 64 bit system %{_libdir} =/usr/lib64

calanor
1st May 2011, 10:23 AM
on a 64 bit system %{_libdir} corresponds to /usr/lib64
while in the install phase(in the buildroot) the software puts libs in /usr/lib irrespective of the underlying architecture. So when on a 64 bit system I just specify %{_libdir}=/usr/lib64, why doesn't it complain about missing file/directory.
Maybe I am getting it all wrong.

Also how did you find where to replace php5 with php ?

One more thing
make DESTDIR=%{buildroot} install
this still uses the software's instal,l right ?

leigh123linux
1st May 2011, 10:39 AM
on a 64 bit system %{_libdir} corresponds to /usr/lib64
while in the install phase(in the buildroot) the software puts libs in /usr/lib irrespective of the underlying architecture. So when on a 64 bit system I just specify %{_libdir}=/usr/lib64, why doesn't it complain about missing file/directory.
Maybe I am getting it all wrong.

Also how did you find where to replace php5 with php ?

One more thing
make DESTDIR=%{buildroot} install
this still uses the software's instal,l right ?
Does it?, it didn't here.



Also how did you find where to replace php5 with php

I just checked the built rpm for php files

calanor
1st May 2011, 10:47 AM
I just checked the built rpm for php files

:confused: how ????

And we are still using the software's install script ? (I guess yeah). Then how does it save us from a dodgy script ?