Re: [gentoo-dev] splitting one source package into many binaries

2005-06-17 Thread Thomas de Grenier de Latour
On Thu, 16 Jun 2005 13:50:47 -0300
Rafael Espndola [EMAIL PROTECTED] wrote:

 Has someone worked on changing ebuild so that it could create
 many binary packages from one source? 

A less intrusive solution (well, i think, although it would
still be an important change) would be to have some kind of
special flags dedicated to a new ebuild phase: pkg_filter. Lets
call them FILTER flags (i will often use the server/client
example in the above, but that's just an example sure).

The main differences with USE flags would be:
 - only work at pkg_filter time, so the would not have any
influence on compile-time or the contents of binary packages
 - accessible through a different bash test function (filter
instead of use)
 - not recorded in binary packages metadata, so its really the
target host's FILTER flags that are taken into account, and not
the building host's ones
 - they would sound negative rather than positive, there
purpose being to remove things
 - they would be a bit simpler (probably no need to have some
defaults in profiles, no auto-triggering  la use.defaults, etc.) 

Other than that, they would be similar (have some filter.desc
and filter.local.desc, have a package.filter config file in /etc/
portage, be recorded in /var/db/pkg, add some colored output to
`emerge -pv`, etc). 

The pkg_filter() step would happen somewhere after src_install (or
binary package unpacking) and before the merge. Not sure whether
it should be before or after pkg_preinst (oh, and btw, if I
suggest not using pkg_preinst, that's because it really should
be sandboxed).

Based on this FILTER flags, pkg_filter would apply some kind of
ebuild-specific contents filtering, by deleting stuffs in the
the image directory. Example for openssh:

pkg_filter() {
  if filter 'noserver' ; then
rm ${D}usr/bin/sshd
rm ${D}etc/init.d/sshd
rm ${D}etc/conf.d/sshd
...
  fi
}

So, this proposal is really about putting in ebuilds the logic to
replace some of the INSTALL_MASK or overlayed ebuild hacks. I
don't think it's the right thing to put that completly on user's
responsability like it is now when it's such common needs like
installing a simple ssh or samba client for instance.

The idea comes from rereading an old thread about server/client
USE flags actually:
http://thread.gmane.org/gmane.linux.gentoo.devel/13501
Some of the point made there that i think it would solve are: 

 * splitting ebuilds into something-client and something-server is
not the right approach from several maintainers point-of-view
(more work on updates, lots of duplicate compile time, etc.)
  = FILTER flags would solve the duplicate compile workload at
least. It would still give more work to maintainers tho, to
write the pkg_filter() functions where needed, and to test the
package in several FILTER configuration. But I tend to think
that it's much less work than a split: 
  - you keep a single ebuild
  - you don't have to change anything in src_*()
  - it's not critical if you miss some files in pkg_filter; 
having forgotten to delete the sshd manpage in the above example
won't break anything. Neither will missing a something.so.1.0
renaming to .so.1.1 when bumping a package. All one has to take
real care of is to delete only things that he is sure are used
only by the package part he want to filter out, but if in doubt,
the safer approach is the easiest one: not deleting the file.

 * USE flags are not neither the right approach (for some no-more-
valid concerns, like their globalness at that time, but also for
some still valid ones like i will have to recompile the whole
samba if i suddenly decide to add a client to my server)
 = with FILTER flags, as soon as you keep binary packages,
reinstalling samba without noclient doesn't imply
recompilation. Also, the same GRP packages will be good for both
people who want a samba server and those who want a samba client.


One last thing I've not talked about are dependencies. A very
valid point made against a server USE flag was that it sometimes
happen that a package can depend on foo/bar being installed with
+server.  The issue still holds with FILTER flags sure. But i
think portage devs are working on solving that for USE flags
(would be something RDEPEND=foo/bar:flag), and if that's true,
then it could easily be extended to FILTER flags too i think.
Something like RDEPEND=foo/bar:!noserver (or maybe the opposite
way: don't accept any filter flag per default, and specify in dep
atoms the acceptable ones).
And again about dependencies, there the question whether RDEPENDs
could be trimed down when filtering parts of a package (in case
libfoobar is only used by a server daemon that won't be
installed for instance). Here, i don't really have an opinion
about whether it worths taking FILTER flag into account. Again,
to much RDEPEND is not critical. But it would be possible to deal
with that anyway: conditionnal RDEPENDs could be interpreted
with the USE flag (the one recorded from compile-time in case
of 

Re: [gentoo-dev] splitting one source package into many binaries

2005-06-16 Thread Caleb Tennis
On Thursday 16 June 2005 11:50 am, Rafael Espndola wrote:
 Is this a bad idea or simply not the Gentoo way?

The idea isn't bad, but the implementation is more work to maintain than it's 
probably worth.

You can, of course, always roll your own ebuild variation and keep it in your 
portage overlay directory.  Or, alternatively, you can just rm 
-f /usr/qt/3/bin/designer.

Caleb

-- 
gentoo-dev@gentoo.org mailing list



Re: [gentoo-dev] splitting one source package into many binaries

2005-06-16 Thread Mike Frysinger
On Thursday 16 June 2005 12:50 pm, Rafael Espndola wrote:
 libstdc++ can be installed without gcc

that's a bad example, we're debating what to do with the package seeing as how 
many never wanted it in the first place
-mike

-- 
gentoo-dev@gentoo.org mailing list



Re: [gentoo-dev] splitting one source package into many binaries

2005-06-16 Thread Brian Jackson

Rafael Espndola wrote:

I am using Gentoo to build some small systems. While things like the
minimal useflag is a joy, the monolithic nature of most gentoo
packages is a headache.

Kde has been spit and libstdc++ can be installed without gcc but there
are many other packages that don't have this feature. For example,
installing qt also installs qt designer.


Use INSTALL_MASK to keep it from getting installed. Keep both pieces.



Has someone worked on changing ebuild so that it could create many
binary packages from one source? Something similar to debian's
dpkg-buildpackage. For example, it would be wonderful to be able to do

ebuild qt-something.ebuild split-package

and have in /usr/portage/packages a package for qt-designer and a
package for the rest of the library.

Is this a bad idea or simply not the Gentoo way?

Thanks for any comments

--
Rafael vila de Espndola


--
gentoo-dev@gentoo.org mailing list



Re: [gentoo-dev] splitting one source package into many binaries

2005-06-16 Thread Yuri Vasilevski
Hi,

On Thu, 16 Jun 2005 12:40:39 -0500
Brian Jackson [EMAIL PROTECTED] wrote:

 Rafael Espndola wrote:
  I am using Gentoo to build some small systems. While things like the
  minimal useflag is a joy, the monolithic nature of most gentoo
  packages is a headache.
  
  Kde has been spit and libstdc++ can be installed without gcc but there
  are many other packages that don't have this feature. For example,
  installing qt also installs qt designer.
 
 Use INSTALL_MASK to keep it from getting installed. Keep both pieces.

I think that it's not the way to go because this will create
the exact problem that existed with installing an incomplete
kde before there where split ebuilds for it.

And this problem is that when you emerge a package it expects
it's dependencies to have the things it'll use form them. And
with INSTALL_MASK you brake this assumption in a way that there
is no easy way for an ebuild to verify that it's dependencies
have installed the things that the package needs.

So I think it may be good for some packages to be split in
several packages (but right now I can't think of any), but I
think it'll be much better introduce more granularity into
many ebuils with use flags. This is specially the case (in
my opinion) of packages that can have both client and server
functionality (the best example I can think of is net-fs/samba,
which I mostly use just to mount shares form other servers).

Just my 2 non convertible (i.e. non developers) cents.
Yuri.

-- 
gentoo-dev@gentoo.org mailing list