Closed xxc3nsoredxx closed 3 years ago
If you want to automate the install process use a Makefile with make
If you have something like this for example
.PHONY: install
install:
install -D gopro /usr/local/sbin/gopro
then running make install
(as root) would copy the gopro
script to the install location as expected. Because install
is the first (and only) target in the Makefile, running just make
would also result in copying the script to the install location. This goes against the expected behavior where running make
results in the compilation of source files.
AFAIK, make
does not provide a nice mechanism for checking user permissions during runtime. This means that running make install
as a non-root user would error out with a disappointing "Permission denied" providing no additional information. On the other hand, it is easy to check the UID/EUID at runtime in a bash script allowing you to provide a more useful error message before any privileged commands need to be run.
Also, a Makefile like the stub above would provide no additional automation, and would actually result in a more confusing "build" system. As such, I believe a Makefile is the wrong solution here.
An install script is totally fine, but please do not ask users to run a command like sudo […] wget […] obscureURL
.
It tells Linux newbies to trust basically anything on the web...
Either place the direct github link into the wget
command or simply ask the user to download the script manually and run it (that's not too big of a thing).
A better solution would be to clone the repo and install the local version of the script.