emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Jude DaShiell <jdashiel@shellworld.net>
Cc: Bastien <bzg@altern.org>, nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: patch org-mode Makefile - solve a couple debian build problems and a slackware build problem
Date: Fri, 08 Jul 2011 05:10:08 -0400	[thread overview]
Message-ID: <21342.1310116208@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Jude DaShiell <jdashiel@shellworld.net> of "Fri, 08 Jul 2011 03:33:33 EDT." <alpine.BSF.2.00.1107080318430.74073@freire1.furyyjbeyq.arg>

Jude DaShiell <jdashiel@shellworld.net> 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
path=/usr/local
installinfo=install-info

ifeq ($(distro),debian)
	path=/usr/deb
        installinfo=ginstall-info
endif

ifeq ($(distro),slackware)
	path=/usr/slack
endif


all:
	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
endif
--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 putting
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" "/usr/share/info")
`----

Isn't that enough?

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

Nick

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

> 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 <jdashiel@shellworld.net> 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
> > 
> > 
> 
> 
> 

  parent reply	other threads:[~2011-07-08  9:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-06  1:11 patch org-mode Makefile - solve a couple debian build problems and a slackware build problem Jude DaShiell
2011-07-07 14:42 ` Bastien
2011-07-08  7:33   ` Jude DaShiell
2011-07-08  8:21     ` Bastien
2011-07-08  9:10     ` Nick Dokos [this message]
2011-07-08  9:29       ` Bastien
2011-07-08 10:08         ` Andrea Crotti
2011-07-08 22:07       ` Achim Gratz
2011-07-08 22:50         ` Nick Dokos
2011-07-09  6:26           ` Achim Gratz
2011-07-09  8:38             ` Bastien
2011-07-09 16:00             ` Nick Dokos
2011-07-09 16:40               ` Achim Gratz
2011-07-09 20:45               ` Jude DaShiell
2011-07-10  1:40                 ` Nick Dokos
2011-07-10  1:44                   ` Nick Dokos
2011-07-10  8:16                   ` Jude DaShiell
2011-07-10  7:24                 ` Achim Gratz
2011-07-10  8:13                   ` Jude DaShiell
2011-07-10  8:40                     ` Achim Gratz
2011-07-08 10:34     ` Jambunathan K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=21342.1310116208@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=jdashiel@shellworld.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).