RPM %post rule fails ??? - Suse

This is a discussion on RPM %post rule fails ??? - Suse ; Hi, I am trying to build a RPM package, that installs an icon on the current user's desktop. Better would be installing the icon to every user's desktop. This will fail: %post cp %{prefix}/share/lbdmf/wxWrapper.desktop /home/`who | awk 'BEGIN {} { ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: RPM %post rule fails ???

  1. RPM %post rule fails ???

    Hi,

    I am trying to build a RPM package, that installs an icon on the
    current user's desktop.
    Better would be installing the icon to every user's desktop.

    This will fail:

    %post
    cp %{prefix}/share/lbdmf/wxWrapper.desktop /home/`who | awk 'BEGIN {}
    { print $$1; }'`/Desktop
    ldconfig

    %postun
    rm /home/`who | awk 'BEGIN {} { print $$1; }'`/Desktop/
    wxWrapper.desktop

    How could I reach what I want to do ?

    Thanks, Lothar


  2. Re: RPM %post rule fails ???

    Lothar Behrens wrote:
    > Hi,
    >
    > I am trying to build a RPM package, that installs an icon on the
    > current user's desktop.
    > Better would be installing the icon to every user's desktop.


    For new users, you put it in /etc/skel/....
    That way each new user will get whatever is in /etc/skel/...

    Installing for existing users I would do by not looking with `who`
    because not eevrybody will be logged in, but by looking at
    /home/*/wherever.

    I would do some serious testing to be sure that ONLY users will get it.
    This by looking at /etc/users (I think) and then be sure not to include
    admin-users. first look at /home/*/ and see what * is, then look at
    /etc/users if the user exists.

    houghi
    --
    If God doesn't destroy Hollywood Boulevard, he owes Sodom and
    Gomorrah an apology.

  3. Re: RPM %post rule fails ???

    On Mon, 17 Sep 2007, Lothar Behrens wrote:-

    >Hi,
    >
    >I am trying to build a RPM package, that installs an icon on the
    >current user's desktop.
    >Better would be installing the icon to every user's desktop.


    Even better would be to give the (other) user(s) a choice as to whether
    they want an icon on the desktop.

    The best idea would be to add a desktop menu entry[0] and if the user
    wants a desktop icon, they can create one themselves. Of course, after
    the program is removed, they'd have to remove the icon themselves.



    >How could I reach what I want to do ?


    If you really want to add an icon to the desktop, have the program check
    to see if there's one there when it starts up and add one if not. You'll
    need it to maintain a list of where it's created the desktop icons so
    they can be removed when the program is removed[1].

    One other question. Have you thought how you'd add an icon to users
    added after your package is installed?


    [0]

    [1] Don't forget to think about malicious local users if this is
    implemented. All it takes is a slight edit of the list and, because the
    program would be removed by root, it could be made to remove any file or
    files.

    Regards,
    David Bolt

    --
    Member of Team Acorn checking nodes at 100 Mnodes/s: www.distributed.net
    RISC OS 3.11 | SUSE 10.0 32bit | SUSE 10.1 32bit | openSUSE 10.2 32bit
    RISC OS 3.6 | SUSE 10.0 64bit | SUSE 10.1 64bit | openSUSE 10.2 64bit
    TOS 4.02 | SUSE 9.3 32bit | | openSUSE 10.3b2 32bit

  4. Re: RPM %post rule fails ???

    David Bolt wrote:
    > On Mon, 17 Sep 2007, Lothar Behrens wrote:-
    >
    >>Hi,
    >>
    >>I am trying to build a RPM package, that installs an icon on the
    >>current user's desktop.
    >>Better would be installing the icon to every user's desktop.

    >
    > Even better would be to give the (other) user(s) a choice as to whether
    > they want an icon on the desktop.


    That depends on wether it is a company enviroment or not. If it is and
    you want an identical desktop, then perhaps it might even be better to
    place it outside /hoe/user/ and symlink the things that need to be
    identical. That all however is out of scope for this question, I think.

    > One other question. Have you thought how you'd add an icon to users
    > added after your package is installed?


    That is where /etc/skel/* comes into play. On any multi user system, you
    should edit /etc/skel to your wants and needs once you desire to have
    real control over new users.

    Most things in that directory are placed ther by aaa_skel, except that
    the following put something there as well:
    xorg-x11-7.2-26.i586.rpm: /etc/skel/.xinitrc.template
    x11-tools-0.1-57.i586.rpm: /etc/skel/.xim.template
    emacs-21.3-249.i586.rpm: /etc/skel/.gnu-emacs

    There might be others as well.

    Oh and that URL? Somebody seriously messed up the numbering in the menu.
    # 1.4.9 9.4.9. System Categories
    :-D

    houghi
    --
    If God doesn't destroy Hollywood Boulevard, he owes Sodom and
    Gomorrah an apology.

  5. Re: RPM %post rule fails ???

    On Mon, 17 Sep 2007, houghi wrote:-



    >Oh and that URL? Somebody seriously messed up the numbering in the menu.
    ># 1.4.9 9.4.9. System Categories


    I know. The person(s) who moved it from static HTML files onto the wiki
    left in the original section numbering. The problem is that the wiki
    doesn't remember the numbering across pages and so you end up with that
    sort of numbering.

    When I first transcribed my own version, I dropped all the original
    section numbering so, if you were to look at that same page on my wiki,
    the table of contents shows "1.4.9 System Categories". Other than that,
    and the fact that section titles don't include the section numbering,
    it's virtually identical[0] to the opensuse.org version.


    [0] Well, it's not in quite the same name-space, and I've had to add the
    section 11 that wasn't included in the older HTML version, but that's
    about the only difference.

    Regards,
    David Bolt

    --
    Member of Team Acorn checking nodes at 100 Mnodes/s: www.distributed.net
    RISC OS 3.11 | SUSE 10.0 32bit | SUSE 10.1 32bit | openSUSE 10.2 32bit
    RISC OS 3.6 | SUSE 10.0 64bit | SUSE 10.1 64bit | openSUSE 10.2 64bit
    TOS 4.02 | SUSE 9.3 32bit | | openSUSE 10.3b2 32bit

  6. Re: RPM %post rule fails ???

    David Bolt wrote:
    > I know. The person(s) who moved it from static HTML files onto the wiki
    > left in the original section numbering. The problem is that the wiki
    > doesn't remember the numbering across pages and so you end up with that
    > sort of numbering.


    Looked at it, just did not dare to change it, because it might be worse.
    It is a wiki, so if somebody feels in reairing it, please do.

    houghi
    --
    If God doesn't destroy Hollywood Boulevard, he owes Sodom and
    Gomorrah an apology.

  7. Re: RPM %post rule fails ???

    On Mon, 17 Sep 2007, houghi wrote:-

    >David Bolt wrote:
    >> I know. The person(s) who moved it from static HTML files onto the wiki
    >> left in the original section numbering. The problem is that the wiki
    >> doesn't remember the numbering across pages and so you end up with that
    >> sort of numbering.

    >
    >Looked at it, just did not dare to change it, because it might be worse.


    There's always the undo feature of wiki, just in case you make a really
    bad mistake, plus there's the preview button so you can see what the
    changes look like before you save the page :-)

    Unfortunately, while it's an option available to Mediawiki, the wiki at
    opensuse.org doesn't enforce a preview before allowing changes to be
    saved.

    >It is a wiki, so if somebody feels in reairing it, please do.


    I looked at it and changed a tiny piece before posting the link. In
    section 9.3, Installation and Update, the bits that are now
    pre-formatted
    text originally contained a load of '?' in place of spaces, and was
    using '
    ' tags to do the formatting. I stripped those out, changed
    the '?' to spaces and converted it to pre-formatted text, generally
    making it consistent with the rest of the page.

    Thinking about it, when it was mentioned that they were going to put the
    packaging conventions on the wiki, I should have just added my already
    transcribed version, making it fit into their name-space and let them
    update that. They'd have still had to add the section 11, but most of
    the work would have already been done.

    One more small change later, and now the revision history is correct :-)


    Regards,
    David Bolt

    --
    Member of Team Acorn checking nodes at 100 Mnodes/s: www.distributed.net
    RISC OS 3.11 | SUSE 10.0 32bit | SUSE 10.1 32bit | openSUSE 10.2 32bit
    RISC OS 3.6 | SUSE 10.0 64bit | SUSE 10.1 64bit | openSUSE 10.2 64bit
    TOS 4.02 | SUSE 9.3 32bit | | openSUSE 10.3b2 32bit

  8. Re: RPM %post rule fails ???

    David Bolt wrote:
    > On Mon, 17 Sep 2007, houghi wrote:-
    >
    >>David Bolt wrote:
    >>> I know. The person(s) who moved it from static HTML files onto the wiki
    >>> left in the original section numbering. The problem is that the wiki
    >>> doesn't remember the numbering across pages and so you end up with that
    >>> sort of numbering.

    >>
    >>Looked at it, just did not dare to change it, because it might be worse.

    >
    > There's always the undo feature of wiki, just in case you make a really
    > bad mistake, plus there's the preview button so you can see what the
    > changes look like before you save the page :-)
    >
    > Unfortunately, while it's an option available to Mediawiki, the wiki at
    > opensuse.org doesn't enforce a preview before allowing changes to be
    > saved.


    Well, I have no idea how to correct it. It has the following numbering:
    1. 9.
    1.1. 9.1.
    1.2. 9.2.
    1.3. 9.3.
    1.4. 9.4.
    1.4.1. 9.4.1.
    1.4.2. 9.4.2.
    instead of
    9.
    9.1.
    9.2.
    9.3.
    9.4.
    9.4.1.
    9.4.2.

    For those who want to know why it starts at 9 and not 1, please look at
    http://en.opensuse.org/Packaging/SUS...ge_Conventions

    Looks like a bug to me in the Wiki. Look at the other pages coming from
    there. They have the same issue.

    houghi
    --
    > Knock-knock.
    > Who's there?
    > Under the Patriot Act, we don't have to tell you that.


  9. Re: RPM %post rule fails ???

    On Tue, 18 Sep 2007, houghi wrote:-



    >For those who want to know why it starts at 9 and not 1, please look at
    >http://en.opensuse.org/Packaging/SUS...ge_Conventions
    >
    >Looks like a bug to me in the Wiki. Look at the other pages coming from
    >there. They have the same issue.


    It's not really a bug in Wiki. The reason for the numbering is because
    Wiki starts counting at sections, subsections, etc. from one, and each
    page is completely independent of any other. If the whole of the SPC
    document had been put up on a single page, the numbering would have been
    correct, but because the sections are split into separate pages, the
    numbering ends up broken.

    So, without modifying Wiki so it either remembers previous page
    numbering, or it allows for an initial section number offset to be
    added, there are three things I can see that can be done:

    1, leave it as-is, even though it looks ugly and might even be slightly
    confusing;
    2, merge the whole lot into a single page;
    3, drop the original section numbering and let Wiki provide them itself.

    I chose the third option. Here's a comparison so you can see the
    difference:


    esktop_Menu>


    Regards,
    David Bolt

    --
    Member of Team Acorn checking nodes at 100 Mnodes/s: www.distributed.net
    RISC OS 3.11 | SUSE 10.0 32bit | SUSE 10.1 32bit | openSUSE 10.2 32bit
    RISC OS 3.6 | SUSE 10.0 64bit | SUSE 10.1 64bit | openSUSE 10.2 64bit
    TOS 4.02 | SUSE 9.3 32bit | | openSUSE 10.3b2 32bit

  10. Re: RPM %post rule fails ???

    David Bolt wrote:
    > On Tue, 18 Sep 2007, houghi wrote:-
    >
    >
    >
    >>For those who want to know why it starts at 9 and not 1, please look at
    >>http://en.opensuse.org/Packaging/SUS...ge_Conventions
    >>
    >>Looks like a bug to me in the Wiki. Look at the other pages coming from
    >>there. They have the same issue.

    >
    > It's not really a bug in Wiki. The reason for the numbering is because
    > Wiki starts counting at sections, subsections, etc. from one, and each
    > page is completely independent of any other. If the whole of the SPC
    > document had been put up on a single page, the numbering would have been
    > correct, but because the sections are split into separate pages, the
    > numbering ends up broken.


    I see that as a bug. You are unable to start with a different number
    then 9. If you try, it produces unexpected coding. That is a bug to me.

    The fact that you can explain why something happens does not suddenly
    make it not a bug anymore.

    houghi
    --
    > Knock-knock.
    > Who's there?
    > Under the Patriot Act, we don't have to tell you that.


+ Reply to Thread