Discussion:
A way to get subpackage specific architecture tag
ELASRI Patrice SOFRECOM
2007-10-08 14:14:05 UTC
Permalink
Hi,

Does someone know a way to get subpackage specific %arch macros (issued
from the BuildArch tag) that do not conflict with the main package one ?

Regards,

mailto: ***@sofrecom.com

phone: +33 1 43985883
ELASRI Patrice SOFRECOM
2007-10-08 14:18:51 UTC
Permalink
Hi,

Can we use architecture-based conditionals (%ifarch linux ... %endif)
blocks within the .rpmmacros file ?

Regards,

mailto: ***@sofrecom.com

phone: +33 1 43985883
Jeff Johnson
2007-10-08 15:23:25 UTC
Permalink
Post by ELASRI Patrice SOFRECOM
Hi,
Can we use architecture-based conditionals (%ifarch linux ...
%endif) blocks within the .rpmmacros file ?
Nope, %ifarch is a parser, not a macro, directive.

Instead, refactor per-arch macros into a file which is loaded
only on a specific architecture.

See the macrofiles: directive on the last line of /usr/lib/rpm/rpmrc.
Note
the %{_target} substitution that chooses 1-of-N per-architecture macro
configuration files.

Write a stub rpmrc file with two lines to override the default. The
two lines
will look like
include: /usr/lib/rpm/rpmrc
macrofiles: <whatever paths you want>

Put the rprmrc file in any of the usual places, or invoke rpmbuild
with --rcfile your_stub_rpmrc_file

73 de Jeff
ELASRI Patrice SOFRECOM
2007-10-31 14:36:58 UTC
Permalink
Hi,

Is there a way to build an RPM package of patches including just a
subset of the application files ?
This package would be installed as an upgrade of the initial application
package.

Regards,

mailto: ***@sofrecom.com

phone: +33 1 43985883
Bob Proulx
2007-10-31 16:16:53 UTC
Permalink
Post by ELASRI Patrice SOFRECOM
Is there a way to build an RPM package of patches including just a
subset of the application files ?
This package would be installed as an upgrade of the initial application
package.
Incremental patches are not supported by design. The standard method
is not to try to patch existing packages but to create new packages
that replace the previous ones. This ensures that the state of the
machine is managed and can be recreated.

Bob
ELASRI Patrice SOFRECOM
2008-01-08 13:26:42 UTC
Permalink
Hi,

I have built a package located by default under /usr/local.
When I try to install it, I'm returned the following error :

$ rpm -U sof-u-2.1.2-1.noarch.rpm
error: Failed dependencies:
/usr is needed by sof-u-2.1.2-1.noarch

If I relocate the package, I'm returned the following error, with
dependencies on original paths :

$ rpm -U --define "_autorelocate_path %{nil}" --prefix
/usr/local/sofrecom sof-u-2.1.2-1.noarch.rpm
error: Failed dependencies:
/usr is needed by sof-u-2.1.2-1.noarch
/usr/local is needed by sof-u-2.1.2-1.noarch
/usr/local/etc is needed by sof-u-2.1.2-1.noarch
...

The _autorelocate_path macro setting is necessary. Otherwise, the
package is installed under /emul/noarch-hpux11.23 !!!

I'm using rpm 4.4.7 which I have built on HPUX 11.23 / ia64. The RPM
database was initialised with a pseudo package providing usual
interpreters ( /bin/sh, /bin/ksh, /bin/perl, ... ).

Regards,

mailto: ***@sofrecom.com <mailto:***@sofrecom.com>

phone: +33 1 43985883
Jeff Johnson
2008-01-08 14:00:32 UTC
Permalink
Post by ELASRI Patrice SOFRECOM
Hi,
I have built a package located by default under /usr/local.
$ *rpm -U sof-u-2.1.2-1.noarch.rpm*
/usr is needed by sof-u-2.1.2-1.noarch
If I relocate the package, I'm returned the following error, with
$ *rpm -U --define "_autorelocate_path %{nil}" --prefix
/usr/local/sofrecom sof-u-2.1.2-1.noarch.rpm
/usr is needed by sof-u-2.1.2-1.noarch
/usr/local is needed by sof-u-2.1.2-1.noarch
/usr/local/etc is needed by sof-u-2.1.2-1.noarch
...
In rpm-4.4.7 and later, every file depends on its parent directory.

All of the dependency failures you are seeing are parent directories
that aren't packaged.

