Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Apr 2018 17:46:11 +0200
From:      Mathieu Arnold <mat@FreeBSD.org>
To:        Gerhard Schmidt <estartu@ze.tum.de>
Cc:        Freebsd Ports <freebsd-ports@freebsd.org>, Mathieu Arnold <mat@FreeBSD.org>
Subject:   Re: flavors and rc scripts
Message-ID:  <20180403154611.nlljbkp5eqaqdopy@ogg.in.absolight.net>
In-Reply-To: <6d3d4733-058d-c17e-5964-a5bc8c4a1e32@ze.tum.de>
References:  <b5cce474-45d6-aa2b-332a-7325e3a5ade2@ze.tum.de> <20180403115735.hduffiw2xvscqe5a@ogg.in.absolight.net> <6d3d4733-058d-c17e-5964-a5bc8c4a1e32@ze.tum.de>

next in thread | previous in thread | raw e-mail | index | archive | help

--eolb5omoeyf2cdja
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Apr 03, 2018 at 03:01:45PM +0200, Gerhard Schmidt wrote:
> Am 03.04.2018 um 13:57 schrieb Mathieu Arnold:
> > On Tue, Apr 03, 2018 at 09:26:51AM +0200, Gerhard Schmidt wrote:
> >> Hi,
> >>
> >> I'm trying to build a python package that uses flavors to allow parall=
el
> >> installation for different python versions.
> >>
> >> So far building an installing works fine till the start script comes in
> >> the picture.
> >>
> >> The port should install a start script for each of the flavors
> >> installed, but USE_RC_SUBR installs the rc.script under the name given
> >> and don't add the prefix or suffix. When i use
> >> USE_RC_SUBR=3D${PYTHON_PKGNAMEPREFIX}scriptname i have to add a start
> >> script for every flavor.
> >>
> >> Is there a way to gent USE_RC_SUBR to add the prefix or suffix.
> >=20
> > I am not sure I understand exacly what you want to achieve by installing
> > different flavors of the same daemon.
> >=20
> > Would you want it to run multiple times?
> >=20
> > What happens with the rc variables?
> >=20
> > Are all the flavors managed using the same variables, and then, all the
> > daemons run concurrently?
> >=20
> > Are they supposed to be named something like this for the default
> > flavor:
> >=20
> > scriptname_arguments
> > scriptname_pidfile
> >=20
> > and like this for a non default flavor:
> >=20
> > scriptname_py36_arguments
> > scriptname_py36_pidfile
>=20
> Yes. There should be running multiple daemons with different python
> versions. And the rc script itself can start multiple daemons with
> different profiles.
>=20
> the variables start all with <flavor>_<packagename>_... but the
> rc_scripts are all generated from the same template using SUB_FILE and
> SUB_LIST to generate the flavor specific version.
>=20
> There could be another way to do this by installing one rc file for all
> flavors. But I don't know how to do this either. The first flavor
> installed would install the rc and the last flavor to be removed would
> need to remove it. So the approach above seams the more reasonable one.

Well, rc.subr has no support for multiple flavors, or what is more
generically called profiles, so this is something that the one
flavorized port that needs to be installed concurrently and that has a
rc file would have to do itself.

It should probably not use USE_RC_SUBR, but do manually the two things
it does, something along the lines of:

	SUB_FILES=3D  rcfilename

	post-install:
		${INSTALL_SCRIPT} ${WRKDIR}/rcfilename \
			${STAGEDIR}${PREFIX}/etc/rc.d/unique-rcfilename

Add the unique-rcfilename to the plist.  You will probably need to add
some placeholders to SUB_LIST to uniquify the variables.

This all looks like way more work than it may be worth.

--=20
Mathieu Arnold

--eolb5omoeyf2cdja
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQJ8BAABCgBmBQJaw6HCXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQzQUI2OTc4OUQyRUQxMjEwNjQ0MEJBNUIz
QTQ1MTZGMzUxODNDRTQ4AAoJEDpFFvNRg85IS+IP/jIy2LZc2P9OH21XrhbVpRjc
RI9LM50MhtUM5eVgyw8N+oxY+H6yYZTd3LbZCV1/A8vCO8PuvUY6/TatughtD5e2
L0grboDID39K/8tH2rYLYFwoPZs1jmgj9Aue9CqXRVPsgTrNN5hCunUZYlLMC0gr
P7kpN14izRSd+glnrpva8SeXOo7Kf3vcDgM8Kl/PE3Kf/wJDp0n8glCectqwGfVN
7Pq3cqqq56by6i+HGCbo4178o2G+xhEA/KA/JGD1ps9eorVySYtskQVKnB19pLE+
hNHx9HYUfJhSLsDST9z7D/rdrqqYfsIUIJHtUTVfhUgI8KEinPj/g7kKqMMCw/DU
JraddGkbS9Xudc+uHGMqKYoq9phiF82Tz+hEqp4tNDg6wSwzwYEy2j8EtVEKUqIQ
QzxamPEGb9YnDx7haRt3aB/A89WQ663661yuSRuj1+DRYhy0YYenTc2HxFZ24yFF
3Zesw9/47vZaReP+nUC79swS/vYvQ8Rcou14+JAhcxqmRw9xzPy5f91INMkzq3wg
fAZ1dJE86N1gVfweWyxNXKsDFJ1nOM7Yxt4YxJeRcXPP+Y+zJgom2XYfJxr+Ntxo
7BECDqvlUBQ4bkceKDezwVHZ1CM7rmSD+cPZ4o1lEFmw6CdLpNr0Pu+2Ue4+lkrN
tYUmyjItxS/5lbXQqoD+
=k1O6
-----END PGP SIGNATURE-----

--eolb5omoeyf2cdja--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180403154611.nlljbkp5eqaqdopy>