Post-install script execution in a package - BSD

This is a discussion on Post-install script execution in a package - BSD ; Hi all, Sorry to bother you, but I'm stuck. I have been trying to make a customized package with a post-install script but I can't find out how to do it. ( Openbsd 3.8 ). I am using an existing ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Post-install script execution in a package

  1. Post-install script execution in a package

    Hi all,

    Sorry to bother you, but I'm stuck.

    I have been trying to make a customized package with a post-install
    script but I can't find out how to do it. ( Openbsd 3.8 ).
    I am using an existing port where I customized the Makefile to change
    some configuration options , then execute "make package".

    Using the target post-install in the Makefile seems only to be
    executed when I do the "make install" in the port directory.

    Is there a way to make post-install scripts executed at the
    installation of a package ?
    I tried to untar existing packages with post-install in their port's
    Makefile but can't find any trace of a post-install script.

    Regards,
    Matt


  2. Re: Post-install script execution in a package

    drymizu@gmail.com wrote:
    > Hi all,
    >
    > Sorry to bother you, but I'm stuck.
    >
    > I have been trying to make a customized package with a post-install
    > script but I can't find out how to do it. ( Openbsd 3.8 ).


    Upgrade. Really.

    > I am using an existing port where I customized the Makefile to change
    > some configuration options , then execute "make package".
    >
    > Using the target post-install in the Makefile seems only to be
    > executed when I do the "make install" in the port directory.
    >
    > Is there a way to make post-install scripts executed at the
    > installation of a package ?
    > I tried to untar existing packages with post-install in their port's
    > Makefile but can't find any trace of a post-install script.


    It's usually a better idea to use pkg/MESSAGE, anyway. But if you
    *really* want to do, it's probably best to look at a port that already
    does it and copy that behaviour. Postfix is an obvious example.

    Do note that you'll want to use @exec/@unexec in pkg/PLIST instead of
    obsolote stuff that will break as soon as you upgrade your system to a
    modern version (i.e. pkg/INSTALL, which will no longer work in 4.2, see
    ports/mail/postfix/snapshots/Makefile r1.170). Postfix uses this in
    -current; look at
    http://www.openbsd.org/cgi-bin/cvswe...tfix/snapshot/ for
    details.

    Joachim

  3. Re: Post-install script execution in a package

    Thanks for your tips.

    On Aug 8, 6:01 am, "Joachim Schipper"
    wrote:
    > It's usually a better idea to use pkg/MESSAGE, anyway. But if you
    > *really* want to do, it's probably best to look at a port that already
    > does it and copy that behaviour. Postfix is an obvious example.
    >
    > Do note that you'll want to use @exec/@unexec in pkg/PLIST instead of
    > obsolote stuff that will break as soon as you upgrade your system to a
    > modern version (i.e. pkg/INSTALL, which will no longer work in 4.2, see
    > ports/mail/postfix/snapshots/Makefile r1.170). Postfix uses this in
    > -current; look athttp://www.openbsd.org/cgi-bin/cvsweb/ports/mail/postfix/snapshot/for
    > details.


    This fixed my problem.
    Thank you

    Anyway you know if there is a doc for existing commands as @exec,
    @unexec ?
    I was not able to find the man page talking about that.

    Matt


  4. Re: Post-install script execution in a package

    In article <1186453333.403184.312240@i13g2000prf.googlegroups. com>,
    wrote:
    >Hi all,
    >
    >Sorry to bother you, but I'm stuck.
    >
    >I have been trying to make a customized package with a post-install
    >script but I can't find out how to do it. ( Openbsd 3.8 ).
    >I am using an existing port where I customized the Makefile to change
    >some configuration options , then execute "make package".
    >
    >Using the target post-install in the Makefile seems only to be
    >executed when I do the "make install" in the port directory.


    You're hopelesly confused. Read the description of ports builds in ports(7)
    and bsd.port.mk(5). Focus on THE FAKE FRAMEWORK.

    The post-install target has no incidence on the package installation. It's
    all done during fake.

    >Is there a way to make post-install scripts executed at the
    >installation of a package ?
    >I tried to untar existing packages with post-install in their port's
    >Makefile but can't find any trace of a post-install script.


    Put your script in the file system, add an @exec line in the packing-list.
    Refer to pkg_create(1) for details.

    Caveat: there are lots and lots of not so special cases that are better
    dealt with WITHOUT using install scripts. Install scripts are special,
    they break when you install stuff, they break when you update stuff, they
    break when you remove stuff.

    Think twice: do you really need that install script ? If you still think
    so, think again. If you still think so, tell us about it.

    As Joachim pointed out, as of 4.2, we have removed ALL install scripts from
    the ports tree. The infrastructure is still there in pkg_create, but it
    will be removed as well.

    @exec/@unexec, especially with the new modes it has, is much simpler to
    use, and needs ways less documentation. It's still fairly dangerous if
    you don't know what you're doing...

  5. Re: Post-install script execution in a package

    On Aug 8, 9:31 am, es...@lain.home (Marc Espie) wrote:
    > Caveat: there are lots and lots of not so special cases that are better
    > dealt with WITHOUT using install scripts. Install scripts are special,
    > they break when you install stuff, they break when you update stuff, they
    > break when you remove stuff.
    >
    > Think twice: do you really need that install script ? If you still think
    > so, think again. If you still think so, tell us about it.


    But using @exec/@unexec is more or less like an INSTALL since you
    can execute commands on installation of the package, am I right ?

    > As Joachim pointed out, as of 4.2, we have removed ALL install scripts from
    > the ports tree. The infrastructure is still there in pkg_create, but it
    > will be removed as well.
    >
    > @exec/@unexec, especially with the new modes it has, is much simpler to
    > use, and needs ways less documentation. It's still fairly dangerous if
    > you don't know what you're doing...


    Effectively, I think that the @exec/@unexec way to do things is
    convenient enough,
    so I don't think INSTALL scripts are needed anymore with it.

    Regards,
    Matt


  6. Re: Post-install script execution in a package

    In article <1186533962.468204.323300@d30g2000prg.googlegroups. com>,
    wrote:
    >On Aug 8, 9:31 am, es...@lain.home (Marc Espie) wrote:
    >> Caveat: there are lots and lots of not so special cases that are better
    >> dealt with WITHOUT using install scripts. Install scripts are special,
    >> they break when you install stuff, they break when you update stuff, they
    >> break when you remove stuff.
    >>
    >> Think twice: do you really need that install script ? If you still think
    >> so, think again. If you still think so, tell us about it.

    >
    >But using @exec/@unexec is more or less like an INSTALL since you
    >can execute commands on installation of the package, am I right ?


    yes, @exec and @unexec are *still* dangerous, and you *still* must think
    twice before using them.

    Long-term, a lot of the stuff that currently uses @exec will use other
    mechanisms. Because it's more or less always register/deregister stuff,
    which is a nicer way to think about it.

    The more the packages understand the semantics of what's going on, the
    better. Then you only fix bugs once, instead of reinventing the wheel all
    over the place.

    INSTALL scripts have always beeen a total nightmare. Most of them do not
    interact well with existing frameworks, a large proportion of them are
    buggy.

+ Reply to Thread