Re: Problem with %attr/%defattr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks Elia!

Exactly what I was looking for.
Ive put attr independently for each file - now it works.


On Sat, Oct 8, 2011 at 5:30 PM, <rpm-list-request@xxxxxxxxxxxxx> wrote:
Send Rpm-list mailing list submissions to
       rpm-list@xxxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
       http://lists.rpm.org/mailman/listinfo/rpm-list
or, via email, send a message with subject or body 'help' to
       rpm-list-request@xxxxxxxxxxxxx

You can reach the person managing the list at
       rpm-list-owner@xxxxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Rpm-list digest..."


Today's Topics:

  1. Problem with %attr/%defattr (Amol Kulkarni)
  2. Re: Problem with %attr/%defattr (Jos Vos)
  3. Re: Problem with %attr/%defattr (devzero2000)
  4. rpm: failed dependency even though the dso library is
     installed, but seems to not be "provided" (Jim Galarowicz)


----------------------------------------------------------------------

Message: 1
Date: Fri, 7 Oct 2011 18:11:15 +0530
From: Amol Kulkarni <amolk112k@xxxxxxxxx>
To: rpm-list@xxxxxxxxxxxxx
Subject: Problem with %attr/%defattr
Message-ID:
       <CABhJRgMW+_7ogzQPBbD7urRGow7VFTuR5hS3pccmFzFrMtvXug@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="iso-8859-1"

Dear All,

I had built some RPMs for our product on RHEL4  ( rpm ver= rpm-4.3.3-26 ).
Now I'm migrating these rpms to RHEL6 ( rpm ver = rpm-4.8.0-16 ).

One of the rpms has files owned by different users.

Eg. In qmail queue, "queue/remote" folder is owned by "qmails" user while
"queue/todo" folder is owned by "qmailq" user.

The qmail makefile creates the files with appropriate permissions and
ownerships. There is no code to set the permissions/ownership in spec file.

In RHEL4, rpm was automatically taking the file permissions set on the files
during the build/compile phase. But in RHEL6, it is changing the ownership
to root.root.

My files section is :

%files
/var/qmail/bin
/var/qmail/boot
%config(noreplace) /var/qmail/control
/var/qmail/doc
/var/qmail/log
/var/qmail/man
%config(noreplace) /var/qmail/queue
/var/qmail/users
/var/qmail/rc


After searching the net, I tried using %defattr(-,-,-,-) macro at global
level and the %attr(-,-,-) macro per entry in the %files section. But to no
avail.

Can anybody point me in the right direction ?

Thanks for all the help in advance.
Amol.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20111007/cfdcd442/attachment-0001.html>

------------------------------

Message: 2
Date: Fri, 7 Oct 2011 14:57:17 +0200
From: Jos Vos <jos@xxxxxx>
To: General discussion about the RPM package manager
       <rpm-list@xxxxxxxxxxxxx>
Subject: Re: Problem with %attr/%defattr
Message-ID: <20111007125717.GA15842@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset=us-ascii

On Fri, Oct 07, 2011 at 06:11:15PM +0530, Amol Kulkarni wrote:

> The qmail makefile creates the files with appropriate permissions and
> ownerships. There is no code to set the permissions/ownership in spec file.

In %install a package should *never* set ownership of files, as you
should be able to build the package as *any* user (building a package
as root is almost a crime ;-)).  If the Makefile does this, you should
apply a patch in your package to avoid this.

> In RHEL4, rpm was automatically taking the file permissions set on the files
> during the build/compile phase. But in RHEL6, it is changing the ownership
> to root.root.
>
> My files section is :
>
> %files
> /var/qmail/bin
> /var/qmail/boot
> %config(noreplace) /var/qmail/control
> /var/qmail/doc
> /var/qmail/log
> /var/qmail/man
> %config(noreplace) /var/qmail/queue
> /var/qmail/users
> /var/qmail/rc
>
> After searching the net, I tried using %defattr(-,-,-,-) macro at global
> level and the %attr(-,-,-) macro per entry in the %files section. But to no
> avail.

