Hi Ed,
The behavior you're seeing is because EasyBuild also fiddles with
permissions, after the postinstallcmds are run.
There's a separate "permissions" step where this is done, which you can
skip by including this in your easyconfig file:
skipsteps = ['permissions']
I'm not sure why the 'mv' you do isn't working out as expected, that's
pretty strange...
Can you double check if you can reproduce that issue after cleaning up
the installation directory and trying again?
regards,
Kenneth
On 15/06/2021 18:24, Ed Eyles wrote:
Hi
I am trying to create a new easyconfig for the application USEARCH,
where a licence condition of the free version is that the permissions of
the installed executable be changed to 0111, to discourage copying. I
cannot get this permissions change to work. Here is my easyconfig:
easyblock = 'Binary'
name = 'USEARCH'
version = '11.0.667'
versionsuffix = '_i86linux32'
homepage = 'https://www.drive5.com/usearch/index.html'
description = """
USEARCH is a unique sequence analysis tool with thousands of users
world-wide.
USEARCH offers search and clustering algorithms that are often orders of
magnitude faster than BLAST.
"""
toolchain = SYSTEM
_download_file = 'usearch%(version)s%(versionsuffix)s'
_installed_file = '%(installdir)s/%(namelower)s'
# Download via form at
# https://www.drive5.com/usearch/download_academic_site.html
sources = [_download_file]
checksums =
['492c4dafedcf6acf99782357a7ca32c26e7bd395fc9867c2ac3b26fbbd4cd501']
#install_cmd = 'mv %s %s && ' % (_download_file, _installed_file)
#install_cmd += 'chmod 111 %s' % _installed_file # Licence condition.
postinstallcmds = [
'mv %s %s' % (_download_file, _installed_file),
'chmod 111 %s' % _installed_file # Licence condition.
]
modloadmsg = """This is the free-of-charge 32-bit version of USEARCH."""
sanity_check_paths = {
'files': ['%(namelower)s'],
'dirs': [],
}
sanity_check_commands = ['usearch --version']
moduleclass = 'bio'
I have tried this with both "install_cmd" uncommented in the file and
"postinstallcmds" commented out; and vice versa (as above). In neither
case does the "chmod" command seem to do anything. The log file shows
it as having been run, and as having an exit code of 0.
An additional but less important problem with the "postinstallcmds"
version is that it leaves the original downloaded filename in place,
alongside the copy with the new name (which is plain 'usearch'), as
though it has run "cp" instead of "mv". I do not get this problem when
I use "install_cmd" in the easyconfig.
Does anyone have any idea what is going wrong here? Perhaps I should be
using a different easyblock - but which?
Regards
Ed
Rothamsted Research is a company limited by guarantee, registered in
England at Harpenden, Hertfordshire, AL5 2JQ under the registration
number 2393175 and a not for profit charity number 802038.