Opened 10 years ago

Closed 7 years ago

Last modified 7 years ago

#134 closed bug (fixed (in master))

Comply with the FHS for multi-user installations

Reported by: takkaria Owned by: magnate
Milestone: 3.1.2 beta Keywords: compat unix
Cc:

Description

http://www.pathname.com/fhs/pub/fhs-2.3.html

Involves moving lib/data/ to /var/cache/, lib/ to to /usr/share/; scores/ghosts should be in /var/games/.

Change History (22)

comment:1 Changed 10 years ago by takkaria

  • component changed from Project admin to Cleanup

comment:2 Changed 10 years ago by takkaria

  • component changed from Main game to Port-specific
  • Keywords cleanup added
  • Milestone set to Future

comment:3 Changed 10 years ago by takkaria

  • component changed from Port-specific to Main game
  • Keywords port added

comment:5 Changed 8 years ago by magnate

  • Keywords unix added
  • Owner set to magnate
  • Status changed from new to assigned

Should have spotted this a while ago - the Debian install scripts do most of this, but I'll sort it for use on other *nix platforms. It will have a pleasant side-effect of simplifying the Debianisation.

comment:6 Changed 8 years ago by magnate

  • Keywords port removed

comment:7 Changed 8 years ago by magnate

  • Keywords compat added; cleanup removed

comment:8 Changed 8 years ago by magnate

I need permission to split up INSTALL_LIB to do this.

comment:9 Changed 7 years ago by magnate

Ok, here's a proposed setup for multi-user installation on unices using --with-private-dirs:

lib/edit/, lib/pref/ and lib/file/ all go in /etc/angband/
lib/help/ and lib/info/ and lib/xtra/ go in /usr/lib/angband
lib/apex/, lib/save/, lib/user/ and lib/bone/ all go in ~/.angband/Angband
lib/data/ goes in /var/games/angband until raw files are dumped altogether in 3.2.x

comment:10 Changed 7 years ago by takkaria

works for me

comment:11 Changed 7 years ago by magnate

Good. Apols for the crappy formatting. While you're there, I propose a fundamental alteration to init2.c and main*.c which reflects that we now have three angband dirs rather than one. I suggest we pass three paths to init_file_paths: conf_path, lib_path and data_path.

conf_path is /etc/angband and contains /lib/edit, lib/pref and lib/file (though arguably the latter is not configurable and could go under lib_path)

lib_path is either /usr/lib/angband or /usr/share/angband (I am taking advice on this, as I don't understand how Debian sees the difference) and contains lib/help, lib/info (which is empty, as spoilers are a separate package) and lib/xtra

data_path is either ~/.angband/Angband, or /var/games/angband, depending on PRIVATE_USER_PATH, and contains the rest (apex, bone, save, user).

Obviously there is nothing to stop all three paths being identical on non-Unix systems, preserving current behaviour. Does that sound ok?

(I think I'd quite like to remove raw files during this transition, rather than catering for before and after their removal, but let's see how it goes.)

comment:12 Changed 7 years ago by magnate

Hmmm. Come to think of it, to preserve existing behaviour on other systems we'll need *path as a fourth argument.

comment:13 Changed 7 years ago by takkaria

I get emails, so the formatting works fine for me. :)

We should be nuking bone/* as well as data/* if we're going to be fiddling like that. What you say works fine for me.

comment:14 Changed 7 years ago by magnate

Oh ok. There is an open ticket to bring back player ghosts (#39) - do you want to close this, or will you not keep them in bone/ ...?

comment:15 Changed 7 years ago by takkaria

I just think we need to have an empty directory now for a feature we might get round to having in five years' time. :)

comment:16 Changed 7 years ago by magnate

Ok, agreed. Can we drop /lib/info/ as well then, since that should be created by the package which installs the spoilers, rather than by the game itself? (Spoilers created by wizard mode are placed in ~/.angband/Angband)

comment:17 Changed 7 years ago by takkaria

works for me

comment:18 Changed 7 years ago by magnate

  • Resolution set to fixed
  • Status changed from assigned to closed

[7ba7966] (SVN r1718). It should now work like this:

the binary goes into $execprefix/games

lib/edit, lib/file and lib/pref go into $prefix/etc/angband (confdir)

lib/help and lib/xtra go into $prefix/share/angband (libdir)

lib/apex and lib/save go in $prefix/var/games/angband (datadir, if not using private dirs, otherwise ~/.angband/Angband)

lib/usr is always in ~/.angband/Angband on a multi-user system.

lib/bone has been removed completely

lib/info no longer gets created at install, as it should be created upon installation of the spoilers package. The code expects an info dir under libdir.

The default prefix is /usr/local (so is the default execprefix). This means that datapath ends up as /usr/local/var/games/angband, which is not *strictly* FHS-compliant, but see https://lists.linux-foundation.org/pipermail/lsb-discuss/2009-April/005980.html

comment:19 Changed 7 years ago by magnate

Oops. Looks like [7ba7966] (SVN r1718) broke --with-no-install. Will fix this asap.

comment:20 Changed 7 years ago by magnate

As of [8f3fb17] (SVN r1727) it should now build on Linux again. --with-setgid and --with-no-install work fine. --with-private-dirs works, but unnecessarily creates the apex/, save/ and user/ directories under $prefix/var/games/angband/. This is due to the presence of the delete.me files in those dirs - removing those files would solve this problem, but would break the build on Windows (and maybe other OSs). Still looking for a solution to this.

comment:21 Changed 7 years ago by magnate

[52ab8d5] (SVN r1734) fixes --with-private-dirs.

comment:22 Changed 7 years ago by magnate

  • Milestone changed from Future to 3.1.2 beta
Note: See TracTickets for help on using tickets.