سؤال

I am building rpm package for internal software. It contains binaries and perl script/modules. During build process rpmbuild automatically scans perl code and builds dependency perl modules including DBD:mysql. When I try to install the software package rpm fails with error that it cannot find DBD::mysql. DBD::mysql is installed on the system.

# rpm -ivh conserver-admin-8.1.18-.el5.CME_1.0.x86_64.rpm
error: Failed dependencies:
    perl(DBD::mysql) is needed by conserver-admin-8.1.18-.el5.CME_1.0.x86_64

# rpm -qp --requires conserver-admin-8.1.18-.el5.CME_1.0.x86_64.rpm
/bin/ksh  
/bin/sh  
/usr/bin/perl  
perl(CMEconserver)  
perl(DBD::mysql)  
perl(DBI)  
perl(Data::Dumper)  
perl(Exporter)  
perl(FindBin)  
perl(Getopt::Std)  
perl(POSIX)  
perl(Socket)  
perl(lib)  
perl(strict)  
perl(warnings)  
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1`

The perl module is installed on the system

# perl -e 'use DBD::mysql;'
#

All of the perl modules in the dependency list are installed on the system and I can run the script without any problem.

What am I doing wrong?

هل كانت مفيدة؟

المحلول

I figured out the problem. rpm will only know about the package that was installed using rpm. I had downloaded the DBD::mysql source and manually compiled and installed it on my system.

I added

AutoReq: no

to my spec file turn of dependency check during build. This could be dangerous so be careful before you use it.

نصائح أخرى

Another option is to filter out the automatic dependency script's output. I document here how to do it.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top