GNOME Bugzilla – Bug 318928
Implement --with-sysconfsubdir in configure
Last modified: 2005-11-29 10:48:14 UTC
This is an adaptation of bug #134517 filled against GConf, which requested this same feature in that package and was already successfully fixed. First, a bit of background: In pkgsrc (the native NetBSD's packaging system), the user has the ability to configure the system-wide sysconfdir by defining a variable, PKG_SYSCONFBASE, to where it should be. Suppose he does: PKG_SYSCONFBASE=/etc/pkg Then, all packages install their configuration files there, so gnopernicus ends using /etc/pkg/gnopernicus-1.0 as its configuration directory (as pkgsrc gives --sysconfdir=/etc/pkg to the configure script). This is fine. But this framework is more flexible. It also allow users to specify the configuration directory on a package basis. So, that user could do: PKG_SYSCONFDIR.gnopernicus=/etc/foo/gnopernicus And here comes the "problem". Passing that value to gnopernicus' configure script (through the --sysconfdir argument) means that configuration files will end up in /etc/foo/gnopernicus/gnopernicus-1.0/*, as sources have hardcoded in them the '/gnopernicus-1.0/' subdirectory. Thus the user will get an "unexpected" result. In pkgsrc, we workaround this by patching gnopernicus' sources to remove that part of the path on all accesses to the configuration directory. But you guessed right: this is error prone, and patches get out of sync on almost every update. My proposal is the following: remove the '/gnopernicus-1.0/' part from all paths that refer to the configuration directory, and keep it centralized somewhere (that is, in the configure script). This alone will make things more consistent (and in my oppinion, cleaner), as that part of the path won't be hardcoded in the Makefile.am files. And then, after changing this, allow the user to change the value of the subdirectory. This can be done through a configure argument, which is what the attached patch does. It provides the --with-sysconfsubdir argument that sets the subdirectory under sysconfdir that will be used and modifies sources to strip the '/gnopernicus-1.0/' part of paths. Everything will behave as usual unless the user explicitly specifies this option, so this is non-intrusive.
Created attachment 53506 [details] [review] Sample patch.
Comment on attachment 53506 [details] [review] Sample patch. Looks good to me, on inspection. BAUM folks, can you test and apply if it tests out OK?
Comment on attachment 53506 [details] [review] Sample patch. Patch looks fine. Please apply it.
Comment on attachment 53506 [details] [review] Sample patch. Patch committed to cvs head.