There is a --noparentdirs that disables the dependencies on parent
directories.

Another easy persistent fix for your specific problem(s) is
mkdir -p /etc/rpm/sysinfo
echo "/usr" >> /etc/rpm/sysinfoDirnames
echo "/usr/local" >> /etc/rpm/sysinfo/Dirnames
echo "/usr/local/etc" >> /etc/rpm/sysinfo/Dirnames
...

There is also ( in 4.4.7+?, I fergit) a --orphandirs popt alias that will
display all directories that are not packaged:
rpm -Va --nofiles --orphandirs
that should generate a sort'd uniq'd list of directories that are not
packaged.
Post by ELASRI Patrice SOFRECOM
The *_autorelocate_path** *macro setting is necessary. Otherwise, the
package is installed under /emul/noarch-hpux11.23 !!!
I'm using rpm 4.4.7 which I have built on HPUX 11.23 / ia64. The RPM
database was initialised with a pseudo package providing usual interpreters
( /bin/sh, /bin/ksh, /bin/perl, … ).
Ah ia64 multilib.

Expect some problems is all that I can say. The implementation of multilib
on ia64
in rpm was done in like 8 hours on a borrowed ia64 developer's box and has
never been
properly QA'd to my knowledge.

SELinux, in particular, is likely to be extremely weird on a multilib/ia64
box
because of the /emul/noarch-hpux11.23 prefix breaking the lookup of
file contexts from SELinux configuration.

I'll be happy to help you sort out any/all multilib/ia64.

Likely <rpm-***@rpm5.org> is a better place to report issues, as only the
few & the brave are attempting HP-UX multilib/ia64 relocated installs with
rpm-4.4.7+.

73 de Jeff
ELASRI Patrice SOFRECOM
2008-01-11 09:03:37 UTC
Permalink
-----Message d'origine-----
De : rpm-list-***@redhat.com [mailto:rpm-list-***@redhat.com] De la part de Jeff Johnson
Envoyé : mardi 8 janvier 2008 15:01
À : RPM Package Manager
Objet : Re: Failed dependencies on /usr





On Jan 8, 2008 8:26 AM, ELASRI Patrice SOFRECOM <***@sofrecom.com> wrote:

Hi,

I have built a package located by default under /usr/local.
When I try to install it, I'm returned the following error :

$ rpm -U sof-u-2.1.2-1.noarch.rpm
error: Failed dependencies:
/usr is needed by sof-u-2.1.2-1.noarch

If I relocate the package, I'm returned the following error, with dependencies on original paths :

$ rpm -U --define "_autorelocate_path %{nil}" --prefix /usr/local/sofrecom sof-u-2.1.2-1.noarch.rpm
error: Failed dependencies:
/usr is needed by sof-u-2.1.2-1.noarch
/usr/local is needed by sof-u-2.1.2-1.noarch
/usr/local/etc is needed by sof-u-2.1.2-1.noarch
...



In rpm-4.4.7 and later, every file depends on its parent directory.



All of the dependency failures you are seeing are parent directories

that aren't packaged.



There is a --noparentdirs that disables the dependencies on parent

directories.



Another easy persistent fix for your specific problem(s) is

mkdir -p /etc/rpm/sysinfo

echo "/usr" >> /etc/rpm/sysinfoDirnames

echo "/usr/local" >> /etc/rpm/sysinfo/Dirnames

echo "/usr/local/etc" >> /etc/rpm/sysinfo/Dirnames

...



Thanks for these information. Is there a document which talks about it ?
I tried the -noparentdirs option and it works fine.



There is also ( in 4.4.7+?, I fergit) a --orphandirs popt alias that will

display all directories that are not packaged:

rpm -Va --nofiles --orphandirs

that should generate a sort'd uniq'd list of directories that are not packaged.

The _autorelocate_path macro setting is necessary. Otherwise, the package is installed under /emul/noarch-hpux11.23 !!!

I'm using rpm 4.4.7 which I have built on HPUX 11.23 / ia64. The RPM database was initialised with a pseudo package providing usual interpreters ( /bin/sh, /bin/ksh, /bin/perl, ... ).



Ah ia64 multilib.



Expect some problems is all that I can say. The implementation of multilib on ia64

in rpm was done in like 8 hours on a borrowed ia64 developer's box and has never been

properly QA'd to my knowledge.



