Skip to content
New issue

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

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

Already on GitHub? # to your account

How to change the installation path of the binary and lib when building / compiling a package? #449

Closed
vukitoso opened this issue Jul 1, 2021 · 3 comments

Comments

@vukitoso
Copy link

vukitoso commented Jul 1, 2021

Hello.
After compilation via make and building of the package via checkinstall - binaries are located in /usr/local/bin/ and in /usr/local/lib/.
The goal is to place bin and lib files anywhere but in "/usr/local", for example just in "/usr".
Please tell me how to compile correctly so that the binaries and binaries are not in "/usr/local".
Thx.

@gustavo-iniguez-goya
Copy link
Collaborator

Hi @vebmaster ,

The installation path is hardcoded right now. The daemon can be placed anywhere, but the configuration files are expected to be found under /etc.

The service file also expects to find the daemon under /usr/local.

In order to install it in a different directory than /usr/local/ follow these steps:

  1. Copy daemon/opensnitchd to /usr/bin/
  2. Modify this path:
    ExecStart=/usr/local/bin/opensnitchd -rules-path /etc/opensnitchd/rules
    to point to /usr/bin/

The Makefile could be modified to personalize the install path:

ifeq ($(PREFIX),)
    PREFIX=/usr/local
endif

(...)

install:
        @mkdir -p /etc/opensnitchd/rules $(PREFIX)/bin/
        @cp opensnitchd $(PREFIX)/bin/
        (...)    

$ PREFIX=/usr make install

@vukitoso
Copy link
Author

vukitoso commented Jul 1, 2021

  1. Copy daemon/opensnitchd to /usr/bin/

Thank you. I didn't understand this step.
Should this file be copied after I make "make"? Copy it manually?

@gustavo-iniguez-goya
Copy link
Collaborator

Yes, after typing "make" a new binary will be created under the daemon/ directory: opensnitchd. That's the file to copy to /usr/bin/

gustavo-iniguez-goya added a commit that referenced this issue Jan 8, 2024
 - Added cli option -config-file to specify an alternate path to the
   config file.
 - Allow to configure rules path from the configuration file (cli option
   takes precedence).
 - Default options are now /etc/opensnitchd/rules and
   /etc/opensnitchd/default-config.json. Previously the default rules
   directory was "rules" (relative path).

Closes #449

(cherry picked from commit 211c864)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants