Date: Tue, 9 May 2006 09:50:25 +0100 From: Aren Olvalde Tyr <aren.tyr@gawab.com> To: freebsd-ports@freebsd.org Subject: Re: ports structure and improvement suggestions Message-ID: <200605090950.33459.aren.tyr@gawab.com> In-Reply-To: <20060509061026.GA14039@pentarou.parodius.com> References: <20060508200926.GA6005@daemons.gr> <20060509061026.GA14039@pentarou.parodius.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart7038720.6UEgW8K4bW Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tuesday 09 May 2006 07:10, Jeremy Chadwick wrote: > What I proposed in the aforementioned thread was to have an actual > BIND-like configuration file (e.g. a tree) which contains individual > options which are set to yes/no per port. There is a global scope > which applies to all ports, while individual ports can be adjusted > individually -- or overwride the global scope settings. I proposed > something that applied to both ports *and* buildworld, which now > that I think about it, probably wasn't a good idea. So here's > a modified version: > > # No IPv6, and no X11 > IPV6 =3D no > X11 =3D no > > devel/gettext { > EXAMPLES =3D no > HTMLMAN =3D no > } > www/apache20 { > KQUEUE_SUPPORT =3D yes > } > www/suphp { > CHECKPATH =3D no > LOGFILE =3D /var/log/suphp.log > } > net/cvsup { > X11 =3D yes > } I like the format (and your idea).=20 Going a bit further, to keep the file size manageable, I think it would be= =20 best to have it split across multiple files, eg. ports.master.conf, with=20 defines the overall global template: # ports.master.conf # Global ports configuration file # Define global build options: all { IPVG =3D no X11 =3D no } accessibility { file->ports.accessibility.conf } graphics { file->ports.graphics.conf } foobar { file->ports.foo.conf } Then in the particular file you can have your options. # ports.graphics.conf # Configuration file for all graphics ports under ${PORTBASE}/graphics gimp { WITH_X11 =3D no } # ( ;^) ) And I guess it would then be nice to store all these configuration files un= der=20 somewhere like /etc/ports/ or so, or alternatively /usr/ports/config if you= =20 want to keep it all contained under the ports tree. I'm almost tempted to hack up some Perl (probably quickest/simplest) script= s=20 (called "portconfig" or something similar) to implement this idea as an=20 interesting little programming project. I'd like it to run something like: =20 # portconfig --init --generate-config -v Generating configuration files for the first time... Generating accessibility options (ports.accessiblity.conf)... DONE Generating arabic options (ports.arabic.conf)... DONE <snip> Generating x11-wm options (ports.x11-wm.conf)... DONE Generating master configuration file (ports.master.conf)... DONE *********************************************************** =46ile generation complete. The following files have been created: config/ports.accessibility.conf config/ports.arabic.conf <snip> config/ports.x11-wm.conf config/ports.master.conf Now edit the appropriate configuration file[s] and run portconfig --install= =20 <port> (where <port> is of type category/port name, e.g. graphics/gimp) to= =20 install your port[s]. =20 ************************************************************ Now, if we use the gimp port as an example, under ports.graphics.conf it=20 should have generated something like the following: <snip> gimp { WITH_DEBUG =3D no=09 WITH_PYTHON =3D no WITHOUT_PRINT =3D no WITH_MP =3D no WITH_HTML_HELP_BROWSER =3D yes GNOME_ENABLED =3D no } <snip> Note that it checked the default OPTIONS and set WITH_HTML_HELP_BROWSER=20 to "yes" according. Now, presuming you set say WITH_PYTHON to yes, then running=20 portconfig --install graphics/gimp would invoke make with the appropriate=20 knob(s) (e..g make -DWITH_HTML_HELP_BROWSER -DWITH_PYTHON install clean). # portconfig --install graphics/gimp Installing gimp-2.2.11... Options:=20 =2D> WITH_HTML_HELP_BROWSER =2D> WITH_PYTHON Checking dependencies... gimp-2.2.11 requires:=20 =2D> package: foo-1.x.z - found =2D> package: bar-2.x.y - not found Installing bar-2.x.y Options: =2D> WITH_CONQUER_THE_WORLD =2D> WITHOUT_XP Checking dependencies... bar-2.x.y requires: =2D> package: discretion-1.0.0 - found =2D> package: intelligence-1.0.0 - found =2D> package: nice-1.0.0 - found <build> Returning to build of gimp-2.2.11... <build> Pakage gimp-2.2.11 installed successfully. Integrating it with portupgrade would be nice, I guess a current hackaroun= d=20 would be to call portversion -l "<" (or pkg_version) to determine out of da= te=20 ports, then get portconfig to upgrade them all itself. It would probably ha= ve=20 to call (or the user would have to have made sure to call) something like=20 #portconfig --update-config Updating configuration files (whilst preserving your specified existant=20 options).... Updating ports.accessibility.conf... DONE <etc>=20 first, which would have to go through and check all the defined options/kno= bs=20 against the new ports snapshot which presumably you'd just fetched, and=20 update accordingly (remembering your settings where they are still=20 applicable/existant). Then #portconfig --upgrade foo =20 Would upgrade foo, and=20 #portconfig --upgrade all would upgrade all ports. An alternative method, but very ugly, would be to generate a load of=20 =2Eif ${CURDIR} =3D=3D some_category/some_port <set make options> =2Eendif type macros in make.conf. You could then just use portupgrade et al as norm= al.=20 But I don't like it, make.conf could start to get ridiculously large. Anyway, just a few rambling thoughts, I don't know if any of this is any go= od. Regards Aren. --nextPart7038720.6UEgW8K4bW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQBEYFfZoWGxb6IQ4B4RAp2bAKCF0oczvv5j+WByTrbZuJXqHCL3qQCfYIDW pZNXsO/LdvItlj+pldja1j0= =eGMU -----END PGP SIGNATURE----- --nextPart7038720.6UEgW8K4bW--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605090950.33459.aren.tyr>