Editing Spec file in RPM

I’m trying to edit a spec file which always fails when I try to install it on other computer using RPM. I’m using CentOS. Here is the error.

error: Failed dependencies:
perl(ActsUtil) is needed by my_program
perl(ParseBishop) is needed by my_program

Both these 2 files are dependencies for the RPM. The thing is, these 2 files are actually provided inside the RPM package. Both these files are .pm file and located inside /opt/mysoftware/bin. I know it can be solved using rpm - ivh --nodeps mysoftware. But I dont prefer to use that method. So, I tried fixing the spec file. Here are some of the code that I’ve tried.

1st try

Provides: perl(ParseBishop), perl(ActsUtil)

2nd try

Provides: ParseBishop, ActsUtil

3rd try

Provides: ParseBishop.pm, ActsUtil.pm

4th try

Provides: /opt/mysoftware/bin/ParseBishop, /opt/mysoftware/bin/ActsUtil

Am I doing the “Provides” command wrong? Or my approach in solving the issue is already wrong? All guide and help are really appreciated.

linux + squashfs-tools for red-hat 5.3

I want to install the squashfs-tools-4.0-5.el6.i686.rpm
But I have the following dependencies ( after RPM installation )

please advice what the additional packages that I need to install on my linux red-hat 5.3 in order to solve the dependencies issue ?

[root@localhost WORK]# rpm -i squashfs-tools-4.0-5.el6.i686.rpm
 warning: squashfs-tools-4.0-5.el6.i686.rpm: Header V3 RSA/SHA1 signature: NOKEY, key  ID c105b9de
  error: Failed dependencies:
    libc.so.6(GLIBC_2.11) is needed by squashfs-tools-4.0-5.el6.i686
    libc.so.6(GLIBC_2.7) is needed by squashfs-tools-4.0-5.el6.i686
    rpmlib(FileDigests) <= 4.6.0-1 is needed by squashfs-tools-4.0-5.el6.i686
    rpmlib(PayloadIsXz) <= 5.2-1 is needed by squashfs-tools-4.0-5.el6.i686

uname -a

   [root@localhost WORK]# uname -a
    Linux localhost 2.6.18-128.el5PAE #1 SMP Wed Dec 17 12:02:33 EST 2008 i686 i686 i386 GNU/Linux

How can i fix the following gmp library dependency error while trying to install Charm?

