#278 Roma makefile has problems

ROMA
closed
5
2011-11-11
2011-05-19
Andrew Hankinson
No

The Roma Makefile has problems with the usage of $PREFIX and $LOCATION. I think this was caused by commit #8875 and updating the path names.

In HEAD, if $PREFIX is not set, the Makefile will default to trying to install to the systemwide /etc, instead of ${LOCATION}/etc . This is obviously not desirable behaviour.

I have attached a .diff file that illustrates one possible solution. There may be others that I'm unaware of.

I'm on OS X 10.6.

Discussion

  •  
    Attachments
  • I am confused. The Makefle does seem to use PREFIX incorrectly, should be {} not (), but the install into ${PREFIX}/etc is correct - the default behaviour is intentionally to put data file in /usr/share, and config into /etc. I dont want it in /usr/etc....

     
  • Currently, If "make" is run without setting any PREFIX or LOCATION variables, the makefile will try to create $(PREFIX)/etc, where PREFIX is null (by default). (Line 39). Thus it will try to install tei-roma in the root /etc, which is not the best location for it.

    If PREFIX is set while running make, e.g.,

    make PREFIX=/usr/share install

    then PREFIX is used in combination with the default value of LOCATION (Lines 36 ff) and will try to install roma2 in /usr/share/usr/..., which is also wrong.

    If both PREFIX and LOCATION are set, e.g.,

    make PREFIX=/usr/share LOCATION=/usr/local install

    then all sorts of weird things will happen with the paths, since it will start creating things in /usr/share/usr/local/... This is what alerted me to the problem -- the new Makefile (since commit #8875) installed stuff in /usr/local/usr/local/etc/tei-roma when PREFIX was set, but tried to install it in /etc/tei-roma when it was not set.

    My attached diff "normalizes" the use of PREFIX and LOCATION so that it's consistent across all the install locations, e.g., it uses the ${PREFIX}${LOCATION} pattern everwhere. Thus you really only need to set LOCATION, but if you really wanted to you could add a PREFIX to it too.

     
  • Sorry, but I _did_ intend it to write in /etc if no variables are set, that's where Debian expects to put files like that.

    Agreed, if you say "make PREFIX=/usr/share LOCATION=/usr/local install" then you'll get weird results, but why would you do this? The PREFIX thing is there for Debian packages, which build a hierarchy in a subdirectory complete with etc, usr/bin, share etc.

     
  • Ah. Ok.

    On most BSD-based systems, (OSX, but also FreeBSD, NetBSD, etc.), /usr/local is where any non-core system files are kept, so you rarely ever touch /etc, and no locally-installed software that is not a part of the core OS should ever write config files there. I noticed it because the script was failing because of a permissions problem when it tried to write to /etc.

    Regardless, I'm happy using LOCATION=/usr/local to specify the location of TEI, but I certainly don't want TEI to touch my root /etc. If LOCATION controlled the location of the tei-roma config files I would be happy with that, but right now there is currently no way of forcing the configuration files into /usr/local/etc/tei-roma without breaking the entire install process.

     
  • understood. I have changed /etc to ${ETC} so that you can override it, and added the mssing ${PREFIX} in one reference

     
  • Great. It seems to work fine for me now.

     
  • Martin Holmes
    Martin Holmes
    2011-08-26

    Any reason not to close this ticket? It seems to be resolved, doesn't it?

     
    • status: open --> closed