mutt-wizard/Makefile
Kipras Melnikovas 4904fcf51f Fix script removal (#310)
The `script` variable you were referring to previously is actually the
relative path to a script, for example `bin/mw`.

This fails to remove the script, because, obviously, the path is
incorrect.

I'd suggest renaming `script` to `scriptPath` in line 13
and `shared` to `sharedPath` in line 18
(or whatever variable names you prefer that make it clearer)
to avoid confusion in the future.

Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
2019-11-23 18:31:17 -05:00

37 lines
981 B
Makefile

.POSIX:
OS = $(shell uname -s)
ifeq ($(OS), Darwin)
PREFIX = /usr/local
else
PREFIX = /usr
endif
MANPREFIX = $(PREFIX)/share/man
install:
mkdir -p $(DESTDIR)$(PREFIX)/bin
for script in bin/*; do \
cp -f $$script $(DESTDIR)$(PREFIX)/bin/; \
chmod 755 $(DESTDIR)$(PREFIX)/$$script; \
done
mkdir -p $(DESTDIR)$(PREFIX)/share/mutt-wizard
for shared in share/*; do \
cp -f $$shared $(DESTDIR)$(PREFIX)/share/mutt-wizard; \
done
if [ "$(OS)" = "Darwin" ]; then \
sed -iba 's/\/usr\//\/usr\/local\//' $(DESTDIR)$(PREFIX)/share/mutt-wizard/mutt-wizard.muttrc; \
rm $(DESTDIR)$(PREFIX)/share/mutt-wizard/mutt-wizard.muttrcba; \
fi
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
cp -f mw.1 $(DESTDIR)$(MANPREFIX)/man1/mw.1
uninstall:
for scriptPath in bin/*; do \
scriptFile=$$(basename $$scriptPath); \
rm -f $(DESTDIR)$(PREFIX)/bin/$$scriptFile; \
done
rm -rf $(DESTDIR)$(PREFIX)/share/mutt-wizard
rm -f $(DESTDIR)$(MANPREFIX)/man1/mw.1
.PHONY: install uninstall