Project

General

Profile

Feature #988

Makefile: install target for cocoa5

Added by John Abbott over 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Portability
Target version:
Start date:
29 Nov 2016
Due date:
% Done:

100%

Estimated time:
Spent time:

Description

Zoltan kovacs would like to install both CoCoALib and CoCoA-5.
Currently the install target in the Makefile installs just CoCoALib.

History

#1 Updated by John Abbott over 7 years ago

This will be a little complicated because we need to install both the executable and the packages, and also tell the executable where to find the packages!

The default directory for the executable should be /usr/local/bin.
Presumably the packages should be placed in a newly created subdirectory of /usr/local/bin.

Here is my initial suggestion:
  • executable is actually a shell script called cocoa5 which contains the path of the CoCoA-5 directory
  • true executables and packages go into the directory cocoa-5.1.6/ e.g. packages in cocoa-5.1.6/packages/

It may be nice to offer a way of telling the script to run another version of CoCoA-5 by passing it the path of a directory of another version (e.g. cocoa5 --version /usr/local/bin/cocoa-5.1.4)

This design keeps all files related to a single version of CoCoA-5 together in a clearly-named directory. I am a little uneasy about putting the directory cocoa-5.1.6/ inside /usr/local/bin/ but where else could it go?

#2 Updated by John Abbott over 7 years ago

  • Assignee set to John Abbott
  • % Done changed from 0 to 60

I have just checked in a first attempt at making an install target for CoCoA-5.
Currently the destination directory is hard-wired to /usr/local/bin in the configure script. At some later time, we can add an option to specify a different directory... to avoid confusion with the installation settings for CoCoALib, we really should have a separate configuration script for CoCoA-5!

#3 Updated by John Abbott over 7 years ago

  • Status changed from New to In Progress

I now think that it might be simpler to make /usr/local/bin/cocoa5 a (symbolic?) link to /usr/local/bin/cocoa-5.1.6/cocoa5 rather than make it a script which calls a script.

Also the script-which-calls-a-script approach would require both scripts to go through the acrobatics of each finding out which directory it is in; this is not necessary if we use a link.

At the moment my preference is for a symbolic link: this should make it very clear which file is actually linked to.

As for calling other versions of CoCoA-5, I am now inclined to say that we do nothing clever (for the moment, at least). I believe the user can simply type the command as cocoa-5.1.5/cocoa5. If we want (e.g. for mnemonic reasons), we could change the name of the cocoa5 script (in the directory cocoa-5.1.5) to something like run... That way an old version can be started by the command cocoa-5.1.5/run
Actually I am not entirely sure that cocoa-5.1.5/cocoa5 will actually work; if it does not, we may have to adopt the script-which-calls-a-script approach if we really want to make it easy to call "old" versions of CoCoA-5.

#4 Updated by John Abbott over 7 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 60 to 80

I have opted to use a symbolic link from /usr/local/bin/cocoa5 to the actual script which does the work (e.g. /usr/local/bin/cocoa-5.1.5/cocoa5).

However, if you want to run a different version, then you must type in the full path; my suggestion above that it may suffice to type in just the last two components of the path does not work (at least not on my old MacBook).

Another two points:
  • installing a new version of CoCoA-5 does not delete any older versions (but they will no longer be accessible via the convenient symbolic link /usr/local/bin/cocoa5
  • reinstalling an already installed version of CoCoA-5 will delete the previous installation, then put the new installation in its place

I have checked in src/CoCoA-5/Makefile which contains the installation commands.

#5 Updated by John Abbott over 6 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 80 to 100

Until the installation process actually becomes used by some people, it will be hard to debug it.
I think the current version is reasonable. Closing.

Also available in: Atom PDF