[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] patch org-mode Makefile - solve a couple debian build problems a

From: Nick Dokos
Subject: Re: [O] patch org-mode Makefile - solve a couple debian build problems and a slackware build problem
Date: Fri, 08 Jul 2011 05:10:08 -0400

Jude DaShiell <address@hidden> wrote:

> To use org-mode default uncomment /usr/local as prefix for all systems 
> that put emacs stuff or some emacs stuff under /usr/local.  For 
> Slackware and Debian though, /usr/local isn't in the load-paths.  The 
> install-info part of the patch was using debian's install-info program 
> all along and that was apparently depricated in favor of ginstall-info.  
> That change will effect other distros into the future as they update 
> their packages.  The org-mode default would be to uncomment install-info 
> choice but debian squeeze needs ginstall-info uncommented.  There's 
> another reason I can't provide better patches.  The Makefile structure 
> itself.  I wrote code earlier which tested if [ -r /etc/debian_version 
> ]; then and took action if that was true but putting it into the 
> variables section of the Make file and running make caused make to freak 
> out on me with the complaint that commands were in the variables 
> section.  Apparently Makefile structure and COBOL share some 
> similarities and not the good ones.

Most Linux systems I know of have a description of what distro is
installed in the /etc/issue file: Ubuntu, Debian, RH, Fedora, SuSE
certainly have it and others might (but I haven't run Slackware in 10
years, so I don't know if that's the case on it). If /etc/issue exists
and contains what I think it contains, then GNU make will parse a
Makefile like this:

--8<---------------cut here---------------start------------->8---
distro = $(shell sed 1q /etc/issue | cut -d' ' -f1 | tr A-Z a-z)

# default values

ifeq ($(distro),debian)

ifeq ($(distro),slackware)

        echo ${path}
        echo ${installinfo}

--8<---------------cut here---------------end--------------->8---

There are supposedly better ways to write the conditionals, but trying
them on recent Ubuntu and old Debian, I got inconsistent results, so
I fell back to the above in order to satisfy both. I believe that
(modulo the existence of /etc/issue) it should run on any Linux distro
of any (relatively recent: say the last five years) vintage.

Having said that, I'm not sure that Jude's diagnosis is completely
correct.  It might very well be the case that debian squeeze installs
ginstall-info only: they certainly did that with earlier versions.  On
my Ubuntu 10.04 laptop, I have both and they are *different* programs:

-rwxr-xr-x 1 root root 40512 2010-02-11 08:49 /usr/bin/ginstall-info
-rwxr-xr-x 1 root root  6216 2011-01-06 14:15 /usr/sbin/install-info

In fact, on Ubuntu, install-info is a wrapper around ginstall-info:
in normal usage, it does not do *anything* other than calling ginstall-info.
Read the manual page for more details.

On debian, the problem can be circumvented by planting a symlink
wherever ginstall-info is installed:

   sudo ln -s /usr/bin/ginstall-info /usr/bin/install-info

Or the makefile can figure out if install-info exists and if it does not,
use ginstall-info in a way similar to the above:

--8<---------------cut here---------------start------------->8---
iiprog = $(shell which install-info)

# check if it is empty
ifeq ($(strip $(iiprog)),)
        iiprog = ginstall-info
--8<---------------cut here---------------end--------------->8---

What I don't understand is the load-path comment: what is it that is
stopping one from adding /usr/local/something/or/other to his/her load-path and 
it in the appropriate place in the list? Same thing with
Info-directory-list. I like to initialize the latter from the INFOPATH
environment variable, but in any case it ends up like this:

| Info-directory-list is a variable defined in `info.el'.
| Its value is
| ("/home/nick/src/emacs/org/org-mode/doc" "/usr/local/share/info" 

Isn't that enough?

Do other users of debian and slackware have similar difficulties? If so, why?


PS and then there is OS X and Windows, and other Unixes and who knows what 

> On Thu, 7 Jul 2011, Bastien wrote:
> > Hi Jude,
> > 
> > I infer this patch will break most non-debian/slackware configs.
> > Could you provide a patch that works for *every* distro, including 
> > debian and slackware?
> > 
> > Thanks!
> > 
> > Jude DaShiell <address@hidden> writes:
> > 
> > > diff -c a//Makefile b//Makefile
> > > *** a//Makefile   2011-07-05 21:05:08.000000000 -0400
> > > --- b//Makefile   2011-07-05 21:05:21.000000000 -0400
> > 
> > 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]