upgrade a package with source

Asked by metanix

Hi,
I tried to upgrade some existing .deb packages (cairo) using the latest tarball (version 1.4.10 and using the --enable-glitz option).

The usual compilation steps...
 $ ./configure --enable-glitz
 $ make
   worked like charm (as they say).

Then I removed libcairo2, libcairo2-dev and libcairo2-doc from my system (Gutsy 7.10):
 $ sudo dpkg --force-depends -r libcairo2 libcairo2-dev libcairo2-doc
    half the system didn't work as anything from (g)vim to synaptic needs those libraries...

I played it nice using checkinstall:
 $ sudo checkinstall
    synaptic (and other things) started working again but it informed me that there were 186 broken packages dependencies.

So I played nicer:
$ sudo checkinstall --review-control
    modifying the deb rules file before the package was built, adding 2 "Provides:" lines with libcairo2 and libcairo2-dev values, still having 186 broken packages dependencies.

Meanwhile, I discovered (thanks to synaptic) that the original libcairo2 and libcairo2-dev provided libcairo and libcairo-dev, respectively, so I repeated the above command using 2 "Provides:" lines with libcairo and libcairo-dev values instead, leaving me again with the same 186 broken packages dependencies.

Adding "Replaces:" or "Conflicts:" to the deb rules doesn't help as this should be a reciprocal agreement between mutual excluding packages.

The question is: how do I upgrade a package to a more recent/optimized/customized version using a tarball, being able to use the package manager to remove/upgrade it later and not leaving the whole system unmanageble for the rest of its days?

Thanks for your answers,
 Nic

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
metanix
Solved:
Last query:
Last reply:
Revision history for this message
metanix (metanix) said :
#1

I managed to fix my sytem this way (being able to get updates again):

- disinstalled the cairo package I installed with the checkinstall commands above
$ dpkg -r cairo

- reinstall the original ubuntu cairo packages downloading them first, as synaptic wanted to remove some -dev packages first (bug or feature?):
$ wget http://archive.ubuntu.com/ubuntu/pool/main/libc/libcairo/libcairo2_1.4.10-1ubuntu4_i386.deb
$ wget http://archive.ubuntu.com/ubuntu/pool/main/libc/libcairo/libcairo2-dev_1.4.10-1ubuntu4_i386.deb
$ wget http://archive.ubuntu.com/ubuntu/pool/main/libc/libcairo/libcairo2-doc_1.4.10-1ubuntu4_all.deb
$ sudo dpkg -i libcairo2_1.4.10-1ubuntu4_i386.deb libcairo2-dev_1.4.10-1ubuntu4_i386.deb libcairo2-doc_1.4.10-1ubuntu4_all.deb

- reinstall the package I compiled from the tarball using a non-conflicting name that makes it also easier to isolate later (but shoudn't the mantainer field suffice?)
$ sudo checkinstall
    at the request, select option 2 (name) and used someting trivial (I prefixed the package name with "mx.")

- pointed the shell to the not standard library location:
$ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
    (setting the same into one of the startup rc scripts is beneficial)

- finally verified the correctness of the above steps:
$ ldconfig -p | grep libcairo.so.2
    the library into /usr/local/lib (.tar.gz) cames first of the one into /usr/lib (.deb)

I don't like the above solution at all but at least this way I'm able to update the system and use/upgrade/remove my customized packages later.

Any other (and no doubt better) solutions?

Ciao,
 Nic

Revision history for this message
Clóvis Fabrício (nosklo) said :
#2

The correct way would be to make a real package (i.e. not one made with checkinstall).

Like this: https://wiki.ubuntu.com/PackagingGuide

You may wish to download the libcairo's package sources and start from there.

Another option would be to use apt-build.

Revision history for this message
metanix (metanix) said :
#3

Thanks a lot to the very informative pages.

It's good to make good packages (if you know how ;).

Ciao,
  Nic