TamtamHero / fw-fanctrl

A simple systemd service to better control Framework Laptop's fan(s)
BSD 3-Clause "New" or "Revised" License
178 stars 33 forks source link

Installation script adaptation for package maintainers #37

Closed leopoldhub closed 3 months ago

leopoldhub commented 3 months ago
leopoldhub commented 3 months ago

@icedream , is there anything else that should be done to ease the work of package maintainers?

icedream commented 3 months ago

One more thing I forgot to mention: The script will install its own version of ectool, my AUR package currently has a dependency to another package specifically for that tool which conflicts.

leopoldhub commented 3 months ago

Hi @icedream , sorry for the delay, I haven't had much time over the last few days, I hope this latest commit fixes the issues you raised.

Thanks again for your help, feel free to let me know if there is anything else I can do.

leopoldhub commented 3 months ago

I also have a question, would it be problematic for you if we used logname to move legacy config files in the home directory to their new location if they exist? I would like to avoid breaking old installations and configurations.

leopoldhub commented 3 months ago

/run seems to be the standard and /var/run is deprecated according to https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s15.html. I also took the liberty to set /etc instead of $DEST_DIR/etc for the SYSCONF default value as it is the expected directory for users who run the script manually.

leopoldhub commented 3 months ago

Hi @icedream ,

Thanks again for all the great work you put in to make this work, I have learned a lot from you and will try to improve in this domain in the future.

Since everything is fine and the final issue is fixed, I will now merge the branch into the project. I will do it in ~10 minutes, if you have any objections, feel free to say so.

It was a pleasure to work with you, have a wonderful day ^^

icedream commented 3 months ago

I still got one more thing, I just tried the code with the changes to the AUR package I pointed out earlier (with prefix /usr and sysconf dir /etc) and it seems it's installing files like this into the destination dir now:

It seems the prefix gets lost in translation here still for /lib and /bin paths.

icedream commented 3 months ago

But yes thank you very much for making these changes, awesome cooperation on this. πŸ‘πŸ»

At this point it's just taking your latest commit and running the command and checking how the files look at the other end. The changes for the AUR package are also ready on my end.

leopoldhub commented 3 months ago

Hopefully good with this

icedream commented 3 months ago

Not quite, wrong way round: $DEST_DIR$PREFIX_DIR (to make ${pkgdir}/usr), not $PREFIX_DIR$DEST_DIR (/usr${pkgdir}).

Currently results in:

+ mkdir -p /usr/home/icedream/Documents/Source/Git/aur.archlinux.org/fw-fanctrl-git/pkg/fw-fanctrl-git/bin
mkdir: cannot create directory β€˜/usr/home’: Permission denied
icedream commented 3 months ago

Forgot the command-line I use in all that excitement.

./install.sh \
                --dest-dir "${pkgdir}" \
                --prefix-dir "/usr" \
                --sysconf-dir "/etc" \
                --no-ectool \
                --no-post-install
leopoldhub commented 3 months ago

πŸŽ‰ Yay πŸŽ‰ Congrats