I'm not so aware about the rpm developments ; I'm just an rpm user. What do you means by multilib ?
About the _autorelocate_path macro setting, I noticed that this one is mandatory when the -prefix option is used, what ever the package architecture. Otherwise, the package is installed under /emul/noarch-hpux11.23, or even under /emul/ia64-hpux11.23 for the architecture dependents packages built on ia64.



SELinux, in particular, is likely to be extremely weird on a multilib/ia64 box

because of the /emul/noarch-hpux11.23 prefix breaking the lookup of

file contexts from SELinux configuration.



I'll be happy to help you sort out any/all multilib/ia64.



Likely <rpm-***@rpm5.org> is a better place to report issues, as only the few & the brave are attempting HP-UX multilib/ia64 relocated installs with rpm-4.4.7+.



If you are interested on, I can report you what I did for building and installing RPM on HP-UX.



73 de Jeff
Jeff Johnson
2008-01-11 11:35:35 UTC
Permalink
Post by ELASRI Patrice SOFRECOM
Thanks for these information. Is there a document which talks about it ?
I tried the –noparentdirs option and it works fine.
I'm not sure what else you want documented. The rule
Every file depends on its parent directory.
seems pretty obvious and unambiguous to me.

The issues that I'm aware of are solely with compatibility,
and the --noparentdirs/--parentdirs options are mechanism only, they
cannot solve compatibility issues that depend on distro packaging policy.

There has always been a need in rpm to identify directories that
are not contained in packages, and are left behind when packages
are erased. There is also the need to add SELinux file contexts
to all created files/directories correctly, which is most rationally done
if all directories are contained in some package.
Post by ELASRI Patrice SOFRECOM
There is also ( in 4.4.7+?, I fergit) a --orphandirs popt alias that will
rpm -Va --nofiles --orphandirs
that should generate a sort'd uniq'd list of directories that are not packaged.
The *_autorelocate_path *macro setting is necessary. Otherwise, the
package is installed under /emul/noarch-hpux11.23 !!!
I'm using rpm 4.4.7 which I have built on HPUX 11.23 / ia64. The RPM
database was initialised with a pseudo package providing usual interpreters
( /bin/sh, /bin/ksh, /bin/perl, … ).
Ah ia64 multilib.
Expect some problems is all that I can say. The implementation of multilib on ia64
in rpm was done in like 8 hours on a borrowed ia64 developer's box and has never been
properly QA'd to my knowledge.
I'm not so aware about the rpm developments ; I'm just an rpm user. What
do you means by multilib ?
About the *_autorelocate_path *macro setting, I noticed that this one is
mandatory when the –prefix option is used, what ever the package
architecture. Otherwise, the package is installed under /emul/noarch-
hpux11.23, or even under /emul/ia64-hpux11.23 for the architecture
dependents packages built on ia64.
The term "multilib" comes from gcc and describes conventions for installing
executables/libraries for multiple platforms on a system.

The functionality was added to rpm on ia64 to permit installing ix86
as well as ia64 packages. The _autorelocate_path variable is used
to configure the prefix of the path for the non-native executables.

SELinux, in particular, is likely to be extremely weird on a multilib/ia64
Post by ELASRI Patrice SOFRECOM
box
because of the /emul/noarch-hpux11.23 prefix breaking the lookup of
file contexts from SELinux configuration.
I'll be happy to help you sort out any/all multilib/ia64.
the few & the brave are attempting HP-UX multilib/ia64 relocated installs
with rpm-4.4.7+.
If you are interested on, I can report you what I did for building and
installing RPM on HP-UX.
I'd be interested in any additional patches that are needed; <
rpm-***@rpm5.org>
is the better place to send patches.

73 de Jeff

Michael Jennings
2007-10-08 16:14:46 UTC
Permalink
On Monday, 08 October 2007, at 16:14:05 (+0200),
Post by ELASRI Patrice SOFRECOM
Does someone know a way to get subpackage specific %arch macros
(issued from the BuildArch tag) that do not conflict with the main
package one ?
No. Architecture is based on target, and target is per-build, not
per-package.

Michael
--
Michael Jennings (a.k.a. KainX) http://www.kainx.org/ <***@kainx.org>
Linux Server/Cluster Admin, LBL.gov Author, Eterm (www.eterm.org)
-----------------------------------------------------------------------
"Some mornings, it's just not worth chewing through the leather
straps." -- Emo Phillips
Loading...