I am trying to install Charm crypto python framework in ubuntu 11.04 with python 2.7.
Requirements say that i should have gmp installed 5.*. I have successfully installed gmp lib and i have run all the tests. Also after running `

ldconfig -p |grep libgmp

libgmpxx.so.4 (libc6,x86-64) => /usr/lib/libgmpxx.so.4
libgmpxx.so (libc6,x86-64) => /usr/lib/libgmpxx.so
libgmp.so.10 (libc6,x86-64) => /usr/local/lib/libgmp.so.10
libgmp.so.3 (libc6,x86-64) => /usr/lib/libgmp.so.3
libgmp.so (libc6,x86-64) => /usr/local/lib/libgmp.so
libgmp.so (libc6,x86-64) => /usr/lib/libgmp.so

In order to install Charm i have downloaded it from here. I run ./configure, make , make install, and sdconfig as the INSTALL says.

But after running make test for i am getting a lot of errors of this form:

charm/Charm-Crypto-0.43/charm/core/math/integer.so: undefined symbol: __gmpz_powm_sec

Charm shared libraries cannot find libgmp. How can i fix that?
I made an ldd integer.so and it uses libgmp.so.3. In my system libgmp.so.3 is placed under /usr/lib so added this line under te config.mk file of the Charm framework:

LDFLAGS= -m64 -L/usr/lib . 

(-m64 was already there). I make and make install again but i am getting the same error

Inject specific classes or not

I have a TableSqlBuilder interface which has a method getCreateTableSql. This interface is used in some other class as follows:

function createTable( $tableDefinition ) {
    $sql = $this->tableSqlBuilder->getCreateTableSql( $tableDefinition );
    $this->db->execute( $sql );

The TableSqlBuilder interface has multiple implementations, such as SQLiteTableSqlBuilder and MySQLTableSqlBuilder.

SQLiteTableSqlBuilder originally created all SQL itself, and had methods to create SQL for an index or for a field. It turned own that the functionality of these methods was needed on its own at other places, so it has been split off into a SQLiteFieldSqlBuilder and a SQLiteIndexSqlBuilder. These classes are instantiated by SQLiteTableSqlBuilder – they are thus not injected, and SQLiteTableSqlBuilder depends on these concrete classes.

I’m unsure if this should be changed to have these field and index sql builders injected. On the one hand this gives more flexibility. It also allows mocking out this behaviour in tests. Then again, the binding and flexibility is currently the same as before the code was split of into new classes.

When going with the injection approach, the accepted types could be FieldSqlBuilder and IndexSqlBuilder, both interfaces implemented by the current concrete classes. This however means one can happily end up with a MySqlIndexBuilder in a SQLiteTableBuilder, which is clearly to be avoided. Could also just type hint against the concrete class, pretending it is an interface, which gets rid of the dependency as long as the construction happens outside of the table sql builder.

Do you think these collaborators should be injected, or is it a valid exception where it is better to not go all the way?

Versioning and deploying dependent systems

I need some best practices or experiences of developer teams who had to treat the same issues I have at the moment =)

Our company is developing a client software for years. The one and only dependency was to have an appropriate database. With each release (update) we also update (incremental) the database if necessary. The versioning schema is well-established and matches our ideology.

Now we have started developing mobile applications (act as external client). Some preliminary remarks to our architecture:

The interface between the mobile client and the database (same database as for the desktop client) is a RESTful webservice. The versioning of both clients are independent. One application is maintained by the desktop development team and the mobile part is maintained by another team.

But I don’t know how to handle the webservice. Should it be independent as well (own versioning) despite the fact that it’s using a lot of shared libraries which are maintained by the desktop development team?

How it works:
The mobile client synchronizes it’s reference data with the webservice which interacts live with the database (read-only access to database).
User data which are produced on the mobile application become also synchronized with the webservice but it’s written to some persistent temporary tables. And an asynchronous job will be started to try the import to the database (could fail in case of locking issues, permissions, ….). If the import fails the same import procedure can also be started on the desktop client (they use the same library for importing from temporary tables to the specific ones)

In general each of these three parts could change (e.g. bugfix, features, performance improvements) without affecting the other two. Therefore I need a strategy to deploy each by itself. Nevertheless most probably it will affect two of three.

Where / when should i check if all three systems are compatible? How should I check this? Having a table in the database with every single possible combination of version which work together?

If you don’t understand my question because it’s entirely ambiguous, please let me know. It’s not that easy to describe =)

Does Debian have any kind of virtual environment for make install?

If someone used a Python virtualenv he knows we can run scripts in its own environment installing all necessary libraries which won’t impact main python distribution.

Do we have something similar in a Linux (Debian) world for make utility?

  1. Case 1: I downloaded sources and I know what dependencies I need. I
    put libraries somewhere in home directory and I explicitly say to
    make utility where to search them.
  2. Case 2: I run some kind of virtualenv for make utility and I call there apt-get install lib-required-dev so downloaded libraries would be placed in this virtual environment and won’t pollute my OS. And then I run make.

How to install a custom boost version in CentOS?

I’m trying to compile and install boost 1.54 from source in CentOS.

The documentation is pretty straight forward and there are plenty of tutorials in the internet available (1) (2) (3). This is what I did:

wget http://sourceforge.net/projects/boost/files/boost/1.54.0/boost_1_54_0.tar.gz
tar -xzvf boost_1_54_0.tar.gz
cd boost_1_54_0
./bootstrap.sh --prefix=/usr/local
./b2 install --with=all

This is compiling and installing boost correctly to /usr/local/lib and everything looks fine.

Now I compile other software that requires boost using gcc and everything works fine. From my understanding everything should be OK as long as gcc finds the required libs.

But now the problem: If I run my compiled binaries I get the following error:

  ./myProgramm: error while loading shared libraries: libboost_system.so.1.54.0: cannot open shared object file: No such file or directory

Why can the libraries not be found?

In addition I tried:

locate boost

But boost libraries can not be found. I’ve looked for the path manually, it is:


I also tried to create symlinks to /usr/lib but this doesnt fix this either.

Any ideas? What can I do?

RPM: failed jre dependency, even though that JRE version is installed

I am trying to install a package, and it fails reporting a missing dependency:

# rpm -ivh *
error: Failed dependencies:
    jre >= 1.7.0 is needed by Tomcat-7.0.37-1.noarch

At the same time, when I check my java version, here is what I get:

# java -version
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) Server VM (build 24.0-b56, mixed mode)

Isn’t it the java that the rpm wants? Am I missing something? Does the rpm see a different java and how can I check that?

How can I know if a virtual package is “installed” on a Debian system?

Some packages, have a Provide: header. For example, the package postfix on Debian Wheezy has Provides: mail-transport-agent.

The package mail-transport-agent which doesn’t exist physically is considered as a “virtual” package.

How can I know, on a Debian based system, if a given virtual package is “installed” (or “provided”)? Can I list every “provided” virtual package?

Hint: to list every existing virtual package, installed or not, do: aptitude search "~v"

Relations, dependencies and normal form

I have some issues in understanding about relations and dependencies. I will show two examples and what I want to know:

Assume the relation GTX {G,T,X} with the following dependencies:

G,X -> T
T -> X

or this one:

Relation {W,X,Y,Z}:

X,Y -> Z
Z -> W
  • So to my question, how do I properly draw a dependency diagram for
    this kind of relations? (tutorials or/and explanations are much
  • How do I see what the primary key is? (I know what a pk is)
  • In which normal form are the relations?

I have never been able to understand this fully and always got confused by the tutorials I found. I appreciate all answers!

Question and Answer is proudly powered by WordPress.
Theme "The Fundamentals of Graphic Design" by Arjuna
Icons by FamFamFam