You don't need to use %defattr (defaults to -,root,root), but use %attr
for the files/dirs that need a non-root owner/group, e.g.

%attr(-,qmails,root) /var/qmail/queue/remote
%attr(-,qmailq,root) /var/qmail/queue/remote

Hope this helps,

--
--    Jos Vos <jos@xxxxxx>
--    X/OS Experts in Open Systems BV   |   Phone: +31 20 6938364
--    Amsterdam, The Netherlands        |     Fax: +31 20 6948204


------------------------------

Message: 3
Date: Fri, 7 Oct 2011 15:59:00 +0200
From: devzero2000 <pinto.elia@xxxxxxxxx>
To: General discussion about the RPM package manager
       <rpm-list@xxxxxxxxxxxxx>
Subject: Re: Problem with %attr/%defattr
Message-ID:
       <CAH5b-BVJU6ZQuDefybMYuj9HW1vJuXOabVP5yONXYst2ukfFaw@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="iso-8859-1"

On Fri, Oct 7, 2011 at 2:41 PM, Amol Kulkarni <amolk112k@xxxxxxxxx> wrote:

> Dear All,
>
> I had built some RPMs for our product on RHEL4  ( rpm ver= rpm-4.3.3-26 ).
> Now I'm migrating these rpms to RHEL6 ( rpm ver = rpm-4.8.0-16 ).
>
> One of the rpms has files owned by different users.
>
> Eg. In qmail queue, "queue/remote" folder is owned by "qmails" user while
> "queue/todo" folder is owned by "qmailq" user.
>
> The qmail makefile creates the files with appropriate permissions and
> ownerships. There is no code to set the permissions/ownership in spec file.
>
> In RHEL4, rpm was automatically taking the file permissions set on the
> files during the build/compile phase. But in RHEL6, it is changing the
> ownership to root.root.
>
> My files section is :
>
> %files
> /var/qmail/bin
> /var/qmail/boot
> %config(noreplace) /var/qmail/control
> /var/qmail/doc
> /var/qmail/log
> /var/qmail/man
> %config(noreplace) /var/qmail/queue
> /var/qmail/users
> /var/qmail/rc
>
>
> After searching the net, I tried using %defattr(-,-,-,-) macro at global
> level and the %attr(-,-,-) macro per entry in the %files section. But to no
> avail.
>
> Can anybody point me in the right direction ?
>
> Thanks for all the help in advance.
>
In rpm 4.4 (Oct 31 2004) was introduced the "add default
%defattr(-,root,root) for all packages". So the "problem" is not only in
RHEL6 but also RHEL5 for example.

IIUC you're basing your spec on  a behavior later deemed incorrect. My
advice, as already mentioned, is to use multiple %attr or use, if you have
many file, multiple %defattr with the right perms and ownership.


hth

> Amol.
>
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@xxxxxxxxxxxxx
> http://lists.rpm.org/mailman/listinfo/rpm-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20111007/09dd63f7/attachment-0001.html>

------------------------------

Message: 4
Date: Fri, 07 Oct 2011 09:28:44 -0500
From: Jim Galarowicz <jeg@xxxxxxxxxxxxx>
To: General discussion about the RPM package manager
       <rpm-list@xxxxxxxxxxxxx>
Subject: rpm: failed dependency even though the dso library is
       installed, but seems to not be "provided"
Message-ID: <4E8F0C9C.9030408@xxxxxxxxxxxxx>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi everyone,

I have successfully built an openspeedshop rpm and installed it before,
but now I'm having a problem with the latest source and spec file when
trying to install the latest version of the openspeedshop rpm file.

Specifically, I'm having trouble with a dso that is built in my own tool
(OpenSpeedShop, www.openspeedshop.org).
When I try to install, rpm installs flag the "so.0" variant to be not
provided.
I believe the automake option in the makefile is creating
libopenss-cli.so which is linked to libopenss-cli.so.0.0.0 and
additionally libopenss-cli.so.0 is also linked to libopenss-cli.so.0.0.0.

Another library, libopenss-framework builds and installs successfully.
libopenss-framework.so variants also appear to be similar but I don't
have a problem with those dsos and rpm installation.

