On 12/20/2017 05:00 PM, Gary E. Miller via devel wrote: > Neither --prefix, nor DESTDIR > affect the generated and installed files.
I haven't checked, but I'm willing to stipulate that PREFIX is not *currently* being embedded in any files installed by NTPsec. The proposed "option H" is a change which would start embedding the PREFIX or PYTHONDIR (which, by default, is based on PREFIX) inside the installed files. It would not, however, embed DESTDIR. In the examples below, I am embedding PYTHONDIR (again, based on PREFIX by default), as I think that is what we really want. You'll see why when you look at the custom --pythondir example. The Debian packaging: ./waf configure --prefix=/usr ./waf install --destdir=debian/tmp I will end up with a file named: debian/tmp/bin/ntpq which will have something like this: PYTHONDIR='/usr/lib/python2.7/site-packages' import sys sys.path.insert(1, PYTHONDIR) # current imports from ntp module A default source install: ./waf configure sudo ./waf install I will end up with a file named: /usr/local/bin/ntpq which will contain something like: PYTHONDIR='/usr/local/lib/python2.7/site-packages' import sys sys.path.insert(1, PYTHONDIR) # current imports from ntp module An install to custom locations: ./waf configure --prefix=/opt/ntpsec --pythondir=/opt/ntpsec/python sudo ./waf install I will end up with a file named: /opt/ntpsec/bin/ntpq which will contain something like: PYTHONDIR='/opt/ntpsec/python' import sys sys.path.insert(1, PYTHONDIR) # current imports from ntp module Note the position of the insertion into sys.path. The result is: ['', PYTHONDIR, the rest of the default sys.path] In this way, the PYTHONDIR overrides the default locations. This fixes the case of distro package in /usr + source install to /usr/local. Since the rest of the default path is kept, all of the standard Python modules and other dependencies are still found as per usual. Since '' is still first, the current directory is still searched first. This allows the regression tests to work using a symlink to the "ntp" directory. Alternatively, here are other ways that can be handled, if needed. For example, the code could be enhanced to add PYTHONDIR *after* the values from the environment's PYTHONPATH. Then the regression test could set a PYTHONPATH. Or, a custom environment variable could be used for regression tests. -- Richard
signature.asc
Description: OpenPGP digital signature
_______________________________________________ devel mailing list devel@ntpsec.org http://lists.ntpsec.org/mailman/listinfo/devel