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

PREFIX=/usr/local tries to install to /usr/local/usr/local.. #49

Closed
erikw opened this issue Jan 18, 2022 · 0 comments · Fixed by #65
Closed

PREFIX=/usr/local tries to install to /usr/local/usr/local.. #49

erikw opened this issue Jan 18, 2022 · 0 comments · Fixed by #65
Assignees
Labels
bug Something isn't working

Comments

@erikw
Copy link
Owner

erikw commented Jan 18, 2022

By default, it should install to /sbin/, so that $ PREFIX=/usr/local make installinstalls as expected to/usr/local/sbin`

I'm working on a fix already, but will not make PR or merge until we've merged #45

If PREFIX is set, we need to sed(1) update all references inside the files as well so that e.g. we look at $PREFIX/etc/restic.
(or just sed-set one global $PREFIX variable which is used everywhere?)

Remember to update the PKGBUILD accordingly

  • Change Makefile to use /usr/lib/systemd instead of /etc/systemd, so that the PKG build does not need to set anything else than PREFIX
@erikw erikw added the bug Something isn't working label Jan 18, 2022
erikw added a commit that referenced this issue Jan 18, 2022
erikw added a commit that referenced this issue Feb 1, 2022
Fix #49

Move from /usr/local/sbin to $PREFIX/sbin
Add $RESTIC_PREFIX
Add target to substitute $RESTIC_PREFIX
@erikw erikw self-assigned this Feb 1, 2022
erikw added a commit that referenced this issue Feb 2, 2022
Fix #49

Move from /usr/local/sbin to $PREFIX/sbin
Add $RESTIC_PREFIX
Add target to substitute $RESTIC_PREFIX
erikw added a commit that referenced this issue Feb 3, 2022
Fix #49

Move from /usr/local/sbin to $PREFIX/sbin
Add $RESTIC_PREFIX
Add target to substitute $RESTIC_PREFIX
erikw added a commit that referenced this issue Feb 3, 2022
* Before, doing `$ PREFIX=/usr/local make install` would install files to`/usr/local/usr/local..` which is wrong
* With this PR, files will be installed to the expected location e.g. `/usr/local/etc/restic`
* `Makefile` almost completely rewritten
   * As e.g. `default.env` would source `_global.env`, `default.env` must be edited to find the right location of `_global.env` depending on what `$PREFIX` was set to.
   * see documented build stages in the `Makefile` itself.
   *  Made sure that the rules are correct so that only modifed files are installed, not all at once unnecessarily like before.
* A sub-goal was that the [PKGBUILD](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=restic-systemd-automatic-backup#n20) for Arch should not need to do any custom install configuration, to keep everything easier to maintain. `$ make install` should work out of the box for Arch.
* Additionally added the `-b` flag to `install(1)` that makes a backup of existing `etc/restic/*` files before installing a newer version.

Fixes #49
@erikw erikw closed this as completed in #65 Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant