On 2014/04/27 20:09, Antoine Jacoutot wrote:
> On Sun, Apr 27, 2014 at 07:55:50PM +0200, Michał Lesiak wrote:
> > So, is it allowed in OpenBSD for the packages to have self-contained
> > install/deinstall scripts (like pkg-install
> > in FreeBSD) and if so, how do I do that? (I've been through Porter's
> > Handbook but to no avail),
> > if not - what's the OpenBSD's way to handle a situation when a package needs
> > to run some complex
> > post-install script?
> 
> If you need to run some scripts/commands before creating the actual package, 
> you can use the post-install target.
> If you need to run some scripts/commands automatically after the package is 
> added with pkg_add, I think your best bet is to install a script that will 
> run whatever needs be and call it with:
> @exec /path/to/script
> so that when you do 'pkg_add foobar', /path/to/script (which is part of the 
> foobar package) is run.

+1, but may want @exec-add rather than @exec for this. See pkg_create(1).
For an example of a port doing something like this, see mail/postfix
(there aren't many examples as we try and avoid anything complex at
this stage).


Reply via email to