When perl executable is not in the standard path (/usr/local/bin/perl,
for instance), it generates perl scripts with the corresponding header
and results in undistributable debs.
----------------------------------------------------------------
% which perl
/usr/local/bin/perl
% head -5 /usr/sbin/update-alternatives
#! /usr/local/bin/perl --
$admindir="/var/lib/dpkg"; # This line modified by Makefile
$dpkglibdir="/usr/lib/dpkg"; # This line modified by Makefile
$version="1.10"; # This line modified by Makefile
----------------------------------------------------------------
I understand that is because dpkg is no longer for GNU/Linux system
only. I think it's good idea to restrict PATH for configure in
debian/rules.
Index: debian/rules
===================================================================
RCS file: /cvs/dpkg/dpkg/debian/rules,v
retrieving revision 1.65
diff -u -r1.65 rules
--- debian/rules 2001/11/15 00:18:08 1.65
+++ debian/rules 2002/01/01 23:42:43
@@ -28,7 +28,7 @@
$(BUILD)/config.status:
$(checkdir)
install -d $(@D)
- cd $(@D) && LDFLAGS=$(LDFLAGS) $(DIR)/configure \
+ cd $(@D) && LDFLAGS=$(LDFLAGS) PATH=/usr/bin:/bin $(DIR)/configure \
--prefix=/usr \
--datadir=/usr/share \
--mandir=/usr/share/man \
--
YAEGASHI Takeshi <t...@keshi.org> <tak...@yaegashi.jp> <yaeg...@dodes.org>
--
To UNSUBSCRIBE, email to debian-dp...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
True, configure should probably check where perl lives and update
the scripts on install accordingly.
> I understand that is because dpkg is no longer for GNU/Linux system
> only. I think it's good idea to restrict PATH for configure in
> debian/rules.
Can you explain why?
Wichert.
--
_________________________________________________________________
/wic...@wiggy.net This space intentionally left occupied \
| wic...@deephackmode.org http://www.liacs.nl/~wichert/ |
| 1024D/2FA3BC2D 576E 100B 518D 2F16 36B0 2805 3CB8 9250 2FA3 BC2D |
> - cd $(@D) && LDFLAGS=$(LDFLAGS) $(DIR)/configure \
> + cd $(@D) && LDFLAGS=$(LDFLAGS) PATH=/usr/bin:/bin $(DIR)/configure \
but if the person building dpkg has perl in some other location, how do you
know they have it in /usr/bin or /bin? And if they do, how do you know if
they want to use those over the one in /usr/local/bin? Their $PATH could
indicate quite the opposite, like yours did.
Packages can't predict the nature of their environments...
--
2. That which causes joy or happiness.
At Wed, 2 Jan 2002 01:02:53 +0100,
Wichert Akkerman wrote:
> Previously YAEGASHI Takeshi wrote:
> > When perl executable is not in the standard path (/usr/local/bin/perl,
> > for instance), it generates perl scripts with the corresponding header
> > and results in undistributable debs.
>
> True, configure should probably check where perl lives and update
> the scripts on install accordingly.
>
> > I understand that is because dpkg is no longer for GNU/Linux system
> > only. I think it's good idea to restrict PATH for configure in
> > debian/rules.
>
> Can you explain why?
Yes. That's to avoid building broken dpkg debs by mistake under
Debian environment. /usr/sbin/update-alternatives that needs
/usr/local/bin/perl would be quite harmful to most sites.
Of course, the perl check itself is useful especially for the build
under non-Debian environment, e.g. *BSD, Solaris, but not needed for
Debian system.
We can explicitly use standard /usr/bin/perl by restricting PATH to
/usr/bin:/bin when configure.
Can we assume it's already under Debian environment when configuring
and building dpkg in debian/rules?
--
YAEGASHI Takeshi <t...@keshi.org> <tak...@yaegashi.jp> <yaeg...@dodes.org>
But changing PATH doesn't affect that at all.
> We can explicitly use standard /usr/bin/perl by restricting PATH to
> /usr/bin:/bin when configure.
Those scripts should run with any perl version (maybe not perl3 and
older, but definitely anything from perl4), so I do not see why we
would want to restrict PATH.
> Can we assume it's already under Debian environment when configuring
> and building dpkg in debian/rules?
Definitely not, the only dependencies should be GNU make, perl4 or later
and the packages listed as Build-Depends.
Wichert.
--
_________________________________________________________________
/wic...@wiggy.net This space intentionally left occupied \
| wic...@deephackmode.org http://www.liacs.nl/~wichert/ |
| 1024D/2FA3BC2D 576E 100B 518D 2F16 36B0 2805 3CB8 9250 2FA3 BC2D |
At Wed, 2 Jan 2002 03:03:28 +0100,
Wichert Akkerman wrote:
> Previously YAEGASHI Takeshi wrote:
> > Yes. That's to avoid building broken dpkg debs by mistake under
> > Debian environment. /usr/sbin/update-alternatives that needs
> > /usr/local/bin/perl would be quite harmful to most sites.
>
> But changing PATH doesn't affect that at all.
I believe that PATH setting when configure does affect the result. It
replaces each #!/usr/bin/perl with one discovered by configure.
> > We can explicitly use standard /usr/bin/perl by restricting PATH to
> > /usr/bin:/bin when configure.
>
> Those scripts should run with any perl version (maybe not perl3 and
> older, but definitely anything from perl4), so I do not see why we
> would want to restrict PATH.
>
> > Can we assume it's already under Debian environment when configuring
> > and building dpkg in debian/rules?
>
> Definitely not, the only dependencies should be GNU make, perl4 or later
> and the packages listed as Build-Depends.
I understand your point w.r.t. the package's policy. Thank you.
--
YAEGASHI Takeshi <t...@keshi.org> <tak...@yaegashi.jp> <yaeg...@dodes.org>