Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "/usr/local" as default prefix for "make install" #448

Merged
merged 5 commits into from
Apr 10, 2019

Commits on Apr 3, 2019

  1. Use "/usr/local" as default prefix for "make install"

    Convential filesystem standards imply that "/usr" prefix should be
    used only by system package managers. Custom installations should go
    to /usr/local by default.
    
    However, we *should* keep "/usr" prefix for packaging, therefore
    override the default for "deb" and "rpm" targets.
    ilammy committed Apr 3, 2019
    Configuration menu
    Copy the full SHA
    f351b86 View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2019

  1. Keep backwards compatibility with source installations

    All previous installation of Themis from source on Linux used "/usr"
    prefix. This means that installing a newer version into "/usr/local"
    will result in two completely unmanaged side-by-side installations of
    Themis. It is brittle and can cause all sorts of trouble, both when
    building software and when loading shared libraries.
    
    Add a shim for backwards compatibility for Linux. If we detect that
    there is already a "make install" installation of Themis in /usr then
    we keep using the old "/usr" prefix by default. Otherwise we use the new
    "/usr/local" prefix. If the user has explicitly specified the prefix
    then we go with that value regardless of the installation status.
    
    It's kinda tricky to detect source-based installation. We do as follows:
    
     1. Check for the main header file <themis/themis.h>
    
        It is always installed by "make install", and it may be installed by
        Themis package (DEB or RPM).
    
        If there is no such file then Themis is not installed to "/usr",
        we can simply use the new prefix.
    
     2. Otherwise, check DEB and RPM packages
    
        If there is "libthemis" package installed then Themis installation
        is managed by the system's package manager. We should not use "/usr"
        prefix to avoid overwriting system installation, use "/usr/local".
    
    In this way we prefer "/usr/local" prefix if possible, avoid overwriting
    installations by package managers, and keep using the old "/usr" prefix
    if the user had Themis installed there before.
    
    macOS has always used "/usr/local" prefix so we can just keep using the
    default there.
    ilammy committed Apr 4, 2019
    Configuration menu
    Copy the full SHA
    71edd43 View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2019

  1. Print out installation paths

    It's better for our users to know where do we install files to and
    where do we remove them from during uninstallation. Let's print the
    PREFIX value for "make install" and "make uninstall" targets.
    ilammy committed Apr 8, 2019
    Configuration menu
    Copy the full SHA
    b835b5d View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2019

  1. Configuration menu
    Copy the full SHA
    f8d5d77 View commit details
    Browse the repository at this point in the history
  2. Warning about multiple Themis installations

    Changing default installation path from /usr to /usr/local is more or
    less safe on Linux as the compilers and linker-loaders *usually* check
    /usr/local before /usr. Therefore after "sudo make install" the software
    will (probably) be using the new version of Themis. However, the old
    installation may still remain there in "/usr" and this may cause issues
    with non-standard configurations.
    
    Check if there are multiple installations of Themis and print a warning
    for the users, suggesting to keep only one installation in their system.
    ilammy committed Apr 9, 2019
    Configuration menu
    Copy the full SHA
    cb510ea View commit details
    Browse the repository at this point in the history