Hello, On sekmadienis 12 Birželis 2011 03:14:08 Joey Hess wrote: > Modestas Vainius wrote: > > Personally I don't understand what's the issue here. If debian/rules has > > no explicit build,install,binary etc. targets (which will continue to be > > >= 90% of cases), current dh implementation works just fine. If > > debian/rules has them, it should be up to maintainer to make sure they > > work as supposed to (with respect to policy). E.g. if maintainer > > re-implements binary, (s)he should define needed dependencies in the > > rules file directly. > > The motivation, besides making it easy for split build-indep/arch is > that expanding a short rules file to add normal targets can be tricky. > > Remembering the semicolon here to avoid running the implicit dh build > target: > > build: build-arch build-indep ; > > And it's unintuitive that all the binary targets need to be made real > when only the build target is being changed too. I just found I'd forgotten > to do that in wmbattery above.
But this all seems like re-implementation of make in perl
Anyway, I guess it is a good thing to be policy complaint. So I suggest adding
a dh restriction that standard targets have to be explicit. Then dh could
check if they exist before running them:
if (defined $rules_target && rules_explicit_target($rules_target)) {
run it
}
In my opinion, this would be rather reasonable. Then these changes won't
affect packages which don't need them.
> > From my experience, it is much better not to touch top targets at all and
> > to implement all customizations via override_% targets.
>
> I somewhat agree, but something will need to be done for split
> build-indep/arch and install-indep/arch. One thing I suggested before is:
>
> override_dh_auto_install:
> dh_do -a -- $(MAKE) -C debian/build install
> DESTDIR=$(CURDIR)/debian/install dh_do -i -- $(MAKE) -C debian/build/po
> install DESTDIR=$(CURDIR)/debian/install
>
Yes. That's indeed a problem with non-obvious solutions. If I need to do
something like this in the override after dh_installdirs, I just do:
if [ -d debian/package ]; then do_custom_stuff; fi
Another solution is:
if [ -n "`dh_listpackages -i`" ]; then do_indep_stuff; fi
if [ -n "`dh_listpackages -a`" ]; then do_arch_stuff; fi
... whenever dh is called via *-arch or *-indep target (i.e. post build at the
moment). Obviously, this is not very obvious unless maintainer knows about
internals of DH_INTERNAL_OPTIONS :) So maybe:
if dh_isapplicable (-ppackage|-a|-i); then do_custom_stuff; fi
would be nice to have.
> But it would be nice to have the full flexability to easily use the
> standard targets. After all, they're standard.
Probably. But it would be best to support both approaches.
--
Modestas Vainius <[email protected]>
signature.asc
Description: This is a digitally signed message part.

