SCIENTIFIC-LINUX-USERS Archives

July 2011

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Nico Kadel-Garcia <[log in to unmask]>
Reply To:
Nico Kadel-Garcia <[log in to unmask]>
Date:
Tue, 19 Jul 2011 18:11:12 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (68 lines)
On Tue, Jul 19, 2011 at 9:50 AM, Andrew Z <[log in to unmask]> wrote:
>
> On Fri, Jul 15, 2011 at 10:58 PM, Nico Kadel-Garcia <[log in to unmask]>
> wrote:
>>
>> On Fri, Jul 15, 2011 at 2:51 PM, Phil Perry <[log in to unmask]> wrote:
>> > On 15/07/11 19:28, Andrew Z wrote:
>> >>
>> >> Hello,
>> >>  i just got curios (google is not helping me @ the moment)...
>> >> What is the right way to handle versions of the files during
>> >> installation and removal of the rpm?
>> >> Example:
>> >> ls -l ./
>> >> <no files>
>> >>
>> >> rpm -uhv   lib_andrew-123.rpm:
>> >>  lib_andrew.so ->  lib_andrew.so.123
>> >>
>> >> rpm -uhv   lib_andrew-456.rpm:
>> >>   lib_andrew.so ->  lib_andrew.so.456
>> >>
>> >> ls -l ./
>> >>  lib_andrew.so ->  lib_andrew.so.456
>> >> lib_andrew.so.123
>> >>
>> >> now, what if i want to remove version 123 ???
>> >>
>> >> Andrew
>> >>
>> >
>> > You need to have your SPEC file create the symlinks in the buildroot so
>> > that
>> > they are a part of the package, i.e, the symlinks are owned by the rpm
>> > package. Then when you uninstall or update the package rpm will
>> > remove/update the symlinks for you rather than leave them dangling as
>> > per
>> > your example above.
>>
>> This is normally handled by "autoconf" based installations installing
>> the software into the RPM build environments "buildroot", and RPM
>> collecting up a list of the files, based on the SPEC file settings.
>> RPM is also good about reporting discrepancies.
>>
>> I've done amazing amounts of turning sloppy, hard coded build
>> structures into autoconf and RPM compatible structures.
>>
>
> Nico, mind to shed more light on how to do this ?

Oh, boy, where do I start.... Have you worked with autoconf and
Makefiles? Does your software have an autoconf or other "Makefile"
based setup for compiling and installing it? Do the Makefiles support
the use of "DESTDIR", a prefix used for instaling the software and
which most .spec files use to say "actually put the binaries and links
and man pages over here, where we can bundle it up safely, rather than
on the local system"?

If not be ready to upgrade the software's build system and installers
to do support DESTDIR, and to include the full installed configuration
or enough for someone deploying the software to complete themselves
after installation. This would run in the '%install' part of your
.spec file, to put all the important bits, including symlinks, in the
build target directory.

Take a good look at the upstream vendor's SRPM's and .spec files for
examples of how this works.

ATOM RSS1 RSS2