Aquí hay un ejemplo de Cygwin
compatibleMakefile
:
DESTDIR?=/usr/local/bin
install_path=$(DESTDIR)
USER_ID=$(shell whoami)
GROUP_ID=$(shell id -gn)
script_name_1=encrypt-file-aes256
script_name_2=decrypt-file-aes256
.PHONY: install
.PHONY: uninstall
install:
install -m 0755 -o $(USER_ID) -g $(GROUP_ID) -t $(install_path) $(script_name_1) $(script_name_2)
# with long options together with verbosity turned on it might be better for users
#install --verbose --mode=0755 --owner=$(USER_ID) --group=$(GROUP_ID) --target-directory=$(install_path) $(script_name_1) $(script_name_2)
uninstall:
rm $(install_path)/$(script_name_1) $(install_path)/$(script_name_2)
Cuando desee instalar en cualquier otra ubicación, puede anular la variable DESTDIR
o proporcionar una en Makefile
.
Cuando ejecuta el script como sudo
en GNU/Linux
, USER_ID
se establece como root.
Nota:Actualmente verificado en GNU/Linux
.
Notas del editor:
Verificado en Cygwin
.
Se modificó la forma en que USER_ID
y GROUP_ID
se asignan al estándar shell
incorporado.
Se agregó una versión de opciones largas con verbosidad, en un comentario.
Si desea cambiar el destino, simplemente puede invocar, por ejemplo:
DESTDIR=/desired/target/directory/ make install
Решено. Проблема была с SELinux, я явно поставил его в разрешительный режим, но я никогда не перезагружался, чтобы изменения применялись должным образом. Итак, я проверил текущее состояние SELinux с помощью sestatus
и увидел, что он настроен на разрешающий режим, но работает в принудительном режиме.