[root@localhost kickstart-files]# ls -lastr /opt/OSS/lib64/libopenss-cli.*
23056 -rw-r--r--. 1 root root 23608899 Sep 27 21:34
/opt/OSS/lib64/libopenss-cli.so.0.0.0
    4 -rwxr-xr-x. 1 root root     1541 Sep 27 21:34
/opt/OSS/lib64/libopenss-cli.la
    0 lrwxrwxrwx. 1 root root       22 Sep 28 07:27
/opt/OSS/lib64/libopenss-cli.so.0 -> libopenss-cli.so.0.0.0
    0 lrwxrwxrwx. 1 root root       22 Sep 28 07:27
/opt/OSS/lib64/libopenss-cli.so -> libopenss-cli.so.0.0.0

[root@localhost kickstart-files]# ls -lastr
/opt/OSS/lib64/libopenss-framework.*
8276 -rwxr-xr-x. 1 root root 8470629 Sep 27 21:34
/opt/OSS/lib64/libopenss-framework.so.1.0.0
   4 -rwxr-xr-x. 1 root root    1053 Sep 27 21:34
/opt/OSS/lib64/libopenss-framework.la
   0 lrwxrwxrwx. 1 root root      28 Sep 28 07:27
/opt/OSS/lib64/libopenss-framework.so.1 -> libopenss-framework.so.1.0.0
   0 lrwxrwxrwx. 1 root root      28 Sep 28 07:27
/opt/OSS/lib64/libopenss-framework.so -> libopenss-framework.so.1.0.0


Here is the error I'm seeing:

rpm --install openspeedshop.OSS.x86_64.rpm
error: Failed dependencies:
    libopenss-cli.so.0()(64bit) is needed by openspeedshop-2.0.1-3.x86_64

or when I try to build a live CD:
Error creating Live CD : Failed to build transaction :
openspeedshop-2.0.1-3.x86_64 requires libopenss-cli.so.0()(64bit)

I forced an install of OpenSpeedShop and the components on my laptop and
now I can use some of the rpm options to query the installed rpm.
I had to do rpm --install --nodeps in order to get around the error
message:
  openspeedshop-2.0.1-3.x86_64 requires libopenss-cli.so.0()(64bit)

I'm seeing the libopenss-cli.so.0.0.0 does not follow the pattern of the
other OpenSpeedShop dsos when I do this query:
        rpm --query --fileprovide openspeedshop-2.0.1-3.x86_64

...
...
/opt/OSS/lib64/libopenss-CustomExperimentPanel.so.0.0.0
libopenss-CustomExperimentPanel.so.0()(64bit)
/opt/OSS/lib64/libopenss-ExprInfo.so.0.0.0
libopenss-ExprInfo.so.0()(64bit)
/opt/OSS/lib64/libopenss-framework-binutils.so.1.0.0
libopenss-framework-binutils.so.1()(64bit)
/opt/OSS/lib64/libopenss-gui.so.0.0.0   libopenss-gui.so.0()(64bit)
...
/opt/OSS/lib64/libopenss-cli.so.0.0.0             ##### Nothing listed
here - no libopenss-cli.so.0 like the other dsos

I think that is the key, but the Makefile.am for libopenss-cli has the
same  "-export-dynamic -version-info 0:0:0" clause that
the other dsos that show provides output that I'd like to see for
libopenss-cli: "/opt/OSS/lib64/libopenss-gui.so.0.0.0
libopenss-gui.so.0()(64bit)"

libopenss_cli_la_LDFLAGS = \
        -L$(top_srcdir)/libopenss-message \
        -L$(top_srcdir)/libopenss-framework \
        -L$(top_srcdir)/libopenss-queries \
        @PYTHON_LDFLAGS@ \
        @OPENMP_LDFLAGS@ \
        -export-dynamic -version-info 0:0:0

Does anyone have any experience with this kind of issue?

It seems it could be an autotools usage or rpm spec file issue?  I hope
this is the correct list to post this.

Thanks,
Jim G



------------------------------

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list


End of Rpm-list Digest, Vol 128, Issue 5
****************************************

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux