On Fri, Jun 01, 2001 at 02:32:59PM +0200, Robert Bihlmeyer wrote: > James Bromberger <[EMAIL PROTECTED]> writes: > > > is being created on a Debian system. The reason is that I have a very small > > set of diffs that I want applied to the package only for Debian, and hope > > at some stage to feed these diffs upstream (things like file paths, etc). > > Why are these changes only applicable when on a Debian system? What > about Progeny? Corel? SuSE? Orange Bone Linux? OpenBSD? SunOS? Cygwin?
Ahhh. Well. File locations. The Makefile I want to modify has certain
installation directories set. Debian's elegent filesystem and FHS compliance
is perhaps different from the upstream author's locations. With this
Autoconf test, I can then select where I want these files to go with.
I could play with the install in other ways, but this seems quite elegent.
I haven't actually touched the source itself (C code). This is reasonably
elegent.
> The correct way to to size up OSs and people is to check for
> capabilities, not names.
Yes, but I think in this case, locations of files are specific to Debian.
> For example, if you want to know whether /proc/loadavg is usable, try
> to open it. This test will then work on any Linux, and maybe other
> systems as well, and won't break when Linux 3.17 returns to the purity
> of using /proc only for processes.
>
> > > if test -f /etc/debian_version ; then
> > > AC_MSG_RESULT(yes)
> > > INSTALL="/usr/bin/install"
> > > AC_SUBST(INSTALL)
> [...]
>
> Why not check directly whether /usr/bin/install exists? This will then
> work on any OS that has it.
My makefile looks like this in one part:
> ifdef DEBIAN
> bindir = $(exec_prefix)/lib/apache/1.3
> else
> bindir = $(exec_prefix)/bin
> libdir = $(prefix)/lib
> infodir = $(prefix)/info
> endif
> > Is using /etc/debian_version the right thing to do, or is there a
> > better/more accurate way to determine this? Existence of
> > /usr/bin/dpkg? Existence of /var/lib/dpkg?
>
> Since /etc/debian_version is a conffile, a user may have removed it.
> My answer would be to check if "dpkg -s base-files" succeeds, but
> that's not 100 % either. Anyway, you shouldn't do that, see above.
Yes, but as Nick Bannon pointed out to me off list, dpkg is portable, and
supposedly has been ported to other distros/platforms(?). Thus, I was looking
for a sure fire way to know that I am on a Debian system during compilation.
Thus these specific file locations can be sent upstream (perhaps?).
Ta,
James
--
James Bromberger <james_AT_rcpt.to> www.rcpt.to/~james
* * C u in Bordeaux - 1st Debian Conference, July 2001 * *
Remainder moved to http://www.rcpt.to/~james/james/sig.html
pgpjLPqUsllkG.pgp
Description: PGP signature

