From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos 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 Message-ID: <21342.1310116208@alphaville.dokosmarshall.org> References: <8739ii885d.fsf@gnu.org> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:42876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qf74h-0003Sz-Qf for emacs-orgmode@gnu.org; Fri, 08 Jul 2011 05:10:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qf74f-0004ja-GI for emacs-orgmode@gnu.org; Fri, 08 Jul 2011 05:10:15 -0400 Received: from vms173003pub.verizon.net ([206.46.173.3]:37363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qf74f-0004jI-2S for emacs-orgmode@gnu.org; Fri, 08 Jul 2011 05:10:13 -0400 Received: from alphaville.dokosmarshall.org ([unknown] [173.76.32.106]) by vms173003.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0LO000JKTC4WX0CD@vms173003.mailsrvcs.net> for emacs-orgmode@gnu.org; Fri, 08 Jul 2011 04:10:10 -0500 (CDT) In-reply-to: Message from Jude DaShiell of "Fri, 08 Jul 2011 03:33:33 EDT." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Jude DaShiell Cc: Bastien , nicholas.dokos@hp.com, emacs-orgmode@gnu.org Jude DaShiell 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 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 > > > > > > >