graysky2 / anything-sync-daemon

Symlinks and syncs user specified dirs to RAM thus reducing HDD/SDD calls and speeding-up the system.
https://wiki.archlinux.org/index.php/Anything-sync-daemon
MIT License
345 stars 45 forks source link

Clarify install on Fedora: should `make` be called as root? #83

Closed simon-liebehenschel closed 1 year ago

simon-liebehenschel commented 1 year ago

System

Fedora 38

Command

make install-systemd-all

Result

systemctl stop asd asd-resync || /bin/true
Failed to stop asd.service: Unit asd.service not loaded.
Failed to stop asd-resync.service: Unit asd-resync.service not loaded.
Setting version
Installing main script...
install -p -d "/usr/bin"
install: cannot change permissions of ‘/usr/bin’: Operation not permitted
make: *** [Makefile:46: install-bin] Error 1

There is also a note in the docs:

As of v3.13, the Makefiles for systemd-native distros such as Arch, Exherbo, and Fedora, no longer install the deprecated cron script using a systemd timer instead. Users may override and install the deprecated cron script by running make with install-with-cron instead of install at this point.

but, to be honest, it is not clear for me whether I must use make install-with-cron instead of make install-systemd-all on Fedora 38.

graysky2 commented 1 year ago

At issue is you are not packaging this for use with your package manager. So yes, you need to run make as root.

You can install it to a different destination dir as a regular user as your package manager would:

% make
Setting version

% make install-systemd-all DESTDIR=tit
Installing manpage...
Installing main script...
install -p -d "tit/usr/share/man/man1"
Installing systemd files...
install -p -d "tit/usr/bin"
install -p -d "tit/etc"
install -p -m644 doc/asd.1 "tit/usr/share/man/man1/asd.1"
install -p -m755 common/anything-sync-daemon "tit/usr/bin/anything-sync-daemon"
install -p -d "tit/usr/lib/systemd/system"
gzip -9 "tit/usr/share/man/man1/asd.1"
install -p -m644 init/asd.service "tit/usr/lib/systemd/system/asd.service"
ln -sf anything-sync-daemon "tit/usr/bin/asd"
ln -sf asd.1.gz "tit/usr/share/man/man1/anything-sync-daemon.1.gz"
cp -n common/asd.conf "tit/etc/asd.conf"
install -p -m644 init/asd-resync.service "tit/usr/lib/systemd/system/asd-resync.service"
install -p -d "tit/usr/share/zsh/site-functions"
install -p -m644 init/asd-resync.timer "tit/usr/lib/systemd/system/asd-resync.timer"
install -p -m644 common/zsh-completion "tit//usr/share/zsh/site-functions/_asd"
install -p -d "tit/usr/share/bash-completion/completions"
install -p -m644 common/bash-completion "tit//usr/share/bash-completion/completions/asd"

% tree tit
[  80]  tit
├── [  60]  etc
│   └── [2.2K]  asd.conf
└── [ 100]  usr
    ├── [  80]  bin
    │   ├── [ 23K]  anything-sync-daemon
    │   └── [  20]  asd -> anything-sync-daemon
    ├── [  60]  lib
    │   └── [  60]  systemd
    │       └── [ 100]  system
    │           ├── [ 323]  asd-resync.service
    │           ├── [ 124]  asd-resync.timer
    │           └── [ 430]  asd.service
    └── [ 100]  share
        ├── [  60]  bash-completion
        │   └── [  60]  completions
        │       └── [ 804]  asd
        ├── [  60]  man
        │   └── [  80]  man1
        │       ├── [   8]  anything-sync-daemon.1.gz -> asd.1.gz
        │       └── [4.0K]  asd.1.gz
        └── [  60]  zsh
            └── [  60]  site-functions
                └── [ 270]  _asd

14 directories, 10 files

Closing as not a bug.